Solidity API
使用 solidity-docgen 生成的文档。
Aura代币
基本上,它是由VoterProxy(Booster)的「操作者」(operator)操作的具有铸造功能的ERC20。
铸造日程是基于通过质押获得的CRV数量,并沿着供应曲线(如供应悬崖等)分布。这是ConvexToken的一个分叉。
operator
vecrvProxy
EMISSIONS_MAX_SUPPLY
INIT_MINT_AMOUNT
totalCliffs
reductionPerCliff
minter
minterMinted
Initialised
OperatorChanged
constructor
Name | Type | Description |
---|---|---|
_proxy | address | CVX VoterProxy |
_nameArg | string | Token name |
_symbolArg | string | Token symbol |
init
初始化以及铸造初始的代币供应量
Name | Type | Description |
---|---|---|
_to | address | Target address to mint. |
_minter | address | The minter address. |
updateOperator
如果投票代理的操作者发生变化,可以调用这个功能。
mint
根据BAL供应计划,为指定用户铸造AURA。
minterMint
允许铸币者向特定地址进行铸造。
AuraBalRewardPool
Modifications from convex-platform/contracts/contracts/BaseRewardPool.sol: - Delayed start (tokens transferred then delay is enforced before notification) - One time duration of 14 days - Remove child reward contracts - Penalty on claim at 20%
rewardToken
stakingToken
duration
rewardManager
auraLocker
penaltyForwarder
pendingPenalty
startTime
periodFinish
rewardRate
lastUpdateTime
rewardPerTokenStored
_totalSupply
userRewardPerTokenPaid
rewards
_balances
RewardAdded
Staked
Withdrawn
RewardPaid
PenaltyForwarded
Rescued
constructor
Simple constructor
Name | Type | Description |
---|---|---|
_stakingToken | address | Pool LP token |
_rewardToken | address | $AURA |
_rewardManager | address | Depositor |
_auraLocker | address | $AURA lock contract |
_penaltyForwarder | address | Address to which penalties are sent |
_startDelay | uint256 |
totalSupply
balanceOf
updateReward
lastTimeRewardApplicable
rewardPerToken
earned
stake
stakeAll
stakeFor
withdraw
getReward
给予质押者奖励
Name | Type | Description |
---|---|---|
_lock | bool | Lock the rewards? If false, takes a 20% haircut |
forwardPenalty
Forwards to the penalty forwarder for distro to Aura Lockers
rescueReward
如果奖励代币尚未启动,则执行救援。
setLocker
更新Locker地址
initialiseRewards
根据stakeToken余额进行一次性初始化奖励。
AuraClaimZap
Claim zap - 一次打包多笔奖励申领
Claims from all pools, and stakes cvxCrv and CVX if wanted. v2: - change exchange to use curve pool - add getReward(address,token) type - add option to lock cvx - add option use all funds in wallet
crv
cvx
cvxCrv
crvDepositWrapper
cvxCrvRewards
locker
owner
Options
constructor
Name | Type | Description |
---|---|---|
_crv | address | CRV token (0xD533a949740bb3306d119CC777fa900bA034cd52); |
_cvx | address | CVX token (0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B); |
_cvxCrv | address | cvxCRV token (0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7); |
_crvDepositWrapper | address | crvDepositWrapper (0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae); |
_cvxCrvRewards | address | cvxCrvRewards (0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e); |
_locker | address | vlCVX (0xD18140b4B819b895A3dba5442F959fA44994AF50); |
getName
setApprovals
Approve spending of: crv -> crvDepositor cvxCrv -> cvxCrvRewards cvx -> Locker
_checkOption
Use bitmask to check if option flag is set
claimRewards
申领所有奖励
Name | Type | Description |
---|---|---|
rewardContracts | address[] | Array of addresses for LP token rewards |
extraRewardContracts | address[] | Array of addresses for extra rewards |
tokenRewardContracts | address[] | Array of addresses for token rewards e.g vlCvxExtraRewardDistribution |
tokenRewardTokens | address[] | Array of token reward addresses to use with tokenRewardContracts |
depositCrvMaxAmount | uint256 | The max amount of CRV to deposit if converting to crvCvx |
minAmountOut | uint256 | The min amount out for crv:cvxCrv swaps if swapping. Set this to zero if you want to use CrvDepositor instead of balancer swap |
depositCvxMaxAmount | uint256 | The max amount of CVX to deposit if locking CVX |
options | uint256 | Claim options |
_claimExtras
由: - cvxCrvRewards - cvxLocker 申领額外的奖励
Name | Type | Description |
---|---|---|
depositCrvMaxAmount | uint256 | see claimRewards |
minAmountOut | uint256 | see claimRewards |
depositCvxMaxAmount | uint256 | see claimRewards |
removeCrvBalance | uint256 | crvBalance to ignore and not redeposit (starting Crv balance) |
removeCvxBalance | uint256 | cvxBalance to ignore and not redeposit (starting Cvx balance) |
options | uint256 | see claimRewards |
AuraLocker
实际上允许 CVX 的 16 周滚动锁定,并提供每个时期(1 周)的可用余额。还从 CvxStakingProxy 接收 cvxCrv 并重新分配给存款人。.
个人和代表的投票权力查找都使用独立的会计机制。
RewardData
UserData
EarnedData
Balances
LockedBalance
Epoch
DelegateeCheckpoint
rewardTokens
queuedRewards
newRewardRatio
rewardData
rewardDistributors
userData
rewardsDuration
lockDuration
lockedSupply
epochs
balances
userLocks
_delegates
_checkpointedVotes
delegateeUnlocks
blacklist
stakingToken
cvxCrv
denominator
cvxcrvStaking
kickRewardPerEpoch
kickRewardEpochDelay
isShutdown
_name
_symbol
_decimals
DelegateChanged
DelegateCheckpointed
Recovered
RewardPaid
Staked
Withdrawn
KickReward
RewardAdded
BlacklistModified
KickIncentiveSet
Shutdown
constructor
Name | Type | Description |
---|---|---|
_nameArg | string | Token name, simples |
_symbolArg | string | Token symbol |
_stakingToken | address | CVX (0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B) |
_cvxCrv | address | cvxCRV (0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7) |
_cvxCrvStaking | address | cvxCRV rewards (0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e) |
updateReward
notBlacklisted
modifyBlacklist
addReward
approveRewardDistributor
setKickIncentive
shutdown
recoverERC20
setApprovals
lock
_lock
getReward
getReward
getReward
checkpointEpoch
_checkpointEpoch
processExpiredLocks
kickExpiredLocks
emergencyWithdraw
_processExpiredLocks
delegate
Delegate votes from the sender to newDelegatee
.
_checkpointDelegate
delegates
Get the address account
is currently delegating to.
getVotes
Gets the current votes balance for account
checkpoints
Get the pos
-th checkpoint for account
.
numCheckpoints
Get number of checkpoints for account
.
getPastVotes
Retrieve the number of votes for account
at the end of blockNumber
.
getPastTotalSupply
Retrieve the totalSupply
at the end of timestamp
. Note, this value is the sum of all balances. It is but NOT the sum of all the delegated votes!
_checkpointsLookup
Lookup a value in a list of (sorted) checkpoints. Copied from oz/ERC20Votes.sol
balanceOf
balanceAtEpochOf
lockedBalances
totalSupply
totalSupplyAtEpoch
findEpochId
epochCount
decimals
name
symbol
claimableRewards
lastTimeRewardApplicable
rewardPerToken
_earned
_lastTimeRewardApplicable
_rewardPerToken
queueNewRewards
_notifyReward
AuraMerkleDrop
Forked from convex-platform/contracts/contracts/MerkleAirdrop.sol. Changes: - solc 0.8.11 & OpenZeppelin MerkleDrop - Delayed start w/ trigger - EndTime for withdrawal to treasuryDAO - Penalty on claim & AuraLocker lock (only if address(auraLocker) != 0) - Non custodial (cannot change root)
dao
merkleRoot
aura
auraLocker
penaltyForwarder
pendingPenalty
deployTime
startTime
expiryTime
hasClaimed
DaoSet
RootSet
StartedEarly
ExpiredWithdrawn
LockerSet
Claimed
PenaltyForwarded
Rescued
constructor
Name | Type | Description |
---|---|---|
_dao | address | The Aura Dao |
_merkleRoot | bytes32 | Merkle root |
_aura | address | Aura token |
_auraLocker | address | Aura locker contract |
_penaltyForwarder | address | PenaltyForwarded contract |
_startDelay | uint256 | Delay until claim is live |
_expiresAfter | uint256 | Timestamp claim expires |
setDao
setRoot
startEarly
withdrawExpired
setLocker
rescueReward
claim
forwardPenalty
AuraMinter
Wraps the AuraToken minterMint function and protects from inflation until 3 years have passed.
Ownership initially owned by the DAO, but likely transferred to smart contract wrapper or additional value system at some stage as directed by token holders.
aura
Aura token
inflationProtectionTime
Timestamp upon which minting will be possible
constructor
mint
Mint function allows the owner of the contract to inflate AURA post protection time
Name | Type | Description |
---|---|---|
_to | address | Recipient address |
_amount | uint256 | Amount of tokens |
AuraPenaltyForwarder
Receives a given token and forwards it on to a distribution contract.
distributor
token
distributionDelay
lastDistribution
Forwarded
DistributorChanged
constructor
During deployment approves the distributor to spend all tokens
Name | Type | Description |
---|---|---|
_distributor | address | Contract that will distribute tokens |
_token | address | Token to be distributed |
_delay | uint256 | Delay between each distribution trigger |
_dao | address | Address of DAO |
forward
Forwards the complete balance of token in this contract to the distributor
setDistributor
Updates distributor address
AuraStakingProxy
Receives CRV from the Booster as overall reward, then distributes to vlCVX holders. Also acts as a depositor proxy to support deposit/withdrawals from the CVX staking contract.
From CVX: - receive tokens to stake - get current staked balance - withdraw staked tokens - send rewards back to owner(cvx locker) - register token types that can be distributed
crv
cvx
cvxCrv
keeper
crvDepositorWrapper
outputBps
denominator
rewards
owner
pendingOwner
callIncentive
RewardsDistributed
CallIncentiveChanged
constructor
Name | Type | Description |
---|---|---|
_rewards | address | vlCVX |
_crv | address | CRV token |
_cvx | address | CVX token |
_cvxCrv | address | cvxCRV token |
_crvDepositorWrapper | address | Wrapper that converts CRV to CRVBPT and deposits |
_outputBps | uint256 | Configurable output bps where 100% == 10000 |
setCrvDepositorWrapper
Set CrvDepositorWrapper
Name | Type | Description |
---|---|---|
_crvDepositorWrapper | address | CrvDepositorWrapper address |
_outputBps | uint256 | Min output base points |
setKeeper
Set keeper
setPendingOwner
Set pending owner
applyPendingOwner
Apply pending owner
setCallIncentive
Set call incentive
Name | Type | Description |
---|---|---|
_incentive | uint256 | Incentive base points |
setRewards
Set reward address
setApprovals
Approve crvDepositorWrapper to transfer contract CRV and rewards to transfer cvxCrv
rescueToken
Transfer stuck ERC20 tokens to _to
distribute
distribute
Collects cvxCRV rewards from cvxRewardPool, converts any CRV deposited directly from the booster, and then applies the rewards to the cvxLocker, rewarding the caller in the process.
_distribute
distributeOther
Allow generic token distribution in case a new reward is ever added
AuraVestedEscrow
Vests tokens over a given timeframe to an array of recipients. Allows locking of these tokens directly to staking contract.
Adaptations: - One time initialisation - Consolidation of fundAdmin/admin - Lock in AuraLocker by default - Start and end time
rewardToken
admin
funder
auraLocker
startTime
endTime
totalTime
initialised
totalLocked
totalClaimed
Funded
Cancelled
Claim
constructor
Name | Type | Description |
---|---|---|
rewardToken_ | address | Reward token (AURA) |
admin_ | address | Admin to cancel rewards |
auraLocker_ | address | Contract where rewardToken can be staked |
starttime_ | uint256 | Timestamp when claim starts |
endtime_ | uint256 | When vesting ends |
setAdmin
Change contract admin
Name | Type | Description |
---|---|---|
_admin | address | New admin address |
setLocker
Change locker contract address
Name | Type | Description |
---|---|---|
_auraLocker | address | Aura Locker address |
fund
Fund recipients with rewardTokens
Name | Type | Description |
---|---|---|
_recipient | address[] | Array of recipients to vest rewardTokens for |
_amount | uint256[] | Arrary of amount of rewardTokens to vest |
cancel
Cancel recipients vesting rewardTokens
Name | Type | Description |
---|---|---|
_recipient | address | Recipient address |
available
Available amount to claim
Name | Type | Description |
---|---|---|
_recipient | address | Recipient to lookup |
remaining
Total remaining vested amount
Name | Type | Description |
---|---|---|
_recipient | address | Recipient to lookup |
_totalVestedOf
Get total amount vested for this timestamp
Name | Type | Description |
---|---|---|
_recipient | address | Recipient to lookup |
_time | uint256 | Timestamp to check vesting amount for |
claim
_claim
Claim reward token (Aura) and lock it.
Name | Type | Description |
---|---|---|
_recipient | address | Address to receive rewards. |
_lock | bool | Lock rewards immediately. |
Deposits $BAL into a BAL/WETH BPT. Hooks into TWAP to determine minOut.
Abstract contract for depositing BAL -> balBPT -> auraBAL via crvDepositor
BALANCER_VAULT
BAL
WETH
BALANCER_POOL_TOKEN
BAL_ETH_POOL_ID
constructor
_setApprovals
_getBptPrice
_getMinOut
_investBalToPool
BalLiquidityProvider
Provides initial liquidity to a Balancer pool on behalf of a given DAO
startToken
pairToken
minPairAmount
provider
dao
bVault
LiquidityProvided
MinPairAmountChanged
constructor
provideLiquidity
Provides liquidity on behalf of the dao, in a non-custodial manner. Has protections in place to ensure that no erroneous liquidity data gets added.
changeMinPairAmount
Allows the DAO to change the minimum amount of the pair token that must be added as liquidity
rescueToken
Rescues a given token from the contract. Only provider or DAO can call this function.
ChefForwarder
pid
briber
chef
constructor
setBriber
setPid
deposit
claim
ExtraRewardsDistributor
Allows anyone to distribute rewards to the AuraLocker at a given epoch.
auraLocker
canAddReward
rewardData
rewardEpochs
userClaims
WhitelistModified
RewardAdded
RewardPaid
RewardForfeited
constructor
Simple constructor
Name | Type | Description |
---|---|---|
_auraLocker | address | Aura Locker address |
modifyWhitelist
addReward
Add a reward to the current epoch. can be called multiple times for the same reward token
Name | Type | Description |
---|---|---|
_token | address | Reward token address |
_amount | uint256 | Amount of reward tokenπ |
addRewardToEpoch
Add reward token to a specific epoch
Name | Type | Description |
---|---|---|
_token | address | Reward token address |
_amount | uint256 | Amount of reward tokens to add |
_epoch | uint256 | Which epoch to add to (must be less than the previous epoch) |
_addReward
Transfer reward tokens from sender to contract for vlCVX holders
Add reward token for specific epoch
Name | Type | Description |
---|---|---|
_token | address | Reward token address |
_amount | uint256 | Amount of reward tokens |
_epoch | uint256 | Epoch to add tokens to |
getReward
Claim rewards for a specific token since the first epoch.
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token address |
getReward
Claim rewards for a specific token at a specific epoch
Name | Type | Description |
---|---|---|
_token | address | Reward token address |
_startIndex | uint256 | Index of rewardEpochs[_token] to start checking for rewards from |
_getReward
Claim rewards for a specific token at a specific epoch
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token address |
_startIndex | uint256 | Index of rewardEpochs[_token] to start checking for rewards from |
forfeitRewards
Allow a user to set their claimed index forward without claiming rewards Because claims cycle through all periods that a specific reward was given there becomes a situation where, for example, a new user could lock 2 years from now and try to claim a token that was given out every week prior. This would result in a 2mil gas checkpoint.(about 20k gas * 52 weeks * 2 years)
Name | Type | Description |
---|---|---|
_token | address | Reward token to forfeit |
_index | uint256 | Epoch index to forfeit from |
claimableRewards
Get claimable rewards (rewardToken) for vlCVX holder
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token address |
claimableRewardsAtEpoch
Get claimable rewards for a token at a specific epoch
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token address |
_epoch | uint256 | The epoch to check for rewards |
_allClaimableRewards
Get all claimable rewards by looping through each epoch starting with the latest saved epoch the user last claimed from
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token |
_startIndex | uint256 | Index of rewardEpochs[_token] to start checking for rewards from |
_claimableRewards
Get claimable rewards for a token at a specific epoch
Name | Type | Description |
---|---|---|
_account | address | Address of vlCVX holder |
_token | address | Reward token address |
_epoch | uint256 | The epoch to check for rewards |
rewardEpochsCount
Simply gets the current epoch count for a given reward token
Name | Type | Description |
---|---|---|
_token | address | Reward token address |
Name | Type | Description |
---|---|---|
[0] | uint256 | _epochs Number of epochs |
RewardPool
deposit
RewardPoolDepositWrapper
Peripheral contract that allows users to deposit into a Balancer pool and then stake their BPT into Aura in 1 tx. Flow: - rawToken.transferFrom(user, address(this)) - vault.deposit(rawToken), receive poolToken - poolToken.approve(rewardPool) - rewardPool.deposit(poolToken), converts to auraBPT and then deposits
bVault
constructor
depositSingle
Deposits a single raw token into a BPT before depositing in reward pool. Requires sender to approve this contract before calling.
Last updated