Selected Contract Functions
Explanation of most commonly used smart contract functions
This triggers a deposit request of tokens to another chain with the following parameters. The
originChainIdis automatically set to the chain ID on which the SpokePool is deployed. For example, sending a deposit from the
Optimism_SpokePoolwill set its
originChainIdequal to 10.
Note on sending ETH:
payablefunction meaning it is possible to send native ETH instead of wrapped ETH (i.e. WETH). If you choose to send ETH, you must set
Note on approvals: the caller must approve the SpokePool to transfer
amountlimits: If the
amountis set too high, it can take a while for the deposit to be filled depending on available relayer liquidity. If the
amountis set too low, it can be unprofitable to relay regardless of the relayer fee %. Query the suggested max and min limits here. The contracts will not revert if the
amountis set outside of the recommended range, so it is highly recommended to set
amountwithin the suggested limits to avoid locking up funds for an unexpected length of time.
Note on setting
- 1.Call the read-only function
getCurrentTime()to get the current UNIX timestamp on the origin chain. e.g. this could return: 1665418548.
- 2.Call the read-only function
depositQuoteTimeBuffer()to get the buffer around the current time that the
quoteTimestampmust be set to. e.g. this could return: 600.
quoteTimestampmust be <=
currentTime + bufferand >=
currentTime - buffer.
Some of a pending deposit's parameters can be modified by calling this function. If a deposit has been completed already, this function will not revert but it won't be able to be filled anymore with the updated params. It is the responsibility of the depositor to verify that the deposit has not been fully filled before calling this function.
A depositor can request modifications by signing a hash containing the updated details and information uniquely identifying the deposit to relay. This information ensures that this signature cannot be re-used for other deposits.
Successfully calling this function will emit an event
RequestedSpeedUpDepositwhich can be used by relayers to fill the original deposit with the new parameters. Depositors should assume that the parameters emitted with the highest
relayerFeePctwill be used, since they are incentivized to use the highest fee possible.
Any relayer can use updated deposit parameters by calling