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

Outdated comment at calculateWithdrawalAmountsOnPartVaults #13

Open
code423n4 opened this issue Jul 5, 2021 · 0 comments
Open

Outdated comment at calculateWithdrawalAmountsOnPartVaults #13

code423n4 opened this issue Jul 5, 2021 · 0 comments

Comments

@code423n4
Copy link
Contributor

Handle

gpersoon

Vulnerability details

Impact

The comment calculateWithdrawalAmountsOnPartVaults says it returns true of false (e.g. boolean).
However the function implementation returns:
uint256 withdrawType

Probably the comment is outdated, which can be confusing.

Proof of Concept

// https://github.com/code-423n4/2021-06-gro/blob/main/contracts/insurance/Insurance.sol#L329
/// @notice Calculate withdrawal amounts based on part vaults, if the sum of part vaults'
/// maxWithdrawal can meet required amount, return true and valid array,
/// otherwise return false and invalid array
...
function calculateWithdrawalAmountsOnPartVaults(uint256 amount, address[N_COINS] memory vaults)
private view returns (uint256 withdrawType, uint256[N_COINS] memory withdrawalAmounts)
{

Tools Used

Recommended Mitigation Steps

Fix the comment of function calculateWithdrawalAmountsOnPartVaults

@code423n4 code423n4 added 0 (Non-critical) bug Something isn't working labels Jul 5, 2021
code423n4 added a commit that referenced this issue Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants