-
Notifications
You must be signed in to change notification settings - Fork 359
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
Added optional memo to ics20 packets #868
Conversation
Tested this on mainnet as follows:
(If you notice the long time time between txs it's because it took me a while to discover allow lists on cw20_ics20 and copy pasting a CLI command made it so I kept sending to an osmosis addr instead of juno 😅) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, can you sign that license which is prompted on CI?
Signed! |
@@ -51,6 +51,8 @@ pub struct TransferMsg { | |||
pub remote_address: String, | |||
/// How long the packet lives in seconds. If not specified, use default_timeout | |||
pub timeout: Option<u64>, | |||
/// An optional memo to add to the IBC transfer | |||
pub memo: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change -.-. It must not be merged in the 1.x series.
Okay, so this breaks existing Rust code when constructing or destructing Ics20Packet or TransferMsg. Those are public symbols. However, I am not sure if this contract is embedded as a library somewhere. |
Right. I don't think this merits having two different v1 and v2 structs, but happy to have this be tagged in a 2.x major version (like you said, I don't think this is used as a library) Having serialization be backwards compatible should be enough to be able to update the live contracts |
To be on the safe side, let's create a 1.x release branch befor this merge. Then we can have breaking changes on main that people can use. There will be a 2.0 release series of the contracts in summer anyways. |
IBC has introduced an optional memo field on the ICS20 transfer packet. The memo enables features such as Osmosis cross chain swaps, and forwarding tokens using the packet forward middleware.
The change in this PR allows users to specify the memo to use when transferring CW20s. Note that since the memo is optional (both in the messages passed to the contract and the serialization of the Ics20Packet) this change will only affect the case when the memo is included in TransferMsg by the user. In short, this change should be backwards compatible.