IRiverV1
Kiln
River Interface (v1)
The main system interface
Methods
allowance
Retrieve the allowance value for a spender
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address that issued the allowance |
_spender | address | Address that received the allowance |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The allowance in shares for a given spender |
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 |
---|---|---|
_spender | address | Address that is allowed to spend the tokens |
_value | uint256 | The allowed amount in shares, will override previous value |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
balanceOf
Retrieve the balance of an account
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address to be checked |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The balance of the account in shares |
balanceOfUnderlying
Retrieve the underlying asset balance of an account
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Address to be checked |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The underlying balance of the account |
decimals
Retrieve the decimal count
Returns
Name | Type | Description |
---|---|---|
_0 | uint8 | The decimal count |
decreaseAllowance
Decrease allowance to another account
Parameters
Name | Type | Description |
---|---|---|
_spender | address | Spender that receives the allowance |
_subtractableValue | uint256 | Amount of shares to subtract |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
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 |
---|---|---|
_recipient | address | Address receiving the minted LsETH |
depositToConsensusLayer
Deposits current balance to the Consensus Layer by batches of 32 ETH
Parameters
Name | Type | Description |
---|---|---|
_maxCount | uint256 | The maximum amount of validator keys to fund |
getAllowlist
Retrieve the allowlist address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The allowlist address |
getBalanceToDeposit
Returns the amount of pending ETH
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The amount of pending ETH |
getCLValidatorCount
Get CL validator count (the amount of validator reported by the oracles)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The CL validator count |
getCLValidatorTotalBalance
Get CL validator total balance
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The CL Validator total balance |
getCollector
Retrieve the collector address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The collector address |
getCoverageFund
Retrieve the coverage fund
Returns
Name | Type | Description |
---|---|---|
_0 | address | The coverage fund address |
getDepositedValidatorCount
Get the deposited validator count (the count of deposits made by the contract)
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The deposited validator count |
getELFeeRecipient
Retrieve the execution layer fee recipient
Returns
Name | Type | Description |
---|---|---|
_0 | address | The execution layer fee recipient address |
getGlobalFee
Get the current global fee
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The global fee |
getMetadataURI
Retrieve the metadata uri string value
Returns
Name | Type | Description |
---|---|---|
_0 | string | The metadata uri string value |
getOperatorsRegistry
Retrieve the operators registry
Returns
Name | Type | Description |
---|---|---|
_0 | address | The operators registry address |
getOracle
Get oracle address
Returns
Name | Type | Description |
---|---|---|
_0 | address | The oracle address |
getWithdrawalCredentials
Retrieve the withdrawal credentials
Returns
Name | Type | Description |
---|---|---|
_0 | bytes32 | The withdrawal credentials |
increaseAllowance
Increase allowance to another account
Parameters
Name | Type | Description |
---|---|---|
_spender | address | Spender that receives the allowance |
_additionalValue | uint256 | Amount of shares to add |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
initRiverV1
Initializes the River system
Parameters
Name | Type | Description |
---|---|---|
_depositContractAddress | address | Address to make Consensus Layer deposits |
_elFeeRecipientAddress | address | Address that receives the execution layer fees |
_withdrawalCredentials | bytes32 | Credentials to use for every validator deposit |
_oracleAddress | address | The address of the Oracle contract |
_systemAdministratorAddress | address | Administrator address |
_allowlistAddress | address | Address of the allowlist contract |
_operatorRegistryAddress | address | Address of the operator registry |
_collectorAddress | address | Address receiving the the global fee on revenue |
_globalFee | uint256 | Amount retained when the ETH balance increases and sent to the collector |
name
Retrieve the token name
Returns
Name | Type | Description |
---|---|---|
_0 | string | The token name |
sendCoverageFunds
Input for coverage funds
sendELFees
Input for execution layer fee earnings
setAllowlist
Changes the allowlist address
Parameters
Name | Type | Description |
---|---|---|
_newAllowlist | address | New address for the allowlist |
setCollector
Changes the collector address
Parameters
Name | Type | Description |
---|---|---|
_newCollector | address | New address for the collector |
setConsensusLayerData
Sets the validator count and validator total balance sum reported by the oracle
Can only be called by the oracle addressThe round id is a blackbox value that should only be used to identify unique reportsWhen a report is performed, River computes the amount of fees that can be pulledfrom the execution layer fee recipient. This amount is capped by the max allowedincrease provided during the report.If the total asset balance increases (from the reported total balance and the pulled funds)we then compute the share that must be taken for the collector on the positive delta.The execution layer fees are taken into account here because they are the product ofnode operator's work, just like consensus layer fees, and both should be handled in thesame manner, as a single revenue stream for the users and the collector.
Parameters
Name | Type | Description |
---|---|---|
_validatorCount | uint256 | The number of active validators on the consensus layer |
_validatorTotalBalance | uint256 | The balance sum of the active validators on the consensus layer |
_roundId | bytes32 | An identifier for this update |
_maxIncrease | uint256 | The maximum allowed increase in the total balance |
setCoverageFund
Changes the coverage fund
Parameters
Name | Type | Description |
---|---|---|
_newCoverageFund | address | New address for the fund |
setELFeeRecipient
Changes the execution layer fee recipient
Parameters
Name | Type | Description |
---|---|---|
_newELFeeRecipient | address | New address for the recipient |
setGlobalFee
Changes the global fee parameter
Parameters
Name | Type | Description |
---|---|---|
newFee | uint256 | New fee value |
setMetadataURI
Sets the metadata uri string value
Parameters
Name | Type | Description |
---|---|---|
_metadataURI | string | The new metadata uri string value |
setOracle
Set the oracle address
Parameters
Name | Type | Description |
---|---|---|
_oracleAddress | address | Address of the oracle |
sharesFromUnderlyingBalance
Retrieve the shares count from an underlying asset amount
Parameters
Name | Type | Description |
---|---|---|
_underlyingAssetAmount | uint256 | Amount of underlying asset to convert |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The amount of shares worth the underlying asset amopunt |
symbol
Retrieve the token symbol
Returns
Name | Type | Description |
---|---|---|
_0 | string | The token symbol |
totalSupply
Retrieve the total token supply
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The total supply in shares |
totalUnderlyingSupply
Retrieve the total underlying asset supply
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The total underlying asset supply |
transfer
Performs a transfer from the message sender to the provided account
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address receiving the tokens |
_value | uint256 | Amount of shares to be sent |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
transferFrom
Performs a transfer between two recipients
Parameters
Name | Type | Description |
---|---|---|
_from | address | Address sending the tokens |
_to | address | Address receiving the tokens |
_value | uint256 | Amount of shares to be sent |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | True if success |
underlyingBalanceFromShares
Retrieve the underlying asset balance from an amount of shares
Parameters
Name | Type | Description |
---|---|---|
_shares | uint256 | Amount of shares to convert |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | The underlying asset balance represented by the shares |
Events
Approval
Parameters
Name | Type | Description |
---|---|---|
owner | address | undefined |
spender | address | undefined |
value | uint256 | undefined |
ConsensusLayerDataUpdate
The consensus layer data provided by the oracle has been updated
Parameters
Name | Type | Description |
---|---|---|
validatorCount | uint256 | undefined |
validatorTotalBalance | uint256 | undefined |
roundId | bytes32 | undefined |
FundedValidatorKey
A validator key got funded on the deposit contract
Parameters
Name | Type | Description |
---|---|---|
publicKey | bytes | undefined |
PulledCoverageFunds
Funds have been pulled from the Coverage Fund
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount pulled |
PulledELFees
Funds have been pulled from the Execution Layer Fee Recipient
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount pulled |
RewardsEarned
The system underlying supply increased. This is a snapshot of the balances for accounting purposes
Parameters
Name | Type | Description |
---|---|---|
_collector | address | The address of the collector during this event |
_oldTotalUnderlyingBalance | uint256 | Old total ETH balance under management by River |
_oldTotalSupply | uint256 | Old total supply in shares |
_newTotalUnderlyingBalance | uint256 | New total ETH balance under management by River |
_newTotalSupply | uint256 | New total supply in shares |
SetAllowlist
The stored Allowlist has been changed
Parameters
Name | Type | Description |
---|---|---|
allowlist | address | The new Allowlist |
SetCollector
The stored Collector has been changed
Parameters
Name | Type | Description |
---|---|---|
collector | address | The new Collector |
SetCoverageFund
The stored Coverage Fund has been changed
Parameters
Name | Type | Description |
---|---|---|
coverageFund | address | The new Coverage Fund |
SetDepositContractAddress
The stored deposit contract address changed
Parameters
Name | Type | Description |
---|---|---|
depositContract | address | undefined |
SetELFeeRecipient
The stored Execution Layer Fee Recipient has been changed
Parameters
Name | Type | Description |
---|---|---|
elFeeRecipient | address | The new Execution Layer Fee Recipient |
SetGlobalFee
The stored Global Fee has been changed
Parameters
Name | Type | Description |
---|---|---|
fee | uint256 | The new Global Fee |
SetMetadataURI
The stored Metadata URI string has been changed
Parameters
Name | Type | Description |
---|---|---|
metadataURI | string | The new Metadata URI string |
SetOperatorsRegistry
The stored Operators Registry has been changed
Parameters
Name | Type | Description |
---|---|---|
operatorRegistry | address | The new Operators Registry |
SetOracle
The stored oracle address changed
Parameters
Name | Type | Description |
---|---|---|
oracleAddress | address | undefined |
SetWithdrawalCredentials
The stored withdrawal credentials changed
Parameters
Name | Type | Description |
---|---|---|
withdrawalCredentials | bytes32 | undefined |
Transfer
Parameters
Name | Type | Description |
---|---|---|
from | address | undefined |
to | address | undefined |
value | uint256 | undefined |
UserDeposit
User deposited ETH in the system
Parameters
Name | Type | Description |
---|---|---|
depositor | address | undefined |
recipient | address | undefined |
amount | uint256 | undefined |
Errors
AllowanceTooLow
Allowance too low to perform operation
Parameters
Name | Type | Description |
---|---|---|
_from | address | Account where funds are sent from |
_operator | address | Account attempting the transfer |
_allowance | uint256 | Current allowance |
_value | uint256 | Requested transfer value in shares |
BalanceTooLow
Balance too low to perform operation
Denied
The access was denied
Parameters
Name | Type | Description |
---|---|---|
account | address | The account that was denied |
EmptyDeposit
And empty deposit attempt was made
ErrorOnDeposit
An error occured 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
InvalidPublicKeyCount
The received count of public keys to deposit is invalid
InvalidSignatureCount
The received count of signatures to deposit is invalid
InvalidValidatorCountReport
The reported validator count is invalid
Parameters
Name | Type | Description |
---|---|---|
providedValidatorCount | uint256 | The received validator count value |
depositedValidatorCount | uint256 | The number of deposits performed by the system |
InvalidWithdrawalCredentials
The withdrawal credentials value is null
NoAvailableValidatorKeys
The internal key retrieval returned no keys
NotEnoughFunds
Not enough funds to deposit one validator
NullTransfer
Invalid empty transfer
UnauthorizedTransfer
Invalid transfer recipients
Parameters
Name | Type | Description |
---|---|---|
_from | address | Account sending the funds in the invalid transfer |
_to | address | Account receiving the funds in the invalid transfer |
ZeroMintedShares
The computed amount of shares to mint is 0
Last updated