View Source: contracts/pool/Staking/StakingPools.sol
↗ Extends: StakingPoolInfo
StakingPools
function (IStore s) public nonpayable StakingPoolInfo Arguments
| Name | Type | Description |
|---|---|---|
| s | IStore |
Source Code
constructor(IStore s) StakingPoolInfo(s) {}Deposit your desired amount of tokens to the specified staking pool. When you deposit, you receive rewards if tokens are still available in the reward pool.
function deposit(bytes32 key, uint256 amount) external nonpayable nonReentrant Arguments
| Name | Type | Description |
|---|---|---|
| key | bytes32 | |
| amount | uint256 |
Source Code
function deposit(bytes32 key, uint256 amount) external override nonReentrant {
s.mustNotBePaused();
s.ensureValidStakingPoolInternal(key);
(address stakingToken, address rewardToken, uint256 rewards, uint256 rewardsPlatformFee) = s.depositInternal(key, amount);
emit Deposited(key, msg.sender, stakingToken, amount);
if (rewards > 0) {
emit RewardsWithdrawn(key, msg.sender, rewardToken, rewards, rewardsPlatformFee);
}
}Withdraw your desired amount of tokens from the staking pool. When you withdraw, you receive rewards if tokens are still available in the reward pool.
function withdraw(bytes32 key, uint256 amount) external nonpayable nonReentrant Arguments
| Name | Type | Description |
|---|---|---|
| key | bytes32 | |
| amount | uint256 |
Source Code
function withdraw(bytes32 key, uint256 amount) external override nonReentrant {
s.mustNotBePaused();
s.ensureValidStakingPoolInternal(key);
(address stakingToken, address rewardToken, uint256 rewards, uint256 rewardsPlatformFee) = s.withdrawInternal(key, amount);
emit Withdrawn(key, msg.sender, stakingToken, amount);
if (rewards > 0) {
emit RewardsWithdrawn(key, msg.sender, rewardToken, rewards, rewardsPlatformFee);
}
}- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundStablecoinDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundStablecoinDelegator
- Finalization
- ForceEther
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICompoundERC20DelegatorLike
- ICover
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- ILiquidityEngine
- IMember
- INeptuneRouterV1
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceOracle
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockLiquidityEngineUser
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NeptuneRouterV1
- NPM
- NpmDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- POT
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness