You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The deadline argument passed to swapExactTokensForTokens function is 60 blocks into the future. The deadline parameter is useful for frontend and other off-chain software to ensure there's a deadline after which a swap transaction will revert.
In this case, passing just block.timestamp is enough to ensure correct behavior:
The issue here though is that you still need to add +1 to the block.timestamp because of the way the deadline modifier in Curve.sol is defined. Because of this, we leave it to the Xave Finance team the decision change the call to originSwap since there are no (gas) benefits, although it might provide more clarity to the reader:
Description
Treasury.buybackRnbw()
uses Uniswap V2 to convert underlying tokens into USDC:review-xave-lending-market-2021-10/code/contracts/buyback/Treasury.sol
Lines 63 to 69 in 15d777b
The
deadline
argument passed toswapExactTokensForTokens
function is 60 blocks into the future. The deadline parameter is useful for frontend and other off-chain software to ensure there's a deadline after which a swap transaction will revert.In this case, passing just
block.timestamp
is enough to ensure correct behavior:Uniswap's
swapExactTokensForTokens
definition:Uniswap
ensure
modifier:Recommendation
Instead of
block.timestamp + 60
just passblock.timestamp
as the deadline argument toswapExactTokensForTokens
call.Notes
A similar change can be made to the
originSwap
call:review-xave-lending-market-2021-10/code/contracts/buyback/Treasury.sol
Lines 81 to 88 in 15d777b
The issue here though is that you still need to add
+1
to theblock.timestamp
because of the way thedeadline
modifier inCurve.sol
is defined. Because of this, we leave it to the Xave Finance team the decision change the call tooriginSwap
since there are no (gas) benefits, although it might provide more clarity to the reader:The text was updated successfully, but these errors were encountered: