DullahanRewardsStaking
UserRewardState
RewardState
UserClaimableRewards
UserClaimedRewards
initialized
Is the contract initialized
vault
Address of the Dullahan Vault
totalScaledAmount
Total scaled deposited amount
userScaledBalances
User scaled deposits
rewardList
Address of tokens used in reward distributions
rewardStates
Reward state for each reward token
rewardDepositors
Addresses allowed to deposit rewards
allowedClaimer
Addresses allowed to claim for another user
Initialized
Event emitted when the contract is initialized
Staked
Event emitted when staking
Unstaked
Event emitted when unstaking
ClaimedRewards
Event emitted when rewards are claimed
SetUserAllowedClaimer
Event emitted when a new Claimer is set for an user
NewRewards
Event emitted when a new reward is added
AddedRewardDepositor
Event emitted when a new reward depositor is added
RemovedRewardDepositor
Event emitted when a reward depositor is removed
onlyRewardDepositors
Check that the caller is allowed to deposit rewards
isInitialized
Check that the contract is initalized
constructor
init
lastRewardUpdateTimestamp
Get the last update timestamp for a reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Last update timestamp |
totalAssets
Get the total amount of assets staked
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Total amount of assets staked |
getCurrentIndex
Get the current index to convert between balance and scaled balances
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Current index |
getRewardList
Get the list of all reward tokens
Return Values
Name | Type | Description |
---|---|---|
[0] | address[] | address[] : List of reward tokens |
userCurrentStakedAmount
Get the current amount staked by an user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Current amount staked |
getUserRewardState
Get the current reward state of an user for a given reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
user | address | Address of the user |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DullahanRewardsStaking.UserRewardState | UserRewardState : User reward state |
getUserAccruedRewards
Get the current amount of rewards accrued by an user for a given reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
user | address | Address of the user |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : amount of rewards accured |
getUserTotalClaimableRewards
Get all current claimable amount of rewards for all reward tokens for a given user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DullahanRewardsStaking.UserClaimableRewards[] | UserClaimableRewards[] : Amounts of rewards claimable by reward token |
stake
Stake Vault shares
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to stake |
receiver | address | Address of the address to stake for |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : scaled amount for the deposit |
_stake
Pull the ScalingERC20 token & stake in this contract & tracks the correct scaled amount
Parameters
Name | Type | Description |
---|---|---|
caller | address | |
amount | uint256 | Amount to stake |
receiver | address | Address of the caller to pull token from |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : scaled amount for the deposit |
unstake
Unstake Vault shares
Unstake ScalingERC20 shares based on the given scaled amount & send them to the receiver
Parameters
Name | Type | Description |
---|---|---|
scaledAmount | uint256 | Scaled amount ot unstake |
receiver | address | Address to receive the shares |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : amount unstaked |
claimRewards
Claim the accrued rewards for a given reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Amount of rewards claimed |
claimRewardsForUser
Claim the accrued rewards for a given reward token on behalf of a given user
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
user | address | Address that accrued the rewards |
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Amount of rewards claimed |
claimAllRewards
Claim all accrued rewards for all reward tokens
Parameters
Name | Type | Description |
---|---|---|
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DullahanRewardsStaking.UserClaimedRewards[] | UserClaimedRewards[] : Amounts of reward claimed |
claimAllRewardsForUser
Claim all accrued rewards for all reward tokens on behalf of a given user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address that accrued the rewards |
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DullahanRewardsStaking.UserClaimedRewards[] | UserClaimedRewards[] : Amounts of reward claimed |
updateRewardState
Update the reward state for a given reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
updateAllRewardState
Update the reward state for all reward tokens
queueRewards
Add rewards to the disitribution queue
Set the amount of reward in the queue & push it to distribution if reaching the ratio
Parameters
Name | Type | Description |
---|---|---|
rewardToken | address | Address of the reward token |
amount | uint256 | Amount to queue |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | bool : success |
_updateRewardDistribution
Update the disitrubtion parameters for a given reward token
Parameters
Name | Type | Description |
---|---|---|
rewardToken | address | Address of the reward token |
state | struct DullahanRewardsStaking.RewardState | State of the reward token |
rewardAmount | uint256 | Total amount ot distribute |
_getCurrentIndex
Get the current index to convert between balance and scaled balances
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Current index |
_getNewRewardPerToken
Calculate the new rewardPerToken value for a reward token distribution
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : new rewardPerToken value |
_getUserEarnedRewards
Calculate the amount of rewards accrued by an user since last update for a reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
user | address | Address of the user |
currentRewardPerToken | uint256 |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Accrued rewards amount for the user |
_updateRewardState
Update the reward token distribution state
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
_updateUserRewardState
Update the user reward state for a given reward token
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of the reward token |
user | address | Address of the user |
_updateAllRewardStates
Update the reward state for all the reward tokens
_updateAllUserRewardStates
Update the reward state of the given user for all the reward tokens
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
_claimRewards
Claims rewards of an user for a given reward token and sends them to the receiver address
Parameters
Name | Type | Description |
---|---|---|
reward | address | Address of reward token |
user | address | Address of the user |
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : claimed amount |
_claimAllRewards
Claims all rewards of an user and sends them to the receiver address
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
receiver | address | Address to receive the rewards |
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DullahanRewardsStaking.UserClaimedRewards[] | UserClaimedRewards[] : list of claimed rewards |
pause
Pause the contract
unpause
Unpause the contract
addRewardDepositor
Add an address to the lsit of allowed reward depositors
Parameters
Name | Type | Description |
---|---|---|
depositor | address | Address to deposit rewards |
removeRewardDepositor
Remove an address from the lsit of allowed reward depositors
Parameters
Name | Type | Description |
---|---|---|
depositor | address | Address to deposit rewards |
setUserAllowedClaimer
Sets a given address as allowed to claim rewards for a given user
Sets a given address as allowed to claim rewards for a given user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
claimer | address | Address of the allowed claimer |
safe128
Last updated