DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: high
Valid

`L2ContractMigrationFacet` never sets the global silo variables

Summary

L2ContractMigrationFacet#setStalk never sets the global silo variables

Vulnerability Details

When users migrate via L2ContractMigrationFacet, they're calculated the necessary stalk and get it minted via setStalk.

function setStalk(address account, uint256 accountStalk, uint256 accountRoots) internal {
s.accts[account].stalk += accountStalk;
s.accts[account].roots += accountRoots;
// emit event.
emit StalkBalanceChanged(account, int256(accountStalk), int256(accountRoots));
}

However, the global silo variables s.sys.silo.stalk and s.sys.silo.roots are never increased

Impact

Incorrect global state variables. Multiple critical functions which depend on it (plant, withdrawDeposit, minting/ burning stalk, etc) will fail/ lead to unexpected results

Tools Used

Manual review

Recommendations

Increase the global state variables

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

L2ContractMigrationFacet doesn't increase total Stalk and Roots

Support

FAQs

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