cosmos / solidity-ibc-eureka

This is a work-in-progress solidity implementation of IBC Eureka.
MIT License
12 stars 2 forks source link

Refactor ICS20Transfer "unwrap" functions #36

Open gjermundgaraba opened 1 month ago

gjermundgaraba commented 1 month ago

In ICS20Transfer.sol we have two functions that "unwrap" (and more) the packet data: _unwrapSendPacketData() and _unwrapReceivePacketData().

They are hard to read and reason about, and if we could find a better way to handle all the logic it contains, it would be a big improvement to the ICS20Transfer code.

The UnwrappedPacketData has become big, complex and contains a lot of information that might be better suited elsewhere (some fields might just be kept local since they are not used many places, like the originatorChainIsSource field).