Sidechain Contracts

Aura Finance is expanding to become a cross-chain protocol. Deploying to chains beyond Ethereum, with the intent to deploy to wherever the balancer is deployed and emitting rewards. As part of this expansion, a new set of contracts had been deployed.

Sidechain Contracts

  • AuraBalProxyOFT.sol : L1 Aura BAL proxy OFT

  • AuraBalOFT.sol : L2 Aura BAL OFT

  • AuraProxyOFT.sol : L1 Aura proxy OFT

  • AuraOFT.sol : L2 Aura OFT

  • Create2Factory.sol : A create2 factory to deploy the sidechain contracts to constant addresses

  • CrossChainConfig.sol : Abstract contract to handle setting LZ configs

  • CrossChainMessages.sol : Shared LZ messaging library

  • L1Coordinator.sol : L1 Coordinator handles sending messages to canonical chain

  • L2Coordinator.sol : L2 Coordinator handles sending messages to canonical chain

  • PausableOFT.sol : OFT extension that allows a guardian address to perform an emergency pause

  • PausableProxyOFT.sol : Proxy OFT extension that allows a guardian address to perform an emergency pause

  • PauseGuardian.sol : Allows to implement pauses triggered by a guardian address

AuraBalOFT

Sidechain auraBAL

constructor

constructor(string _name, string _symbol) public

Constructs the AuraBalOFT contract.

Parameters

initialize

function initialize(address _lzEndpoint, address _guardian) external

Initialize the contract.

Parameters

AuraBalProxyOFT

Send and receive auraBAL to and from all the sidechains. all auraBAL sat in this bridge will be staked in the auraBAL compounder and rewards distributed to the L2 staking contracts

HarvestToken

struct HarvestToken {
  address token;
  uint256 rewards;
}

vault

address vault

auraBAL compounder vault contract address

internalTotalSupply

uint256 internalTotalSupply

Internally tracking of total auraBAL supply bridged

harvestSrcChainIds

uint16[] harvestSrcChainIds

Harvest src chain IDs array

totalClaimable

mapping(address => uint256) totalClaimable

token address mapped to amount

claimable

mapping(address => mapping(uint16 => uint256)) claimable

token address mapped srcChainId mapped to amount claimable

rewardReceiver

mapping(uint16 => address) rewardReceiver

srcChainId mapped to reward receiver

authorizedHarvesters

mapping(address => bool) authorizedHarvesters

Authorized harvesters

ofts

mapping(address => address) ofts

Token to OFT

Harvest

event Harvest(address caller, uint256 totalUnderlyingSum)

Emitted when harvest rewards.

Parameters

constructor

constructor(address _lzEndpoint, address _token, address _vault, address _guardian, address _sudo, uint256 _inflowLimit) public

Constructs the AuraBalProxyOFT contract

Parameters

setAdapterParams

function setAdapterParams(uint16 _srcChainId, bytes32 _selector, bytes _adapterParams) external

Sets the configuration for a given source chain ID and selector.

Parameters

setRewardReceiver

function setRewardReceiver(uint16 _srcChainId, address _receiver) external

Set reward receiver for src chain

Parameters

updateAuthorizedHarvesters

function updateAuthorizedHarvesters(address _harvester, bool _authorized) external

Adds or remove an address from the harvesters' whitelist

Parameters

setOFT

function setOFT(address _token, address _oft) external

Set OFT for token

Parameters

setHarvestSrcChainIds

function setHarvestSrcChainIds(uint16[] _srcChainIds) external

Set srcChainIds to loop through for harvest

Parameters

circulatingSupply

function circulatingSupply() public view returns (uint256)

returns the circulating amount of tokens on current chain

harvest

function harvest(uint256[] _totalUnderlying, uint256 _totalUnderlyingSum) external

_Harvest rewards from the compounder and distribute them to the source chains

 Collect the amount of auraBAL that is staked on each source chain (L2). Then
 trigger a harvest on the vault which calculates the amount of auraBAL that has
 been earned since the last claim and the amount of extra rewards. These rewards
 are then lazily distributed to the src chains proportionally.

 Lazily meaning the claimable values are just added to a claimable mapping for
 processing latest via processClaimable_

Parameters

processClaimable

function processClaimable(address _token, uint16 _srcChainId, address _zroPaymentAddress) external payable

Process claimable rewards

Parameters

vaultExecute

function vaultExecute(uint256 _value, bytes _data) external returns (bool, bytes)

Execute a function on the vault

In order to account for the withdrawalPenalty this contract needs To be the owner of the auraBAL vault. Therefore it needs to be able to call vault owner functions. Rather than wrapping each function we can just use an execute pointing at the vault

rescue

function rescue(address _token, address _to, uint256 _amount) external

Rescues the specified amount of tokens from the bridge and transfers them to the specified address.

This function is only callable by the sudo address.

Parameters

AuraOFT

Sidechain AURA

canonicalChainId

uint16 canonicalChainId

canonical chain ID

Locked

event Locked(address caller, uint256 amount)

Emitted when locked cvx on the L1 chain

Parameters

constructor

constructor(string _name, string _symbol, uint16 _canonicalChainId) public

Constructs the AuraOFT contract.

Parameters

initialize

function initialize(address _lzEndpoint, address _guardian) external

Initialize the contract.

Parameters

setAdapterParams

function setAdapterParams(uint16 _srcChainId, bytes32 _selector, bytes _adapterParams) external

Sets the configuration for a given source chain ID and selector.

Parameters

lock

function lock(address _receiver, uint256 _cvxAmount, address _zroPaymentAddress) external payable

Lock CVX on the L1 chain

Parameters

AuraProxyOFT

Send and receive AURA to and from all the Sidechains and receives lock requests from the sidechains

locker

address locker

Aura Locker contract address

constructor

constructor(address _lzEndpoint, address _token, address _locker, address _guardian, address _sudo, uint256 _inflowLimit) public

Constructs the AuraProxyOFT contract

Parameters

Create2Factory

Deploy contracts using CREATE2 opcode.

A factory contract that uses the CREATE2 opcode to deploy contracts with a deterministic address.

Deployed

event Deployed(bytes32 salt, address deployed)

Event emitted when a contract is successfully deployed.

Parameters

deployer

mapping(address => bool) deployer

updateDeployer

function updateDeployer(address _deployer, bool _authorized) external

Adds or remove an address from the deployers' whitelist

Parameters

deploy

function deploy(uint256 amount, bytes32 salt, bytes bytecode, bytes[] callbacks) external returns (address)

Deploys a contract using the CREATE2 opcode.

Parameters

Return Values

computeAddress

function computeAddress(bytes32 salt, bytes32 codeHash) external view returns (address)

receive

receive() external payable

Fallback function that accepts Ether.

CrossChainConfig

Setter/Getter logic for cross chain layer zero config

getAdapterParams

mapping(uint16 => mapping(bytes32 => bytes)) getAdapterParams

srcChainId mapped to selector and configuration

SetAdapterParams

event SetAdapterParams(uint16 srcChainId, bytes32 selector, bytes adapterParams)

Emitted a configuration is set for a given source chain id.

Parameters

setAdapterParams

function setAdapterParams(uint16 _srcChainId, bytes32 _selector, bytes _adapterParams) external virtual

Sets the configuration for a given source chain ID and selector.

Parameters

CrossChainMessages

Share types for cross chain messages

MAGIC_BYTES

bytes4 MAGIC_BYTES

_Magic Bytes to pad the custom message with bytes4(keccak256("isCustomMessage(bytes)"))

MessageType

enum MessageType {
  LOCK,
  FEES,
  FEES_CALLBACK
}

L1Coordinator

Tracks the amount of fee debt accrued by each sidechain and sends AURA back to each sidechain for rewards

REWARD_MULTIPLIER_DENOMINATOR

uint256 REWARD_MULTIPLIER_DENOMINATOR

balToken

address balToken

BAL token contract

auraToken

address auraToken

AURA token contract

auraOFT

address auraOFT

AURA OFT token contract

