All pages
Powered by GitBook
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

OracleManagerV1

Alluvial Finance Inc.

Oracle Manager (v1)

This contract handles the inputs provided by the oracle. The Oracle contract is plugged to this contract and is in charge of pushing data whenever a new report has been deemed valid. The report consists in two values: the sum of all balances of all deposited validators and the count of validators that have been activated on the consensus layer.

Methods

_DEPOSIT_SIZE

Size of a deposit in ETH

Returns

Name
Type
Description

getCLSpec

Retrieve the current cl spec

Returns

Name
Type
Description

getCLValidatorCount

Get CL validator count (the amount of validator reported by the oracles)

Returns

Name
Type
Description

getCLValidatorTotalBalance

Get CL validator total balance

Returns

Name
Type
Description

getCurrentEpochId

Retrieve the current epoch id based on block timestamp

Returns

Name
Type
Description

getCurrentFrame

Retrieve the current frame details

Returns

Name
Type
Description

getExpectedEpochId

Retrieve expected epoch id

Returns

Name
Type
Description

getFrameFirstEpochId

Retrieve the first epoch id of the frame of the provided epoch id

Parameters

Name
Type
Description

Returns

Name
Type
Description

getLastCompletedEpochId

Retrieve the last completed epoch id

Returns

Name
Type
Description

getLastConsensusLayerReport

Retrieve the last consensus layer report

Returns

Name
Type
Description

getOracle

Get oracle address

Returns

Name
Type
Description

getReportBounds

Retrieve the report bounds

Returns

Name
Type
Description

getTime

Retrieve the block timestamp

Returns

Name
Type
Description

isValidEpoch

Verifies if the provided epoch is valid

Parameters

Name
Type
Description

Returns

Name
Type
Description

setCLSpec

Parameters

Name
Type
Description

setConsensusLayerData

Parameters

Name
Type
Description

setOracle

Set the oracle address

Parameters

Name
Type
Description

setReportBounds

Parameters

Name
Type
Description

Events

ConsensusLayerDataUpdate

The consensus layer data provided by the oracle has been updated

Parameters

Name
Type
Description

ProcessedConsensusLayerReport

The provided report has been processed

Parameters

Name
Type
Description

SetBounds

The Report Bounds are changed

Parameters

Name
Type
Description

SetOracle

The stored oracle address changed

Parameters

Name
Type
Description

SetSpec

The Consensus Layer Spec is changed

Parameters

Name
Type
Description

Errors

InvalidDecreasingValidatorsExitedBalance

The total exited balance decreased

Parameters

Name
Type
Description

InvalidDecreasingValidatorsSkimmedBalance

The total skimmed balance decreased

Parameters

Name
Type
Description

InvalidEpoch

Thrown when an invalid epoch was reported

Parameters

Name
Type
Description

InvalidValidatorCountReport

The reported validator count is invalid

Parameters

Name
Type
Description

InvalidZeroAddress

The address is zero

TotalValidatorBalanceDecreaseOutOfBound

The balance decrease is higher than the maximum allowed by the lower bound

Parameters

Name
Type
Description

TotalValidatorBalanceIncreaseOutOfBound

The balance increase is higher than the maximum allowed by the upper bound

Parameters

Name
Type
Description

Unauthorized

The operator is unauthorized for the caller

Parameters

Name
Type
Description

epochsToAssumedFinality

uint64

The number of epochs before an epoch is considered final

_0

uint256

undefined

_0

CLSpec.CLSpecStruct

The Consensus Layer Specification

_0

uint256

The CL validator count

_0

uint256

The CL Validator total balance

_0

uint256

The current epoch id

_startEpochId

uint256

The epoch at the beginning of the frame

_startTime

uint256

The timestamp of the beginning of the frame in seconds

_endTime

uint256

The timestamp of the end of the frame in seconds

_0

uint256

The current expected epoch id

_epochId

uint256

Epoch id used to get the frame

_0

uint256

The first epoch id of the frame containing the given epoch id

_0

uint256

The last completed epoch id

_0

IOracleManagerV1.StoredConsensusLayerReport

The stored consensus layer report

_0

address

The oracle address

_0

ReportBounds.ReportBoundsStruct

The report bounds

_0

uint256

The current timestamp from the EVM context

_epoch

uint256

undefined

_0

bool

True if valid

_newValue

CLSpec.CLSpecStruct

undefined

_report

IOracleManagerV1.ConsensusLayerReport

undefined

_oracleAddress

address

Address of the oracle

_newValue

ReportBounds.ReportBoundsStruct

undefined

validatorCount

uint256

The new count of validators running on the consensus layer

validatorTotalBalance

uint256

The new total balance sum of all validators

roundId

bytes32

Round identifier

report

IOracleManagerV1.ConsensusLayerReport

The report that was provided

trace

IOracleManagerV1.ConsensusLayerDataReportingTrace

