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

Insufficient balance in vault contract when calling approveTo leads to transaction revert.

Summary

When calling the approveTo() function inside the L1Bossbridge contract's constructor the approval amount is passed as type(uint256).max which when passed to token.approve statement inside the function will revert since the vault doesn't have that balance to approve the bridge contract.

Vulnerability Details

constructor(IERC20 _token) Ownable(msg.sender) {
token = _token;
vault = new L1Vault(token);
// Allows the bridge to move tokens out of the vault to facilitate withdrawals
vault.approveTo(address(this), type(uint256).max);
}

valut.approveTo statement will trigger the approveTo() function inside the L1vault contract which has token.transfer(target, amount) statement inside it will revert since the vault has not have that max balance.

Impact

The L1Bossbridge contract will not have the approval to move the tokens from the vault.

Tools Used

Manual review

Recommendations

+ vault.approveTo(address(this), address(vault).balance );

needs to approve only the balance amount of vault.

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.