Skip to content

opts.memo disappears when making E(localOrcAccount).transfer that requires PFM #11408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
anilhelvaci opened this issue May 23, 2025 · 0 comments · May be fixed by #11410
Open

opts.memo disappears when making E(localOrcAccount).transfer that requires PFM #11408

anilhelvaci opened this issue May 23, 2025 · 0 comments · May be fixed by #11410
Assignees

Comments

@anilhelvaci
Copy link
Collaborator

Problem Definition

Currently localOrchestrationAccount's transfer method accepts memo through its arguments. This works fine when the packet is sent directly to the destination chain. However, if we have to send a memo to the destination chain the pfm's forward memo takes precedence over what zoe contract is supplying. See;

if (forwardInfo) {
// forward memo takes precedence
memo = JSON.stringify(forwardInfo);
}

This situation creates a problem in situations like Osmosis' crosschain swaps where we have to have a specific memo attached to the packet in order to trigger the cosmwasm contract on Osmosis.

To Reproduce

Steps to reproduce the behavior, in your orchestration contract;

  1. Create a localOrchestationAccount
  2. Create an offer handler or address hook where you pass a memo to the transfer. Like;
await localOrchestraitonAccount.transfer(
  {
    value: destAddr,
    encoding: 'bech32',
    chainId: /** @type {CosmosChainInfo} */ (osmosisChainInfo).chainId,
  },
  { denom, value },
  { memo },
);
  1. Initiate a transfer where destination chain is not the issuer chain of the token in transfer. For example, send Agoric wrapped ATOM to Osmosis
  2. Open the Osmosis logs and see memo isn't in the packet

Expected behavior

We should protect the memo passed in by the application and observe it on the destination chain even with PFM involved.

Possible Solution

Make sure we attach the opts.memo (memo sent by application code) to the pfm's forward.next

@anilhelvaci anilhelvaci self-assigned this May 23, 2025
@anilhelvaci anilhelvaci linked a pull request May 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant