Skip to content

Commit

Permalink
fix: remove EncodedData type to make decoding easier (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak authored Nov 14, 2023
1 parent 7ba60f9 commit 9475402
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
10 changes: 1 addition & 9 deletions contracts/Ojo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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}(
Expand Down
13 changes: 0 additions & 13 deletions contracts/OjoTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 9475402

Please sign in to comment.