Developer Docs
Waygustaker

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

NameTypeDescription
_0contract IBeaconDepositContractundefined

VALIDATOR_DEPOSIT_SIZE

function VALIDATOR_DEPOSIT_SIZE() external view returns (uint256)

Validator deposit size.

Returns

NameTypeDescription
_0uint256undefined

addAdmin

function addAdmin(address newAdmin) external nonpayable

addAdmin() 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

NameTypeDescription
newAdminaddressundefined

addOperator

function addOperator(address newOperator) external nonpayable

Adds a new operator to the list of operators

Only the admin can add a new operator

Parameters

NameTypeDescription
newOperatoraddressThe address of the new operator

admins

function admins(address) external view returns (bool)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0boolundefined

batchMigrate

function batchMigrate(IStakingModule.ValidatorData[] batchData) external nonpayable

Parameters

NameTypeDescription
batchDataIStakingModule.ValidatorData[]undefined

deleteAdmin

function deleteAdmin(address oldAdmin) external nonpayable

Deletes an admin from the list of admins.

Only admins can delete other admins. If the adminsCounter is 0, the transaction will revert.

Parameters

NameTypeDescription
oldAdminaddressundefined

deleteOperator

function deleteOperator(address oldOperator) external nonpayable

Parameters

NameTypeDescription
oldOperatoraddressundefined

deposit

function deposit(IStakingModule.ValidatorData data, bytes32 latestDepositRoot) external payable

Parameters

NameTypeDescription
dataIStakingModule.ValidatorDataundefined
latestDepositRootbytes32undefined

mevEth

function mevEth() external view returns (address)

The address of the MevEth contract

Returns

NameTypeDescription
_0addressundefined

operators

function operators(address) external view returns (bool)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0boolundefined

payRewards

function payRewards(uint256 rewards) external nonpayable

Function to pay rewards to the MevEth contract

Only callable by an operator

Parameters

NameTypeDescription
rewardsuint256rewards to pay to the MevEth contract

payValidatorWithdraw

function payValidatorWithdraw() external nonpayable

Function 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

NameTypeDescription
totalDepositeduint128undefined
totalWithdrawnuint128undefined
totalRewardsPaiduint128undefined
totalValidatorExitsPaiduint128undefined

recoverToken

function recoverToken(address token, address recipient, uint256 amount) external nonpayable

Function to recover tokens sent to the contract.

This function is only callable by an admin.

Parameters

NameTypeDescription
tokenaddressundefined
recipientaddressundefined
amountuint256undefined

registerExit

function registerExit() external nonpayable

registerExit() 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 nonpayable

Function to set a new mevEth address.#### Parameters

NameTypeDescription
newMevEthaddressundefined

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

NameTypeDescription
newAdmin indexedaddressundefined

AdminDeleted

event AdminDeleted(address indexed oldAdmin)

Parameters

NameTypeDescription
oldAdmin indexedaddressundefined

MevEthUpdated

event MevEthUpdated(address indexed meveth)

Event emitted when the mevEth address is updated.#### Parameters

NameTypeDescription
meveth indexedaddressundefined

NewValidator

event NewValidator(address indexed operator, bytes pubkey, bytes32 withdrawalCredentials, bytes signature, bytes32 deposit_data_root)

Event emitted when a validator is registered#### Parameters

NameTypeDescription
operator indexedaddressundefined
pubkeybytesundefined
withdrawalCredentialsbytes32undefined
signaturebytesundefined
deposit_data_rootbytes32undefined

OperatorAdded

event OperatorAdded(address indexed newOperator)

Parameters

NameTypeDescription
newOperator indexedaddressundefined

OperatorDeleted

event OperatorDeleted(address indexed oldOperator)

Parameters

NameTypeDescription
oldOperator indexedaddressundefined

RewardsPaid

event RewardsPaid(uint256 indexed amount)

Event emitted when rewards are paid to the MevEth contract.#### Parameters

NameTypeDescription
amount indexeduint256undefined

TokenRecovered

event TokenRecovered(address indexed recipient, address indexed token, uint256 indexed amount)

Event emitted when tokens are recovered from the contract.#### Parameters

NameTypeDescription
recipient indexedaddressundefined
token indexedaddressundefined
amount indexeduint256undefined

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()