stake(uint96 amount, address delegatee, address beneficiary)(uint256 depositIds)
method of the RewardsDistribution facet from the BaseRegistry diamond contract.
Users must select a delegatee, for instance an active operator (active operators are listed on www.towns.com/token), to delegate to in order to earn periodic rewards.
Users must also select a beneficiary, which is the address that will receive the rewards.
Once stake()
is called, a unique depositId
is returned to track the stake for the owner. A given address can have multiple deposits or can manage a single deposit.
To increase the amount of stake, the deposit owner can call increaseStake(uint256 depositId, uint96 amount)
.
redelegate(uint256 depositId, address delegatee)
.permitAndStake(uint96 amount, address delegatee, address beneficiary, uint256 nonce, uint256 deadline, bytes signature)
permitAndIncreaseStake(uint256 depositId, uint96 amount, uint256 nonce, uint256 deadline, bytes signature)
stakeOnBehalf(uint96 amount, address delegatee, address beneficiary, address owner, uint256 nonce, bytes signature)
changeBeneficiary(uint256 depositId, address newBeneficiary)
- Change who receives the rewards from a specific depositclaimReward(address beneficiary, address recipient)
method:
For Regular Stakers:
beneficiary = your_address
to claim your own staking rewardsrecipient
address (yourself or someone else)getDepositsByDepositor(address depositor)
to get the list of depositIds for the depositor.initiateWithdraw(uint256 depositId)
with the depositId to start the withdrawal process.withdraw(uint256 depositId)
to complete the withdrawal process transferring the stake back to the owner.