Waygu Staker Contract
Methods
BEACON_CHAIN_DEPOSIT_CONTRACT
function BEACON_CHAIN_DEPOSIT_CONTRACT() external view returns (contract IBeaconDepositContract)The Canonical Address of the BeaconChainDepositContract
Returns
| Name | Type | Description |
|---|---|---|
| _0 | contract IBeaconDepositContract | undefined |
VALIDATOR_DEPOSIT_SIZE
function VALIDATOR_DEPOSIT_SIZE() external view returns (uint256)Validator deposit size.
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
addAdmin
function addAdmin(address newAdmin) external nonpayableaddAdmin() function allows an admin to add a new admin to the contract.
This function is only accessible to the existing admins and requires the address of the new admin. If the new admin is already set, the function will revert. Otherwise, the adminsCounter will be incremented and the new admin will be added to the admins mapping. An AdminAdded event will be emitted.
Parameters
| Name | Type | Description |
|---|---|---|
| newAdmin | address | undefined |
addOperator
function addOperator(address newOperator) external nonpayableAdds a new operator to the list of operators
Only the admin can add a new operator
Parameters
| Name | Type | Description |
|---|---|---|
| newOperator | address | The address of the new operator |
admins
function admins(address) external view returns (bool)Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
batchMigrate
function batchMigrate(IStakingModule.ValidatorData[] batchData) external nonpayableParameters
| Name | Type | Description |
|---|---|---|
| batchData | IStakingModule.ValidatorData[] | undefined |
deleteAdmin
function deleteAdmin(address oldAdmin) external nonpayableDeletes an admin from the list of admins.
Only admins can delete other admins. If the adminsCounter is 0, the transaction will revert.
Parameters
| Name | Type | Description |
|---|---|---|
| oldAdmin | address | undefined |
deleteOperator
function deleteOperator(address oldOperator) external nonpayableParameters
| Name | Type | Description |
|---|---|---|
| oldOperator | address | undefined |
deposit
function deposit(IStakingModule.ValidatorData data, bytes32 latestDepositRoot) external payableParameters
| Name | Type | Description |
|---|---|---|
| data | IStakingModule.ValidatorData | undefined |
| latestDepositRoot | bytes32 | undefined |
mevEth
function mevEth() external view returns (address)The address of the MevEth contract
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
operators
function operators(address) external view returns (bool)Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
payRewards
function payRewards(uint256 rewards) external nonpayableFunction to pay rewards to the MevEth contract
Only callable by an operator
Parameters
| Name | Type | Description |
|---|---|---|
| rewards | uint256 | rewards to pay to the MevEth contract |
payValidatorWithdraw
function payValidatorWithdraw() external nonpayableFunction to pay MevEth when withdrawing funds from a validator
This function is only callable by an operator and emits an event for offchain validator registry tracking.
record
function record() external view returns (uint128 totalDeposited, uint128 totalWithdrawn, uint128 totalRewardsPaid, uint128 totalValidatorExitsPaid)Record of total deposits, withdraws, rewards paid and validators exited
Returns
| Name | Type | Description |
|---|---|---|
| totalDeposited | uint128 | undefined |
| totalWithdrawn | uint128 | undefined |
| totalRewardsPaid | uint128 | undefined |
| totalValidatorExitsPaid | uint128 | undefined |
recoverToken
function recoverToken(address token, address recipient, uint256 amount) external nonpayableFunction to recover tokens sent to the contract.
This function is only callable by an admin.
Parameters
| Name | Type | Description |
|---|---|---|
| token | address | undefined |
| recipient | address | undefined |
| amount | uint256 | undefined |
registerExit
function registerExit() external nonpayableregisterExit() allows users to exit the system.
registerExit() is a function that allows users to exit the system. It is triggered by an external call.
setNewMevEth
function setNewMevEth(address newMevEth) external nonpayableFunction to set a new mevEth address.#### Parameters
| Name | Type | Description |
|---|---|---|
| newMevEth | address | undefined |
validators
function validators() external view returns (uint256)The number of validators on the consensus layer registered under this contract
Returns
| Name | Type | Description | | ---- | ------- | ----------- | --------- | | _0 | uint256 | undefined | ## Events |
AdminAdded
event AdminAdded(address indexed newAdmin)Parameters
| Name | Type | Description |
|---|---|---|
newAdmin indexed | address | undefined |
AdminDeleted
event AdminDeleted(address indexed oldAdmin)Parameters
| Name | Type | Description |
|---|---|---|
oldAdmin indexed | address | undefined |
MevEthUpdated
event MevEthUpdated(address indexed meveth)Event emitted when the mevEth address is updated.#### Parameters
| Name | Type | Description |
|---|---|---|
meveth indexed | address | undefined |
NewValidator
event NewValidator(address indexed operator, bytes pubkey, bytes32 withdrawalCredentials, bytes signature, bytes32 deposit_data_root)Event emitted when a validator is registered#### Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | undefined |
| pubkey | bytes | undefined |
| withdrawalCredentials | bytes32 | undefined |
| signature | bytes | undefined |
| deposit_data_root | bytes32 | undefined |
OperatorAdded
event OperatorAdded(address indexed newOperator)Parameters
| Name | Type | Description |
|---|---|---|
newOperator indexed | address | undefined |
OperatorDeleted
event OperatorDeleted(address indexed oldOperator)Parameters
| Name | Type | Description |
|---|---|---|
oldOperator indexed | address | undefined |
RewardsPaid
event RewardsPaid(uint256 indexed amount)Event emitted when rewards are paid to the MevEth contract.#### Parameters
| Name | Type | Description |
|---|---|---|
amount indexed | uint256 | undefined |
TokenRecovered
event TokenRecovered(address indexed recipient, address indexed token, uint256 indexed amount)Event emitted when tokens are recovered from the contract.#### Parameters
| Name | Type | Description |
|---|---|---|
recipient indexed | address | undefined |
token indexed | address | undefined |
amount indexed | uint256 | undefined |
ValidatorWithdraw
event ValidatorWithdraw(address sender, uint256 amount)Event emitted when funds representing a validator withdrawal are sent to the MevEth contract.#### Parameters
| Name | Type | Description | | ------ | ------- | ----------- | --------- | | sender | address | undefined | | amount | uint256 | undefined | ## Errors |
AlreadySet
error AlreadySet()DepositWasFrontrun
error DepositWasFrontrun()NoAdmin
error NoAdmin()NotEnoughEth
error NotEnoughEth()UnAuthorizedCaller
error UnAuthorizedCaller()Unauthorized
error Unauthorized()WrongDepositAmount
error WrongDepositAmount()ZeroAddress
error ZeroAddress()