yui-ibc-solidity icon indicating copy to clipboard operation
yui-ibc-solidity copied to clipboard

sendTransfer interface modifications proposal

Open dzmitry-lahoda opened this issue 1 year ago • 1 comments

IBC power lays not only in ability to transfer tokens by wallets, but also in ability of on chain protocols(contracts) to work with that. Memo can be formed in memory and send to provide additional instructions. And IBC stack is complex and big to setup, so having interface to work with could be awesome for productivity. Also for packet forwarding middleware, it may be the case that sendTransfer is used via inheritance, so that may be it function to be public and receive memory for memo.

So now having:

    // ... contract 
    function sendTransfer(
        string calldata denom,
        uint256 amount,
        string calldata receiver,
        string calldata sourcePort,
        string calldata sourceChannel,
        uint64 timeoutHeight
    ) external {
  // ...

desired

interface ICS20Transfer { 
    function sendTransfer(
        // not sure about other strings - if they should be memory?
        string calldata denom,
        uint256 amount,
        string calldata receiver,
        string calldata sourcePort,
        string calldata sourceChannel,
        (uint64,uint64) timeoutHeight, // https://github.com/CosmWasm/cosmwasm/blob/e7c4ed8e0a0b0d0816c24a516d413811fdebb686/packages/std/src/ibc.rs#L165
// CosmWasm Rust, Cosmos Go and pallet-ibc in ibc-rs afaik use this defintion of height. so that IBC can talk to forked chains to which height from zero. can we retain that interface?
        string memory memo  // memo is often created via string concatenation
    ) public ;

dzmitry-lahoda avatar Oct 24 '23 10:10 dzmitry-lahoda

XRP CLOUD HACKER

Bunsen1990 avatar Feb 18 '24 18:02 Bunsen1990