diff --git a/examples/nft/contracts/Universal.sol b/examples/nft/contracts/Universal.sol index 3aee92e..af49446 100644 --- a/examples/nft/contracts/Universal.sol +++ b/examples/nft/contracts/Universal.sol @@ -97,7 +97,7 @@ contract Universal is address(this), true, address(0), - message, + abi.encode(tokenId, uri, msg.sender), gasLimit ); @@ -165,16 +165,22 @@ contract Universal is destination, abi.encode(receiver, tokenId, uri, out - gasFee, sender), CallOptions(gasLimit, false), - RevertOptions(address(0), false, address(0), "", 0) + RevertOptions( + address(this), + true, + address(0), + abi.encode(tokenId, uri, sender), + 0 + ) ); } emit TokenTransferToDestination(receiver, destination, tokenId, uri); } function onRevert(RevertContext calldata context) external onlyGateway { - (address sender, uint256 tokenId, string memory uri) = abi.decode( + (uint256 tokenId, string memory uri, address sender) = abi.decode( context.revertMessage, - (address, uint256, string) + (uint256, string, address) ); _safeMint(sender, tokenId); diff --git a/examples/token/contracts/Universal.sol b/examples/token/contracts/Universal.sol index 07ad092..61caaa1 100644 --- a/examples/token/contracts/Universal.sol +++ b/examples/token/contracts/Universal.sol @@ -77,7 +77,7 @@ contract Universal is ERC20, Ownable2Step, UniversalContract, Events { address(this), true, address(0), - message, + abi.encode(amount, msg.sender), gasLimit ); @@ -129,16 +129,22 @@ contract Universal is ERC20, Ownable2Step, UniversalContract, Events { destination, abi.encode(receiver, tokenAmount, out - gasFee, sender), CallOptions(gasLimit, false), - RevertOptions(address(0), false, address(0), "", 0) + RevertOptions( + address(this), + true, + address(0), + abi.encode(amount, sender), + 0 + ) ); } emit TokenTransferToDestination(destination, receiver, amount); } function onRevert(RevertContext calldata context) external onlyGateway { - (address sender, uint256 amount) = abi.decode( + (uint256 amount, address sender) = abi.decode( context.revertMessage, - (address, uint256) + (uint256, address) ); _mint(sender, amount); emit TokenTransferReverted(sender, amount);