Open hats-bug-reporter[bot] opened 3 months ago
could you describe a scenario where the allowance will remain?
USDT approve method in ethereum mainnet (it checks that allowance is zero):
is it the same on Blast?
I think the issue is invalid
@0xmahdirostami looks like only USDB
stable coin in blast chain.
https://blastexplorer.io/tokens
Github username: @erictee2802 Twitter username: 0xEricTee Submission hash (on-chain): 0x780273f04aca1197d7cf3a7d242a41e0664084d3a9352c17a44368d68b4bf710 Severity: medium
Description: Description
In
contracts/nest/SingelTokenBuybackUpgradeable.sol::buybackTokenByV2
:Version
4.9.5
ofsafeApprove
(https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/token/ERC20/utils/SafeERC20.sol#L45-L54) is currently in use in the contract.USDT approve method in ethereum mainnet (it checks that allowance is zero):
Attack Scenario
In the current implementation, if the
SingelTokenBuybackUpgradeable
contract is left with an extra allowance forrouter
, then users will not be able to callSingelTokenBuybackUpgradeable.sol::buybackTokenByV2
function due to revert of non zero allowance.Attachments
NA
Manual Analysis
approve(0)
before calling the main approve or consider usingforceApprove
function from the latest Openzeppelin contract (v5.0.2
).