The trace structure providing more insights on internals

annualAprUpperBound

uint256

The reporting upper bound

relativeLowerBound

uint256

The reporting lower bound

oracleAddress indexed

address

The new oracle address

epochsPerFrame

uint64

The number of epochs inside a frame

slotsPerEpoch

uint64

The number of slots inside an epoch

secondsPerSlot

uint64

The number of seconds inside a slot

genesisTime

uint64

The genesis timestamp

currentValidatorsExitedBalance

uint256

The current exited balance

newValidatorsExitedBalance

uint256

The new exited balance

currentValidatorsSkimmedBalance

uint256

The current exited balance

newValidatorsSkimmedBalance

uint256

The new exited balance

epoch

uint256

Invalid epoch

providedValidatorCount

uint256

The received validator count value

depositedValidatorCount

uint256

The number of deposits performed by the system

lastReportedValidatorCount

uint256

The last reported validator count

prevTotalEthIncludingExited

uint256

The previous total balance, including all exited balance

postTotalEthIncludingExited

uint256

The post-report total balance, including all exited balance

timeElapsed

uint256

The time in seconds since last report

relativeLowerBound

uint256

The lower bound value that was used

prevTotalEthIncludingExited

uint256

The previous total balance, including all exited balance

postTotalEthIncludingExited

uint256

The post-report total balance, including all exited balance

timeElapsed

uint256

The time in seconds since last report

annualAprUpperBound

uint256

caller

address

Address performing the call

The upper bound value that was used

function _DEPOSIT_SIZE() external view returns (uint256)
function getCLSpec() external view returns (struct CLSpec.CLSpecStruct)
function getCLValidatorCount() external view returns (uint256)
function getCLValidatorTotalBalance() external view returns (uint256)
function getCurrentEpochId() external view returns (uint256)
function getCurrentFrame() external view returns (uint256 _startEpochId, uint256 _startTime, uint256 _endTime)
function getExpectedEpochId() external view returns (uint256)
function getFrameFirstEpochId(uint256 _epochId) external view returns (uint256)
function getLastCompletedEpochId() external view returns (uint256)
function getLastConsensusLayerReport() external view returns (struct IOracleManagerV1.StoredConsensusLayerReport)
function getOracle() external view returns (address)
function getReportBounds() external view returns (struct ReportBounds.ReportBoundsStruct)
function getTime() external view returns (uint256)
function isValidEpoch(uint256 _epoch) external view returns (bool)
function setCLSpec(CLSpec.CLSpecStruct _newValue) external nonpayable
function setConsensusLayerData(IOracleManagerV1.ConsensusLayerReport _report) external nonpayable
function setOracle(address _oracleAddress) external nonpayable
function setReportBounds(ReportBounds.ReportBoundsStruct _newValue) external nonpayable
event ConsensusLayerDataUpdate(uint256 validatorCount, uint256 validatorTotalBalance, bytes32 roundId)
event ProcessedConsensusLayerReport(IOracleManagerV1.ConsensusLayerReport report, IOracleManagerV1.ConsensusLayerDataReportingTrace trace)
event SetBounds(uint256 annualAprUpperBound, uint256 relativeLowerBound)
event SetOracle(address indexed oracleAddress)
event SetSpec(uint64 epochsPerFrame, uint64 slotsPerEpoch, uint64 secondsPerSlot, uint64 genesisTime, uint64 epochsToAssumedFinality)
error InvalidDecreasingValidatorsExitedBalance(uint256 currentValidatorsExitedBalance, uint256 newValidatorsExitedBalance)
error InvalidDecreasingValidatorsSkimmedBalance(uint256 currentValidatorsSkimmedBalance, uint256 newValidatorsSkimmedBalance)
error InvalidEpoch(uint256 epoch)
error InvalidValidatorCountReport(uint256 providedValidatorCount, uint256 depositedValidatorCount, uint256 lastReportedValidatorCount)
error InvalidZeroAddress()
error TotalValidatorBalanceDecreaseOutOfBound(uint256 prevTotalEthIncludingExited, uint256 postTotalEthIncludingExited, uint256 timeElapsed, uint256 relativeLowerBound)
error TotalValidatorBalanceIncreaseOutOfBound(uint256 prevTotalEthIncludingExited, uint256 postTotalEthIncludingExited, uint256 timeElapsed, uint256 annualAprUpperBound)
error Unauthorized(address caller)

Components

UserDepositManagerV1

Alluvial Finance Inc.

User Deposit Manager (v1)

This contract handles the inbound transfers cases or the explicit submissions

Methods

deposit

Explicit deposit method to mint on msg.sender

depositAndTransfer

Explicit deposit method to mint on msg.sender and transfer to _recipient

Parameters

Name
Type
Description

Events

UserDeposit

User deposited ETH in the system

Parameters

Name
Type
Description

Errors

