IERC20(token).approve revert if the underlying ERC20 token approve does not return boolean
Source: https://github.com/sherlock-audit/2023-06-bond-judging/issues/86
Found by
Auditwolf, ctf_sec, pks_, tsvetanovv
Summary
IERC20(token).approve revert if the underlying ERC20 token approve does not return boolean
Vulnerability Detail
When transferring the token, the protocol use safeTransfer and safeTransferFrom
but when approving the payout token, the safeApprove is not used
for non-standard token such as USDT,
calling approve will revert because the solmate ERC20 enforce the underlying token return a boolean
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
while the token such as USDT does not return boolean
https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7#code#L126
Impact
USDT or other ERC20 token that does not return boolean for approve is not supported as the payout token
Code Snippet
Tool used
Manual Review
Recommendation
Use safeApprove instead of approve
Discussion
Oighty
Agree with proposed solution.
Oighty
Fix implemented in https://github.com/Bond-Protocol/options/pull/8
ctf-sec
Fix looks good!
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity business logic bug in Bond Options. Sherlock made it public on 13 July 2023. Found in the 99 audit contest (finding M-6), also found by 3 other wardens.
About Business logic
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.