Message: ExecuteMsg::Deallocate
This deallocates INJ staking rewards from a specified recipient.
Inputs
info.sender
Validation: Verified to ensure the sender is whitelisted. Confirms that the contract is not paused.
Impact: Acts as the deallocator of the funds.
recipient
Validation: Ensures the recipient address is valid. Checks that the recipient has an existing allocation from the sender.
Impact: Has their allocation reduced or removed.
amount
Validation: Must not exceed the current allocation to the recipient. Remaining allocation must either be zero or at least
ONE_INJ
.Impact: The amount of INJ removed from the allocation.
Branches and code coverage (including function calls)
Intended branches
Deallocate the
amount
from the recipient.Remove the allocation entirely if the remaining amount is zero.
Update the allocation with the reduced amount while preserving the share price.
Negative behavior
Fail if the contract is paused.
Fail if the sender is not whitelisted.
Fail if the recipient address is invalid.
Fail if no allocation exists between the sender and recipient.
Fail if the
amount
exceeds the current allocation.Fail if the remaining allocation is nonzero but less than
ONE_INJ
.