EmptyDeposit

And empty deposit attempt was made

InvalidCall

The call was invalid

InvalidZeroAddress

The address is zero

_recipient

address

Address receiving the minted LsETH

depositor indexed

address

Address performing the deposit

recipient indexed

address

Address receiving the minted shares

amount

uint256

Amount in ETH deposited

function deposit() external payable
function depositAndTransfer(address _recipient) external payable
event UserDeposit(address indexed depositor, address indexed recipient, uint256 amount)
error EmptyDeposit()
error InvalidCall()
error InvalidZeroAddress()

ConsensusLayerDepositManagerV1

Alluvial Finance Inc.

Consensus Layer Deposit Manager (v1)

This contract handles the interactions with the official deposit contract, funding all validatorsWhenever a deposit to the consensus layer is requested, this contract computed the amount of keys that could be deposited depending on the amount available in the contract. It then tries to retrieve validator keys by calling its internal virtual method _getNextValidators. This method should be overridden by the implementing contract to provide [0; _keyCount] keys when invoked.

Methods

DEPOSIT_SIZE

Size of a deposit in ETH

Returns

Name
Type
Description

PUBLIC_KEY_LENGTH

Size of a BLS Public key in bytes

Returns

Name
Type
Description

SIGNATURE_LENGTH

Size of a BLS Signature in bytes

Returns

Name
Type
Description

depositToConsensusLayerWithDepositRoot

Deposits current balance to the Consensus Layer by batches of 32 ETH

Parameters

Name
Type
Description

getBalanceToDeposit

Returns the amount of ETH not yet committed for deposit

Returns

Name
Type
Description

getCommittedBalance

Returns the amount of ETH committed for deposit

Returns

Name
Type
Description

getDepositedValidatorCount

Get the deposited validator count (the count of deposits made by the contract)

Returns

Name
Type
Description

getKeeper

Get the keeper address

Returns

Name
Type
Description

getWithdrawalCredentials

Retrieve the withdrawal credentials

Returns

Name
Type
Description

Events

SetDepositContractAddress

The stored deposit contract address changed

Parameters

Name
Type
Description

SetDepositedValidatorCount

Emitted when the deposited validator count is updated

Parameters

Name
Type
Description

SetWithdrawalCredentials

The stored withdrawal credentials changed

Parameters

Name
Type
Description

Errors

ErrorOnDeposit

An error occurred during the deposit

InconsistentPublicKeys

The length of the BLS Public key is invalid during deposit

InconsistentSignatures

The length of the BLS Signature is invalid during deposit

InvalidDepositRoot

Invalid deposit root

InvalidPublicKeyCount

The received count of public keys to deposit is invalid

InvalidSignatureCount

The received count of signatures to deposit is invalid

InvalidWithdrawalCredentials

The withdrawal credentials value is null

NoAvailableValidatorKeys

The internal key retrieval returned no keys

NotEnoughFunds

Not enough funds to deposit one validator

OnlyKeeper

SliceOutOfBounds

The slice is outside of the initial bytes bounds

SliceOverflow

The length overflows an uint

_0

uint256

undefined

_0

uint256

undefined

_0

uint256

undefined

_maxCount

uint256

The maximum amount of validator keys to fund

_depositRoot

bytes32

The root of the deposit tree

_0

uint256

The amount of ETH not yet committed for deposit

_0

uint256

The amount of ETH committed for deposit

_0

uint256

The deposited validator count

_0

address

The keeper address

_0

bytes32

The withdrawal credentials

depositContract indexed

address

Address of the deposit contract

oldDepositedValidatorCount

uint256

The old deposited validator count value

newDepositedValidatorCount

uint256

The new deposited validator count value

withdrawalCredentials

bytes32

The withdrawal credentials to use for deposits

function DEPOSIT_SIZE() external view returns (uint256)
function PUBLIC_KEY_LENGTH() external view returns (uint256)
function SIGNATURE_LENGTH() external view returns (uint256)
function depositToConsensusLayerWithDepositRoot(uint256 _maxCount, bytes32 _depositRoot) external nonpayable
function getBalanceToDeposit() external view returns (uint256)
function getCommittedBalance() external view returns (uint256)
function getDepositedValidatorCount() external view returns (uint256)
function getKeeper() external view returns (address)
function getWithdrawalCredentials() external view returns (bytes32)
event SetDepositContractAddress(address indexed depositContract)
event SetDepositedValidatorCount(uint256 oldDepositedValidatorCount, uint256 newDepositedValidatorCount)
event SetWithdrawalCredentials(bytes32 withdrawalCredentials)
error ErrorOnDeposit()
error InconsistentPublicKeys()
error InconsistentSignatures()
error InvalidDepositRoot()
error InvalidPublicKeyCount()
error InvalidSignatureCount()
error InvalidWithdrawalCredentials()
error NoAvailableValidatorKeys()
error NotEnoughFunds()
error OnlyKeeper()
error SliceOutOfBounds()
error SliceOverflow()

