From 94754029250de11aaad43f59e5fdfee81983afa7 Mon Sep 17 00:00:00 2001 From: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:10:34 -0800 Subject: [PATCH] fix: remove EncodedData type to make decoding easier (#8) --- contracts/Ojo.sol | 10 +--------- contracts/OjoTypes.sol | 13 ------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/contracts/Ojo.sol b/contracts/Ojo.sol index 9c4c962..3c77f22 100644 --- a/contracts/Ojo.sol +++ b/contracts/Ojo.sol @@ -33,17 +33,9 @@ contract Ojo is IOjo, AxelarExecutable { bytes4 commandSelector, bytes calldata commandParams ) external payable { - OjoTypes.EncodedData memory packet = OjoTypes.EncodedData({ - assetNames: assetNames, - contractAddress: contractAddress, - commandSelector: commandSelector, - commandParams: commandParams, - timestamp: block.timestamp - }); - bytes memory payloadWithVersion = abi.encodePacked( bytes4(uint32(0)), // version number - abi.encode(packet) // payload + abi.encode(assetNames, contractAddress, commandSelector, commandParams, block.timestamp) // payload ); gasReceiver.payNativeGasForContractCall{value: msg.value}( diff --git a/contracts/OjoTypes.sol b/contracts/OjoTypes.sol index 86e189b..bf0f0f6 100644 --- a/contracts/OjoTypes.sol +++ b/contracts/OjoTypes.sol @@ -33,17 +33,4 @@ library OjoTypes { // Quote asset of asset pair uint256 quoteResolveTime; } - - struct EncodedData { - // Assets that you would like to encode & relay - bytes32[] assetNames; - // Address for the contract to call later - address contractAddress; - // Command selector - bytes4 commandSelector; - // Params to send back to the execute contract - bytes commandParams; - // Block timestamp - uint256 timestamp; - } }