dymensionxyz / dymension

Dymension Hub
https://dymension.xyz
Other
363 stars 327 forks source link

Add a fungible packet memo namespacer #928

Closed danwt closed 3 weeks ago

danwt commented 3 weeks ago

We now use a namespaced json in the fungible memo for

and maybe other future use cases

Regular users or third party code might also want to use it. We don't want to place restrictions on them or make assumptions, so we should assume that their memo can be arbitrary.

Therefore we need something to take their memo, namespace it according to our rules, and then un-namespace it at the other end

danwt commented 3 weeks ago

See some example code here https://github.com/dymensionxyz/dymension/blob/9348869e92155ca106a853ab60ec3ba1ea2ee8b3/utils/memo/memo.go#L12-L48

danwt commented 3 weeks ago

see also https://github.com/dymensionxyz/dymension/blob/02eb0c108fa589a81a9a830f5cc2455f58756666/utils/map/funcs.go#L13-L39

danwt commented 3 weeks ago

see https://github.com/dymensionxyz/fungible-packet-memo-namespace-middleware

Needs to be tested I'm not sure if it breaks acks It shouldn't do..