SharesManagerV1

Alluvial Finance Inc.

Shares Manager (v1)

This contract handles the shares of the depositor and the ERC20 interface

Methods

allowance

Retrieve the allowance value for a spender

Parameters

Name
Type
Description

Returns

Name
Type
Description

approve

Approves an account for future spendings

An approved account can use transferFrom to transfer funds on behalf of the token owner

Parameters

Name
Type
Description

Returns

Name
Type
Description

balanceOf

Retrieve the balance of an account

Parameters

Name
Type
Description

Returns

Name
Type
Description

balanceOfUnderlying

Retrieve the underlying asset balance of an account

Parameters

Name
Type
Description

Returns

Name
Type
Description

decimals

Retrieve the decimal count

Returns

Name
Type
Description

decreaseAllowance

Decrease allowance to another account

Parameters

Name
Type
Description

Returns

Name
Type
Description

increaseAllowance

Increase allowance to another account

Parameters

Name
Type
Description

Returns

Name
Type
Description

name

Retrieve the token name

Returns

Name
Type
Description

sharesFromUnderlyingBalance

Retrieve the shares count from an underlying asset amount

Parameters

Name
Type
Description

Returns

Name
Type
Description

symbol

Retrieve the token symbol

Returns

Name
Type
Description

totalSupply

Retrieve the total token supply

Returns

Name
Type
Description

totalUnderlyingSupply

Retrieve the total underlying asset supply

Returns

Name
Type
Description

transfer

Performs a transfer from the message sender to the provided account

Parameters

Name
Type
Description

Returns

Name
Type
Description

transferFrom

Performs a transfer between two recipients

Parameters

Name
Type
Description

Returns

Name
Type
Description

underlyingBalanceFromShares

Retrieve the underlying asset balance from an amount of shares

Parameters

Name
Type
Description

Returns

Name
Type
Description

Events

Approval

Emitted when the allowance of a spender for an owner is set by a call to {approve}. value is the new allowance.

Parameters

Name
Type
Description

SetTotalSupply

Emitted when the total supply is changed

Parameters

Name
Type
Description

Transfer

Emitted when value tokens are moved from one account (from) to another (to). Note that value may be zero.

Parameters

Name
Type
Description

Errors

AllowanceTooLow

Allowance too low to perform operation

Parameters

Name
Type
Description

BalanceTooLow

Balance too low to perform operation

InvalidZeroAddress

The address is zero

NullTransfer

Invalid empty transfer

UnauthorizedTransfer

Invalid transfer recipients

Parameters

Name
Type
Description

_owner

address

Address that issued the allowance

_spender

address

Address that received the allowance

_0

uint256

The allowance in shares for a given spender

_spender

address

Address that is allowed to spend the tokens

_value

uint256

The allowed amount in shares, will override previous value

_0

bool

True if success

_owner

address

Address to be checked

_0

uint256

The balance of the account in shares

_owner

address

Address to be checked

_0

uint256

The underlying balance of the account

_0

uint8

The decimal count

_spender

address

Spender that receives the allowance

_subtractableValue

uint256

Amount of shares to subtract

_0

bool

True if success

_spender

address

Spender that receives the allowance

_additionalValue

uint256

Amount of shares to add

_0

bool

True if success

_0

string

The token name

_underlyingAssetAmount

uint256

Amount of underlying asset to convert

_0

uint256

The amount of shares worth the underlying asset amount

_0

string

The token symbol

_0

uint256

The total supply in shares

_0

uint256

The total underlying asset supply

_to

address

Address receiving the tokens

_value

uint256

Amount of shares to be sent

_0

bool

True if success

_from

address

Address sending the tokens

_to

address

Address receiving the tokens

_value

uint256

Amount of shares to be sent

_0

bool

True if success

_shares

uint256

Amount of shares to convert

_0

uint256

The underlying asset balance represented by the shares

owner indexed

address

undefined

spender indexed

address

undefined

value

uint256

undefined

totalSupply

uint256

undefined

from indexed

address

undefined

to indexed

address

undefined

value

uint256

undefined

_from

address

Account where funds are sent from

_operator

address

Account attempting the transfer

_allowance

uint256

Current allowance

_value

uint256

_from

address

Account sending the funds in the invalid transfer

_to

address

Account receiving the funds in the invalid transfer

Requested transfer value in shares

