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

Arithmetic operations without using SafeMath may over/underflow #44

Open
code423n4 opened this issue Nov 16, 2021 · 2 comments
Open

Arithmetic operations without using SafeMath may over/underflow #44

code423n4 opened this issue Nov 16, 2021 · 2 comments
Labels
1 (Low Risk) bug Something isn't working

Comments

@code423n4
Copy link
Contributor

Handle

WatchPug

Vulnerability details

https://github.com/Badger-Finance/badger-ibbtc-utility-zaps/blob/8d265aacb905d30bd95dcd54505fb26dc1f9b0b6/contracts/IbbtcVaultZap.sol#L179-L183

if (_amounts[1] > 0 || _amounts[2] > 0) {
    // Use renbtc and wbtc to mint ibbtc
    // NOTE: Can change to external zap if implemented
    depositAmounts[0] += _renZapToIbbtc([_amounts[1], _amounts[2]]);
}

Even though it's unlikely to overflow in this particular case, we still recommend using SafeMath instead.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Nov 16, 2021
code423n4 added a commit that referenced this issue Nov 16, 2021
@GalloDaSballo
Copy link
Collaborator

Ambivalent on the finding esp because bitcoin tokens tend to have 8 decimals

@0xleastwood
Copy link
Collaborator

agree with warden, this is best practice so keeping issue open as low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants