The decoder smart-contracts allows to parse and validate the raw calldata that is passed to the AspisPool.execute function to interact with trading protocols like 1inch, Uniswap and Odos. The contracts allow to extract information like input and output tokens, trade amount, recipient, etc.
The calldata contains an encoded swap function with parameters. For example it might contain an encoded IAggregationRouterV6.swap call to 1inch router.
There are three decoders for each exchange that Aspis is integrated with:
All decoders must implement the following function:
Decodes the calldata and returns it’s elements.
function decodeExchangeInput(
uint256 value,
bytes calldata inputData
) public view override returns (address, address, uint256, uint256, address)
value - the ether value passed to the Aspis Pool.
inputData - the encoded swap call to the exchange router.
Return values: