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

`ReseedSilo` does not set global state variables

Summary

ReseedSilo does not set global state variables

Vulnerability Details

When migrating deposits within ReseedSilo, users are given the stalk they should have. However, global variables such as s.sys.silo.stalk and s.sys.silo.roots are never increased (roots are never allocated anyway, but that's another issue).

// increment stalkForAccount by the stalk issued per BDV.
// placed outside of loop for gas effiency.
accountStalk += stalkIssuedPerBdv * totalBdvForAccount;
// set stalk for account.
s.accts[deposits.accounts].stalk = accountStalk;
}
// verify that the total deposited and total deposited bdv are correct.
require(
totalCalcDeposited == siloDeposit.totalDeposited,
"ReseedSilo: INVALID_TOTAL_DEPOSITS"
);
require(
totalCalcDepositedBdv == siloDeposit.totalDepositedBdv,
"ReseedSilo: INVALID_TOTAL_DEPOSITED_BDV"
);
// set global state
s.sys.silo.balances[siloDeposit.token].deposited = siloDeposit.totalDeposited;
s.sys.silo.balances[siloDeposit.token].depositedBdv = siloDeposit.totalDepositedBdv;
}

Impact

Global variables are not set. Multiple major functions which depend on it (such as withdrawing, minting stalk, burning stalk) will fail/ lead to unexpected results.

Tools Used

Manual review

Recommendations

Increase the global variables.

Updates

Lead Judging Commences

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

ReseedSilo doesn't update global `s.sys.silo.stalk` and `s.sys.silo.roots`

Support

FAQs

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