Skip to content

Commit

Permalink
slight tweak to implementation to account for ERC20s that do not hand…
Browse files Browse the repository at this point in the history
…le max allowances the same way
  • Loading branch information
tbrent committed Oct 10, 2023
1 parent 6107963 commit 1f49f79
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions contracts/libraries/Allowance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ library AllowanceLib {
// 3. Fall-back to setting a maximum allowance
if (!success) {
token.approve(spender, type(uint256).max);
require(
token.allowance(address(this), spender) == type(uint256).max,
"allowance not max"
);
require(token.allowance(address(this), spender) >= value, "allowance missing");
}
}
}

0 comments on commit 1f49f79

Please sign in to comment.