Similar to the V-PHX-VUL-008 issue, the stakes vector in a user’s BondingInfo grows with each subsequent bond operation that a user performs. Therefore, each bond operation will become more and more expensive for the user to perform and could eventually exceed the transaction storage limit.
Impact: This impacts the usability of the staking contract and discourages users from having many stakes in the contract.
Recommendation: Since the stake_timestamp of each stake is not checked or used after a stake is created, and the WithdrawAdjustment tracks adjustments based on the time the user performs a bond, the BondingInfo could solely track a user’s total_stake and omit storing all of the user’s individual stake operations.
file: contracts/stake/src/storage.rs location: BondingInfo
Similar to the V-PHX-VUL-008 issue, the stakes vector in a user’s
BondingInfo
grows with each subsequent bond operation that a user performs. Therefore, each bond operation will become more and more expensive for the user to perform and could eventually exceed the transaction storage limit.Impact: This impacts the usability of the staking contract and discourages users from having many stakes in the contract.
Recommendation: Since the
stake_timestamp
of each stake is not checked or used after a stake is created, and theWithdrawAdjustment
tracks adjustments based on the time the user performs a bond, theBondingInfo
could solely track a user’stotal_stake
and omit storing all of the user’s individual stake operations.