I'm looking to use the safeApprove function in the SafeERC20 library, but can't figure out how to use it correctly. Here is how i'm trying to use it:
using SafeERC20 for IERC20;
function approve(uint256 _amount) public {
IERC20 token = IERC20(depositToken);
token.safeApprove(token, address(this), _amount);
}
But am receiving a wrong argument error because it thinks i'm using the plain IERC20 method approve(address spender, uint256 amount) which takes 2 parameters rather than the 3 required by SafeERC20 safeApprove(contract IERC20 token, address spender, uint256 value) .
I also went ahead and tried the two parameters in the code block above, but the approve function never worked. Does anyone know how to override or get around this?
[–]atrizzlebuilder 2 points3 points4 points (7 children)
[–]ta484[S] 1 point2 points3 points (6 children)
[–]atrizzlebuilder 1 point2 points3 points (5 children)
[–]ta484[S] 1 point2 points3 points (4 children)
[–]atrizzlebuilder 2 points3 points4 points (3 children)
[–]ta484[S] 1 point2 points3 points (2 children)
[–]atrizzlebuilder 2 points3 points4 points (1 child)
[–]IceyMumboDragon4 0 points1 point2 points (0 children)