treasury

address treasury

AURA treasury address

booster

address booster

Booster contract address

rewardMultiplier

uint256 rewardMultiplier

Reward multiplier

feeDebtOf

mapping(uint16 => uint256) feeDebtOf

src chain ID mapped to total feeDebt

settledFeeDebtOf

mapping(uint16 => uint256) settledFeeDebtOf

src chain ID mapped to total settled feeDebt

distributedFeeDebtOf

mapping(uint16 => uint256) distributedFeeDebtOf

src chain ID mapped to total distributed feeDebt

bridgeDelegates

mapping(uint16 => address) bridgeDelegates

src chain ID to bridgeDelegate

l2Coordinators

mapping(uint16 => address) l2Coordinators

src chain ID to L2Coordinator address

distributors

mapping(address => bool) distributors

sender to isDistributor

BridgeDelegateUpdated

event BridgeDelegateUpdated(uint16 srcChainId, address bridgeDelegate)

Parameters

L2CoordinatorUpated

event L2CoordinatorUpated(uint16 srcChainId, address l2Coordinator)

Parameters

DisributorUpdated

event DisributorUpdated(address distributor, bool active)

Parameters

FeeDebtNotified

event FeeDebtNotified(uint16 srcChainId, uint256 amount)

Parameters

AuraDistributed

event AuraDistributed(uint16 srcChainId, uint256 amount)

Parameters

FeeDebtSettled

event FeeDebtSettled(uint16 srcChainId, uint256 amount)

Parameters

RewardMultiplierUpdated

event RewardMultiplierUpdated(uint256 multiplier)

Parameters

BoosterUpdated

event BoosterUpdated(address booster)

Parameters

constructor

constructor(address _lzEndpoint, address _booster, address _balToken, address _auraToken, address _auraOFT, address _treasury) public

setAdapterParams

function setAdapterParams(uint16 _srcChainId, bytes32 _selector, bytes _adapterParams) external

Sets the configuration for a given source chain ID and selector.

Parameters

setBridgeDelegate

function setBridgeDelegate(uint16 _srcChainId, address _bridgeDelegate) external

Set bridge delegate for given srcChainId

Parameters

setL2Coordinator

function setL2Coordinator(uint16 _srcChainId, address _l2Coordinator) external

Set L2 Coordinator for given srcChainId

Parameters

setDistributor

function setDistributor(address _distributor, bool _active) external

Set distributor as valid or invalid so the can call harvest

Parameters

setRewardMultiplier

function setRewardMultiplier(uint256 _multiplier) external

Set the reward multiplier

Parameters

setBooster

function setBooster(address _booster) external

Set the booster address

Parameters

distributeAura

function distributeAura(uint16 _srcChainId, address _zroPaymentAddress, address _sendFromZroPaymentAddress, bytes _sendFromAdapterParams) external payable

Distribute AURA to the src chain using the BAL float in this contract mint AURA by calling distributeL2Fees on the Booster and then send those AURA tokens to the src chain

settleFeeDebt

function settleFeeDebt(uint16 _srcChainId, uint256 _amount) external

Receive CRV from the L2 via some thirdpart bridge to settle the feeDebt for the remote chain

receive

receive() external payable

L2Coordinator

Coordinates LZ messages and actions from the L1 on the L2

canonicalChainId

uint16 canonicalChainId

canonical chain ID

auraOFT

address auraOFT

AuraOFT contract

booster

address booster

Booster contract

balToken

address balToken

The BAL token contract

bridgeDelegate

address bridgeDelegate

The bridge delegate contract

accBalRewards

uint256 accBalRewards

Accumulated BAL rewards

accAuraRewards

uint256 accAuraRewards

Accumulated AURA rewards

BridgeDelegateUpdated

event BridgeDelegateUpdated(address bridgeDelegate)

Emitted when the bridge delegate address is updated.

Parameters

RewardAdded

event RewardAdded(address token, uint256 reward)

Emmitted when rewards are added

Parameters

constructor

constructor(address _auraOFT, uint16 _canonicalChainId) public

mintRate

