multichain icon indicating copy to clipboard operation
multichain copied to clipboard

Cosmos tx amount is casted to uint64

Open 0x0ece opened this issue 2 years ago • 1 comments

Hi, while Terra and Cosmos have relatively low amount of decimals, new chains are popping up with 18 decimals, e.g. XPLA.

We just noticed that there's an explicit cast to uint64: https://github.com/renproject/multichain/blob/master/chain/cosmos/tx.go#L120

This causes overflow issue/incorrect amount on such chains.

0x0ece avatar Oct 26 '22 14:10 0x0ece

Hey @0x0ece, good catch! We should go through and update the internal amount types to pack.U256 to prevent this from happening. We will add this to the backlog, but if you would like to give it a go and create a PR that would be appreciated!

jazg avatar Oct 26 '22 22:10 jazg