Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: medium
Invalid

L1vault has no check in approval amount to the bridge which might lead to call approveTo function with amount parameter more than the balanceOf vault

Summary

The approveTo() function in L1valut contract has no check for approval amount in place which might lead to call with amount more than the balance of vault.

Vulnerability Details

function approveTo(address target, uint256 amount) external onlyOwner {
token.approve(target, amount);
}

there needs to be a check statement when approving amount to target address.

Impact

When approving the amount to the target more than the balance of the vault will revert the transaction.

Tools Used

Manual review

Recommendations

Add the following require statement to the approveTo function in L1vault.

+ function approveTo(address target, uint256 amount) external onlyOwner{
+ require(amount <= token.balanceOf(address(this)), amount will not exceed the vault balance);
+ }
Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.