function mintRate() public view returns (uint256)

Get mint rate based on accumulated BAL and AURA

Dev mint rate is aura per bal rewards

initialize

function initialize(address _booster, address _balToken, address _lzEndpoint) external

Initializes the booster and balToken addresses

This function should only be called by the owner of the contract

Parameters

setBridgeDelegate

function setBridgeDelegate(address _bridgeDelegate) external

setAdapterParams

function setAdapterParams(uint16 _srcChainId, bytes32 _selector, bytes _adapterParams) external

Sets the configuration for a given source chain ID and selector.

Parameters

mint

function mint(address _to, uint256 _amount) external

Mint function called by Booster.rewardClaimed. uses the CVX (L2) balance of this contract to transfer tokens

Parameters

queueNewRewards

function queueNewRewards(address _originalSender, uint256 _fees, uint256 _rewards, address _zroPaymentAddress) external payable

Called by the booster.earmarkRewards to register feeDebt with the L1 and receive CVX tokens in return

Parameters

PausableOFT

Extension to the OFT standard that allows a guardian address to perform an emergency pause on the sendFrom function.

constructor

constructor(string _name, string _symbol) public

Constructs the PausableOFT contract

Parameters

sendFrom

function sendFrom(address _from, uint16 _dstChainId, bytes _toAddress, uint256 _amount, address payable _refundAddress, address _zroPaymentAddress, bytes _adapterParams) public payable

Override sendFrom to add pause modifier

PausableProxyOFT

Extension to the ProxyOFT standard that allows a guardian address to perform an emergency pause.

  • When paused all messages received are added to a queue to be processed after queueDelay time has passed.

  • When paused no messages can be sent via sendFrom.

epochDuration

uint256 epochDuration

Duration of each inflow epoch

sudo

address sudo

Addres of super user

inflowLimit

uint256 inflowLimit

Transfer inflow limit per epoch

queueDelay

uint256 queueDelay

Queue delay

outflow

mapping(uint256 => uint256) outflow

Epoch mapped to transfer outflow

inflow

mapping(uint256 => uint256) inflow

Epoch mapped to transfer inflow

queue

mapping(bytes32 => bool) queue

Transfer queue

QueuedFromChain

event QueuedFromChain(uint256 epoch, uint16 srcChainId, address to, uint256 amount, uint256 timestamp)

Parameters

Rescue

event Rescue(address token, address to, uint256 amount)

Parameters

constructor

constructor(address _token, address _sudo, uint256 _inflowLimit) public

Parameters

setQueueDelay

function setQueueDelay(uint256 _delay) external

Amount of time that a transfer has to sit in the queue until it can be processed

Parameters

setInflowLimit

function setInflowLimit(uint256 _limit) external

Set the inflow limit per epoch

Parameters

getCurrentEpoch

function getCurrentEpoch() external view returns (uint256)

Get current epoch

sendFrom

function sendFrom(address _from, uint16 _dstChainId, bytes _toAddress, uint256 _amount, address payable _refundAddress, address _zroPaymentAddress, bytes _adapterParams) public payable

Override sendFrom to add pause modifier

processQueued

function processQueued(uint256 _epoch, uint16 _srcChainId, address _to, uint256 _amount, uint256 _timestamp) external

Process a queued transfer Transfer has to be a valid root and the queue delay has to have passed

Parameters

rescue

function rescue(address _token, address _to, uint256 _amount) external virtual

In a doomsday bridge scenario there may be a case where funds need to be rescued.

Parameters

PauseGuardian

Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized immutable guardian address.

guardian

address guardian

The guardian address

pause

function pause() external

This function pauses the contract.

This function can only be called by the 'guardian'.

unpause

function unpause() external

This function is used to unpause the contract.

This function can only be called by the 'guardian' of the contract.

IArbitrumGatewayRouter

outboundTransfer

function outboundTransfer(address _l1Token, address _to, uint256 _amount, bytes _data) external payable returns (bytes)

ArbitrumBridgeSender

gatewayRouter

address gatewayRouter

The Gnosis bridge address

