Staking (DEPRECATED)
DEI-DEUS
DEI-USDC
DEUS-ETH
DEUS_MATIC
0x4e5D8794f08F2792DC51016d0a4b9A205cAFc63A
Same on all chains
0xa78Ea447ce5AA4669A5f0cD8D27bF5883E1Bf20f
Same on all chains
0x4C48f1421F62d923d9130834135FB4A58E2F4298
Same on all chains except Polygon
0x4C48f1421F62d923d9130834135FB4A58E2F4298
The following codes are for ETH mainnet which you can find here:
mapping (address => User) public users
To store user's data
uint256 public rewardTillNowPerToken
Used to adjust reward calculation
uint256 public lastUpdatedBlock
This is the number of last block in which function
update()
is calleduint256 public rewardPerBlock
Used to adjust staking APY
uint256 public scale
Used for math calculations
uint256 public particleCollector
When users call
claim(),
sum of daoShare
and earlyFoundersShare
is added to this variableuint256 public daoShare
Denotes the share of DAO
uint256 public earlyFoundersShare
Denotes the share of early founders
address public daoWallet
Denotes the wallet of DAO
address public earlyFoundersWallet
Denotes the wallet of early founders
uint256 public totalStakedToken
Denotes the all tokens which is staked (LP tokens)
address public stakedToken
Address of token which can be staked
address public rewardToken
Addess of reward token (DEUS)
bytes32 private constant REWARD_PER_BLOCK_SETTER
AccessControl
role for the reward per block setterbytes32 private constant TRUSTY_ROLE
AccessControl
role for the trustyUser {uint256 depositAmount; uint256 paidReward;}
onlyTrusty()
Restricts actions to the trusty wallet( DAO agent/multisig wallet), e.g. set variables
pendingReward(address _user) external view returns (uint256 reward)
Returns the amount of reward which user can claim until the current block
update() public
Updates reward variables of the pool to be up-to-date. It is called when someone deposit or withdraw his/her LP tokens
deposit(uint256 amount) external
Called when user wants to stake his/her LP tokens
depositFor(address _user, uint256 amount) public
Called when user wants to stake his/her LP tokens for a specific address
withdraw(uint256 amount) external
It is called for two purposes: 1. Claiming reward (if amount = 0) 2. Withdrawing LP tokens + Claiming reward (if amount > 0)
withdrawParticleCollector() public
Transfers
daoShare
and earlyFoundersShare
to daoWallet
and earlyFoundersWallet
. It can be called by anyoneemergencyWithdraw() external
Withdraws LP tokens without caring about rewards. EMERGENCY ONLY
withdrawAllStakedtokens(address to) external onlyTrusty
Add temporary withdrawal functionality for owner(DAO) to transfer all tokens to a safe place.
setStakedToken(address _stakedToken) external onlyTrusty
Sets
stakedToken
addresssetWallets(address _daoWallet, address _earlyFoundersWallet) external onlyTrusty
Sets
daoWallet
and earlyFoundersWallet
setShares(uint256 _daoShare, uint256 _earlyFoundersShare) external onlyTrusty
Sets
daoShare
and earlyFoundersWallet
setRewardPerBlock(uint256 _rewardPerBlock) external
Sets
rewardPerBlock
withdrawStakedtokens(uint256 totalStakedTokens, address to)
Emitted when
withdrawAllStakedtokens()
is calledStakedTokenSet(address _stakedToken)
Emitted when
setStakedToken()
is calledSharesSet(uint256 _daoShare, uint256 _earlyFoundersShare)
Emitted when
setShares()
is calledWithdrawParticleCollectorAmount(uint256 _earlyFoundersShare, uint256 _daoShare)
Emitted when
withdrawParticleCollector()
is calledWalletsSet(address _daoWallet, address _earlyFoundersWallet)
Emitted when
setWallets()
is calledDeposit(address user, uint256 amount)
Emitted when
diposit() or depositFor()
is calledWithdraw(address user, uint256 amount)
Emitted when
withdraw()
is calledEmergencyWithdraw(address user, uint256 amount)
Emitted when
emergencyWithdraw()
is calledRewardClaimed(address user, uint256 amount)
Emitted when
withdraw()
is calledRewardPerBlockChanged(uint256 oldValue, uint256 newValue)
Emitted when
setRewardPerBlock()
is calledLast modified 3mo ago