TSwap approve function #168
-
I am currently writing the TSwap invariant tests along with the course. poolToken.approve(address(pool), type(uint256).max);
weth.approve(address(pool), type(uint256).max);
I could not find any approve function in In short, if there is no approve function in the original Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @Shawon-Mandal, I am not sure I correctly understand your question, but we are doing those two approvals because we want to send some |
Beta Was this translation helpful? Give feedback.
Hello @Shawon-Mandal, I am not sure I correctly understand your question, but we are doing those two approvals because we want to send some
poolToken
andweth
to the pool. Since bothpoolToken
andweth
areERC20,
we need to call the approve function on them to approve the address of theTSWAP pool
to take our token. Doing so ensures that the transaction successfully goes through whenever we call a function to supply liquidity to theTSWAP pool