function allowance(address _owner, address _spender) external view returns (uint256)
function approve(address _spender, uint256 _value) external nonpayable returns (bool)
function balanceOf(address _owner) external view returns (uint256)
function balanceOfUnderlying(address _owner) external view returns (uint256)
function decimals() external pure returns (uint8)
function decreaseAllowance(address _spender, uint256 _subtractableValue) external nonpayable returns (bool)
function increaseAllowance(address _spender, uint256 _additionalValue) external nonpayable returns (bool)
function name() external pure returns (string)
function sharesFromUnderlyingBalance(uint256 _underlyingAssetAmount) external view returns (uint256)
function symbol() external pure returns (string)
function totalSupply() external view returns (uint256)
function totalUnderlyingSupply() external view returns (uint256)
function transfer(address _to, uint256 _value) external nonpayable returns (bool)
function transferFrom(address _from, address _to, uint256 _value) external nonpayable returns (bool)
function underlyingBalanceFromShares(uint256 _shares) external view returns (uint256)
event Approval(address indexed owner, address indexed spender, uint256 value)
event SetTotalSupply(uint256 totalSupply)
event Transfer(address indexed from, address indexed to, uint256 value)
error AllowanceTooLow(address _from, address _operator, uint256 _allowance, uint256 _value)
error BalanceTooLow()
error InvalidZeroAddress()
error NullTransfer()
error UnauthorizedTransfer(address _from, address _to)

ERC20VestableVotesUpgradeableV1

Alluvial Finance Inc.

ERC20VestableVotesUpgradeableV1

This is an ERC20 extension that- can be used as source of vote power (inherited from OpenZeppelin ERC20VotesUpgradeable)- can delegate vote power from an account to another account (inherited from OpenZeppelin ERC20VotesUpgradeable)- can manage token vestings: ownership is progressively transferred to a beneficiary according to a vesting schedule- keeps a history (checkpoints) of each account's vote power@notice Notes from OpenZeppelin ERC20VotesUpgradeable- vote power can be delegated either by calling the {delegate} function, or by providing a signature to be used with {delegateBySig}- keeps a history (checkpoints) of each account's vote power- power can be queried through the public accessors {getVotes} and {getPastVotes}.- by default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked.@notice Notes about token vesting- any token holder can call the method {createVestingSchedule} in order to transfer tokens to a beneficiary according to a vesting schedule. When creating a vesting schedule, tokens are transferred to an escrow that holds the token while the vesting progresses. Voting power of the escrowed token is delegated to the beneficiary or a delegatee account set by the vesting schedule creator- the schedule beneficiary call {releaseVestingSchedule} to get vested tokens transferred from escrow- the schedule creator can revoke a revocable schedule by calling {revokeVestingSchedule} in which case the non-vested tokens are transferred from the escrow back to the creator- the schedule beneficiary can delegate escrow voting power to any account by calling {delegateVestingEscrow}@notice Vesting schedule attributes are- start : start time of the vesting period- cliff duration: duration before which first tokens gets ownable- total duration: duration of the entire vesting (sum of all vesting period durations)- period duration: duration of a single period of vesting- lock duration: duration before tokens gets unlocked. can exceed the duration of the vesting schedule- amount: amount of tokens granted by the vesting schedule- beneficiary: beneficiary of tokens after they are releaseVestingScheduled- revocable: whether the schedule can be revoked- ignoreGlobalUnlockSchedule: whether the schedule should ignore the global unlock schedule@notice Vesting schedule- if currentTime < cliff: vestedToken = 0- if cliff <= currentTime < end: vestedToken = (vestedPeriodCount(currentTime) _ periodDuration _ amount) / totalDuration- if end < currentTime: vestedToken = amount@notice Global unlock schedule- the global unlock schedule releases 1/24th of the total scheduled amount every month after the local lock end- the local lock end is the end of the lock period of the vesting schedule- the global unlock schedule is ignored if the vesting schedule has the ignoreGlobalUnlockSchedule flag set to true- the global unlock schedule is only a cap on the vested funds that can be withdrawn, it does not alter the vesting@notice Remark: After cliff new tokens get vested at the end of each period@notice Vested token & lock period- a vested token is a token that will be eventually releasable from the escrow to the beneficiary once the lock period is over- lock period prevents beneficiary from releasing vested tokens before the lock period ends. Vested tokens will eventually be releasable once the lock period is over@notice Example: Joe gets a vesting starting on Jan 1st 2022 with duration of 1 year and a lock period of 2 years.On Jan 1st 2023, Joe will have all tokens vested but can not yet release it due to the lock period.On Jan 1st 2024, lock period is over and Joe can release all tokens.

Methods

CLOCK_MODE

Description of the clock

Returns

Name
Type
Description

DOMAIN_SEPARATOR

See {IERC20Permit-DOMAIN_SEPARATOR}.

Returns

Name
Type
Description

allowance

See {IERC20-allowance}.

Parameters

Name
Type
Description

Returns

Name
Type
Description

approve

See {IERC20-approve}. NOTE: If amount is the maximum uint256, the allowance is not updated on transferFrom. This is semantically equivalent to an infinite approval. Requirements: - spender cannot be the zero address.

Parameters

Name
Type
Description

Returns

Name
Type
Description

