Function: addYeetVolume(address user, uint256 amount)
This is available only for the yeetContract address. Before executing the main logic of this function, the epoch will be updated if the current epoch has ended. The function increases the userYeetVolume by the amount for the provided user address and for the current epoch. Additionally, the totalYeetVolume is updated by the provided amount.
Inputs
userControl: N/A.
Constraints: Cannot be zero address.
Impact: The address of the user-added volume.
amountControl: N/A.
Constraints: Must be greater than zero.
Impact: The amount of volume.
Branches and code coverage (including function calls)
Intended branches
userYeetVolumeis updated properly.totalYeetVolumeis updated properly.If
_shouldEndEpochis true, the epoch is updated.
Negative behavior
amount == 0.User is zero address.
Function call analysis
_shouldEndEpoch()What is controllable? N/A.
If the return value is controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters or does other unusual control flow? Returns true if
block.timestampis greater than or equal to thecurrentEpochEnd— otherwise, it returns false. If the current epoch ends, the_endEpochfunction is triggered.
_endEpoch()What is controllable? N/A.
Argument control?: N/A.
If the return value is controllable, how is it used and how can it go wrong?: N/A.
What happens if it reverts, reenters or does other unusual control flow?: The function updates the epoch contract state; the
currentEpochis incremented, thecurrentEpochStartis updated using the currentcurrentEpochEnd, and after that, thecurrentEpochEndis set to thecurrentEpochStart + EPOCH_LENGTH. Also, this function updates theepochRewardsfor the new epoch.