IEthSignSATriggerand supports retrieving data from both on-chain and off-chain sources. Note that the final retrieved value must be no longer than 32 characters.
initializeOnChainData()with the following parameters:
address calldata targetContracts: The address(es) of the contracts that you intend to retrieve data from.
bytes memory encodedSelectors: The encoded function selectors of the functions that returns the data in the target contract.
initializeOffChainData()with the following parameters:
string memory urls: The URL(s) of the endpoints that you intend to retrieve data from. Note that only GET endpoints and JSON return types are supported.
IEthSignSATriggermust decide if the predefined execution logic should be run. In order to make that decision, we must define the expected values that would be compared against the returned values. At this moment, we only support checking for equality. In the future, we plan to support size comparisons for numerical values.
initializeOffChainData()with the following parameter:
bytes32 calldata expectedResults: The expected value(s) that would be compared against retrieved data.
IEthSignSAExecutorand run the predefined execution logic. By default, the logic only consists of a token transfer. This can be defined by calling
IEthSignSAExecutor: initialize()with the following parameters:
IERC20 rewardTokenContract: The address of the ERC-20 token that you intend to transfer.
address beneficiary: The receiver of the token.
uint256 memory rewards: An array of rewards that will be paid out in stages. Note that this must match values provided in
customExecute(). With this approach, the possibilities are endless.