balanceOf

See {IERC20-balanceOf}.

Parameters

Name
Type
Description

Returns

Name
Type
Description

checkpoints

Get the pos-th checkpoint for account.

Parameters

Name
Type
Description

Returns

Name
Type
Description

clock

Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).

Returns

Name
Type
Description

computeVestingReleasableAmount

Computes the releasable amount of tokens for a vesting schedule.

Parameters

Name
Type
Description

Returns

Name
Type
Description

computeVestingVestedAmount

Computes the vested amount of tokens for a vesting schedule.

Parameters

Name
Type
Description

Returns

Name
Type
Description

createVestingSchedule

Creates a new vesting scheduleThere may delay between the time a user should start vesting tokens and the time the vesting schedule is actually created on the contract.Typically a user joins the Liquid Collective but some weeks pass before the user gets all legal agreements in place and signed for the token grant emission to happen. In this case, the vesting schedule created for the token grant would start on the join date which is in the past.

As vesting schedules can be created in the past, this means that you should be careful when creating a vesting schedule and what duration parameters you use as this contract would allow creating a vesting schedule in the past and even a vesting schedule that has already ended.

Parameters

Name
Type
Description

Returns

Name
Type
Description

decimals

Returns the number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5.05 (505 / 10 ** 2). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.

Returns

Name
Type
Description

decreaseAllowance

Atomically decreases the allowance granted to spender by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - spender cannot be the zero address. - spender must have allowance for the caller of at least subtractedValue.

Parameters

Name
Type
Description

Returns

Name
Type
Description

delegate

Delegate votes from the sender to delegatee.

Parameters

Name
Type
Description

delegateBySig

Delegates votes from signer to delegatee

Parameters

Name
Type
Description

delegateVestingEscrow

Delegate vesting escrowed tokens

Parameters

Name
Type
Description

Returns

Name
Type
Description

delegates

Get the address account is currently delegating to.

Parameters

Name
Type
Description

Returns

Name
Type
Description

eip712Domain

See {EIP-5267}. Available since v4.9.

Returns

Name
Type
Description

getPastTotalSupply

Retrieve the totalSupply at the end of timepoint. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - timepoint must be in the past

Parameters

Name
Type
Description

Returns

Name
Type
Description

getPastVotes

Retrieve the number of votes for account at the end of timepoint. Requirements: - timepoint must be in the past

Parameters

Name
Type
Description

Returns

Name
Type
Description

getVestingSchedule

Get vesting schedule

The vesting schedule structure represents a static configuration used to compute the desired vesting details of a beneficiary at all times. The values won't change even after tokens are released.The only dynamic field of the structure is end, and is updated whenever a vesting schedule is revoked

Parameters

Name
Type
Description

Returns

Name
Type
Description

getVestingScheduleCount

Get count of vesting schedules

Returns

Name
Type
Description

getVotes

Gets the current votes balance for account

Parameters

Name
Type
Description

Returns

Name
Type
Description

increaseAllowance

Atomically increases the allowance granted to spender by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - spender cannot be the zero address.

Parameters

Name
Type
Description

Returns

Name
Type
Description

isGlobalUnlockedScheduleIgnored

Get vesting global unlock schedule activation status for a vesting schedule

Parameters

Name
Type
Description

Returns

Name
Type
Description

name

Returns the name of the token.

Returns

Name
Type
Description

nonces

See {IERC20Permit-nonces}.

Parameters

Name
Type
Description

Returns

Name
Type
Description

numCheckpoints

Get number of checkpoints for account.

Parameters

Name
Type
Description

Returns

Name
Type
Description

permit

See {IERC20Permit-permit}.

Parameters

Name
Type
Description

releaseVestingSchedule

Release vesting scheduleWhen tokens are released from the escrow, the delegated address of the escrow will see its voting power decrease.The beneficiary has to make sure its delegation parameters are set properly to be able to use/delegate the voting power of its balance.

Parameters

Name
Type
Description

Returns

Name
Type
Description

revokeVestingSchedule

Revoke vesting schedule

Parameters

Name
Type
Description

Returns

Name
Type
Description

symbol

Returns the symbol of the token, usually a shorter version of the name.

Returns

Name
Type
Description

totalSupply

See {IERC20-totalSupply}.

Returns

Name
Type
Description

transfer

See {IERC20-transfer}. Requirements: - to cannot be the zero address. - the caller must have a balance of at least amount.

Parameters

Name
Type
Description

Returns

Name
Type
Description

transferFrom

See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum uint256. Requirements: - from and to cannot be the zero address. - from must have a balance of at least amount. - the caller must have allowance for from's tokens of at least amount.

Parameters

Name
Type
Description

Returns

Name
Type
Description

vestingEscrow

Get the address of the escrow for a vesting schedule

Parameters

Name
Type
Description

Returns

Name
Type
Description

Events

Approval

Emitted when the allowance of a spender for an owner is set by a call to {approve}. value is the new allowance.

Parameters

Name
Type
Description

CreatedVestingSchedule

A new vesting schedule has been created

Parameters

Name
Type
Description

DelegateChanged

Emitted when an account changes their delegate.

Parameters

Name
Type
Description

DelegateVotesChanged

Emitted when a token transfer or delegate change results in changes to a delegate's number of votes.

Parameters

Name
Type
Description

DelegatedVestingEscrow

Vesting escrow has been delegated

Parameters

Name
Type
Description

EIP712DomainChanged

MAY be emitted to signal that the domain could have changed.

Initialized

Triggered when the contract has been initialized or reinitialized.

Parameters

Name
Type
Description

ReleasedVestingSchedule

Vesting schedule has been released

Parameters

Name
Type
Description

RevokedVestingSchedule

Vesting schedule has been revoked

Parameters

Name
Type
Description

Transfer

Emitted when value tokens are moved from one account (from) to another (to). Note that value may be zero.

Parameters

Name
Type
Description

Errors

GlobalUnlockUnderlfow

Underflow in global unlock logic (should never happen)

InvalidRevokedVestingScheduleEnd

Attempt to revoke a vesting schedule with an invalid end parameter

InvalidVestingScheduleParameter

Invalid parameter for a vesting schedule

Parameters

Name
Type
Description

Unauthorized

The operator is unauthorized for the caller

Parameters

Name
Type
Description

UnsufficientVestingScheduleCreatorBalance

Vesting schedule creator has unsufficient balance to create vesting schedule

VestingScheduleIsLocked

The vesting schedule is locked

VestingScheduleNotFound

The VestingSchedule was not found

Parameters

Name
Type
Description

VestingScheduleNotRevocable

The vesting schedule is not revocable

VestingScheduleNotRevocableInPast

Attempt to revoke a schedule in the past

ZeroReleasableAmount

No token to release

_lockDuration

uint32

duration during which tokens are locked (in seconds)

_revocable

bool

whether the vesting schedule is revocable or not

_amount

uint256

amount of token attributed by the vesting schedule

_beneficiary

address

address of the beneficiary of the tokens

_delegatee

address

address to delegate escrow voting power to

_ignoreGlobalUnlockSchedule

bool

whether the vesting schedule should ignore the global lock

r

bytes32

undefined

s

bytes32

undefined

verifyingContract

address

undefined

salt

bytes32

undefined

extensions

uint256[]

undefined

v

uint8

undefined

r

bytes32

undefined

s

bytes32

undefined

_0

string

undefined

_0

bytes32

undefined

owner

address

undefined

spender

address

undefined

_0

uint256

undefined

spender

address

undefined

amount

uint256

undefined

_0

bool

undefined

account

address

undefined

_0

uint256

undefined

account

address

undefined

pos

uint32

undefined

_0

ERC20VotesUpgradeable.Checkpoint

undefined

_0

uint48

undefined

_index

uint256

index of the vesting schedule

_0

uint256

amount of releasable tokens

_index

uint256

index of the vesting schedule

_0

uint256

amount of vested tokens

_start

uint64

start time of the vesting

_cliffDuration

uint32

duration to vesting cliff (in seconds)

_duration

uint32

total vesting schedule duration after which all tokens are vested (in seconds)

_periodDuration

uint32

_0

uint256

index of the created vesting schedule

_0

uint8

undefined

spender

address

undefined

subtractedValue

uint256

undefined

_0

bool

undefined

delegatee

address

undefined

delegatee

address

undefined

nonce

uint256

undefined

expiry

uint256

undefined

v

uint8

_index

uint256

index of the vesting schedule

_delegatee

address

address to delegate the token to

_0

bool

True on success

account

address

undefined

_0

address

undefined

fields

bytes1

undefined

name

string

undefined

version

string

undefined

chainId

uint256

undefined

timepoint

uint256

undefined

_0

uint256

undefined

account

address

undefined

timepoint

uint256

undefined

_0

uint256

undefined

_index

uint256

Index of the vesting schedule

_0

VestingSchedulesV2.VestingSchedule

undefined

_0

uint256

count of vesting schedules

account

address

undefined

_0

uint256

undefined

spender

address

undefined

addedValue

uint256

undefined

_0

bool

undefined

_index

uint256

Index of the vesting schedule

_0

bool

true if the vesting schedule should ignore the global unlock schedule

_0

string

undefined

owner

address

undefined

_0

uint256

undefined

account

address

undefined

_0

uint32

undefined

owner

address

undefined

spender

address

undefined

value

uint256

undefined

deadline

uint256

_index

uint256

Index of the vesting schedule to release

_0

uint256

released amount

_index

uint256

Index of the vesting schedule to revoke

_end

uint64

End date for the schedule

_0

uint256

amount returned to the vesting schedule creator

_0

string

undefined

_0

uint256

undefined

to

address

undefined

amount

uint256

undefined

_0

bool

undefined

from

address

undefined

to

address

undefined

amount

uint256

undefined

_0

bool

undefined

_index

uint256

Index of the vesting schedule

_0

address

address of the escrow

owner indexed

address

undefined

spender indexed

address

undefined

value

uint256

undefined

index

uint256

Vesting schedule index

creator indexed

address

Creator of the vesting schedule

beneficiary indexed

address

Vesting beneficiary address

amount

uint256

delegator indexed

address

undefined

fromDelegate indexed

address

undefined

toDelegate indexed

address

undefined

delegate indexed

address

undefined

previousBalance

uint256

undefined

newBalance

uint256

undefined

index

uint256

Vesting schedule index

oldDelegatee indexed

address

old delegatee

newDelegatee indexed

address

new delegatee

beneficiary indexed

address

vesting schedule beneficiary

version

uint8

undefined

index

uint256

Vesting schedule index

releasedAmount

uint256

Amount of tokens released to the beneficiary

index

uint256

Vesting schedule index

returnedAmount

uint256

Amount of tokens returned to the creator

newEnd

uint256

New end timestamp after revoke action

from indexed

address

undefined

to indexed

address

undefined

value

uint256

undefined

msg

string

undefined

caller

address

Address performing the call

index

uint256

vesting schedule index

duration of a period after which new tokens unlock (in seconds)

undefined

undefined

Vesting schedule amount

function CLOCK_MODE() external view returns (string)
function DOMAIN_SEPARATOR() external view returns (bytes32)
function allowance(address owner, address spender) external view returns (uint256)
function approve(address spender, uint256 amount) external nonpayable returns (bool)
function balanceOf(address account) external view returns (uint256)
function checkpoints(address account, uint32 pos) external view returns (struct ERC20VotesUpgradeable.Checkpoint)
function clock() external view returns (uint48)
function computeVestingReleasableAmount(uint256 _index) external view returns (uint256)
function computeVestingVestedAmount(uint256 _index) external view returns (uint256)
function createVestingSchedule(uint64 _start, uint32 _cliffDuration, uint32 _duration, uint32 _periodDuration, uint32 _lockDuration, bool _revocable, uint256 _amount, address _beneficiary, address _delegatee, bool _ignoreGlobalUnlockSchedule) external nonpayable returns (uint256)
function decimals() external view returns (uint8)
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
function delegate(address delegatee) external nonpayable
function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external nonpayable
function delegateVestingEscrow(uint256 _index, address _delegatee) external nonpayable returns (bool)
function delegates(address account) external view returns (address)
function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)
function getPastTotalSupply(uint256 timepoint) external view returns (uint256)
function getPastVotes(address account, uint256 timepoint) external view returns (uint256)
function getVestingSchedule(uint256 _index) external view returns (struct VestingSchedulesV2.VestingSchedule)
function getVestingScheduleCount() external view returns (uint256)
function getVotes(address account) external view returns (uint256)
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
function isGlobalUnlockedScheduleIgnored(uint256 _index) external view returns (bool)
function name() external view returns (string)
function nonces(address owner) external view returns (uint256)
function numCheckpoints(address account) external view returns (uint32)
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
function releaseVestingSchedule(uint256 _index) external nonpayable returns (uint256)
function revokeVestingSchedule(uint256 _index, uint64 _end) external nonpayable returns (uint256)
function symbol() external view returns (string)
function totalSupply() external view returns (uint256)
function transfer(address to, uint256 amount) external nonpayable returns (bool)
function transferFrom(address from, address to, uint256 amount) external nonpayable returns (bool)
function vestingEscrow(uint256 _index) external view returns (address)
event Approval(address indexed owner, address indexed spender, uint256 value)
event CreatedVestingSchedule(uint256 index, address indexed creator, address indexed beneficiary, uint256 amount)
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate)
event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance)
event DelegatedVestingEscrow(uint256 index, address indexed oldDelegatee, address indexed newDelegatee, address indexed beneficiary)
event EIP712DomainChanged()
event Initialized(uint8 version)
event ReleasedVestingSchedule(uint256 index, uint256 releasedAmount)
event RevokedVestingSchedule(uint256 index, uint256 returnedAmount, uint256 newEnd)
event Transfer(address indexed from, address indexed to, uint256 value)
error GlobalUnlockUnderlfow()
error InvalidRevokedVestingScheduleEnd()
error InvalidVestingScheduleParameter(string msg)
error Unauthorized(address caller)
error UnsufficientVestingScheduleCreatorBalance()
error VestingScheduleIsLocked()
error VestingScheduleNotFound(uint256 index)
error VestingScheduleNotRevocable()
error VestingScheduleNotRevocableInPast()
error ZeroReleasableAmount()