l1Crv

address l1Crv

Mainnet CRV token address

constructor

constructor(address _gatewayRouter, address _crv, address _l1Crv) public

Constructs the GnosisBridgeSender contract.

Parameters

send

function send(uint256 _amount) external

_Function to send a specified amount of tokens. Requirements:

  • The caller must be the owner of the contract._

Parameters

BridgeDelegateReceiver

Receive bridged tokens from the L2 on L1

l1Coordinator

address l1Coordinator

The L1Coordinator address

srcChainId

uint16 srcChainId

The source chain id

SettleFeeDebt

event SettleFeeDebt(uint256 amount)

Emitted when tokens are sent to a recipient.

Parameters

constructor

constructor(address _l1Coordinator, uint16 _srcChainId) public

Constructs the BridgeDelegateReceiver contract.

Parameters

settleFeeDebt

function settleFeeDebt(uint256 _amount) external

Settle fee debt on the L1 Coordinator.

Parameters

BridgeDelegateSender

Sends tokens to L1 via a bridge

crv

address crv

The crv token address

l1Receiver

address l1Receiver

The L1Receiver address

Send

event Send(address to, uint256 amount)

Emitted when tokens are sent to a recipient.

Parameters

L1ReceiverUpated

event L1ReceiverUpated(address l1Receiver)

Emitted when the l1 receiver address is updated.

Parameters

setL1Receiver

function setL1Receiver(address _l1Receiver) external

Allows the owner of the contract to set the L1 receiver address.

This function requires the owner of the contract to call it and pass in a valid address. If the address is valid, the l1Receiver variable is updated and an event is emitted.

Parameters

send

function send(uint256 _amount) external virtual

Function to send a specified amount of tokens

Parameters

SimpleBridgeDelegateSender

Only used as an example and for tests Sends tokens to "L1" via a simple transfer

token

address token

The ERC20 bridged token address.

constructor

constructor(address _token) public

Constructs the SimpleBridgeDelegateSender contract.

Parameters

send

function send(uint256 _amount) external

Sends tokens to a l1Receiver.

Parameters

SidechainClaimZap

Claim zap to bundle various reward claims

Claims from all pools, Bridges/Locks to L1 if Wanted and compounds if needed.

receive

receive() external payable

cvx

address cvx

cvxCrv

address cvxCrv

compounder

address compounder

owner

address owner

canonicalChainID

uint16 canonicalChainID

ClaimRewardsAmounts

struct ClaimRewardsAmounts {
  uint256 lockCvxMaxAmount;
  uint256 depositCvxCrvMaxAmount;
  uint256 bridgeCvxMaxAmount;
}

Options

struct Options {
  bool useAllWalletFunds;
  bool sendCvxToL1;
  bool lockCvxL1;
  bool useCompounder;
  bool refundEth;
  bool overrideL1Receiver;
  address l1Receiever;
  address zro;
  bytes adapterParams;
}

initialize

function initialize(address _owner, address _cvx, address _cvxCrv, address _compounder) external

getName

function getName() external pure returns (string)

Returns meta data of contract

setApprovals

function setApprovals() external

Approve spending of: cvxCrv -> Compounder

claimRewards

function claimRewards(address zroPaymentAddress, address[] rewardContracts, address[] extraRewardContracts, address[] tokenRewardContracts, address[] tokenRewardTokens, struct SidechainClaimZap.ClaimRewardsAmounts amounts, struct SidechainClaimZap.Options options) external payable

Claim all the rewards

Parameters

SimpleStrategy

Simple strategy to harvest all vault's extra rewards and queue them.

auraBalToken

address auraBalToken

The $AURABAL token address

vault

address vault

The AuraBal compounder vault address

constructor

constructor(address _auraBalToken, address _vault) public

Simple constructor

Parameters

harvest

function harvest() external returns (uint256)

setApprovals

function setApprovals() external

stake

function stake(uint256 _amount) external

totalUnderlying

function totalUnderlying() external view returns (uint256)

withdraw

function withdraw(uint256 _amount) external

