Skip to content
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

anomac transfer should support multitoken transfers #132

Closed
james-chf opened this issue Jun 1, 2022 · 0 comments · Fixed by #359
Closed

anomac transfer should support multitoken transfers #132

james-chf opened this issue Jun 1, 2022 · 0 comments · Fixed by #359

Comments

@james-chf
Copy link
Contributor

james-chf commented Jun 1, 2022

We will want accounts on Anoma which handle the ledgers for more than one token, for example this is how wrapped ERC20 assets will be kept track of. (#114)

#<eth-bridge-bech32m-address>/ERC20/<erc20-ethereum-address>/balance/<owner-bech32m-address> : Amount

e.g.

#atest1v4ehgw36g4pyg3j9x3qnjd3cxgmyz3fk8qcrys3hxdp5xwfnx3zyxsj9xgunxsfjg5u5xvzyzrrqtn/ERC20/0x6B175474E89094C44Da98b954EedeAC495271d0F/balance/atest1d9khqw36x9zyxwfhgfpygv2pgc65gse4gy6rjs34gfzr2v69gy6y23zpggurjv2yx5m52sesu6r4y4

More generally we want to support transfers for any arbitrary "/balance/` key suffix that isn't necessarily top level. So in general we could have multitoken accounts like

#<some-top-level-bech32m-address>/.../<token-id>/balance/<owner-bech32m-address>

This issue is to update anomac transfer to work with such multitokens, specifically we need a tx wasm that does the transfer correctly - the validity predicate(s) for validating that such a transfer happened is out of scope for this issue and may differ slightly between different multitokens.

One way would do this issue would be to update the existing tx_transfer to work with any arbitrary storage key prefix (e.g. #<eth-bridge-bech32m-address>/erc20/<erc20-ethereum-address>/...) rather than a top-level Anoma address. Alternatively we could make a new separate tx_multitoken_transfer that the anomac transfer should delegate to using in the case of multitoken transfers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Tested in Devnet
Development

Successfully merging a pull request may close this issue.

2 participants