Skip to content

DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers. #2

Merged
danwt merged 93 commits intomain-dymfrom
danwt/main-dym-01
Jun 4, 2025
Merged

DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers. #2
danwt merged 93 commits intomain-dymfrom
danwt/main-dym-01

Conversation

@danwt
Copy link
Copy Markdown

@danwt danwt commented Apr 15, 2025

danwt added 7 commits May 7, 2025 16:58
* backup the working dymension <-> ethereum test

* add sol collateral memo, confirm all uts pass

* add solana program build registration

* pre add the registration for sol collateral memo

* add changes to rust/sealevel/client/src/warp_route.rs untested

* add sol client changes for collateral memo (untested)

* try to fix and run build script, untested there is a build error for (non memo) collat about stack size

* working on the dymension_test commands for sol

* need to clean up env vars

* more consolidation

* in middle of sol test

* going to have just one eth test and one sol test with dym

* clean up the ethereum<->dymension test

* rename dymension test -> ethereum test, delete backup, delete old eth<->eth test
* work on a script for eth collateral -> hub synthetic

* cp

* chore: forge init

* forge install: forge-std

v1.9.7

* try to make collateral erc20 work

* deploy works, now need to test it

* confirms that it works collateral -> synth on hub

* bump foo_test

* bump foo test readme
@danwt
Copy link
Copy Markdown
Author

danwt commented May 14, 2025

using dymensionxyz/hyperlane-cosmos#6

@danwt danwt closed this May 14, 2025
@danwt danwt reopened this May 14, 2025
@danwt danwt closed this May 15, 2025
@danwt danwt reopened this May 15, 2025
let (escrow_account, _escrow_bump) = Pubkey::find_program_address(
hyperlane_token_escrow_pda_seeds_memo!(),
&query.program_id,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accounts_to_query.push(escrow_account);

is missing

Comment on lines +1356 to +1363
let ixn = DymHtInstruction::TransferRemoteMemo(DymHtTransferRemoteMemo {
base: HtTransferRemote {
destination_domain: xfer.destination_domain,
recipient,
amount_or_id: xfer.amount.into(),
},
memo: xfer.memo.as_bytes().to_vec(), // TODO: conversion OK?
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole code for TokenSubCmd::TransferRemoteMemo is the same as for TokenSubCmd::TransferRemote except these lines, am I right? do you think it's worth spending time to dry it out? but I'm guessing it's fine anyway

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yh
I didn't want to refactor too much to make it hard to sync with upstream
Probably worth spending some time on, but not now #5

# The paths to the programs
CORE_PROGRAM_PATHS=("mailbox" "ism/multisig-ism-message-id" "validator-announce" "hyperlane-sealevel-igp")
TOKEN_PROGRAM_PATHS=("hyperlane-sealevel-token" "hyperlane-sealevel-token-collateral" "hyperlane-sealevel-token-native")
TOKEN_PROGRAM_PATHS=("hyperlane-sealevel-token" "hyperlane-sealevel-token-collateral", "hyperlane-sealevel-token-collateral-memo", "hyperlane-sealevel-token-native", "hyperlane-sealevel-token-native-memo","hyperlane-sealevel-token-memo")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hyperlane-sealevel-token-memo does not exist

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TokenType.collateralMemo]: {
factory: HypERC20CollateralMemo__factory,
method: 'wrappedToken',
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TokenType.nativeMemo is missing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not erc20

token: addressOrDenom,
});
} else if (standard === TokenStandard.EvmHypSynthetic) {
} else if (standard === TokenStandard.EvmHypSynthetic || standard === TokenStandard.EvmHypSyntheticMemo ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to do the same for EvmHypNativeMemo and EvmHypCollateralMemo?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a good idea 👍

danwt and others added 6 commits May 16, 2025 17:41
Co-authored-by: keruch <53012408+keruch@users.noreply.github.com>
Co-authored-by: keruch <53012408+keruch@users.noreply.github.com>
Co-authored-by: keruch <53012408+keruch@users.noreply.github.com>
@danwt danwt requested a review from keruch May 16, 2025 17:00
@danwt danwt changed the title DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers. (Solana synth is todo) May 16, 2025
* add to readme

* add copied synthetic token memo directory, same as non-memo

* rust/sealevel/Cargo.toml

* rust/sealevel/client/Cargo.toml

* rust/sealevel/programs/build-programs.sh

* should be all the changes for the token program itself

* should be all the changes for the client package

* fmt

* build seems to work

* start working on the sol test 2 (synthetic)

* typo
@danwt danwt changed the title DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers. (Solana synth is todo) DYMENSION: add memo fields to outbound ERC20 Collateral and Synthetic transfers, and Native transfers. Jun 4, 2025
@danwt danwt merged commit 1915073 into main-dym Jun 4, 2025
33 of 53 checks passed
@danwt danwt deleted the danwt/main-dym-01 branch June 4, 2025 17:54
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 this pull request may close these issues.

2 participants