Allows the Vault to withdraw a given amount of auraBal.

Only callable by the vault.

Parameters

harvest

function harvest(uint256) public returns (uint256 harvested)

This function is used to process extra rewards for the vault.

This function will loop through the extra rewards and transfer the balance of the reward token to the rewards address. It will then queue the new rewards with the balance.

PoolInfo

struct PoolInfo {
  address lptoken;
  address token;
  address gauge;
  address crvRewards;
  address stash;
  bool shutdown;
}

earmarkRewards

function earmarkRewards(uint256 _pid, address _zroPaymentAddress) external payable returns (bool)

poolLength

function poolLength() external view returns (uint256)

lockRewards

function lockRewards() external view returns (address)

poolInfo

function poolInfo(uint256 _pid) external view returns (struct IBoosterLite.PoolInfo poolInfo)

lockIncentive

function lockIncentive() external view returns (uint256)

stakerIncentive

function stakerIncentive() external view returns (uint256)

earmarkIncentive

function earmarkIncentive() external view returns (uint256)

platformFee

function platformFee() external view returns (uint256)

FEE_DENOMINATOR

function FEE_DENOMINATOR() external view returns (uint256)

AuraClaimZapV3

Claim zap to bundle various reward claims

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 v3: - add option to deposit to compounder - reduce calls to cvxcrv rewards/compounder - removed enum and option bitshifting - introduced options struct - gas optimisation on use all funds balances - helper functions to reduce code repetition

crv

address crv

cvx

address cvx

cvxCrv

address cvxCrv

crvDepositWrapper

address crvDepositWrapper

cvxCrvRewards

address cvxCrvRewards

locker

address locker

owner

address owner

compounder

address compounder

ClaimRewardsAmounts

struct ClaimRewardsAmounts {
  uint256 depositCrvMaxAmount;
  uint256 minAmountOut;
  uint256 depositCvxMaxAmount;
  uint256 depositCvxCrvMaxAmount;
}

Options

struct Options {
  bool claimCvxCrv;
  bool claimLockedCvx;
  bool lockCvxCrv;
  bool lockCrvDeposit;
  bool useAllWalletFunds;
  bool useCompounder;
  bool lockCvx;
}

constructor

constructor(address _crv, address _cvx, address _cvxCrv, address _crvDepositWrapper, address _cvxCrvRewards, address _locker, address _compounder) public

Parameters

getName

function getName() external pure returns (string)

Returns meta data of contract.

setApprovals

function setApprovals() external

Approve spending of: crv -> crvDepositor cvxCrv -> cvxCrvRewards cvxCrv -> Compounder cvx -> Locker

claimRewards

function claimRewards(address[] rewardContracts, address[] extraRewardContracts, address[] tokenRewardContracts, address[] tokenRewardTokens, struct AuraClaimZapV3.ClaimRewardsAmounts amounts, struct AuraClaimZapV3.Options options) external

Claim all the rewards

Parameters

AuraViewHelpers

View-only contract to combine calls

IMPORTANT: These functions are extremely gas-intensive and should not be called from within a transaction.

balancerVault

contract IBalancerVault balancerVault

Token

struct Token {
  address addr;
  uint8 decimals;
  string symbol;
  string name;
}

Pool

struct Pool {
  uint256 pid;
  address lptoken;
  address token;
  address gauge;
  address crvRewards;
  address stash;
  bool shutdown;
  address rewardToken;
  bytes32 poolId;
  uint256[] normalizedWeights;
  address[] poolTokens;
  uint256[] underlying;
  uint256 totalSupply;
  struct AuraViewHelpers.RewardsData rewardsData;
  struct AuraViewHelpers.ExtraRewards[] extraRewards;
}

Vault

struct Vault {
  address addr;
  address underlying;
  uint256 totalUnderlying;
  uint256 totalSupply;
  uint256 withdrawalPenalty;
  struct AuraViewHelpers.ExtraRewards[] extraRewards;
}

VaultAccount

struct VaultAccount {
  address addr;
  uint256 balance;
  uint256 balanceOfUnderlying;
  uint256[] extraRewardsEarned;
}

