You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The e.Contract represents the erc20 token contract address which is specified in the event https://github.com/PeggyJV/gravity-bridge/blob/main/module/x/gravity/types/msgs.pb.go#L856
While addresses in Ethereum should be not case sensitive, I think there is a possibility depending on the orchestrator implementation to use different address representation (case sensitive) and it would endup mapping to a different denom.
Maybe as a safe guard it would be better to always convert to lowercase?
The text was updated successfully, but these errors were encountered:
Hey @thomas-nguy, just to give you an update, I've been looking into this and there are a number of places affected by this casing issue, since in some cases we are using the raw input string from messages and in others using hex conversion from an Address type. Unfortunately the fix isn't as simple as just changing it in the GravityCoin serialization...for example, we are also storing mismatched cases in this instance:
fortunately we have only a single orchestrator implementation and it seems it uses a web3 library that use the lower case format (not the checkum one), so data migration might not be that critical if we assume its all lower case til now.
One idea would also to sanitise the all the address string in the event handler to convert to lower case but it may not be the cleanest solution
Upon a "SendToCosmos" event, gravity tokens will be minted by the gravity module.
The tokens denom will be defined by
strings.Join([]string{GravityDenomPrefix, e.Contract}, GravityDenomSeparator)}
(https://github.com/PeggyJV/gravity-bridge/blob/main/module/x/gravity/types/ethereum.go#L66)
The
e.Contract
represents the erc20 token contract address which is specified in the eventhttps://github.com/PeggyJV/gravity-bridge/blob/main/module/x/gravity/types/msgs.pb.go#L856
While addresses in Ethereum should be not case sensitive, I think there is a possibility depending on the orchestrator implementation to use different address representation (case sensitive) and it would endup mapping to a different denom.
Maybe as a safe guard it would be better to always convert to lowercase?
The text was updated successfully, but these errors were encountered: