Function: vote(address[] pools, uint64[] weights)
This function is used to vote on pools. It updates a user's vote weights, also allowing the user to divide their voting power across different pools.
Inputs
pools
Control: Arbitrary.
Constraints: None.
Impact: Array of pools to change vote weights.
weights
Control: Arbitrary.
Constraints: Must be the same length as
pools
.Impact: Array of voting weight on each pool in
pools
.
Branches and code coverage
Intended branches
Invoke
applyPoolSlopeChanges()
if the pool is active.Invoke
_modifyVoteWeight()
to modify the user's vote weight.
Negative behavior
Revert if the pools and weights arrays have different lengths.
Revert if the user is not the owner and has no veAnzen balance.
Revert if the total voted weight is more than
USER_VOTE_MAX_WEIGHT
.