Locker

struct Locker {
  uint256 epoch;
  uint256 totalSupply;
  uint256 lockedSupply;
  struct AuraViewHelpers.RewardsData rewardsData;
}

LockerAccount

struct LockerAccount {
  address addr;
  uint256 total;
  uint256 unlockable;
  uint256 locked;
  uint256 nextUnlockIndex;
  uint128 rewardPerTokenPaid;
  uint128 rewards;
  address delegate;
  uint256 votes;
  struct AuraLocker.LockedBalance[] lockData;
  struct AuraLocker.EarnedData[] claimableRewards;
}

RewardsData

struct RewardsData {
  uint256 periodFinish;
  uint256 lastUpdateTime;
  uint256 rewardRate;
  uint256 rewardPerTokenStored;
  uint256 queuedRewards;
}

ExtraRewards

struct ExtraRewards {
  address addr;
  address rewardsToken;
  struct AuraViewHelpers.RewardsData rewardsData;
}

PoolBalances

struct PoolBalances {
  uint256 pid;
  uint256 earned;
  uint256[] extraRewardsEarned;
  uint256 staked;
}

getVault

function getVault(address _vault) external view returns (struct AuraViewHelpers.Vault vault)

getVaultAccount

function getVaultAccount(address _vault, address _account) external view returns (struct AuraViewHelpers.VaultAccount vaultAccount)

getLocker

function getLocker(address _locker) external view returns (struct AuraViewHelpers.Locker locker)

getLockerAccount

function getLockerAccount(address _locker, address _account) external view returns (struct AuraViewHelpers.LockerAccount lockerAccount)

getPools

function getPools(address _booster) external view returns (struct AuraViewHelpers.Pool[])

getCvxCrvRewards

function getCvxCrvRewards(address _cvxCrvRewards) public view returns (struct AuraViewHelpers.Pool)

getPool

function getPool(struct IBooster.PoolInfo poolInfo, uint256 _pid) public view returns (struct AuraViewHelpers.Pool)

getPoolsBalances

function getPoolsBalances(address _booster, address _account) external view returns (struct AuraViewHelpers.PoolBalances[])

getPoolBalances

function getPoolBalances(address _rewardPool, uint256 _pid, address _account) public view returns (struct AuraViewHelpers.PoolBalances)

getTokens

function getTokens(address[] _addresses) public view returns (struct AuraViewHelpers.Token[])

getEarmarkingReward

function getEarmarkingReward(uint256 pool, address booster, address token) public returns (uint256 pending)

getMultipleEarmarkingRewards

function getMultipleEarmarkingRewards(uint256[] pools, address booster, address token) external returns (uint256[] pendings)

BoosterLiteHelper

Invokes booster.earmarkRewards for multiple pools on BoosterLite

Allows anyone to call earmarkRewards via the booster.

booster

contract IBoosterLite booster

crv

address crv

constructor

constructor(address _booster, address _crv) public

Parameters

earmarkRewards

function earmarkRewards(uint256[] _pids, address _zroPaymentAddress) external payable returns (uint256)

processIdleRewards

function processIdleRewards(uint256[] _pids) external

Invoke processIdleRewards for each pool id.

Parameters

Convex Platform "Lite" Contracts

The convex platform contracts developed for the sidechain are ‘lite’ variations of those used on Ethereum. In practice this means that contracts have functionality changed or removed, multiple contracts are merged together or contracts are not utilised on the sidechain.

  • BaseRewardPool4626

  • BoosterOwnerLite

  • BoosterLite

  • PoolManagerLite

  • VoterProxyLite

BaseRewardPool4626

Simply wraps the BaseRewardPool with the new IERC4626 Vault standard functions.

See https://github.com/fei-protocol/ERC4626/blob/main/src/interfaces/IERC4626.sol#L58 This is not so much a vault as a Reward Pool, therefore asset:share ratio is always 1:1. To create most utility for this RewardPool, the "asset" has been made to be the crvLP token, as opposed to the cvxLP token. Therefore, users can easily deposit crvLP, and it will first go to the Booster and mint the cvxLP before performing the normal staking function.

