From 2f649b1fecb0b32aa500373a8b8b0804e0c98cd2 Mon Sep 17 00:00:00 2001 From: Matt Rice Date: Fri, 14 Jul 2023 12:04:06 -0400 Subject: [PATCH] fix: [N02] Add docstring (#314) Signed-off-by: Matt Rice --- contracts/SpokePoolVerifier.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contracts/SpokePoolVerifier.sol b/contracts/SpokePoolVerifier.sol index a9678076c..1d5dc6740 100644 --- a/contracts/SpokePoolVerifier.sol +++ b/contracts/SpokePoolVerifier.sol @@ -14,6 +14,24 @@ import "./interfaces/SpokePoolInterface.sol"; contract SpokePoolVerifier { using Address for address; + /** + * @notice Passthrough function to `deposit()` on the SpokePool contract. + * @dev Protects the caller from losing their ETH (or other native token) by reverting if the SpokePool address + * they intended to call does not exist on this chain. Because this contract can be deployed at the same address + * everywhere callers should be protected even if the transaction is submitted to an unintended network. + * This contract should only be used for native token deposits, as this problem only exists for native tokens. + * @param spokePool Address of the SpokePool contract that the user is intending to call. + * @param recipient Address to receive funds at on destination chain. + * @param originToken Token to lock into this contract to initiate deposit. + * @param amount Amount of tokens to deposit. Will be amount of tokens to receive less fees. + * @param destinationChainId Denotes network where user will receive funds from SpokePool by a relayer. + * @param relayerFeePct % of deposit amount taken out to incentivize a fast relayer. + * @param quoteTimestamp Timestamp used by relayers to compute this deposit's realizedLPFeePct which is paid + * to LP pool on HubPool. + * @param message Arbitrary data that can be used to pass additional information to the recipient along with the tokens. + * Note: this is intended to be used to pass along instructions for how a contract should use or allocate the tokens. + * @param maxCount used to protect the depositor from frontrunning to guarantee their quote remains valid. + */ function deposit( SpokePoolInterface spokePool, address recipient,