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
user
Control: N/A.
Constraints: Cannot be zero address.
Impact: The address of the user-added volume.
amount
Control: N/A.
Constraints: Must be greater than zero.
Impact: The amount of volume.
Branches and code coverage (including function calls)
Intended branches
userYeetVolume
is updated properly.totalYeetVolume
is updated properly.If
_shouldEndEpoch
is 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.timestamp
is greater than or equal to thecurrentEpochEnd
— otherwise, it returns false. If the current epoch ends, the_endEpoch
function 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
currentEpoch
is incremented, thecurrentEpochStart
is updated using the currentcurrentEpochEnd
, and after that, thecurrentEpochEnd
is set to thecurrentEpochStart + EPOCH_LENGTH
. Also, this function updates theepochRewards
for the new epoch.