diff --git a/contracts/HubPool.sol b/contracts/HubPool.sol index 11431df48..effbd4cc8 100644 --- a/contracts/HubPool.sol +++ b/contracts/HubPool.sol @@ -481,6 +481,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { * and the caller, or "liquidity provider" earns a continuous fee for their credit that they are extending relayers. * @notice Caller will receive an LP token representing their share of this pool. The LP token's redemption value * increments from the time that they enter the pool to reflect their accrued fees. + * @notice The caller of this function must approve this contract to spend l1TokenAmount of l1Token. * @param l1Token Token to deposit into this contract. * @param l1TokenAmount Amount of liquidity to provide. */ @@ -588,6 +589,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { * called; moreover, this method can't be called again until all leafs are executed. * @param bundleEvaluationBlockNumbers should contain the latest block number for all chains, even if there are no * relays contained on some of them. The usage of this variable should be defined in an off chain UMIP. + * @notice The caller of this function must approve this contract to spend bondAmount of bondToken. * @param poolRebalanceLeafCount Number of leaves contained in pool rebalance root. Max is the number of whitelisted chains. * @param poolRebalanceRoot Pool rebalance root containing leaves that will send tokens from this contract to a SpokePool. * @param relayerRefundRoot Relayer refund root to publish to SpokePool where a data worker can execute leaves to @@ -745,6 +747,7 @@ contract HubPool is HubPoolInterface, Testable, Lockable, MultiCaller, Ownable { * @notice Caller stakes a bond to dispute the current root bundle proposal assuming it has not passed liveness * yet. The proposal is deleted, allowing a follow-up proposal to be submitted, and the dispute is sent to the * optimistic oracle to be adjudicated. Can only be called within the liveness period of the current proposal. + * @notice The caller of this function must approve this contract to spend bondAmount of l1Token. */ function disputeRootBundle() public nonReentrant zeroOptimisticOracleApproval { uint32 currentTime = uint32(getCurrentTime()); diff --git a/contracts/PolygonTokenBridger.sol b/contracts/PolygonTokenBridger.sol index c8f3cbc3d..13ad42fce 100644 --- a/contracts/PolygonTokenBridger.sol +++ b/contracts/PolygonTokenBridger.sol @@ -52,6 +52,7 @@ contract PolygonTokenBridger is Lockable { /** * @notice Called by Polygon SpokePool to send tokens over bridge to contract with the same address as this. + * @notice The caller of this function must approve this contract to spend amount of token. * @param token Token to bridge. * @param amount Amount to bridge. * @param isWrappedMatic True if token is WMATIC. diff --git a/contracts/SpokePool.sol b/contracts/SpokePool.sol index 2c7a4b592..04507f955 100644 --- a/contracts/SpokePool.sol +++ b/contracts/SpokePool.sol @@ -710,12 +710,16 @@ abstract contract SpokePool is SpokePoolInterface, Testable, Lockable, MultiCall } } - // @notice Caller specifies the max amount of tokens to send to user. Based on this amount and the amount of the - // relay remaining (as stored in the relayFills mapping), pull the amount of tokens from the caller ancillaryData - // and send to the caller. - // @dev relayFills keeps track of pre-fee fill amounts as a convenience to relayers who want to specify round - // numbers for the maxTokensToSend parameter or convenient numbers like 100 (i.e. relayers who will fully - // fill any relay up to 100 tokens, and partial fill with 100 tokens for larger relays). + /** + * @notice Caller specifies the max amount of tokens to send to user. Based on this amount and the amount of the + * relay remaining (as stored in the relayFills mapping), pull the amount of tokens from the caller + * and send to the recipient. + * @dev relayFills keeps track of pre-fee fill amounts as a convenience to relayers who want to specify round + * numbers for the maxTokensToSend parameter or convenient numbers like 100 (i.e. relayers who will fully + * fill any relay up to 100 tokens, and partial fill with 100 tokens for larger relays). + * @dev Caller must approve this contract to transfer up to maxTokensToSend of the relayData.destinationToken. + * The amount to be sent might end up less if there is insufficient relay amount remaining to be sent. + */ function _fillRelay( bytes32 relayHash, RelayData memory relayData,