Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #143

Closed
code423n4 opened this issue Jun 2, 2022 · 1 comment
Closed

QA Report #143

code423n4 opened this issue Jun 2, 2022 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

safeApprove() is deprecated

Deprecated in favor of safeIncreaseAllowance() and safeDecreaseAllowance()
The contract made use of the deprecated SafeERC20.safeApprove() function. As noted in the SafeERC20 contract, the safeApprove() function was vulnerable to the same transaction reordering issue as the standard ERC20 approve() function, as detailed here[https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729]

Instances:

contracts/VeAssetDepositor.sol:162: IERC20(minter).safeApprove(_stakeAddress, _amount);
contracts/VE3DRewardPool.sol:287: IERC20(_rewardToken).safeApprove(rewardTokenInfo[_rewardToken].veAssetDeposits, 0);
contracts/VE3DRewardPool.sol:288: IERC20(_rewardToken).safeApprove(
contracts/VE3DRewardPool.sol:301: IERC20(rewardTokenInfo[_rewardToken].ve3Token).safeApprove(
contracts/VE3DRewardPool.sol:305: IERC20(rewardTokenInfo[_rewardToken].ve3Token).safeApprove(
contracts/VE3DLocker.sol:211: IERC20(rewardData[_rewardsToken].ve3Token).safeApprove(
contracts/VE3DLocker.sol:215: IERC20(rewardData[_rewardsToken].ve3Token).safeApprove(
contracts/VE3DLocker.sol:221: IERC20(_rewardsToken).safeApprove(rewardData[_rewardsToken].veAssetDeposits, 0);
contracts/VE3DLocker.sol:222: IERC20(_rewardsToken).safeApprove(
contracts/Booster.sol:374: IERC20(token).safeApprove(rewardContract, _amount);
contracts/VoterProxy.sol:101: IERC20(_token).safeApprove(_gauge, 0);
contracts/VoterProxy.sol:102: IERC20(_token).safeApprove(_gauge, balance);
contracts/VoterProxy.sol:152: IERC20(veAsset).safeApprove(escrow, 0);
contracts/VoterProxy.sol:153: IERC20(veAsset).safeApprove(escrow, _value);
contracts/VoterProxy.sol:160: IERC20(veAsset).safeApprove(escrow, 0);
contracts/VoterProxy.sol:161: IERC20(veAsset).safeApprove(escrow, _value);

Reference:

OpenZeppelin/openzeppelin-contracts#2219

Remediation:

The SafeERC20.safeIncreaseAllowance() function should be used in place of SafeERC20.safeApprove() function.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Jun 2, 2022
code423n4 added a commit that referenced this issue Jun 2, 2022
@JeeberC4 JeeberC4 added the invalid This doesn't seem right label Jul 5, 2022
@JeeberC4
Copy link

JeeberC4 commented Jul 5, 2022

Warden submitted multiple QA Reports. Will not be judged.

@JeeberC4 JeeberC4 closed this as completed Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

2 participants