asset

address asset

The address of the underlying ERC20 token used for the Vault for accounting, depositing, and withdrawing.

constructor

constructor(uint256 pid_, address stakingToken_, address rewardToken_, address operator_, address rewardManager_, address lptoken_) public

See BaseRewardPool.sol

totalAssets

function totalAssets() external view virtual returns (uint256)

Total amount of the underlying asset that is "managed" by Vault.

deposit

function deposit(uint256 assets, address receiver) public virtual returns (uint256)

Mints shares Vault shares to receiver.

Because asset is not actually what is collected here, first wrap to required token in the booster.

mint

function mint(uint256 shares, address receiver) external virtual returns (uint256)

Mints exactly shares Vault shares to receiver by depositing assets of underlying tokens.

withdraw

function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256)

Redeems shares from owner and sends assets of underlying tokens to receiver.

redeem

function redeem(uint256 shares, address receiver, address owner) external virtual returns (uint256)

Redeems shares from owner and sends assets of underlying tokens to receiver.

convertToShares

function convertToShares(uint256 assets) public view virtual returns (uint256)

The amount of shares that the vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.

convertToAssets

function convertToAssets(uint256 shares) public view virtual returns (uint256)

The amount of assets that the vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.

maxDeposit

function maxDeposit(address) public view virtual returns (uint256)

Total number of underlying assets that can be deposited by owner into the Vault, where owner corresponds to the input parameter receiver of a deposit call.

previewDeposit

function previewDeposit(uint256 assets) external view virtual returns (uint256)

Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.

maxMint

function maxMint(address owner) external view virtual returns (uint256)

Total number of underlying shares that can be minted for owner, where owner corresponds to the input parameter receiver of a mint call.

previewMint

function previewMint(uint256 shares) external view virtual returns (uint256)

Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.

maxWithdraw

function maxWithdraw(address owner) public view virtual returns (uint256)

Total number of underlying assets that can be withdrawn from the Vault by owner, where owner corresponds to the input parameter of a withdraw call.

previewWithdraw

function previewWithdraw(uint256 assets) public view virtual returns (uint256 shares)

Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, given current on-chain conditions.

maxRedeem

function maxRedeem(address owner) external view virtual returns (uint256)

Total number of underlying shares that can be redeemed from the Vault by owner, where owner corresponds to the input parameter of a redeem call.

previewRedeem

function previewRedeem(uint256 shares) external view virtual returns (uint256)

Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, given current on-chain conditions.

name

function name() external view returns (string)

Returns the name of the token.

symbol

function symbol() external view returns (string)

Returns the symbol of the token.

decimals

function decimals() external view returns (uint8)

Returns the decimals places of the token.

totalSupply

function totalSupply() public view returns (uint256)

Returns the amount of tokens in existence.

balanceOf

function balanceOf(address account) public view returns (uint256)

Returns the amount of tokens owned by account.

transfer

function transfer(address recipient, uint256 amount) external returns (bool)

_Moves amount tokens from the caller's account to recipient.

Returns a boolean value indicating whether the operation succeeded.

Emits a {Transfer} event._

allowance

function allowance(address owner, address spender) public view virtual returns (uint256)

See {IERC20-allowance}.

approve

function approve(address spender, uint256 amount) public virtual returns (bool)

_See {IERC20-approve}.

Requirements:

  • spender cannot be the zero address._

transferFrom

function transferFrom(address owner, address recipient, uint256 amount) external returns (bool)

Moves amount tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller's allowance.

BoosterOwnerLite

Immutable booster owner that requires all pools to be shutdown before shutting down the entire convex system

A timelock is required if forcing a shutdown if there is a bugged pool that can not be withdrawn from. Allow arbitrary calls to other contracts, but limit how calls are made to Booster. A lite version of the original Booster for use on sidechains

poolManager

address poolManager

booster

address booster

stashFactory

address stashFactory

rescueStash

address rescueStash

owner

address owner

pendingowner

address pendingowner

isSealed