diff --git a/cli/commands/deposit/create.go b/cli/commands/deposit/create.go index 471b3cc2c4..82a90308a6 100644 --- a/cli/commands/deposit/create.go +++ b/cli/commands/deposit/create.go @@ -44,8 +44,8 @@ func NewCreateValidator[ cmd := &cobra.Command{ Use: "create-validator", Short: "Creates a validator deposit", - Long: `Creates a validator deposit with the necessary credentials. The - arguments are expected in the order of withdrawal credentials, deposit + Long: `Creates a validator deposit with the necessary credentials. The + arguments are expected in the order of withdrawal address, deposit amount, current version, and genesis validator root. If the broadcast flag is set to true, a private key must be provided to sign the transaction.`, Args: cobra.ExactArgs(4), //nolint:mnd // The number of arguments. @@ -80,10 +80,13 @@ func createValidatorCmd[ return err } - credentials, err := parser.ConvertWithdrawalCredentials(args[0]) + withdrawalAddress, err := parser.ConvertWithdrawalAddress(args[0]) if err != nil { return err } + credentials := types.NewCredentialsFromExecutionAddress( + withdrawalAddress, + ) amount, err := parser.ConvertAmount(args[1]) if err != nil { diff --git a/cli/commands/genesis/deposit.go b/cli/commands/genesis/deposit.go index 1eba53b125..eefd279d8a 100644 --- a/cli/commands/genesis/deposit.go +++ b/cli/commands/genesis/deposit.go @@ -44,11 +44,17 @@ import ( // AddGenesisDepositCmd - returns the cobra command to // add a premined deposit to the genesis file. +// + func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command { cmd := &cobra.Command{ Use: "add-premined-deposit", Short: "adds a validator to the genesis file", - RunE: func(cmd *cobra.Command, _ []string) error { + Long: `Adds a validator to the genesis file with the necessary + credentials. The arguments are expected in the order of the deposit + amount and withdrawal address.`, + Args: cobra.ExactArgs(2), //nolint:mnd // The number of arguments. + RunE: func(cmd *cobra.Command, args []string) error { config := context.GetConfigFromCmd(cmd) _, valPubKey, err := genutil.InitializeNodeValidatorFiles( @@ -61,11 +67,6 @@ func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command { ) } - var ( - depositAmountString string - depositAmount math.Gwei - ) - // Get the BLS signer. blsSigner, err := components.ProvideBlsSigner( components.BlsSignerInput{ @@ -77,12 +78,8 @@ func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command { } // Get the deposit amount. - depositAmountString, err = cmd.Flags().GetString(depositAmountFlag) - if err != nil { - return err - } - - depositAmount, err = parser.ConvertAmount(depositAmountString) + var depositAmount math.Gwei + depositAmount, err = parser.ConvertAmount(args[0]) if err != nil { return err } @@ -92,14 +89,14 @@ func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command { version.Deneb, ) + // Get the withdrawal address. + withdrawalAddress := common.NewExecutionAddressFromHex(args[1]) + depositMsg, signature, err := types.CreateAndSignDepositMessage( types.NewForkData(currentVersion, common.Root{}), cs.DomainTypeDeposit(), blsSigner, - // TODO: configurable. - types.NewCredentialsFromExecutionAddress( - common.ExecutionAddress{}, - ), + types.NewCredentialsFromExecutionAddress(withdrawalAddress), depositAmount, ) if err != nil { @@ -141,9 +138,6 @@ func AddGenesisDepositCmd(cs common.ChainSpec) *cobra.Command { }, } - cmd.Flags(). - String(depositAmountFlag, defaultDepositAmount, depositAmountFlagMsg) - return cmd } diff --git a/cli/commands/genesis/flags.go b/cli/commands/genesis/flags.go deleted file mode 100644 index 543b29bc52..0000000000 --- a/cli/commands/genesis/flags.go +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2024, Berachain Foundation. All rights reserved. -// Use of this software is governed by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package genesis - -const ( - depositAmountFlag = "deposit-amount" - defaultDepositAmount = "32000000000" // 32e9 - depositAmountFlagMsg = "The amount of deposit to be made" -) diff --git a/cli/utils/parser/validator.go b/cli/utils/parser/validator.go index 895a297fee..2ba0418b46 100644 --- a/cli/utils/parser/validator.go +++ b/cli/utils/parser/validator.go @@ -21,6 +21,7 @@ package parser import ( + "fmt" "math/big" "github.com/berachain/beacon-kit/consensus-types/types" @@ -45,6 +46,24 @@ func ConvertPubkey(pubkey string) (crypto.BLSPubkey, error) { return crypto.BLSPubkey(pubkeyBytes), nil } +// ConvertWithdrawalAddress converts a string to a withdrawal address. +func ConvertWithdrawalAddress(address string) (common.ExecutionAddress, error) { + // Wrap the call in a recover to handle potential panics from invalid + // addresses. + var ( + addr common.ExecutionAddress + err error + ) + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("invalid withdrawal address: %v", r) + } + }() + + addr = common.NewExecutionAddressFromHex(address) + return addr, err +} + // ConvertWithdrawalCredentials converts a string to a withdrawal credentials. func ConvertWithdrawalCredentials(credentials string) ( types.WithdrawalCredentials, diff --git a/cmd/beacond/defaults.go b/cmd/beacond/defaults.go index 674048185f..f8c1f1cd98 100644 --- a/cmd/beacond/defaults.go +++ b/cmd/beacond/defaults.go @@ -41,7 +41,7 @@ func DefaultComponents() []any { *AvailabilityStore, *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, *BlobSidecars, *Logger, ], - components.ProvideBeaconDepositContract[ + components.ProvideDepositContract[ *Deposit, *ExecutionPayload, *ExecutionPayloadHeader, ], components.ProvideBlockStore[ diff --git a/cmd/beacond/types.go b/cmd/beacond/types.go index 920fee86a0..100d617922 100644 --- a/cmd/beacond/types.go +++ b/cmd/beacond/types.go @@ -285,7 +285,7 @@ type ( Deposit = types.Deposit // DepositContract is a type alias for the deposit contract. - DepositContract = deposit.WrappedBeaconDepositContract[ + DepositContract = deposit.WrappedDepositContract[ *Deposit, WithdrawalCredentials, ] diff --git a/consensus/cometbft/service/abci.go b/consensus/cometbft/service/abci.go index cbcddb3e3f..7bf29deb75 100644 --- a/consensus/cometbft/service/abci.go +++ b/consensus/cometbft/service/abci.go @@ -326,16 +326,16 @@ func (s *Service[LoggerT]) internalFinalizeBlock( // // NOTE: Not all raw transactions may adhere to the sdk.Tx interface, e.g. // vote extensions, so skip those. - txResults := make([]*cmtabci.ExecTxResult, 0, len(req.Txs)) - for range req.Txs { + txResults := make([]*cmtabci.ExecTxResult, len(req.Txs)) + for i := range req.Txs { //nolint:mnd // its okay for now. - txResults = append(txResults, &cmtabci.ExecTxResult{ + txResults[i] = &cmtabci.ExecTxResult{ Codespace: "sdk", Code: 2, Log: "skip decoding", GasWanted: 0, GasUsed: 0, - }) + } } finalizeBlock, err := s.Middleware.FinalizeBlock( diff --git a/contracts/Makefile b/contracts/Makefile index f1f1cd5f18..b2e2c5e976 100644 --- a/contracts/Makefile +++ b/contracts/Makefile @@ -36,4 +36,4 @@ forge-lint-fix: forge-lint: @echo "--> Running forge lint" - @cd $(CONTRACTS_DIR) && forge fmt --check \ No newline at end of file + @cd $(CONTRACTS_DIR) && forge fmt --check diff --git a/contracts/src/staking/DepositContract.sol b/contracts/src/staking/DepositContract.sol index 3ec1b20cba..2673f6a0f7 100644 --- a/contracts/src/staking/DepositContract.sol +++ b/contracts/src/staking/DepositContract.sol @@ -1,25 +1,24 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.26; -import { IDepositContract } from "./IDepositContract.sol"; import { ERC165 } from "./IERC165.sol"; +import { IDepositContract } from "./IDepositContract.sol"; /** * @title DepositContract * @author Berachain Team - * @notice A contract that handles deposits of stake. + * @notice A contract that handles validators deposits. * @dev Its events are used by the beacon chain to manage the staking process. - * @dev Its stake asset needs to be of 18 decimals to match the native asset. * @dev This contract does not implement the deposit merkle tree. */ -abstract contract DepositContract is IDepositContract, ERC165 { +contract DepositContract is IDepositContract, ERC165 { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - /// @dev The minimum amount of stake that can be deposited to prevent dust. - /// @dev This is 32 ether in Gwei since our deposit contract denominates in Gwei. 32e9 * 1e9 = 32e18. - uint64 internal constant MIN_DEPOSIT_AMOUNT_IN_GWEI = 32e9; + /// @dev The minimum amount of `BERA` to deposit. + /// @dev This is 1 ether in Gwei since our deposit contract denominates in Gwei. 1e9 * 1e9 = 1e18. + uint64 internal constant MIN_DEPOSIT_AMOUNT_IN_GWEI = 1e9; /// @dev The length of the public key, PUBLIC_KEY_LENGTH bytes. uint8 internal constant PUBLIC_KEY_LENGTH = 48; @@ -30,14 +29,36 @@ abstract contract DepositContract is IDepositContract, ERC165 { /// @dev The length of the credentials, 1 byte prefix + 11 bytes padding + 20 bytes address = 32 bytes. uint8 internal constant CREDENTIALS_LENGTH = 32; + /// @dev 1 day in seconds. + /// @dev This is the delay before a new operator can accept a change. + uint96 private constant ONE_DAY = 86_400; + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + /// @dev QueuedOperator is a struct that represents an operator address change request. + struct QueuedOperator { + uint96 queuedTimestamp; + address newOperator; + } + /// @dev depositCount represents the number of deposits that /// have been made to the contract. + /// @dev The index of the next deposit will use this value. uint64 public depositCount; + /// @dev The hash tree root of the genesis deposits. + /// @dev Should be set in deployment (predeploy state or constructor). + // slither-disable-next-line constable-states + bytes32 public genesisDepositsRoot; + + /// @dev The mapping of public keys to operator addresses. + mapping(bytes => address) private _operatorByPubKey; + + /// @dev The mapping of public keys to operator change requests. + mapping(bytes => QueuedOperator) public queuedOperator; + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* VIEWS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ @@ -53,16 +74,25 @@ abstract contract DepositContract is IDepositContract, ERC165 { || interfaceId == type(IDepositContract).interfaceId; } + /// @inheritdoc IDepositContract + function getOperator(bytes calldata pubkey) + external + view + returns (address) + { + return _operatorByPubKey[pubkey]; + } + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* WRITES */ + /* DEPOSIT */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @inheritdoc IDepositContract function deposit( bytes calldata pubkey, bytes calldata credentials, - uint64 amount, - bytes calldata signature + bytes calldata signature, + address operator ) public payable @@ -80,22 +110,101 @@ abstract contract DepositContract is IDepositContract, ERC165 { revert InvalidSignatureLength(); } - uint64 amountInGwei = _deposit(amount); + // Set operator on the first deposit. + // zero `_operatorByPubKey[pubkey]` means the pubkey is not registered. + if (_operatorByPubKey[pubkey] == address(0)) { + if (operator == address(0)) { + revert ZeroOperatorOnFirstDeposit(); + } + _operatorByPubKey[pubkey] = operator; + emit OperatorUpdated(pubkey, operator, address(0)); + } + // If not the first deposit, operator address must be 0. + // This prevents from the front-running of the first deposit to set the operator. + else if (operator != address(0)) { + revert OperatorAlreadySet(); + } + + uint64 amountInGwei = _deposit(); if (amountInGwei < MIN_DEPOSIT_AMOUNT_IN_GWEI) { revert InsufficientDeposit(); } - unchecked { - // slither-disable-next-line reentrancy-benign,reentrancy-events - emit Deposit( - pubkey, credentials, amountInGwei, signature, depositCount++ - ); + // slither-disable-next-line reentrancy-benign,reentrancy-events + emit Deposit( + pubkey, credentials, amountInGwei, signature, depositCount++ + ); + } + + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* OPERATOR CHANGE */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + + /// @inheritdoc IDepositContract + function requestOperatorChange( + bytes calldata pubkey, + address newOperator + ) + external + { + // Cache the current operator. + address currentOperator = _operatorByPubKey[pubkey]; + // Only the current operator can request a change. + // This will also revert if the pubkey is not registered. + if (msg.sender != currentOperator) { + revert NotOperator(); + } + // Revert if the new operator is zero address. + if (newOperator == address(0)) { + revert ZeroAddress(); + } + QueuedOperator storage qO = queuedOperator[pubkey]; + qO.newOperator = newOperator; + qO.queuedTimestamp = uint96(block.timestamp); + emit OperatorChangeQueued( + pubkey, newOperator, currentOperator, block.timestamp + ); + } + + /// @inheritdoc IDepositContract + function cancelOperatorChange(bytes calldata pubkey) external { + // Only the current operator can cancel the change. + if (msg.sender != _operatorByPubKey[pubkey]) { + revert NotOperator(); + } + delete queuedOperator[pubkey]; + emit OperatorChangeCancelled(pubkey); + } + + /// @inheritdoc IDepositContract + function acceptOperatorChange(bytes calldata pubkey) external { + QueuedOperator storage qO = queuedOperator[pubkey]; + (address newOperator, uint96 queuedTimestamp) = + (qO.newOperator, qO.queuedTimestamp); + + // Only the new operator can accept the change. + // This will revert if nothing is queued as newOperator will be zero address. + if (msg.sender != newOperator) { + revert NotNewOperator(); + } + // Check if the queue delay has passed. + if (queuedTimestamp + ONE_DAY > uint96(block.timestamp)) { + revert NotEnoughTime(); } + // Cache the old operator. + address oldOperator = _operatorByPubKey[pubkey]; + _operatorByPubKey[pubkey] = newOperator; + delete queuedOperator[pubkey]; + emit OperatorUpdated(pubkey, newOperator, oldOperator); } + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* INTERNAL */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + /// @dev Validates the deposit amount and sends the native asset to the zero address. - function _deposit(uint64) internal virtual returns (uint64) { + function _deposit() internal virtual returns (uint64) { if (msg.value % 1 gwei != 0) { revert DepositNotMultipleOfGwei(); } diff --git a/contracts/src/staking/IDepositContract.sol b/contracts/src/staking/IDepositContract.sol index 27c599c07e..03122ca604 100644 --- a/contracts/src/staking/IDepositContract.sol +++ b/contracts/src/staking/IDepositContract.sol @@ -3,10 +3,56 @@ pragma solidity 0.8.26; /// @title IDepositContract /// @author Berachain Team. -/// @dev This contract is used to create validator, deposit and withdraw stake from the Beacon chain. interface IDepositContract { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* EVENTS */ + /* ERRORS */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ + + // Signature: 0xe8966d7a + error NotEnoughTime(); + // Signature: 0xd92e233d + error ZeroAddress(); + // Signature: 0x7c214f04 + error NotOperator(); + + /// @dev Error thrown when the deposit amount is too small, to prevent dust deposits. + // Signature: 0x0e1eddda + error InsufficientDeposit(); + + /// @dev Error thrown when the deposit amount is not a multiple of Gwei. + // Signature: 0x40567b38 + error DepositNotMultipleOfGwei(); + + /// @dev Error thrown when the deposit amount is too high, since it is a uint64. + // Signature: 0x2aa66734 + error DepositValueTooHigh(); + + /// @dev Error thrown when the public key length is not 48 bytes. + // Signature: 0x9f106472 + error InvalidPubKeyLength(); + + /// @dev Error thrown when the withdrawal credentials length is not 32 bytes. + // Signature: 0xb39bca16 + error InvalidCredentialsLength(); + + /// @dev Error thrown when the signature length is not 96 bytes. + // Signature: 0x4be6321b + error InvalidSignatureLength(); + + /// @dev Error thrown when the input operator is zero address on the first deposit. + // Signature: 0x51969a7a + error ZeroOperatorOnFirstDeposit(); + + /// @dev Error thrown when the operator is already set and caller passed non-zero operator. + // Signature: 0xc4142b41 + error OperatorAlreadySet(); + + /// @dev Error thrown when the caller is not the current operator. + // Signature: 0x819a0d0b + error NotNewOperator(); + + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /** @@ -25,27 +71,50 @@ interface IDepositContract { uint64 index ); - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* ERRORS */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - - /// @dev Error thrown when the deposit amount is too small, to prevent dust deposits. - error InsufficientDeposit(); - - /// @dev Error thrown when the deposit amount is not a multiple of Gwei. - error DepositNotMultipleOfGwei(); + /** + * @notice Emitted when the operator change of a validator is queued. + * @param pubkey The pubkey of the validator. + * @param queuedOperator The new queued operator address. + * @param currentOperator The current operator address. + * @param queuedTimestamp The timestamp when the change was queued. + */ + event OperatorChangeQueued( + bytes indexed pubkey, + address queuedOperator, + address currentOperator, + uint256 queuedTimestamp + ); - /// @dev Error thrown when the deposit amount is too high, since it is a uint64. - error DepositValueTooHigh(); + /** + * @notice Emitted when the operator change of a validator is cancelled. + * @param pubkey The pubkey of the validator. + */ + event OperatorChangeCancelled(bytes indexed pubkey); - /// @dev Error thrown when the public key length is not 48 bytes. - error InvalidPubKeyLength(); + /** + * @notice Emitted when the operator of a validator is updated. + * @param pubkey The pubkey of the validator. + * @param newOperator The new operator address. + * @param previousOperator The previous operator address. + */ + event OperatorUpdated( + bytes indexed pubkey, address newOperator, address previousOperator + ); - /// @dev Error thrown when the withdrawal credentials length is not 32 bytes. - error InvalidCredentialsLength(); + /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ + /* VIEWS */ + /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - /// @dev Error thrown when the signature length is not 96 bytes. - error InvalidSignatureLength(); + /** + * @notice Get the operator address for a given pubkey. + * @dev Returns zero address if the pubkey is not registered. + * @param pubkey The pubkey of the validator. + * @return The operator address for the given pubkey. + */ + function getOperator(bytes calldata pubkey) + external + view + returns (address); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* WRITES */ @@ -57,16 +126,44 @@ interface IDepositContract { * @param pubkey is the consensus public key of the validator. If subsequent deposit, its ignored. * @param credentials is the staking credentials of the validator. If this is the first deposit it is * validator operator public key, if subsequent deposit it is the depositor's public key. - * @param amount is the amount of stake native/ERC20 token to be deposited, in Gwei. * @param signature is the signature used only on the first deposit. + * @param operator is the address of the operator. * @dev emits the Deposit event upon successful deposit. + * @dev Reverts if the operator is already set and caller passed non-zero operator. */ function deposit( bytes calldata pubkey, bytes calldata credentials, - uint64 amount, - bytes calldata signature + bytes calldata signature, + address operator ) external payable; + + /** + * @notice Request to change the operator of a validator. + * @dev Only the current operator can request a change. + * @param pubkey The pubkey of the validator. + * @param newOperator The new operator address. + */ + function requestOperatorChange( + bytes calldata pubkey, + address newOperator + ) + external; + + /** + * @notice Cancel the operator change of a validator. + * @dev Only the current operator can cancel the change. + * @param pubkey The pubkey of the validator. + */ + function cancelOperatorChange(bytes calldata pubkey) external; + + /** + * @notice Accept the operator change of a validator. + * @dev Only the new operator can accept the change. + * @dev Reverts if the queue delay has not passed. + * @param pubkey The pubkey of the validator. + */ + function acceptOperatorChange(bytes calldata pubkey) external; } diff --git a/contracts/test/staking/DepositContract.t.sol b/contracts/test/staking/DepositContract.t.sol index ffb3b396a0..1835015e97 100644 --- a/contracts/test/staking/DepositContract.t.sol +++ b/contracts/test/staking/DepositContract.t.sol @@ -1,14 +1,19 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; +import "forge-std/Test.sol"; + import { SoladyTest } from "@solady/test/utils/SoladyTest.sol"; import { IDepositContract } from "@src/staking/IDepositContract.sol"; -import { PermissionedDepositContract } from "./PermissionedDepositContract.sol"; +import { DepositContract } from "@src/staking/DepositContract.sol"; -contract DepositContractTest is SoladyTest { +contract DepositContractTest is SoladyTest, StdCheats { /// @dev The depositor address. address internal depositor = 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4; + /// @dev The owner address. + address owner = 0x6969696969696969696969696969696969696969; + /// @dev The validator public key. bytes internal VALIDATOR_PUBKEY = _create48Byte(); @@ -21,35 +26,34 @@ contract DepositContractTest is SoladyTest { bytes32 internal constant STAKING_ASSET_SLOT = bytes32(0); /// @dev the deposit contract. - PermissionedDepositContract internal depositContract; + DepositContract internal depositContract; function setUp() public virtual { - address owner = 0x6969696969696969696969696969696969696969; - depositContract = new PermissionedDepositContract(owner); - vm.prank(owner); - depositContract.allowDeposit(depositor, 100); + depositContract = new DepositContract(); } function testFuzz_DepositsWrongPubKey(bytes calldata pubKey) public { vm.assume(pubKey.length != 96); vm.expectRevert(IDepositContract.InvalidPubKeyLength.selector); + vm.deal(depositor, 32 ether); vm.prank(depositor); - depositContract.deposit( + depositContract.deposit{ value: 32 ether }( bytes("wrong_public_key"), STAKING_CREDENTIALS, - 32e9, - _create96Byte() + _create96Byte(), + depositor ); } function test_DepositWrongPubKey() public { vm.expectRevert(IDepositContract.InvalidPubKeyLength.selector); + vm.deal(depositor, 32 ether); vm.prank(depositor); - depositContract.deposit( + depositContract.deposit{ value: 32 ether }( bytes("wrong_public_key"), STAKING_CREDENTIALS, - 32e9, - _create96Byte() + _create96Byte(), + depositor ); } @@ -58,51 +62,32 @@ contract DepositContractTest is SoladyTest { { vm.assume(credentials.length != 32); + vm.deal(depositor, 32 ether); vm.expectRevert(IDepositContract.InvalidCredentialsLength.selector); vm.prank(depositor); - depositContract.deposit( - _create48Byte(), credentials, 32e9, _create96Byte() + depositContract.deposit{ value: 32 ether }( + _create48Byte(), credentials, _create96Byte(), depositor ); } function test_DepositWrongCredentials() public { vm.expectRevert(IDepositContract.InvalidCredentialsLength.selector); + vm.deal(depositor, 32 ether); vm.prank(depositor); - depositContract.deposit( - VALIDATOR_PUBKEY, bytes("wrong_credentials"), 32e9, _create96Byte() - ); - } - - function testFuzz_DepositWrongAmount(uint256 amount) public { - amount = _bound(amount, 1, 32e9 - 1); - vm.deal(depositor, amount); - vm.prank(depositor); - vm.expectRevert(IDepositContract.InsufficientDeposit.selector); - depositContract.deposit( + depositContract.deposit{ value: 32 ether }( VALIDATOR_PUBKEY, - STAKING_CREDENTIALS, - uint64(amount), - _create96Byte() + bytes("wrong_credentials"), + _create96Byte(), + depositor ); } function test_DepositWrongAmount() public { vm.expectRevert(IDepositContract.InsufficientDeposit.selector); vm.prank(depositor); + // send with 0 ether depositContract.deposit( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 32e9 - 1, _create96Byte() - ); - } - - function test_Deposit() public { - vm.deal(depositor, 32 ether); - vm.prank(depositor); - vm.expectEmit(true, true, true, true); - emit IDepositContract.Deposit( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 32e9, _create96Byte(), 0 - ); - depositContract.deposit{ value: 32 ether }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 32e9, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } @@ -115,7 +100,7 @@ contract DepositContractTest is SoladyTest { vm.prank(depositor); vm.expectRevert(IDepositContract.InsufficientDeposit.selector); depositContract.deposit{ value: amountInGwei }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } @@ -125,7 +110,7 @@ contract DepositContractTest is SoladyTest { vm.prank(depositor); vm.expectRevert(IDepositContract.InsufficientDeposit.selector); depositContract.deposit{ value: amount }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } @@ -137,7 +122,7 @@ contract DepositContractTest is SoladyTest { vm.prank(depositor); vm.expectRevert(IDepositContract.DepositNotMultipleOfGwei.selector); depositContract.deposit{ value: amount }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } @@ -147,7 +132,7 @@ contract DepositContractTest is SoladyTest { vm.expectRevert(IDepositContract.DepositNotMultipleOfGwei.selector); vm.prank(depositor); depositContract.deposit{ value: amount }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); amount = 32e9 - 1; @@ -155,7 +140,7 @@ contract DepositContractTest is SoladyTest { vm.expectRevert(IDepositContract.DepositNotMultipleOfGwei.selector); vm.prank(depositor); depositContract.deposit{ value: amount }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } @@ -167,28 +152,30 @@ contract DepositContractTest is SoladyTest { VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 32 gwei, _create96Byte(), 0 ); depositContract.deposit{ value: 32 ether }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + VALIDATOR_PUBKEY, STAKING_CREDENTIALS, _create96Byte(), depositor ); } function testFuzz_DepositCount(uint256 count) public { count = _bound(count, 1, 100); - vm.deal(depositor, 32 ether * count); - vm.startPrank(depositor); uint64 depositCount; for (uint256 i; i < count; ++i) { + depositor = makeAddr(vm.toString(i)); + vm.deal(depositor, 32 ether); + + vm.startPrank(depositor); vm.expectEmit(true, true, true, true); emit IDepositContract.Deposit( - VALIDATOR_PUBKEY, + _newPubkey(i), STAKING_CREDENTIALS, 32 gwei, _create96Byte(), - depositCount + depositCount++ ); depositContract.deposit{ value: 32 ether }( - VALIDATOR_PUBKEY, STAKING_CREDENTIALS, 0, _create96Byte() + _newPubkey(i), STAKING_CREDENTIALS, _create96Byte(), depositor ); - ++depositCount; + vm.stopPrank(); } assertEq(depositContract.depositCount(), depositCount); } @@ -204,4 +191,8 @@ contract DepositContractTest is SoladyTest { function _create48Byte() internal pure returns (bytes memory) { return abi.encodePacked(bytes32("32"), bytes16("16")); } + + function _newPubkey(uint256 i) internal pure returns (bytes memory) { + return abi.encodePacked(bytes32(i), bytes16("16")); + } } diff --git a/contracts/test/staking/PermissionedDepositContract.sol b/contracts/test/staking/PermissionedDepositContract.sol deleted file mode 100644 index aa69f921c6..0000000000 --- a/contracts/test/staking/PermissionedDepositContract.sol +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.25; - -import { Ownable } from "@solady/src/auth/Ownable.sol"; -import { DepositContract } from "@src/staking/DepositContract.sol"; - -/// @notice A test contract that permissions deposits. -contract PermissionedDepositContract is DepositContract, Ownable { - error UnauthorizedDeposit(); - - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* STORAGE */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - - /// @dev depositAuth is a mapping of number of deposits an authorized - /// address can make. - mapping(address => uint64) public depositAuth; - - /// @dev Initializes the owner of the contract. - constructor(address owner) { - _initializeOwner(owner); - } - - /// @dev Override to return true to make `_initializeOwner` prevent - /// double-initialization. - function _guardInitializeOwner() - internal - pure - override - returns (bool guard) - { - return true; - } - - /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ - /* WRITES */ - /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ - - function deposit( - bytes calldata pubkey, - bytes calldata withdrawal_credentials, - uint64 amount, - bytes calldata signature - ) - public - payable - override - { - if (depositAuth[msg.sender] == 0) revert UnauthorizedDeposit(); - --depositAuth[msg.sender]; - - super.deposit(pubkey, withdrawal_credentials, amount, signature); - } - - function allowDeposit( - address depositor, - uint64 number - ) - external - onlyOwner - { - depositAuth[depositor] = number; - } -} diff --git a/execution/deposit/contract.go b/execution/deposit/contract.go index fca8570569..d1e551c90b 100644 --- a/execution/deposit/contract.go +++ b/execution/deposit/contract.go @@ -33,27 +33,27 @@ import ( "github.com/berachain/beacon-kit/primitives/math" ) -// WrappedBeaconDepositContract is a struct that holds a pointer to an ABI. -type WrappedBeaconDepositContract[ +// WrappedDepositContract is a struct that holds a pointer to an ABI. +type WrappedDepositContract[ DepositT Deposit[DepositT, WithdrawalCredentialsT], WithdrawalCredentialsT ~[32]byte, ] struct { - // BeaconDepositContractFilterer is a pointer to the codegen ABI binding. - deposit.BeaconDepositContractFilterer + // DepositContractFilterer is a pointer to the codegen ABI binding. + deposit.DepositContractFilterer } -// NewWrappedBeaconDepositContract creates a new BeaconDepositContract. -func NewWrappedBeaconDepositContract[ +// NewWrappedDepositContract creates a new DepositContract. +func NewWrappedDepositContract[ DepositT Deposit[DepositT, WithdrawalCredentialsT], WithdrawalCredentialsT ~[32]byte, ]( address common.ExecutionAddress, client bind.ContractFilterer, -) (*WrappedBeaconDepositContract[ +) (*WrappedDepositContract[ DepositT, WithdrawalCredentialsT, ], error) { - contract, err := deposit.NewBeaconDepositContractFilterer( + contract, err := deposit.NewDepositContractFilterer( gethprimitives.ExecutionAddress(address), client, ) @@ -63,16 +63,16 @@ func NewWrappedBeaconDepositContract[ return nil, errors.New("contract must not be nil") } - return &WrappedBeaconDepositContract[ + return &WrappedDepositContract[ DepositT, WithdrawalCredentialsT, ]{ - BeaconDepositContractFilterer: *contract, + DepositContractFilterer: *contract, }, nil } // ReadDeposits reads deposits from the deposit contract. -func (dc *WrappedBeaconDepositContract[ +func (dc *WrappedDepositContract[ DepositT, WithdrawalCredentialsT, ]) ReadDeposits( diff --git a/geth-primitives/deposit/contract.abigen.go b/geth-primitives/deposit/contract.abigen.go index 5d121d9edf..e3d900567d 100644 --- a/geth-primitives/deposit/contract.abigen.go +++ b/geth-primitives/deposit/contract.abigen.go @@ -29,23 +29,23 @@ var ( _ = abi.ConvertType ) -// BeaconDepositContractMetaData contains all meta data concerning the BeaconDepositContract contract. -var BeaconDepositContractMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowDeposit\",\"inputs\":[{\"name\":\"depositor\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"number\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeOwnershipHandover\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"withdrawal_credentials\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositAuth\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"depositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"result\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownershipHandoverExpiresAt\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"result\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"requestOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"credentials\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverCanceled\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverRequested\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyInitialized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DepositNotMultipleOfGwei\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DepositValueTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientDeposit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCredentialsLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPubKeyLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewOwnerIsZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoHandoverRequest\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedDeposit\",\"inputs\":[]}]", - Bin: "0x6080604052348015600e575f80fd5b50604051610c34380380610c34833981016040819052602b91608e565b6032816037565b5060b9565b638b78c6d819805415605057630dc149f05f526004601cfd5b6001600160a01b03909116801560ff1b8117909155805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b5f60208284031215609d575f80fd5b81516001600160a01b038116811460b2575f80fd5b9392505050565b610b6e806100c65f395ff3fe6080604052600436106100c3575f3560e01c80635b70fa2911610071578063f04e283e1161004c578063f04e283e14610207578063f2fde38b1461021a578063fee81cf41461022d575f80fd5b80635b70fa2914610199578063715018a6146101ac5780638da5cb5b146101b4575f80fd5b80633198a6b8116100a15780633198a6b81461013d57806354d1f13d146101725780635a7517ad1461017a575f80fd5b806301ffc9a7146100c757806325692962146100fb5780632dfdf0b514610105575b5f80fd5b3480156100d2575f80fd5b506100e66100e1366004610809565b61026c565b60405190151581526020015b60405180910390f35b610103610304565b005b348015610110575f80fd5b505f546101249067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100f2565b348015610148575f80fd5b50610124610157366004610877565b60016020525f908152604090205467ffffffffffffffff1681565b610103610351565b348015610185575f80fd5b506101036101943660046108a7565b61038a565b6101036101a736600461091d565b6103f0565b6101036104a5565b3480156101bf575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f2565b610103610215366004610877565b6104b8565b610103610228366004610877565b6104f5565b348015610238575f80fd5b5061025e610247366004610877565b63389a75e1600c9081525f91909152602090205490565b6040519081526020016100f2565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b70fa2900000000000000000000000000000000000000000000000000000000145b92915050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61039261051b565b73ffffffffffffffffffffffffffffffffffffffff919091165f90815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091179055565b335f9081526001602052604081205467ffffffffffffffff169003610441576040517fce7ccd9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260016020526040812080549091906104679067ffffffffffffffff166109cd565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061049c87878787878787610550565b50505050505050565b6104ad61051b565b6104b65f6106e0565b565b6104c061051b565b63389a75e1600c52805f526020600c2080544211156104e657636f5e88185f526004601cfd5b5f90556104f2816106e0565b50565b6104fd61051b565b8060601b61051257637448fbae5f526004601cfd5b6104f2816106e0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146104b6576382b429005f526004601cfd5b6030861461058a576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146105c4576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081146105fe576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6106088461074e565b905064077359400067ffffffffffffffff82161015610653576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116600167ffffffffffffffff928316908101909216179091556040517f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46916106ce918b918b918b918b9188918b918b9190610a7a565b60405180910390a15050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217905550565b5f61075d633b9aca0034610b12565b15610794576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6107a3633b9aca0034610b25565b905067ffffffffffffffff8111156107e7576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102fe5f345f385f3884865af16108055763b12d13eb5f526004601cfd5b5050565b5f60208284031215610819575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610848575f80fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610872575f80fd5b919050565b5f60208284031215610887575f80fd5b6108488261084f565b803567ffffffffffffffff81168114610872575f80fd5b5f80604083850312156108b8575f80fd5b6108c18361084f565b91506108cf60208401610890565b90509250929050565b5f8083601f8401126108e8575f80fd5b50813567ffffffffffffffff8111156108ff575f80fd5b602083019150836020828501011115610916575f80fd5b9250929050565b5f805f805f805f6080888a031215610933575f80fd5b873567ffffffffffffffff811115610949575f80fd5b6109558a828b016108d8565b909850965050602088013567ffffffffffffffff811115610974575f80fd5b6109808a828b016108d8565b9096509450610993905060408901610890565b9250606088013567ffffffffffffffff8111156109ae575f80fd5b6109ba8a828b016108d8565b989b979a50959850939692959293505050565b5f67ffffffffffffffff821680610a0b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f610a8d60a083018a8c610a33565b8281036020840152610aa081898b610a33565b905067ffffffffffffffff871660408401528281036060840152610ac5818688610a33565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82610b2057610b20610ae5565b500690565b5f82610b3357610b33610ae5565b50049056fea26469706673582212209dfb8e5ead8b23553bd4102b9e66cae17b890a520a2c3b480698309f19d2819664736f6c634300081a0033", +// DepositContractMetaData contains all meta data concerning the DepositContract contract. +var DepositContractMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"function\",\"name\":\"acceptOperatorChange\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelOperatorChange\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"credentials\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"depositCount\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"genesisDepositsRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperator\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"queuedOperator\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"queuedTimestamp\",\"type\":\"uint96\",\"internalType\":\"uint96\"},{\"name\":\"newOperator\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"requestOperatorChange\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"newOperator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"Deposit\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"credentials\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"amount\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"signature\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"},{\"name\":\"index\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorChangeCancelled\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorChangeQueued\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"queuedOperator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"currentOperator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"queuedTimestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorUpdated\",\"inputs\":[{\"name\":\"pubkey\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"newOperator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"previousOperator\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"DepositNotMultipleOfGwei\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DepositValueTooHigh\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientDeposit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCredentialsLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPubKeyLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotEnoughTime\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotNewOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotOperator\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OperatorAlreadySet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ZeroOperatorOnFirstDeposit\",\"inputs\":[]}]", + Bin: "0x6080604052348015600e575f80fd5b506110f28061001c5f395ff3fe608060405260043610610093575f3560e01c8063577212fe11610066578063c53925d91161004c578063c53925d914610231578063e12cf4cb14610250578063fea7ab7714610263575f80fd5b8063577212fe146101cc5780639eaffa96146101ed575f80fd5b806301ffc9a7146100975780632dfdf0b5146100cb5780633523f9bd14610103578063560036ec14610126575b5f80fd5b3480156100a2575f80fd5b506100b66100b1366004610c22565b610282565b60405190151581526020015b60405180910390f35b3480156100d6575f80fd5b505f546100ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100c2565b34801561010e575f80fd5b5061011860015481565b6040519081526020016100c2565b348015610131575f80fd5b50610193610140366004610c95565b80516020818301810180516003825292820191909301209152546bffffffffffffffffffffffff8116906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1682565b604080516bffffffffffffffffffffffff909316835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100c2565b3480156101d7575f80fd5b506101eb6101e6366004610dca565b61031a565b005b3480156101f8575f80fd5b5061020c610207366004610dca565b6103f0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c2565b34801561023c575f80fd5b506101eb61024b366004610dca565b610431565b6101eb61025e366004610e2c565b610658565b34801561026e575f80fd5b506101eb61027d366004610edb565b6109ab565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061031457507fffffffff0000000000000000000000000000000000000000000000000000000082167f136f920d00000000000000000000000000000000000000000000000000000000145b92915050565b6002828260405161032c929190610f2b565b908152604051908190036020019020543373ffffffffffffffffffffffffffffffffffffffff9091161461038c576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003828260405161039e929190610f2b565b9081526040519081900360200181205f90556103bd9083908390610f2b565b604051908190038120907f1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db905f90a25050565b5f60028383604051610403929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16905092915050565b5f60038383604051610444929190610f2b565b908152604051908190036020019020805490915073ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000820416906bffffffffffffffffffffffff163382146104c6576040517f819a0d0b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6bffffffffffffffffffffffff42166104e26201518083610f67565b6bffffffffffffffffffffffff161115610528576040517fe8966d7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6002868660405161053b929190610f2b565b9081526040519081900360200181205473ffffffffffffffffffffffffffffffffffffffff16915083906002906105759089908990610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091556003906105da9088908890610f2b565b9081526040519081900360200181205f90556105f99087908790610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a2505050505050565b60308614610692576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146106cc576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608214610706576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff166002888860405161072f929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16036108765773ffffffffffffffffffffffffffffffffffffffff81166107a7576040517f51969a7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600288886040516107ba929190610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff00000000000000000000000000000000000000009093169290921790915561081c9088908890610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff841683525f6020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a26108c4565b73ffffffffffffffffffffffffffffffffffffffff8116156108c4576040517fc4142b4100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108cd610b5d565b9050633b9aca0067ffffffffffffffff82161015610917576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46918a918a918a918a9187918b918b9167ffffffffffffffff16908061095f83610f8b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051610999989796959493929190610ffe565b60405180910390a15050505050505050565b5f600284846040516109be929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff169050338114610a1f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a6c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60038585604051610a7f929190610f2b565b908152604051908190036020018120426bffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff86166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000000000000000161781559150610af79086908690610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff8681168452851660208401524283830152905190917f7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f919081900360600190a25050505050565b5f610b6c633b9aca0034611096565b15610ba3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb2633b9aca00346110a9565b905067ffffffffffffffff811115610bf6576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c005f34610c05565b919050565b5f385f3884865af1610c1e5763b12d13eb5f526004601cfd5b5050565b5f60208284031215610c32575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c61575f80fd5b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215610ca5575f80fd5b813567ffffffffffffffff811115610cbb575f80fd5b8201601f81018413610ccb575f80fd5b803567ffffffffffffffff811115610ce557610ce5610c68565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff82111715610d5157610d51610c68565b604052818152828201602001861015610d68575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f8083601f840112610d95575f80fd5b50813567ffffffffffffffff811115610dac575f80fd5b602083019150836020828501011115610dc3575f80fd5b9250929050565b5f8060208385031215610ddb575f80fd5b823567ffffffffffffffff811115610df1575f80fd5b610dfd85828601610d85565b90969095509350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c00575f80fd5b5f805f805f805f6080888a031215610e42575f80fd5b873567ffffffffffffffff811115610e58575f80fd5b610e648a828b01610d85565b909850965050602088013567ffffffffffffffff811115610e83575f80fd5b610e8f8a828b01610d85565b909650945050604088013567ffffffffffffffff811115610eae575f80fd5b610eba8a828b01610d85565b9094509250610ecd905060608901610e09565b905092959891949750929550565b5f805f60408486031215610eed575f80fd5b833567ffffffffffffffff811115610f03575f80fd5b610f0f86828701610d85565b9094509250610f22905060208501610e09565b90509250925092565b818382375f9101908152919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6bffffffffffffffffffffffff818116838216019081111561031457610314610f3a565b5f67ffffffffffffffff821667ffffffffffffffff8103610fae57610fae610f3a565b60010192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f61101160a083018a8c610fb7565b828103602084015261102481898b610fb7565b905067ffffffffffffffff871660408401528281036060840152611049818688610fb7565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826110a4576110a4611069565b500690565b5f826110b7576110b7611069565b50049056fea264697066735822122069227307258cbe8f29985bb4f3e283b1b03d5c0cbab8add81bf3c22e3d13729664736f6c634300081a0033", } -// BeaconDepositContractABI is the input ABI used to generate the binding from. -// Deprecated: Use BeaconDepositContractMetaData.ABI instead. -var BeaconDepositContractABI = BeaconDepositContractMetaData.ABI +// DepositContractABI is the input ABI used to generate the binding from. +// Deprecated: Use DepositContractMetaData.ABI instead. +var DepositContractABI = DepositContractMetaData.ABI -// BeaconDepositContractBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use BeaconDepositContractMetaData.Bin instead. -var BeaconDepositContractBin = BeaconDepositContractMetaData.Bin +// DepositContractBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use DepositContractMetaData.Bin instead. +var DepositContractBin = DepositContractMetaData.Bin -// DeployBeaconDepositContract deploys a new Ethereum contract, binding an instance of BeaconDepositContract to it. -func DeployBeaconDepositContract(auth *bind.TransactOpts, backend bind.ContractBackend, owner common.Address) (common.Address, *types.Transaction, *BeaconDepositContract, error) { - parsed, err := BeaconDepositContractMetaData.GetAbi() +// DeployDepositContract deploys a new Ethereum contract, binding an instance of DepositContract to it. +func DeployDepositContract(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *DepositContract, error) { + parsed, err := DepositContractMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err } @@ -53,111 +53,111 @@ func DeployBeaconDepositContract(auth *bind.TransactOpts, backend bind.ContractB return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BeaconDepositContractBin), backend, owner) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(DepositContractBin), backend) if err != nil { return common.Address{}, nil, nil, err } - return address, tx, &BeaconDepositContract{BeaconDepositContractCaller: BeaconDepositContractCaller{contract: contract}, BeaconDepositContractTransactor: BeaconDepositContractTransactor{contract: contract}, BeaconDepositContractFilterer: BeaconDepositContractFilterer{contract: contract}}, nil + return address, tx, &DepositContract{DepositContractCaller: DepositContractCaller{contract: contract}, DepositContractTransactor: DepositContractTransactor{contract: contract}, DepositContractFilterer: DepositContractFilterer{contract: contract}}, nil } -// BeaconDepositContract is an auto generated Go binding around an Ethereum contract. -type BeaconDepositContract struct { - BeaconDepositContractCaller // Read-only binding to the contract - BeaconDepositContractTransactor // Write-only binding to the contract - BeaconDepositContractFilterer // Log filterer for contract events +// DepositContract is an auto generated Go binding around an Ethereum contract. +type DepositContract struct { + DepositContractCaller // Read-only binding to the contract + DepositContractTransactor // Write-only binding to the contract + DepositContractFilterer // Log filterer for contract events } -// BeaconDepositContractCaller is an auto generated read-only Go binding around an Ethereum contract. -type BeaconDepositContractCaller struct { +// DepositContractCaller is an auto generated read-only Go binding around an Ethereum contract. +type DepositContractCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// BeaconDepositContractTransactor is an auto generated write-only Go binding around an Ethereum contract. -type BeaconDepositContractTransactor struct { +// DepositContractTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DepositContractTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// BeaconDepositContractFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type BeaconDepositContractFilterer struct { +// DepositContractFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DepositContractFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } -// BeaconDepositContractSession is an auto generated Go binding around an Ethereum contract, +// DepositContractSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. -type BeaconDepositContractSession struct { - Contract *BeaconDepositContract // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +type DepositContractSession struct { + Contract *DepositContract // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } -// BeaconDepositContractCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// DepositContractCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. -type BeaconDepositContractCallerSession struct { - Contract *BeaconDepositContractCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session +type DepositContractCallerSession struct { + Contract *DepositContractCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session } -// BeaconDepositContractTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// DepositContractTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. -type BeaconDepositContractTransactorSession struct { - Contract *BeaconDepositContractTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +type DepositContractTransactorSession struct { + Contract *DepositContractTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } -// BeaconDepositContractRaw is an auto generated low-level Go binding around an Ethereum contract. -type BeaconDepositContractRaw struct { - Contract *BeaconDepositContract // Generic contract binding to access the raw methods on +// DepositContractRaw is an auto generated low-level Go binding around an Ethereum contract. +type DepositContractRaw struct { + Contract *DepositContract // Generic contract binding to access the raw methods on } -// BeaconDepositContractCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type BeaconDepositContractCallerRaw struct { - Contract *BeaconDepositContractCaller // Generic read-only contract binding to access the raw methods on +// DepositContractCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DepositContractCallerRaw struct { + Contract *DepositContractCaller // Generic read-only contract binding to access the raw methods on } -// BeaconDepositContractTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type BeaconDepositContractTransactorRaw struct { - Contract *BeaconDepositContractTransactor // Generic write-only contract binding to access the raw methods on +// DepositContractTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DepositContractTransactorRaw struct { + Contract *DepositContractTransactor // Generic write-only contract binding to access the raw methods on } -// NewBeaconDepositContract creates a new instance of BeaconDepositContract, bound to a specific deployed contract. -func NewBeaconDepositContract(address common.Address, backend bind.ContractBackend) (*BeaconDepositContract, error) { - contract, err := bindBeaconDepositContract(address, backend, backend, backend) +// NewDepositContract creates a new instance of DepositContract, bound to a specific deployed contract. +func NewDepositContract(address common.Address, backend bind.ContractBackend) (*DepositContract, error) { + contract, err := bindDepositContract(address, backend, backend, backend) if err != nil { return nil, err } - return &BeaconDepositContract{BeaconDepositContractCaller: BeaconDepositContractCaller{contract: contract}, BeaconDepositContractTransactor: BeaconDepositContractTransactor{contract: contract}, BeaconDepositContractFilterer: BeaconDepositContractFilterer{contract: contract}}, nil + return &DepositContract{DepositContractCaller: DepositContractCaller{contract: contract}, DepositContractTransactor: DepositContractTransactor{contract: contract}, DepositContractFilterer: DepositContractFilterer{contract: contract}}, nil } -// NewBeaconDepositContractCaller creates a new read-only instance of BeaconDepositContract, bound to a specific deployed contract. -func NewBeaconDepositContractCaller(address common.Address, caller bind.ContractCaller) (*BeaconDepositContractCaller, error) { - contract, err := bindBeaconDepositContract(address, caller, nil, nil) +// NewDepositContractCaller creates a new read-only instance of DepositContract, bound to a specific deployed contract. +func NewDepositContractCaller(address common.Address, caller bind.ContractCaller) (*DepositContractCaller, error) { + contract, err := bindDepositContract(address, caller, nil, nil) if err != nil { return nil, err } - return &BeaconDepositContractCaller{contract: contract}, nil + return &DepositContractCaller{contract: contract}, nil } -// NewBeaconDepositContractTransactor creates a new write-only instance of BeaconDepositContract, bound to a specific deployed contract. -func NewBeaconDepositContractTransactor(address common.Address, transactor bind.ContractTransactor) (*BeaconDepositContractTransactor, error) { - contract, err := bindBeaconDepositContract(address, nil, transactor, nil) +// NewDepositContractTransactor creates a new write-only instance of DepositContract, bound to a specific deployed contract. +func NewDepositContractTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositContractTransactor, error) { + contract, err := bindDepositContract(address, nil, transactor, nil) if err != nil { return nil, err } - return &BeaconDepositContractTransactor{contract: contract}, nil + return &DepositContractTransactor{contract: contract}, nil } -// NewBeaconDepositContractFilterer creates a new log filterer instance of BeaconDepositContract, bound to a specific deployed contract. -func NewBeaconDepositContractFilterer(address common.Address, filterer bind.ContractFilterer) (*BeaconDepositContractFilterer, error) { - contract, err := bindBeaconDepositContract(address, nil, nil, filterer) +// NewDepositContractFilterer creates a new log filterer instance of DepositContract, bound to a specific deployed contract. +func NewDepositContractFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositContractFilterer, error) { + contract, err := bindDepositContract(address, nil, nil, filterer) if err != nil { return nil, err } - return &BeaconDepositContractFilterer{contract: contract}, nil + return &DepositContractFilterer{contract: contract}, nil } -// bindBeaconDepositContract binds a generic wrapper to an already deployed contract. -func bindBeaconDepositContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := BeaconDepositContractMetaData.GetAbi() +// bindDepositContract binds a generic wrapper to an already deployed contract. +func bindDepositContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := DepositContractMetaData.GetAbi() if err != nil { return nil, err } @@ -168,46 +168,46 @@ func bindBeaconDepositContract(address common.Address, caller bind.ContractCalle // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_BeaconDepositContract *BeaconDepositContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _BeaconDepositContract.Contract.BeaconDepositContractCaller.contract.Call(opts, result, method, params...) +func (_DepositContract *DepositContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DepositContract.Contract.DepositContractCaller.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. -func (_BeaconDepositContract *BeaconDepositContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.BeaconDepositContractTransactor.contract.Transfer(opts) +func (_DepositContract *DepositContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositContract.Contract.DepositContractTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_BeaconDepositContract *BeaconDepositContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.BeaconDepositContractTransactor.contract.Transact(opts, method, params...) +func (_DepositContract *DepositContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DepositContract.Contract.DepositContractTransactor.contract.Transact(opts, method, params...) } // Call invokes the (constant) contract method with params as input values and // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_BeaconDepositContract *BeaconDepositContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _BeaconDepositContract.Contract.contract.Call(opts, result, method, params...) +func (_DepositContract *DepositContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DepositContract.Contract.contract.Call(opts, result, method, params...) } // Transfer initiates a plain transaction to move funds to the contract, calling // its default method if one is available. -func (_BeaconDepositContract *BeaconDepositContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.contract.Transfer(opts) +func (_DepositContract *DepositContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositContract.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. -func (_BeaconDepositContract *BeaconDepositContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.contract.Transact(opts, method, params...) +func (_DepositContract *DepositContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DepositContract.Contract.contract.Transact(opts, method, params...) } -// DepositAuth is a free data retrieval call binding the contract method 0x3198a6b8. +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. // -// Solidity: function depositAuth(address ) view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractCaller) DepositAuth(opts *bind.CallOpts, arg0 common.Address) (uint64, error) { +// Solidity: function depositCount() view returns(uint64) +func (_DepositContract *DepositContractCaller) DepositCount(opts *bind.CallOpts) (uint64, error) { var out []interface{} - err := _BeaconDepositContract.contract.Call(opts, &out, "depositAuth", arg0) + err := _DepositContract.contract.Call(opts, &out, "depositCount") if err != nil { return *new(uint64), err @@ -219,57 +219,57 @@ func (_BeaconDepositContract *BeaconDepositContractCaller) DepositAuth(opts *bin } -// DepositAuth is a free data retrieval call binding the contract method 0x3198a6b8. +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. // -// Solidity: function depositAuth(address ) view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractSession) DepositAuth(arg0 common.Address) (uint64, error) { - return _BeaconDepositContract.Contract.DepositAuth(&_BeaconDepositContract.CallOpts, arg0) +// Solidity: function depositCount() view returns(uint64) +func (_DepositContract *DepositContractSession) DepositCount() (uint64, error) { + return _DepositContract.Contract.DepositCount(&_DepositContract.CallOpts) } -// DepositAuth is a free data retrieval call binding the contract method 0x3198a6b8. +// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. // -// Solidity: function depositAuth(address ) view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractCallerSession) DepositAuth(arg0 common.Address) (uint64, error) { - return _BeaconDepositContract.Contract.DepositAuth(&_BeaconDepositContract.CallOpts, arg0) +// Solidity: function depositCount() view returns(uint64) +func (_DepositContract *DepositContractCallerSession) DepositCount() (uint64, error) { + return _DepositContract.Contract.DepositCount(&_DepositContract.CallOpts) } -// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// GenesisDepositsRoot is a free data retrieval call binding the contract method 0x3523f9bd. // -// Solidity: function depositCount() view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractCaller) DepositCount(opts *bind.CallOpts) (uint64, error) { +// Solidity: function genesisDepositsRoot() view returns(bytes32) +func (_DepositContract *DepositContractCaller) GenesisDepositsRoot(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} - err := _BeaconDepositContract.contract.Call(opts, &out, "depositCount") + err := _DepositContract.contract.Call(opts, &out, "genesisDepositsRoot") if err != nil { - return *new(uint64), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } -// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// GenesisDepositsRoot is a free data retrieval call binding the contract method 0x3523f9bd. // -// Solidity: function depositCount() view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractSession) DepositCount() (uint64, error) { - return _BeaconDepositContract.Contract.DepositCount(&_BeaconDepositContract.CallOpts) +// Solidity: function genesisDepositsRoot() view returns(bytes32) +func (_DepositContract *DepositContractSession) GenesisDepositsRoot() ([32]byte, error) { + return _DepositContract.Contract.GenesisDepositsRoot(&_DepositContract.CallOpts) } -// DepositCount is a free data retrieval call binding the contract method 0x2dfdf0b5. +// GenesisDepositsRoot is a free data retrieval call binding the contract method 0x3523f9bd. // -// Solidity: function depositCount() view returns(uint64) -func (_BeaconDepositContract *BeaconDepositContractCallerSession) DepositCount() (uint64, error) { - return _BeaconDepositContract.Contract.DepositCount(&_BeaconDepositContract.CallOpts) +// Solidity: function genesisDepositsRoot() view returns(bytes32) +func (_DepositContract *DepositContractCallerSession) GenesisDepositsRoot() ([32]byte, error) { + return _DepositContract.Contract.GenesisDepositsRoot(&_DepositContract.CallOpts) } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperator is a free data retrieval call binding the contract method 0x9eaffa96. // -// Solidity: function owner() view returns(address result) -func (_BeaconDepositContract *BeaconDepositContractCaller) Owner(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getOperator(bytes pubkey) view returns(address) +func (_DepositContract *DepositContractCaller) GetOperator(opts *bind.CallOpts, pubkey []byte) (common.Address, error) { var out []interface{} - err := _BeaconDepositContract.contract.Call(opts, &out, "owner") + err := _DepositContract.contract.Call(opts, &out, "getOperator", pubkey) if err != nil { return *new(common.Address), err @@ -281,57 +281,71 @@ func (_BeaconDepositContract *BeaconDepositContractCaller) Owner(opts *bind.Call } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperator is a free data retrieval call binding the contract method 0x9eaffa96. // -// Solidity: function owner() view returns(address result) -func (_BeaconDepositContract *BeaconDepositContractSession) Owner() (common.Address, error) { - return _BeaconDepositContract.Contract.Owner(&_BeaconDepositContract.CallOpts) +// Solidity: function getOperator(bytes pubkey) view returns(address) +func (_DepositContract *DepositContractSession) GetOperator(pubkey []byte) (common.Address, error) { + return _DepositContract.Contract.GetOperator(&_DepositContract.CallOpts, pubkey) } -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// GetOperator is a free data retrieval call binding the contract method 0x9eaffa96. // -// Solidity: function owner() view returns(address result) -func (_BeaconDepositContract *BeaconDepositContractCallerSession) Owner() (common.Address, error) { - return _BeaconDepositContract.Contract.Owner(&_BeaconDepositContract.CallOpts) +// Solidity: function getOperator(bytes pubkey) view returns(address) +func (_DepositContract *DepositContractCallerSession) GetOperator(pubkey []byte) (common.Address, error) { + return _DepositContract.Contract.GetOperator(&_DepositContract.CallOpts, pubkey) } -// OwnershipHandoverExpiresAt is a free data retrieval call binding the contract method 0xfee81cf4. +// QueuedOperator is a free data retrieval call binding the contract method 0x560036ec. // -// Solidity: function ownershipHandoverExpiresAt(address pendingOwner) view returns(uint256 result) -func (_BeaconDepositContract *BeaconDepositContractCaller) OwnershipHandoverExpiresAt(opts *bind.CallOpts, pendingOwner common.Address) (*big.Int, error) { +// Solidity: function queuedOperator(bytes ) view returns(uint96 queuedTimestamp, address newOperator) +func (_DepositContract *DepositContractCaller) QueuedOperator(opts *bind.CallOpts, arg0 []byte) (struct { + QueuedTimestamp *big.Int + NewOperator common.Address +}, error) { var out []interface{} - err := _BeaconDepositContract.contract.Call(opts, &out, "ownershipHandoverExpiresAt", pendingOwner) + err := _DepositContract.contract.Call(opts, &out, "queuedOperator", arg0) + outstruct := new(struct { + QueuedTimestamp *big.Int + NewOperator common.Address + }) if err != nil { - return *new(*big.Int), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.QueuedTimestamp = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.NewOperator = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - return out0, err + return *outstruct, err } -// OwnershipHandoverExpiresAt is a free data retrieval call binding the contract method 0xfee81cf4. +// QueuedOperator is a free data retrieval call binding the contract method 0x560036ec. // -// Solidity: function ownershipHandoverExpiresAt(address pendingOwner) view returns(uint256 result) -func (_BeaconDepositContract *BeaconDepositContractSession) OwnershipHandoverExpiresAt(pendingOwner common.Address) (*big.Int, error) { - return _BeaconDepositContract.Contract.OwnershipHandoverExpiresAt(&_BeaconDepositContract.CallOpts, pendingOwner) +// Solidity: function queuedOperator(bytes ) view returns(uint96 queuedTimestamp, address newOperator) +func (_DepositContract *DepositContractSession) QueuedOperator(arg0 []byte) (struct { + QueuedTimestamp *big.Int + NewOperator common.Address +}, error) { + return _DepositContract.Contract.QueuedOperator(&_DepositContract.CallOpts, arg0) } -// OwnershipHandoverExpiresAt is a free data retrieval call binding the contract method 0xfee81cf4. +// QueuedOperator is a free data retrieval call binding the contract method 0x560036ec. // -// Solidity: function ownershipHandoverExpiresAt(address pendingOwner) view returns(uint256 result) -func (_BeaconDepositContract *BeaconDepositContractCallerSession) OwnershipHandoverExpiresAt(pendingOwner common.Address) (*big.Int, error) { - return _BeaconDepositContract.Contract.OwnershipHandoverExpiresAt(&_BeaconDepositContract.CallOpts, pendingOwner) +// Solidity: function queuedOperator(bytes ) view returns(uint96 queuedTimestamp, address newOperator) +func (_DepositContract *DepositContractCallerSession) QueuedOperator(arg0 []byte) (struct { + QueuedTimestamp *big.Int + NewOperator common.Address +}, error) { + return _DepositContract.Contract.QueuedOperator(&_DepositContract.CallOpts, arg0) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) pure returns(bool) -func (_BeaconDepositContract *BeaconDepositContractCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { +func (_DepositContract *DepositContractCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { var out []interface{} - err := _BeaconDepositContract.contract.Call(opts, &out, "supportsInterface", interfaceId) + err := _DepositContract.contract.Call(opts, &out, "supportsInterface", interfaceId) if err != nil { return *new(bool), err @@ -346,167 +360,104 @@ func (_BeaconDepositContract *BeaconDepositContractCaller) SupportsInterface(opt // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) pure returns(bool) -func (_BeaconDepositContract *BeaconDepositContractSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _BeaconDepositContract.Contract.SupportsInterface(&_BeaconDepositContract.CallOpts, interfaceId) +func (_DepositContract *DepositContractSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DepositContract.Contract.SupportsInterface(&_DepositContract.CallOpts, interfaceId) } // SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. // // Solidity: function supportsInterface(bytes4 interfaceId) pure returns(bool) -func (_BeaconDepositContract *BeaconDepositContractCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _BeaconDepositContract.Contract.SupportsInterface(&_BeaconDepositContract.CallOpts, interfaceId) -} - -// AllowDeposit is a paid mutator transaction binding the contract method 0x5a7517ad. -// -// Solidity: function allowDeposit(address depositor, uint64 number) returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) AllowDeposit(opts *bind.TransactOpts, depositor common.Address, number uint64) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "allowDeposit", depositor, number) -} - -// AllowDeposit is a paid mutator transaction binding the contract method 0x5a7517ad. -// -// Solidity: function allowDeposit(address depositor, uint64 number) returns() -func (_BeaconDepositContract *BeaconDepositContractSession) AllowDeposit(depositor common.Address, number uint64) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.AllowDeposit(&_BeaconDepositContract.TransactOpts, depositor, number) -} - -// AllowDeposit is a paid mutator transaction binding the contract method 0x5a7517ad. -// -// Solidity: function allowDeposit(address depositor, uint64 number) returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) AllowDeposit(depositor common.Address, number uint64) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.AllowDeposit(&_BeaconDepositContract.TransactOpts, depositor, number) -} - -// CancelOwnershipHandover is a paid mutator transaction binding the contract method 0x54d1f13d. -// -// Solidity: function cancelOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) CancelOwnershipHandover(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "cancelOwnershipHandover") -} - -// CancelOwnershipHandover is a paid mutator transaction binding the contract method 0x54d1f13d. -// -// Solidity: function cancelOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) CancelOwnershipHandover() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.CancelOwnershipHandover(&_BeaconDepositContract.TransactOpts) -} - -// CancelOwnershipHandover is a paid mutator transaction binding the contract method 0x54d1f13d. -// -// Solidity: function cancelOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) CancelOwnershipHandover() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.CancelOwnershipHandover(&_BeaconDepositContract.TransactOpts) +func (_DepositContract *DepositContractCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _DepositContract.Contract.SupportsInterface(&_DepositContract.CallOpts, interfaceId) } -// CompleteOwnershipHandover is a paid mutator transaction binding the contract method 0xf04e283e. +// AcceptOperatorChange is a paid mutator transaction binding the contract method 0xc53925d9. // -// Solidity: function completeOwnershipHandover(address pendingOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) CompleteOwnershipHandover(opts *bind.TransactOpts, pendingOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "completeOwnershipHandover", pendingOwner) +// Solidity: function acceptOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractTransactor) AcceptOperatorChange(opts *bind.TransactOpts, pubkey []byte) (*types.Transaction, error) { + return _DepositContract.contract.Transact(opts, "acceptOperatorChange", pubkey) } -// CompleteOwnershipHandover is a paid mutator transaction binding the contract method 0xf04e283e. +// AcceptOperatorChange is a paid mutator transaction binding the contract method 0xc53925d9. // -// Solidity: function completeOwnershipHandover(address pendingOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) CompleteOwnershipHandover(pendingOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.CompleteOwnershipHandover(&_BeaconDepositContract.TransactOpts, pendingOwner) +// Solidity: function acceptOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractSession) AcceptOperatorChange(pubkey []byte) (*types.Transaction, error) { + return _DepositContract.Contract.AcceptOperatorChange(&_DepositContract.TransactOpts, pubkey) } -// CompleteOwnershipHandover is a paid mutator transaction binding the contract method 0xf04e283e. +// AcceptOperatorChange is a paid mutator transaction binding the contract method 0xc53925d9. // -// Solidity: function completeOwnershipHandover(address pendingOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) CompleteOwnershipHandover(pendingOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.CompleteOwnershipHandover(&_BeaconDepositContract.TransactOpts, pendingOwner) +// Solidity: function acceptOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractTransactorSession) AcceptOperatorChange(pubkey []byte) (*types.Transaction, error) { + return _DepositContract.Contract.AcceptOperatorChange(&_DepositContract.TransactOpts, pubkey) } -// Deposit is a paid mutator transaction binding the contract method 0x5b70fa29. +// CancelOperatorChange is a paid mutator transaction binding the contract method 0x577212fe. // -// Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, uint64 amount, bytes signature) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) Deposit(opts *bind.TransactOpts, pubkey []byte, withdrawal_credentials []byte, amount uint64, signature []byte) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "deposit", pubkey, withdrawal_credentials, amount, signature) +// Solidity: function cancelOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractTransactor) CancelOperatorChange(opts *bind.TransactOpts, pubkey []byte) (*types.Transaction, error) { + return _DepositContract.contract.Transact(opts, "cancelOperatorChange", pubkey) } -// Deposit is a paid mutator transaction binding the contract method 0x5b70fa29. +// CancelOperatorChange is a paid mutator transaction binding the contract method 0x577212fe. // -// Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, uint64 amount, bytes signature) payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) Deposit(pubkey []byte, withdrawal_credentials []byte, amount uint64, signature []byte) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.Deposit(&_BeaconDepositContract.TransactOpts, pubkey, withdrawal_credentials, amount, signature) +// Solidity: function cancelOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractSession) CancelOperatorChange(pubkey []byte) (*types.Transaction, error) { + return _DepositContract.Contract.CancelOperatorChange(&_DepositContract.TransactOpts, pubkey) } -// Deposit is a paid mutator transaction binding the contract method 0x5b70fa29. +// CancelOperatorChange is a paid mutator transaction binding the contract method 0x577212fe. // -// Solidity: function deposit(bytes pubkey, bytes withdrawal_credentials, uint64 amount, bytes signature) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) Deposit(pubkey []byte, withdrawal_credentials []byte, amount uint64, signature []byte) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.Deposit(&_BeaconDepositContract.TransactOpts, pubkey, withdrawal_credentials, amount, signature) +// Solidity: function cancelOperatorChange(bytes pubkey) returns() +func (_DepositContract *DepositContractTransactorSession) CancelOperatorChange(pubkey []byte) (*types.Transaction, error) { + return _DepositContract.Contract.CancelOperatorChange(&_DepositContract.TransactOpts, pubkey) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// Deposit is a paid mutator transaction binding the contract method 0xe12cf4cb. // -// Solidity: function renounceOwnership() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "renounceOwnership") +// Solidity: function deposit(bytes pubkey, bytes credentials, bytes signature, address operator) payable returns() +func (_DepositContract *DepositContractTransactor) Deposit(opts *bind.TransactOpts, pubkey []byte, credentials []byte, signature []byte, operator common.Address) (*types.Transaction, error) { + return _DepositContract.contract.Transact(opts, "deposit", pubkey, credentials, signature, operator) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// Deposit is a paid mutator transaction binding the contract method 0xe12cf4cb. // -// Solidity: function renounceOwnership() payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) RenounceOwnership() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.RenounceOwnership(&_BeaconDepositContract.TransactOpts) +// Solidity: function deposit(bytes pubkey, bytes credentials, bytes signature, address operator) payable returns() +func (_DepositContract *DepositContractSession) Deposit(pubkey []byte, credentials []byte, signature []byte, operator common.Address) (*types.Transaction, error) { + return _DepositContract.Contract.Deposit(&_DepositContract.TransactOpts, pubkey, credentials, signature, operator) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// Deposit is a paid mutator transaction binding the contract method 0xe12cf4cb. // -// Solidity: function renounceOwnership() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.RenounceOwnership(&_BeaconDepositContract.TransactOpts) +// Solidity: function deposit(bytes pubkey, bytes credentials, bytes signature, address operator) payable returns() +func (_DepositContract *DepositContractTransactorSession) Deposit(pubkey []byte, credentials []byte, signature []byte, operator common.Address) (*types.Transaction, error) { + return _DepositContract.Contract.Deposit(&_DepositContract.TransactOpts, pubkey, credentials, signature, operator) } -// RequestOwnershipHandover is a paid mutator transaction binding the contract method 0x25692962. +// RequestOperatorChange is a paid mutator transaction binding the contract method 0xfea7ab77. // -// Solidity: function requestOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) RequestOwnershipHandover(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "requestOwnershipHandover") +// Solidity: function requestOperatorChange(bytes pubkey, address newOperator) returns() +func (_DepositContract *DepositContractTransactor) RequestOperatorChange(opts *bind.TransactOpts, pubkey []byte, newOperator common.Address) (*types.Transaction, error) { + return _DepositContract.contract.Transact(opts, "requestOperatorChange", pubkey, newOperator) } -// RequestOwnershipHandover is a paid mutator transaction binding the contract method 0x25692962. +// RequestOperatorChange is a paid mutator transaction binding the contract method 0xfea7ab77. // -// Solidity: function requestOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) RequestOwnershipHandover() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.RequestOwnershipHandover(&_BeaconDepositContract.TransactOpts) +// Solidity: function requestOperatorChange(bytes pubkey, address newOperator) returns() +func (_DepositContract *DepositContractSession) RequestOperatorChange(pubkey []byte, newOperator common.Address) (*types.Transaction, error) { + return _DepositContract.Contract.RequestOperatorChange(&_DepositContract.TransactOpts, pubkey, newOperator) } -// RequestOwnershipHandover is a paid mutator transaction binding the contract method 0x25692962. +// RequestOperatorChange is a paid mutator transaction binding the contract method 0xfea7ab77. // -// Solidity: function requestOwnershipHandover() payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) RequestOwnershipHandover() (*types.Transaction, error) { - return _BeaconDepositContract.Contract.RequestOwnershipHandover(&_BeaconDepositContract.TransactOpts) +// Solidity: function requestOperatorChange(bytes pubkey, address newOperator) returns() +func (_DepositContract *DepositContractTransactorSession) RequestOperatorChange(pubkey []byte, newOperator common.Address) (*types.Transaction, error) { + return _DepositContract.Contract.RequestOperatorChange(&_DepositContract.TransactOpts, pubkey, newOperator) } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.TransferOwnership(&_BeaconDepositContract.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) payable returns() -func (_BeaconDepositContract *BeaconDepositContractTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _BeaconDepositContract.Contract.TransferOwnership(&_BeaconDepositContract.TransactOpts, newOwner) -} - -// BeaconDepositContractDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the BeaconDepositContract contract. -type BeaconDepositContractDepositIterator struct { - Event *BeaconDepositContractDeposit // Event containing the contract specifics and raw log +// DepositContractDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the DepositContract contract. +type DepositContractDepositIterator struct { + Event *DepositContractDeposit // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -520,7 +471,7 @@ type BeaconDepositContractDepositIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *BeaconDepositContractDepositIterator) Next() bool { +func (it *DepositContractDepositIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -529,7 +480,7 @@ func (it *BeaconDepositContractDepositIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BeaconDepositContractDeposit) + it.Event = new(DepositContractDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -544,7 +495,7 @@ func (it *BeaconDepositContractDepositIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BeaconDepositContractDeposit) + it.Event = new(DepositContractDeposit) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -560,19 +511,19 @@ func (it *BeaconDepositContractDepositIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BeaconDepositContractDepositIterator) Error() error { +func (it *DepositContractDepositIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BeaconDepositContractDepositIterator) Close() error { +func (it *DepositContractDepositIterator) Close() error { it.sub.Unsubscribe() return nil } -// BeaconDepositContractDeposit represents a Deposit event raised by the BeaconDepositContract contract. -type BeaconDepositContractDeposit struct { +// DepositContractDeposit represents a Deposit event raised by the DepositContract contract. +type DepositContractDeposit struct { Pubkey []byte Credentials []byte Amount uint64 @@ -584,21 +535,21 @@ type BeaconDepositContractDeposit struct { // FilterDeposit is a free log retrieval operation binding the contract event 0x68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46. // // Solidity: event Deposit(bytes pubkey, bytes credentials, uint64 amount, bytes signature, uint64 index) -func (_BeaconDepositContract *BeaconDepositContractFilterer) FilterDeposit(opts *bind.FilterOpts) (*BeaconDepositContractDepositIterator, error) { +func (_DepositContract *DepositContractFilterer) FilterDeposit(opts *bind.FilterOpts) (*DepositContractDepositIterator, error) { - logs, sub, err := _BeaconDepositContract.contract.FilterLogs(opts, "Deposit") + logs, sub, err := _DepositContract.contract.FilterLogs(opts, "Deposit") if err != nil { return nil, err } - return &BeaconDepositContractDepositIterator{contract: _BeaconDepositContract.contract, event: "Deposit", logs: logs, sub: sub}, nil + return &DepositContractDepositIterator{contract: _DepositContract.contract, event: "Deposit", logs: logs, sub: sub}, nil } // WatchDeposit is a free log subscription operation binding the contract event 0x68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46. // // Solidity: event Deposit(bytes pubkey, bytes credentials, uint64 amount, bytes signature, uint64 index) -func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *BeaconDepositContractDeposit) (event.Subscription, error) { +func (_DepositContract *DepositContractFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *DepositContractDeposit) (event.Subscription, error) { - logs, sub, err := _BeaconDepositContract.contract.WatchLogs(opts, "Deposit") + logs, sub, err := _DepositContract.contract.WatchLogs(opts, "Deposit") if err != nil { return nil, err } @@ -608,8 +559,8 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchDeposit(opts * select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BeaconDepositContractDeposit) - if err := _BeaconDepositContract.contract.UnpackLog(event, "Deposit", log); err != nil { + event := new(DepositContractDeposit) + if err := _DepositContract.contract.UnpackLog(event, "Deposit", log); err != nil { return err } event.Raw = log @@ -633,18 +584,18 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchDeposit(opts * // ParseDeposit is a log parse operation binding the contract event 0x68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46. // // Solidity: event Deposit(bytes pubkey, bytes credentials, uint64 amount, bytes signature, uint64 index) -func (_BeaconDepositContract *BeaconDepositContractFilterer) ParseDeposit(log types.Log) (*BeaconDepositContractDeposit, error) { - event := new(BeaconDepositContractDeposit) - if err := _BeaconDepositContract.contract.UnpackLog(event, "Deposit", log); err != nil { +func (_DepositContract *DepositContractFilterer) ParseDeposit(log types.Log) (*DepositContractDeposit, error) { + event := new(DepositContractDeposit) + if err := _DepositContract.contract.UnpackLog(event, "Deposit", log); err != nil { return nil, err } event.Raw = log return event, nil } -// BeaconDepositContractOwnershipHandoverCanceledIterator is returned from FilterOwnershipHandoverCanceled and is used to iterate over the raw logs and unpacked data for OwnershipHandoverCanceled events raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipHandoverCanceledIterator struct { - Event *BeaconDepositContractOwnershipHandoverCanceled // Event containing the contract specifics and raw log +// DepositContractOperatorChangeCancelledIterator is returned from FilterOperatorChangeCancelled and is used to iterate over the raw logs and unpacked data for OperatorChangeCancelled events raised by the DepositContract contract. +type DepositContractOperatorChangeCancelledIterator struct { + Event *DepositContractOperatorChangeCancelled // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -658,7 +609,7 @@ type BeaconDepositContractOwnershipHandoverCanceledIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Next() bool { +func (it *DepositContractOperatorChangeCancelledIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -667,7 +618,7 @@ func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipHandoverCanceled) + it.Event = new(DepositContractOperatorChangeCancelled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -682,7 +633,7 @@ func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipHandoverCanceled) + it.Event = new(DepositContractOperatorChangeCancelled) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -698,51 +649,51 @@ func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Error() error { +func (it *DepositContractOperatorChangeCancelledIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BeaconDepositContractOwnershipHandoverCanceledIterator) Close() error { +func (it *DepositContractOperatorChangeCancelledIterator) Close() error { it.sub.Unsubscribe() return nil } -// BeaconDepositContractOwnershipHandoverCanceled represents a OwnershipHandoverCanceled event raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipHandoverCanceled struct { - PendingOwner common.Address - Raw types.Log // Blockchain specific contextual infos +// DepositContractOperatorChangeCancelled represents a OperatorChangeCancelled event raised by the DepositContract contract. +type DepositContractOperatorChangeCancelled struct { + Pubkey common.Hash + Raw types.Log // Blockchain specific contextual infos } -// FilterOwnershipHandoverCanceled is a free log retrieval operation binding the contract event 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92. +// FilterOperatorChangeCancelled is a free log retrieval operation binding the contract event 0x1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db. // -// Solidity: event OwnershipHandoverCanceled(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) FilterOwnershipHandoverCanceled(opts *bind.FilterOpts, pendingOwner []common.Address) (*BeaconDepositContractOwnershipHandoverCanceledIterator, error) { +// Solidity: event OperatorChangeCancelled(bytes indexed pubkey) +func (_DepositContract *DepositContractFilterer) FilterOperatorChangeCancelled(opts *bind.FilterOpts, pubkey [][]byte) (*DepositContractOperatorChangeCancelledIterator, error) { - var pendingOwnerRule []interface{} - for _, pendingOwnerItem := range pendingOwner { - pendingOwnerRule = append(pendingOwnerRule, pendingOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.FilterLogs(opts, "OwnershipHandoverCanceled", pendingOwnerRule) + logs, sub, err := _DepositContract.contract.FilterLogs(opts, "OperatorChangeCancelled", pubkeyRule) if err != nil { return nil, err } - return &BeaconDepositContractOwnershipHandoverCanceledIterator{contract: _BeaconDepositContract.contract, event: "OwnershipHandoverCanceled", logs: logs, sub: sub}, nil + return &DepositContractOperatorChangeCancelledIterator{contract: _DepositContract.contract, event: "OperatorChangeCancelled", logs: logs, sub: sub}, nil } -// WatchOwnershipHandoverCanceled is a free log subscription operation binding the contract event 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92. +// WatchOperatorChangeCancelled is a free log subscription operation binding the contract event 0x1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db. // -// Solidity: event OwnershipHandoverCanceled(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHandoverCanceled(opts *bind.WatchOpts, sink chan<- *BeaconDepositContractOwnershipHandoverCanceled, pendingOwner []common.Address) (event.Subscription, error) { +// Solidity: event OperatorChangeCancelled(bytes indexed pubkey) +func (_DepositContract *DepositContractFilterer) WatchOperatorChangeCancelled(opts *bind.WatchOpts, sink chan<- *DepositContractOperatorChangeCancelled, pubkey [][]byte) (event.Subscription, error) { - var pendingOwnerRule []interface{} - for _, pendingOwnerItem := range pendingOwner { - pendingOwnerRule = append(pendingOwnerRule, pendingOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.WatchLogs(opts, "OwnershipHandoverCanceled", pendingOwnerRule) + logs, sub, err := _DepositContract.contract.WatchLogs(opts, "OperatorChangeCancelled", pubkeyRule) if err != nil { return nil, err } @@ -752,8 +703,8 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHando select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BeaconDepositContractOwnershipHandoverCanceled) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipHandoverCanceled", log); err != nil { + event := new(DepositContractOperatorChangeCancelled) + if err := _DepositContract.contract.UnpackLog(event, "OperatorChangeCancelled", log); err != nil { return err } event.Raw = log @@ -774,21 +725,21 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHando }), nil } -// ParseOwnershipHandoverCanceled is a log parse operation binding the contract event 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92. +// ParseOperatorChangeCancelled is a log parse operation binding the contract event 0x1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db. // -// Solidity: event OwnershipHandoverCanceled(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) ParseOwnershipHandoverCanceled(log types.Log) (*BeaconDepositContractOwnershipHandoverCanceled, error) { - event := new(BeaconDepositContractOwnershipHandoverCanceled) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipHandoverCanceled", log); err != nil { +// Solidity: event OperatorChangeCancelled(bytes indexed pubkey) +func (_DepositContract *DepositContractFilterer) ParseOperatorChangeCancelled(log types.Log) (*DepositContractOperatorChangeCancelled, error) { + event := new(DepositContractOperatorChangeCancelled) + if err := _DepositContract.contract.UnpackLog(event, "OperatorChangeCancelled", log); err != nil { return nil, err } event.Raw = log return event, nil } -// BeaconDepositContractOwnershipHandoverRequestedIterator is returned from FilterOwnershipHandoverRequested and is used to iterate over the raw logs and unpacked data for OwnershipHandoverRequested events raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipHandoverRequestedIterator struct { - Event *BeaconDepositContractOwnershipHandoverRequested // Event containing the contract specifics and raw log +// DepositContractOperatorChangeQueuedIterator is returned from FilterOperatorChangeQueued and is used to iterate over the raw logs and unpacked data for OperatorChangeQueued events raised by the DepositContract contract. +type DepositContractOperatorChangeQueuedIterator struct { + Event *DepositContractOperatorChangeQueued // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -802,7 +753,7 @@ type BeaconDepositContractOwnershipHandoverRequestedIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Next() bool { +func (it *DepositContractOperatorChangeQueuedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -811,7 +762,7 @@ func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipHandoverRequested) + it.Event = new(DepositContractOperatorChangeQueued) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -826,7 +777,7 @@ func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipHandoverRequested) + it.Event = new(DepositContractOperatorChangeQueued) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -842,51 +793,54 @@ func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Error() error { +func (it *DepositContractOperatorChangeQueuedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BeaconDepositContractOwnershipHandoverRequestedIterator) Close() error { +func (it *DepositContractOperatorChangeQueuedIterator) Close() error { it.sub.Unsubscribe() return nil } -// BeaconDepositContractOwnershipHandoverRequested represents a OwnershipHandoverRequested event raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipHandoverRequested struct { - PendingOwner common.Address - Raw types.Log // Blockchain specific contextual infos +// DepositContractOperatorChangeQueued represents a OperatorChangeQueued event raised by the DepositContract contract. +type DepositContractOperatorChangeQueued struct { + Pubkey common.Hash + QueuedOperator common.Address + CurrentOperator common.Address + QueuedTimestamp *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterOwnershipHandoverRequested is a free log retrieval operation binding the contract event 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d. +// FilterOperatorChangeQueued is a free log retrieval operation binding the contract event 0x7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f. // -// Solidity: event OwnershipHandoverRequested(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) FilterOwnershipHandoverRequested(opts *bind.FilterOpts, pendingOwner []common.Address) (*BeaconDepositContractOwnershipHandoverRequestedIterator, error) { +// Solidity: event OperatorChangeQueued(bytes indexed pubkey, address queuedOperator, address currentOperator, uint256 queuedTimestamp) +func (_DepositContract *DepositContractFilterer) FilterOperatorChangeQueued(opts *bind.FilterOpts, pubkey [][]byte) (*DepositContractOperatorChangeQueuedIterator, error) { - var pendingOwnerRule []interface{} - for _, pendingOwnerItem := range pendingOwner { - pendingOwnerRule = append(pendingOwnerRule, pendingOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.FilterLogs(opts, "OwnershipHandoverRequested", pendingOwnerRule) + logs, sub, err := _DepositContract.contract.FilterLogs(opts, "OperatorChangeQueued", pubkeyRule) if err != nil { return nil, err } - return &BeaconDepositContractOwnershipHandoverRequestedIterator{contract: _BeaconDepositContract.contract, event: "OwnershipHandoverRequested", logs: logs, sub: sub}, nil + return &DepositContractOperatorChangeQueuedIterator{contract: _DepositContract.contract, event: "OperatorChangeQueued", logs: logs, sub: sub}, nil } -// WatchOwnershipHandoverRequested is a free log subscription operation binding the contract event 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d. +// WatchOperatorChangeQueued is a free log subscription operation binding the contract event 0x7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f. // -// Solidity: event OwnershipHandoverRequested(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHandoverRequested(opts *bind.WatchOpts, sink chan<- *BeaconDepositContractOwnershipHandoverRequested, pendingOwner []common.Address) (event.Subscription, error) { +// Solidity: event OperatorChangeQueued(bytes indexed pubkey, address queuedOperator, address currentOperator, uint256 queuedTimestamp) +func (_DepositContract *DepositContractFilterer) WatchOperatorChangeQueued(opts *bind.WatchOpts, sink chan<- *DepositContractOperatorChangeQueued, pubkey [][]byte) (event.Subscription, error) { - var pendingOwnerRule []interface{} - for _, pendingOwnerItem := range pendingOwner { - pendingOwnerRule = append(pendingOwnerRule, pendingOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.WatchLogs(opts, "OwnershipHandoverRequested", pendingOwnerRule) + logs, sub, err := _DepositContract.contract.WatchLogs(opts, "OperatorChangeQueued", pubkeyRule) if err != nil { return nil, err } @@ -896,8 +850,8 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHando select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BeaconDepositContractOwnershipHandoverRequested) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipHandoverRequested", log); err != nil { + event := new(DepositContractOperatorChangeQueued) + if err := _DepositContract.contract.UnpackLog(event, "OperatorChangeQueued", log); err != nil { return err } event.Raw = log @@ -918,21 +872,21 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipHando }), nil } -// ParseOwnershipHandoverRequested is a log parse operation binding the contract event 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d. +// ParseOperatorChangeQueued is a log parse operation binding the contract event 0x7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f. // -// Solidity: event OwnershipHandoverRequested(address indexed pendingOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) ParseOwnershipHandoverRequested(log types.Log) (*BeaconDepositContractOwnershipHandoverRequested, error) { - event := new(BeaconDepositContractOwnershipHandoverRequested) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipHandoverRequested", log); err != nil { +// Solidity: event OperatorChangeQueued(bytes indexed pubkey, address queuedOperator, address currentOperator, uint256 queuedTimestamp) +func (_DepositContract *DepositContractFilterer) ParseOperatorChangeQueued(log types.Log) (*DepositContractOperatorChangeQueued, error) { + event := new(DepositContractOperatorChangeQueued) + if err := _DepositContract.contract.UnpackLog(event, "OperatorChangeQueued", log); err != nil { return nil, err } event.Raw = log return event, nil } -// BeaconDepositContractOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipTransferredIterator struct { - Event *BeaconDepositContractOwnershipTransferred // Event containing the contract specifics and raw log +// DepositContractOperatorUpdatedIterator is returned from FilterOperatorUpdated and is used to iterate over the raw logs and unpacked data for OperatorUpdated events raised by the DepositContract contract. +type DepositContractOperatorUpdatedIterator struct { + Event *DepositContractOperatorUpdated // Event containing the contract specifics and raw log contract *bind.BoundContract // Generic contract to use for unpacking event data event string // Event name to use for unpacking event data @@ -946,7 +900,7 @@ type BeaconDepositContractOwnershipTransferredIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *BeaconDepositContractOwnershipTransferredIterator) Next() bool { +func (it *DepositContractOperatorUpdatedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -955,7 +909,7 @@ func (it *BeaconDepositContractOwnershipTransferredIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipTransferred) + it.Event = new(DepositContractOperatorUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -970,7 +924,7 @@ func (it *BeaconDepositContractOwnershipTransferredIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(BeaconDepositContractOwnershipTransferred) + it.Event = new(DepositContractOperatorUpdated) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -986,60 +940,53 @@ func (it *BeaconDepositContractOwnershipTransferredIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *BeaconDepositContractOwnershipTransferredIterator) Error() error { +func (it *DepositContractOperatorUpdatedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *BeaconDepositContractOwnershipTransferredIterator) Close() error { +func (it *DepositContractOperatorUpdatedIterator) Close() error { it.sub.Unsubscribe() return nil } -// BeaconDepositContractOwnershipTransferred represents a OwnershipTransferred event raised by the BeaconDepositContract contract. -type BeaconDepositContractOwnershipTransferred struct { - OldOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos +// DepositContractOperatorUpdated represents a OperatorUpdated event raised by the DepositContract contract. +type DepositContractOperatorUpdated struct { + Pubkey common.Hash + NewOperator common.Address + PreviousOperator common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// FilterOperatorUpdated is a free log retrieval operation binding the contract event 0x0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403. // -// Solidity: event OwnershipTransferred(address indexed oldOwner, address indexed newOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, oldOwner []common.Address, newOwner []common.Address) (*BeaconDepositContractOwnershipTransferredIterator, error) { +// Solidity: event OperatorUpdated(bytes indexed pubkey, address newOperator, address previousOperator) +func (_DepositContract *DepositContractFilterer) FilterOperatorUpdated(opts *bind.FilterOpts, pubkey [][]byte) (*DepositContractOperatorUpdatedIterator, error) { - var oldOwnerRule []interface{} - for _, oldOwnerItem := range oldOwner { - oldOwnerRule = append(oldOwnerRule, oldOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.FilterLogs(opts, "OwnershipTransferred", oldOwnerRule, newOwnerRule) + logs, sub, err := _DepositContract.contract.FilterLogs(opts, "OperatorUpdated", pubkeyRule) if err != nil { return nil, err } - return &BeaconDepositContractOwnershipTransferredIterator{contract: _BeaconDepositContract.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil + return &DepositContractOperatorUpdatedIterator{contract: _DepositContract.contract, event: "OperatorUpdated", logs: logs, sub: sub}, nil } -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// WatchOperatorUpdated is a free log subscription operation binding the contract event 0x0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403. // -// Solidity: event OwnershipTransferred(address indexed oldOwner, address indexed newOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BeaconDepositContractOwnershipTransferred, oldOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { +// Solidity: event OperatorUpdated(bytes indexed pubkey, address newOperator, address previousOperator) +func (_DepositContract *DepositContractFilterer) WatchOperatorUpdated(opts *bind.WatchOpts, sink chan<- *DepositContractOperatorUpdated, pubkey [][]byte) (event.Subscription, error) { - var oldOwnerRule []interface{} - for _, oldOwnerItem := range oldOwner { - oldOwnerRule = append(oldOwnerRule, oldOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) + var pubkeyRule []interface{} + for _, pubkeyItem := range pubkey { + pubkeyRule = append(pubkeyRule, pubkeyItem) } - logs, sub, err := _BeaconDepositContract.contract.WatchLogs(opts, "OwnershipTransferred", oldOwnerRule, newOwnerRule) + logs, sub, err := _DepositContract.contract.WatchLogs(opts, "OperatorUpdated", pubkeyRule) if err != nil { return nil, err } @@ -1049,8 +996,8 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipTrans select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(BeaconDepositContractOwnershipTransferred) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + event := new(DepositContractOperatorUpdated) + if err := _DepositContract.contract.UnpackLog(event, "OperatorUpdated", log); err != nil { return err } event.Raw = log @@ -1071,12 +1018,12 @@ func (_BeaconDepositContract *BeaconDepositContractFilterer) WatchOwnershipTrans }), nil } -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// ParseOperatorUpdated is a log parse operation binding the contract event 0x0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403. // -// Solidity: event OwnershipTransferred(address indexed oldOwner, address indexed newOwner) -func (_BeaconDepositContract *BeaconDepositContractFilterer) ParseOwnershipTransferred(log types.Log) (*BeaconDepositContractOwnershipTransferred, error) { - event := new(BeaconDepositContractOwnershipTransferred) - if err := _BeaconDepositContract.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { +// Solidity: event OperatorUpdated(bytes indexed pubkey, address newOperator, address previousOperator) +func (_DepositContract *DepositContractFilterer) ParseOperatorUpdated(log types.Log) (*DepositContractOperatorUpdated, error) { + event := new(DepositContractOperatorUpdated) + if err := _DepositContract.contract.UnpackLog(event, "OperatorUpdated", log); err != nil { return nil, err } event.Raw = log diff --git a/geth-primitives/deposit/contract.go b/geth-primitives/deposit/contract.go index 8dc19ccd7c..abc9b022aa 100644 --- a/geth-primitives/deposit/contract.go +++ b/geth-primitives/deposit/contract.go @@ -22,4 +22,4 @@ package deposit // TODO: Remove ldflags=-checklinkname=0 override once fix is applied. // -//go:generate go run -ldflags=-checklinkname=0 github.com/ethereum/go-ethereum/cmd/abigen --abi=../../contracts/out/PermissionedDepositContract.sol/PermissionedDepositContract.abi.json --bin=../../contracts/out/PermissionedDepositContract.sol/PermissionedDepositContract.bin --pkg=deposit --type=BeaconDepositContract --out=contract.abigen.go +//go:generate go run -ldflags=-checklinkname=0 github.com/ethereum/go-ethereum/cmd/abigen --abi=../../contracts/out/DepositContract.sol/DepositContract.abi.json --bin=../../contracts/out/DepositContract.sol/DepositContract.bin --pkg=deposit --type=DepositContract --out=contract.abigen.go diff --git a/kurtosis/src/networks/kurtosis-devnet/network-configs/genesis.json b/kurtosis/src/networks/kurtosis-devnet/network-configs/genesis.json index d83dabe2ec..5e8b0ac5d0 100644 --- a/kurtosis/src/networks/kurtosis-devnet/network-configs/genesis.json +++ b/kurtosis/src/networks/kurtosis-devnet/network-configs/genesis.json @@ -352,10 +352,7 @@ "0x4242424242424242424242424242424242424242": { "balance": "0x0", "nonce": "0x1", - "code": "0x6080604052600436106100c3575f3560e01c80635b70fa2911610071578063f04e283e1161004c578063f04e283e14610207578063f2fde38b1461021a578063fee81cf41461022d575f80fd5b80635b70fa2914610199578063715018a6146101ac5780638da5cb5b146101b4575f80fd5b80633198a6b8116100a15780633198a6b81461013d57806354d1f13d146101725780635a7517ad1461017a575f80fd5b806301ffc9a7146100c757806325692962146100fb5780632dfdf0b514610105575b5f80fd5b3480156100d2575f80fd5b506100e66100e1366004610809565b61026c565b60405190151581526020015b60405180910390f35b610103610304565b005b348015610110575f80fd5b505f546101249067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100f2565b348015610148575f80fd5b50610124610157366004610877565b60016020525f908152604090205467ffffffffffffffff1681565b610103610351565b348015610185575f80fd5b506101036101943660046108a7565b61038a565b6101036101a736600461091d565b6103f0565b6101036104a5565b3480156101bf575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f2565b610103610215366004610877565b6104b8565b610103610228366004610877565b6104f5565b348015610238575f80fd5b5061025e610247366004610877565b63389a75e1600c9081525f91909152602090205490565b6040519081526020016100f2565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b70fa2900000000000000000000000000000000000000000000000000000000145b92915050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61039261051b565b73ffffffffffffffffffffffffffffffffffffffff919091165f90815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091179055565b335f9081526001602052604081205467ffffffffffffffff169003610441576040517fce7ccd9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260016020526040812080549091906104679067ffffffffffffffff166109cd565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061049c87878787878787610550565b50505050505050565b6104ad61051b565b6104b65f6106e0565b565b6104c061051b565b63389a75e1600c52805f526020600c2080544211156104e657636f5e88185f526004601cfd5b5f90556104f2816106e0565b50565b6104fd61051b565b8060601b61051257637448fbae5f526004601cfd5b6104f2816106e0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146104b6576382b429005f526004601cfd5b6030861461058a576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146105c4576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081146105fe576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6106088461074e565b905064077359400067ffffffffffffffff82161015610653576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116600167ffffffffffffffff928316908101909216179091556040517f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46916106ce918b918b918b918b9188918b918b9190610a7a565b60405180910390a15050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217905550565b5f61075d633b9aca0034610b12565b15610794576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6107a3633b9aca0034610b25565b905067ffffffffffffffff8111156107e7576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102fe5f345f385f3884865af16108055763b12d13eb5f526004601cfd5b5050565b5f60208284031215610819575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610848575f80fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610872575f80fd5b919050565b5f60208284031215610887575f80fd5b6108488261084f565b803567ffffffffffffffff81168114610872575f80fd5b5f80604083850312156108b8575f80fd5b6108c18361084f565b91506108cf60208401610890565b90509250929050565b5f8083601f8401126108e8575f80fd5b50813567ffffffffffffffff8111156108ff575f80fd5b602083019150836020828501011115610916575f80fd5b9250929050565b5f805f805f805f6080888a031215610933575f80fd5b873567ffffffffffffffff811115610949575f80fd5b6109558a828b016108d8565b909850965050602088013567ffffffffffffffff811115610974575f80fd5b6109808a828b016108d8565b9096509450610993905060408901610890565b9250606088013567ffffffffffffffff8111156109ae575f80fd5b6109ba8a828b016108d8565b989b979a50959850939692959293505050565b5f67ffffffffffffffff821680610a0b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f610a8d60a083018a8c610a33565b8281036020840152610aa081898b610a33565b905067ffffffffffffffff871660408401528281036060840152610ac5818688610a33565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82610b2057610b20610ae5565b500690565b5f82610b3357610b33610ae5565b50049056fea2646970667358221220b08e6fc3b9c94a2f65976bacf514e878deea80490a6ebe3959e6047117451a1464736f6c634300081a0033", - "storage": { - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927": "0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4" - } + "code": "0x608060405260043610610093575f3560e01c8063577212fe11610066578063c53925d91161004c578063c53925d914610231578063e12cf4cb14610250578063fea7ab7714610263575f80fd5b8063577212fe146101cc5780639eaffa96146101ed575f80fd5b806301ffc9a7146100975780632dfdf0b5146100cb5780633523f9bd14610103578063560036ec14610126575b5f80fd5b3480156100a2575f80fd5b506100b66100b1366004610c22565b610282565b60405190151581526020015b60405180910390f35b3480156100d6575f80fd5b505f546100ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100c2565b34801561010e575f80fd5b5061011860015481565b6040519081526020016100c2565b348015610131575f80fd5b50610193610140366004610c95565b80516020818301810180516003825292820191909301209152546bffffffffffffffffffffffff8116906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1682565b604080516bffffffffffffffffffffffff909316835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100c2565b3480156101d7575f80fd5b506101eb6101e6366004610dca565b61031a565b005b3480156101f8575f80fd5b5061020c610207366004610dca565b6103f0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c2565b34801561023c575f80fd5b506101eb61024b366004610dca565b610431565b6101eb61025e366004610e2c565b610658565b34801561026e575f80fd5b506101eb61027d366004610edb565b6109ab565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061031457507fffffffff0000000000000000000000000000000000000000000000000000000082167f136f920d00000000000000000000000000000000000000000000000000000000145b92915050565b6002828260405161032c929190610f2b565b908152604051908190036020019020543373ffffffffffffffffffffffffffffffffffffffff9091161461038c576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003828260405161039e929190610f2b565b9081526040519081900360200181205f90556103bd9083908390610f2b565b604051908190038120907f1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db905f90a25050565b5f60028383604051610403929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16905092915050565b5f60038383604051610444929190610f2b565b908152604051908190036020019020805490915073ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000820416906bffffffffffffffffffffffff163382146104c6576040517f819a0d0b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6bffffffffffffffffffffffff42166104e26201518083610f67565b6bffffffffffffffffffffffff161115610528576040517fe8966d7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6002868660405161053b929190610f2b565b9081526040519081900360200181205473ffffffffffffffffffffffffffffffffffffffff16915083906002906105759089908990610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091556003906105da9088908890610f2b565b9081526040519081900360200181205f90556105f99087908790610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a2505050505050565b60308614610692576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146106cc576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608214610706576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff166002888860405161072f929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16036108765773ffffffffffffffffffffffffffffffffffffffff81166107a7576040517f51969a7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600288886040516107ba929190610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff00000000000000000000000000000000000000009093169290921790915561081c9088908890610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff841683525f6020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a26108c4565b73ffffffffffffffffffffffffffffffffffffffff8116156108c4576040517fc4142b4100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108cd610b5d565b9050633b9aca0067ffffffffffffffff82161015610917576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46918a918a918a918a9187918b918b9167ffffffffffffffff16908061095f83610f8b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051610999989796959493929190610ffe565b60405180910390a15050505050505050565b5f600284846040516109be929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff169050338114610a1f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a6c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60038585604051610a7f929190610f2b565b908152604051908190036020018120426bffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff86166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000000000000000161781559150610af79086908690610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff8681168452851660208401524283830152905190917f7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f919081900360600190a25050505050565b5f610b6c633b9aca0034611096565b15610ba3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb2633b9aca00346110a9565b905067ffffffffffffffff811115610bf6576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c005f34610c05565b919050565b5f385f3884865af1610c1e5763b12d13eb5f526004601cfd5b5050565b5f60208284031215610c32575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c61575f80fd5b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215610ca5575f80fd5b813567ffffffffffffffff811115610cbb575f80fd5b8201601f81018413610ccb575f80fd5b803567ffffffffffffffff811115610ce557610ce5610c68565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff82111715610d5157610d51610c68565b604052818152828201602001861015610d68575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f8083601f840112610d95575f80fd5b50813567ffffffffffffffff811115610dac575f80fd5b602083019150836020828501011115610dc3575f80fd5b9250929050565b5f8060208385031215610ddb575f80fd5b823567ffffffffffffffff811115610df1575f80fd5b610dfd85828601610d85565b90969095509350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c00575f80fd5b5f805f805f805f6080888a031215610e42575f80fd5b873567ffffffffffffffff811115610e58575f80fd5b610e648a828b01610d85565b909850965050602088013567ffffffffffffffff811115610e83575f80fd5b610e8f8a828b01610d85565b909650945050604088013567ffffffffffffffff811115610eae575f80fd5b610eba8a828b01610d85565b9094509250610ecd905060608901610e09565b905092959891949750929550565b5f805f60408486031215610eed575f80fd5b833567ffffffffffffffff811115610f03575f80fd5b610f0f86828701610d85565b9094509250610f22905060208501610e09565b90509250925092565b818382375f9101908152919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6bffffffffffffffffffffffff818116838216019081111561031457610314610f3a565b5f67ffffffffffffffff821667ffffffffffffffff8103610fae57610fae610f3a565b60010192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f61101160a083018a8c610fb7565b828103602084015261102481898b610fb7565b905067ffffffffffffffff871660408401528281036060840152611049818688610fb7565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826110a4576110a4611069565b500690565b5f826110b7576110b7611069565b50049056fea264697066735822122069227307258cbe8f29985bb4f3e283b1b03d5c0cbab8add81bf3c22e3d13729664736f6c634300081a0033" } } } diff --git a/kurtosis/src/nodes/consensus/beacond/launcher.star b/kurtosis/src/nodes/consensus/beacond/launcher.star index c32b00c17c..f65e797e7d 100644 --- a/kurtosis/src/nodes/consensus/beacond/launcher.star +++ b/kurtosis/src/nodes/consensus/beacond/launcher.star @@ -69,6 +69,8 @@ def get_config(node_struct, engine_dial_url, entrypoint = [], cmd = [], persiste "BEACOND_PERSISTENT_PEERS": persistent_peers, "BEACOND_ENABLE_PROMETHEUS": "true", "BEACOND_CONSENSUS_KEY_ALGO": "bls12_381", + "WITHDRAWAL_ADDRESS": "0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4", + "DEPOSIT_AMOUNT": "32000000000", }, ports = exposed_ports, labels = node_labels, @@ -127,7 +129,7 @@ def init_consensus_nodes(): # Check if genesis file exists, if not then initialize the beacond init_node = "if [ ! -f {} ]; then /usr/bin/beacond init --chain-id {} {} --home {}; fi".format(genesis_file, "$BEACOND_CHAIN_ID", "$BEACOND_MONIKER", "$BEACOND_HOME") - add_validator = "/usr/bin/beacond genesis add-premined-deposit --home {}".format("$BEACOND_HOME") + add_validator = "/usr/bin/beacond genesis add-premined-deposit {} {} --home {}".format("$DEPOSIT_AMOUNT", "$WITHDRAWAL_ADDRESS", "$BEACOND_HOME") collect_gentx = "/usr/bin/beacond genesis collect-premined-deposits --home {}".format("$BEACOND_HOME") return "{} && {} && {}".format(init_node, add_validator, collect_gentx) diff --git a/kurtosis/src/nodes/consensus/beacond/node.star b/kurtosis/src/nodes/consensus/beacond/node.star index 882df6233a..9d2cbb861b 100644 --- a/kurtosis/src/nodes/consensus/beacond/node.star +++ b/kurtosis/src/nodes/consensus/beacond/node.star @@ -58,4 +58,6 @@ def get_genesis_env_vars(cl_service_name): "BEACOND_ENABLE_PROMETHEUS": "true", "BEACOND_CONSENSUS_KEY_ALGO": "bls12_381", "ETH_GENESIS": "/root/eth_genesis/genesis.json", + "WITHDRAWAL_ADDRESS": "0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4", + "DEPOSIT_AMOUNT": "32000000000", } diff --git a/kurtosis/src/nodes/consensus/beacond/scripts/multiple-premined-deposits.sh b/kurtosis/src/nodes/consensus/beacond/scripts/multiple-premined-deposits.sh index 7fcb684411..60f15d7a27 100644 --- a/kurtosis/src/nodes/consensus/beacond/scripts/multiple-premined-deposits.sh +++ b/kurtosis/src/nodes/consensus/beacond/scripts/multiple-premined-deposits.sh @@ -21,7 +21,7 @@ /usr/bin/beacond init --chain-id $BEACOND_CHAIN_ID $BEACOND_MONIKER --home /tmp/config0/.beacond --consensus-key-algo $BEACOND_CONSENSUS_KEY_ALGO -/usr/bin/beacond genesis add-premined-deposit --home /tmp/config0/.beacond +/usr/bin/beacond genesis add-premined-deposit $DEPOSIT_AMOUNT $WITHDRAWAL_ADDRESS --home /tmp/config0/.beacond cp -r /tmp/config0 /tmp/config_genesis for ((i=1; i<$NUM_VALS; i++)); do @@ -29,7 +29,7 @@ for ((i=1; i<$NUM_VALS; i++)); do echo $BEACOND_HOME BEACOND_MONIKER=cl-validator-beaconkit-${i} /usr/bin/beacond init --chain-id $BEACOND_CHAIN_ID $BEACOND_MONIKER --home $BEACOND_HOME --consensus-key-algo $BEACOND_CONSENSUS_KEY_ALGO - /usr/bin/beacond genesis add-premined-deposit --home $BEACOND_HOME + /usr/bin/beacond genesis add-premined-deposit $DEPOSIT_AMOUNT $WITHDRAWAL_ADDRESS --home $BEACOND_HOME cp -r /tmp/config${i}/.beacond/config/premined-deposits/premined-deposit* /tmp/config_genesis/.beacond/config/premined-deposits/ done diff --git a/kurtosis/src/nodes/execution/nethermind/genesis.json b/kurtosis/src/nodes/execution/nethermind/genesis.json index 33baa31fb3..3d7fbb698d 100644 --- a/kurtosis/src/nodes/execution/nethermind/genesis.json +++ b/kurtosis/src/nodes/execution/nethermind/genesis.json @@ -394,7 +394,7 @@ "0x4242424242424242424242424242424242424242": { "balance": "0x0", "nonce": "0x1", - "code": "0x6080604052600436106100b8575f3560e01c80635f53837f11610071578063f04e283e1161004c578063f04e283e146101b1578063f2fde38b146101c4578063fee81cf4146101d7575f80fd5b80635f53837f14610142578063715018a6146101565780638da5cb5b1461015e575f80fd5b806354d1f13d116100a157806354d1f13d146101085780635a7517ad146101105780635b70fa291461012f575f80fd5b806325692962146100bc5780632dfdf0b5146100c6575b5f80fd5b6100c4610216565b005b3480156100d1575f80fd5b505f546100ea90610100900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100c4610263565b34801561011b575f80fd5b506100c461012a36600461085a565b61029c565b6100c461013d3660046108d0565b610302565b34801561014d575f80fd5b506100c4610529565b6100c46105e2565b348015610169575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ff565b6100c46101bf366004610976565b6105f5565b6100c46101d2366004610976565b610632565b3480156101e2575f80fd5b506102086101f1366004610976565b63389a75e1600c9081525f91909152602090205490565b6040519081526020016100ff565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6102a4610658565b73ffffffffffffffffffffffffffffffffffffffff919091165f90815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091179055565b335f9081526001602052604081205467ffffffffffffffff169003610353576040517fce7ccd9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6030861461038d576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146103c7576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608114610401576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61040b8461068d565b905064077359400067ffffffffffffffff82161015610456576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f908152600160205260408120805490919061047c9067ffffffffffffffff16610996565b825467ffffffffffffffff91821661010093840a90810290830219909116179092555f80548281048416600181019094169092027fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000ff9092169190911790556040517f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d4691610517918b918b918b918b9188918b918b9190610a43565b60405180910390a15050505050505050565b5f5460ff1615610599576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a656400000000000000000000000000604482015260640160405180910390fd5b6105b67320f33ce90a13a4b5e7697e3544c3083b8f8a51d4610736565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b6105ea610658565b6105f35f610799565b565b6105fd610658565b63389a75e1600c52805f526020600c20805442111561062357636f5e88185f526004601cfd5b5f905561062f81610799565b50565b61063a610658565b8060601b61064f57637448fbae5f526004601cfd5b61062f81610799565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146105f3576382b429005f526004601cfd5b5f61069c633b9aca0034610ad5565b156106d3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6106e2633b9aca0034610ae8565b905067ffffffffffffffff811115610726576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107305f346107fe565b92915050565b73ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f385f3884865af16108175763b12d13eb5f526004601cfd5b5050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461083e575f80fd5b919050565b803567ffffffffffffffff8116811461083e575f80fd5b5f806040838503121561086b575f80fd5b6108748361081b565b915061088260208401610843565b90509250929050565b5f8083601f84011261089b575f80fd5b50813567ffffffffffffffff8111156108b2575f80fd5b6020830191508360208285010111156108c9575f80fd5b9250929050565b5f805f805f805f6080888a0312156108e6575f80fd5b873567ffffffffffffffff808211156108fd575f80fd5b6109098b838c0161088b565b909950975060208a0135915080821115610921575f80fd5b61092d8b838c0161088b565b909750955085915061094160408b01610843565b945060608a0135915080821115610956575f80fd5b506109638a828b0161088b565b989b979a50959850939692959293505050565b5f60208284031215610986575f80fd5b61098f8261081b565b9392505050565b5f67ffffffffffffffff8216806109d4577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f610a5660a083018a8c6109fc565b8281036020840152610a6981898b6109fc565b905067ffffffffffffffff80881660408501528382036060850152610a8f8287896109fc565b9250808516608085015250509998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82610ae357610ae3610aa8565b500690565b5f82610af657610af6610aa8565b50049056fea26469706673582212207e24af9f2a5a84bc4dcdaa2c9805d39b5428c26cd6fbea59a3617583d355321164736f6c63430008190033" + "code": "0x608060405260043610610093575f3560e01c8063577212fe11610066578063c53925d91161004c578063c53925d914610231578063e12cf4cb14610250578063fea7ab7714610263575f80fd5b8063577212fe146101cc5780639eaffa96146101ed575f80fd5b806301ffc9a7146100975780632dfdf0b5146100cb5780633523f9bd14610103578063560036ec14610126575b5f80fd5b3480156100a2575f80fd5b506100b66100b1366004610c22565b610282565b60405190151581526020015b60405180910390f35b3480156100d6575f80fd5b505f546100ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100c2565b34801561010e575f80fd5b5061011860015481565b6040519081526020016100c2565b348015610131575f80fd5b50610193610140366004610c95565b80516020818301810180516003825292820191909301209152546bffffffffffffffffffffffff8116906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1682565b604080516bffffffffffffffffffffffff909316835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100c2565b3480156101d7575f80fd5b506101eb6101e6366004610dca565b61031a565b005b3480156101f8575f80fd5b5061020c610207366004610dca565b6103f0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c2565b34801561023c575f80fd5b506101eb61024b366004610dca565b610431565b6101eb61025e366004610e2c565b610658565b34801561026e575f80fd5b506101eb61027d366004610edb565b6109ab565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061031457507fffffffff0000000000000000000000000000000000000000000000000000000082167f136f920d00000000000000000000000000000000000000000000000000000000145b92915050565b6002828260405161032c929190610f2b565b908152604051908190036020019020543373ffffffffffffffffffffffffffffffffffffffff9091161461038c576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003828260405161039e929190610f2b565b9081526040519081900360200181205f90556103bd9083908390610f2b565b604051908190038120907f1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db905f90a25050565b5f60028383604051610403929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16905092915050565b5f60038383604051610444929190610f2b565b908152604051908190036020019020805490915073ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000820416906bffffffffffffffffffffffff163382146104c6576040517f819a0d0b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6bffffffffffffffffffffffff42166104e26201518083610f67565b6bffffffffffffffffffffffff161115610528576040517fe8966d7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6002868660405161053b929190610f2b565b9081526040519081900360200181205473ffffffffffffffffffffffffffffffffffffffff16915083906002906105759089908990610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091556003906105da9088908890610f2b565b9081526040519081900360200181205f90556105f99087908790610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a2505050505050565b60308614610692576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146106cc576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608214610706576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff166002888860405161072f929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16036108765773ffffffffffffffffffffffffffffffffffffffff81166107a7576040517f51969a7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600288886040516107ba929190610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff00000000000000000000000000000000000000009093169290921790915561081c9088908890610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff841683525f6020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a26108c4565b73ffffffffffffffffffffffffffffffffffffffff8116156108c4576040517fc4142b4100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108cd610b5d565b9050633b9aca0067ffffffffffffffff82161015610917576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46918a918a918a918a9187918b918b9167ffffffffffffffff16908061095f83610f8b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051610999989796959493929190610ffe565b60405180910390a15050505050505050565b5f600284846040516109be929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff169050338114610a1f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a6c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60038585604051610a7f929190610f2b565b908152604051908190036020018120426bffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff86166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000000000000000161781559150610af79086908690610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff8681168452851660208401524283830152905190917f7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f919081900360600190a25050505050565b5f610b6c633b9aca0034611096565b15610ba3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb2633b9aca00346110a9565b905067ffffffffffffffff811115610bf6576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c005f34610c05565b919050565b5f385f3884865af1610c1e5763b12d13eb5f526004601cfd5b5050565b5f60208284031215610c32575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c61575f80fd5b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215610ca5575f80fd5b813567ffffffffffffffff811115610cbb575f80fd5b8201601f81018413610ccb575f80fd5b803567ffffffffffffffff811115610ce557610ce5610c68565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff82111715610d5157610d51610c68565b604052818152828201602001861015610d68575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f8083601f840112610d95575f80fd5b50813567ffffffffffffffff811115610dac575f80fd5b602083019150836020828501011115610dc3575f80fd5b9250929050565b5f8060208385031215610ddb575f80fd5b823567ffffffffffffffff811115610df1575f80fd5b610dfd85828601610d85565b90969095509350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c00575f80fd5b5f805f805f805f6080888a031215610e42575f80fd5b873567ffffffffffffffff811115610e58575f80fd5b610e648a828b01610d85565b909850965050602088013567ffffffffffffffff811115610e83575f80fd5b610e8f8a828b01610d85565b909650945050604088013567ffffffffffffffff811115610eae575f80fd5b610eba8a828b01610d85565b9094509250610ecd905060608901610e09565b905092959891949750929550565b5f805f60408486031215610eed575f80fd5b833567ffffffffffffffff811115610f03575f80fd5b610f0f86828701610d85565b9094509250610f22905060208501610e09565b90509250925092565b818382375f9101908152919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6bffffffffffffffffffffffff818116838216019081111561031457610314610f3a565b5f67ffffffffffffffff821667ffffffffffffffff8103610fae57610fae610f3a565b60010192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f61101160a083018a8c610fb7565b828103602084015261102481898b610fb7565b905067ffffffffffffffff871660408401528281036060840152611049818688610fb7565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826110a4576110a4611069565b500690565b5f826110b7576110b7611069565b50049056fea264697066735822122069227307258cbe8f29985bb4f3e283b1b03d5c0cbab8add81bf3c22e3d13729664736f6c634300081a0033" } } } diff --git a/node-core/components/deposit_contract.go b/node-core/components/deposit_contract.go index 08387a3d1a..4b78148ecf 100644 --- a/node-core/components/deposit_contract.go +++ b/node-core/components/deposit_contract.go @@ -28,9 +28,9 @@ import ( "github.com/berachain/beacon-kit/primitives/common" ) -// BeaconDepositContractInput is the input for the beacon deposit contract +// DepositContractInput is the input for the deposit contract // for the dep inject framework. -type BeaconDepositContractInput[ +type DepositContractInput[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], @@ -46,9 +46,9 @@ type BeaconDepositContractInput[ ] } -// ProvideBeaconDepositContract provides a beacon deposit contract through the +// ProvideDepositContract provides a deposit contract through the // dep inject framework. -func ProvideBeaconDepositContract[ +func ProvideDepositContract[ DepositT Deposit[ DepositT, *ForkData, WithdrawalCredentials, ], @@ -59,14 +59,14 @@ func ProvideBeaconDepositContract[ WithdrawalT Withdrawal[WithdrawalT], WithdrawalsT Withdrawals[WithdrawalT], ]( - in BeaconDepositContractInput[ + in DepositContractInput[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalT, WithdrawalsT, ], -) (*deposit.WrappedBeaconDepositContract[ +) (*deposit.WrappedDepositContract[ DepositT, WithdrawalCredentials, ], error) { // Build the deposit contract. - return deposit.NewWrappedBeaconDepositContract[ + return deposit.NewWrappedDepositContract[ DepositT, WithdrawalCredentials, ]( diff --git a/scripts/build/constants.mk b/scripts/build/constants.mk index b5fd4f51bc..667942f143 100644 --- a/scripts/build/constants.mk +++ b/scripts/build/constants.mk @@ -4,4 +4,3 @@ MODULES := $(shell find . -type f -name 'go.mod' -exec dirname {} \;) MODULES := $(filter-out ./,$(MODULES)) CONTRACTS_DIR := ./contracts - diff --git a/testing/e2e/e2e_staking_test.go b/testing/e2e/e2e_staking_test.go index 3bfaab506f..723028d636 100644 --- a/testing/e2e/e2e_staking_test.go +++ b/testing/e2e/e2e_staking_test.go @@ -21,6 +21,7 @@ package e2e_test import ( + "crypto/rand" "math/big" "github.com/berachain/beacon-kit/config/spec" @@ -28,7 +29,6 @@ import ( "github.com/berachain/beacon-kit/geth-primitives/deposit" "github.com/berachain/beacon-kit/primitives/common" "github.com/berachain/beacon-kit/testing/e2e/config" - "github.com/berachain/beacon-kit/testing/e2e/suite" "github.com/ethereum/go-ethereum/accounts/abi/bind" gethcommon "github.com/ethereum/go-ethereum/common" coretypes "github.com/ethereum/go-ethereum/core/types" @@ -38,6 +38,9 @@ const ( // NumDepositsLoad is the number of deposits to load in the Deposit // Robustness e2e test. NumDepositsLoad = 500 + + // DepositAmount is the amount of BERA to deposit. + DepositAmount = 32e18 ) func (s *BeaconKitE2ESuite) TestDepositRobustness() { @@ -49,14 +52,8 @@ func (s *BeaconKitE2ESuite) TestDepositRobustness() { s.Require().NotNil(client2) // Sender account - genesisAccount := s.GenesisAccount() sender := s.TestAccounts()[1] - // Get the public key. - pubkey, err := client.GetPubKey(s.Ctx()) - s.Require().NoError(err) - s.Require().Len(pubkey, 48) - // Get the block num blkNum, err := s.JSONRPCBalancer().BlockNumber(s.Ctx()) s.Require().NoError(err) @@ -79,23 +76,12 @@ func (s *BeaconKitE2ESuite) TestDepositRobustness() { // s.Require().NoError(err) // Bind the deposit contract. - dc, err := deposit.NewBeaconDepositContract( + dc, err := deposit.NewDepositContract( gethcommon.HexToAddress(spec.DefaultDepositContractAddress), s.JSONRPCBalancer(), ) s.Require().NoError(err) - tx, err := dc.AllowDeposit(&bind.TransactOpts{ - From: genesisAccount.Address(), - Signer: genesisAccount.SignerFunc(chainID), - }, sender.Address(), NumDepositsLoad) - s.Require().NoError(err) - - // Wait for the transaction to be mined. - receipt, err := bind.WaitMined(s.Ctx(), s.JSONRPCBalancer(), tx) - s.Require().NoError(err) - s.Require().Equal(coretypes.ReceiptStatusSuccessful, receipt.Status) - // Get the nonce. nonce, err := s.JSONRPCBalancer().NonceAt( s.Ctx(), @@ -104,13 +90,35 @@ func (s *BeaconKitE2ESuite) TestDepositRobustness() { ) s.Require().NoError(err) + var ( + tx *coretypes.Transaction + receipt *coretypes.Receipt + ) for i := range NumDepositsLoad { - // Create a deposit transaction. + // Create a deposit transaction. Use the default validators' pubkeys + // if exists, otherwise pubkey is a random 48 byte slice. + var pubkey []byte + switch i { + case 0: + pubkey, err = client.GetPubKey(s.Ctx()) + s.Require().NoError(err) + s.Require().Len(pubkey, 48) + case 1: + pubkey, err = client2.GetPubKey(s.Ctx()) + s.Require().NoError(err) + s.Require().Len(pubkey, 48) + default: + pubkey = make([]byte, 48) + _, err = rand.Read(pubkey) + s.Require().NoError(err) + } + tx, err = s.generateNewDepositTx( dc, sender.Address(), sender.SignerFunc(chainID), big.NewInt(int64(nonce+uint64(i))), + pubkey, ) s.Require().NoError(err) s.Logger(). @@ -182,19 +190,12 @@ func (s *BeaconKitE2ESuite) TestDepositRobustness() { } func (s *BeaconKitE2ESuite) generateNewDepositTx( - dc *deposit.BeaconDepositContract, + dc *deposit.DepositContract, sender gethcommon.Address, signer bind.SignerFn, nonce *big.Int, + pubkey []byte, ) (*coretypes.Transaction, error) { - // Get the consensus client. - client := s.ConsensusClients()[config.DefaultClient] - s.Require().NotNil(client) - - pubkey, err := client.GetPubKey(s.Ctx()) - s.Require().NoError(err) - s.Require().Len(pubkey, 48) - // Generate the credentials. credentials := types.NewCredentialsFromExecutionAddress( common.ExecutionAddress(s.GenesisAccount().Address()), @@ -204,12 +205,11 @@ func (s *BeaconKitE2ESuite) generateNewDepositTx( signature := [96]byte{} s.Require().Len(signature[:], 96) - val, _ := big.NewFloat(32e18).Int(nil) + val, _ := big.NewFloat(DepositAmount).Int(nil) return dc.Deposit(&bind.TransactOpts{ - From: sender, - Value: val, - Signer: signer, - Nonce: nonce, - GasLimit: 600000, - }, pubkey, credentials[:], 32*suite.OneGwei, signature[:]) + From: sender, + Value: val, + Signer: signer, + Nonce: nonce, + }, pubkey, credentials[:], signature[:], sender) } diff --git a/testing/files/entrypoint.sh b/testing/files/entrypoint.sh index 291938a468..7059f8d8fb 100755 --- a/testing/files/entrypoint.sh +++ b/testing/files/entrypoint.sh @@ -73,7 +73,8 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then if [ "$CHAIN_SPEC" == "testnet" ]; then cp -f testing/networks/80084/*.toml testing/networks/80084/genesis.json ${HOMEDIR}/config else - ./build/bin/beacond genesis add-premined-deposit --home $HOMEDIR + ./build/bin/beacond genesis add-premined-deposit --home $HOMEDIR \ + 32000000000 0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4 ./build/bin/beacond genesis collect-premined-deposits --home $HOMEDIR ./build/bin/beacond genesis execution-payload "$ETH_GENESIS" --home $HOMEDIR fi diff --git a/testing/files/eth-genesis.json b/testing/files/eth-genesis.json index d29b5ecf84..724b62f600 100644 --- a/testing/files/eth-genesis.json +++ b/testing/files/eth-genesis.json @@ -352,10 +352,7 @@ "0x4242424242424242424242424242424242424242": { "balance": "0x0", "nonce": "0x1", - "code": "0x6080604052600436106100c3575f3560e01c80635b70fa2911610071578063f04e283e1161004c578063f04e283e14610207578063f2fde38b1461021a578063fee81cf41461022d575f80fd5b80635b70fa2914610199578063715018a6146101ac5780638da5cb5b146101b4575f80fd5b80633198a6b8116100a15780633198a6b81461013d57806354d1f13d146101725780635a7517ad1461017a575f80fd5b806301ffc9a7146100c757806325692962146100fb5780632dfdf0b514610105575b5f80fd5b3480156100d2575f80fd5b506100e66100e1366004610809565b61026c565b60405190151581526020015b60405180910390f35b610103610304565b005b348015610110575f80fd5b505f546101249067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100f2565b348015610148575f80fd5b50610124610157366004610877565b60016020525f908152604090205467ffffffffffffffff1681565b610103610351565b348015610185575f80fd5b506101036101943660046108a7565b61038a565b6101036101a736600461091d565b6103f0565b6101036104a5565b3480156101bf575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f2565b610103610215366004610877565b6104b8565b610103610228366004610877565b6104f5565b348015610238575f80fd5b5061025e610247366004610877565b63389a75e1600c9081525f91909152602090205490565b6040519081526020016100f2565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b70fa2900000000000000000000000000000000000000000000000000000000145b92915050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61039261051b565b73ffffffffffffffffffffffffffffffffffffffff919091165f90815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091179055565b335f9081526001602052604081205467ffffffffffffffff169003610441576040517fce7ccd9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260016020526040812080549091906104679067ffffffffffffffff166109cd565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061049c87878787878787610550565b50505050505050565b6104ad61051b565b6104b65f6106e0565b565b6104c061051b565b63389a75e1600c52805f526020600c2080544211156104e657636f5e88185f526004601cfd5b5f90556104f2816106e0565b50565b6104fd61051b565b8060601b61051257637448fbae5f526004601cfd5b6104f2816106e0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146104b6576382b429005f526004601cfd5b6030861461058a576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146105c4576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081146105fe576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6106088461074e565b905064077359400067ffffffffffffffff82161015610653576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116600167ffffffffffffffff928316908101909216179091556040517f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46916106ce918b918b918b918b9188918b918b9190610a7a565b60405180910390a15050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217905550565b5f61075d633b9aca0034610b12565b15610794576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6107a3633b9aca0034610b25565b905067ffffffffffffffff8111156107e7576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102fe5f345f385f3884865af16108055763b12d13eb5f526004601cfd5b5050565b5f60208284031215610819575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610848575f80fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610872575f80fd5b919050565b5f60208284031215610887575f80fd5b6108488261084f565b803567ffffffffffffffff81168114610872575f80fd5b5f80604083850312156108b8575f80fd5b6108c18361084f565b91506108cf60208401610890565b90509250929050565b5f8083601f8401126108e8575f80fd5b50813567ffffffffffffffff8111156108ff575f80fd5b602083019150836020828501011115610916575f80fd5b9250929050565b5f805f805f805f6080888a031215610933575f80fd5b873567ffffffffffffffff811115610949575f80fd5b6109558a828b016108d8565b909850965050602088013567ffffffffffffffff811115610974575f80fd5b6109808a828b016108d8565b9096509450610993905060408901610890565b9250606088013567ffffffffffffffff8111156109ae575f80fd5b6109ba8a828b016108d8565b989b979a50959850939692959293505050565b5f67ffffffffffffffff821680610a0b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f610a8d60a083018a8c610a33565b8281036020840152610aa081898b610a33565b905067ffffffffffffffff871660408401528281036060840152610ac5818688610a33565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82610b2057610b20610ae5565b500690565b5f82610b3357610b33610ae5565b50049056fea2646970667358221220b08e6fc3b9c94a2f65976bacf514e878deea80490a6ebe3959e6047117451a1464736f6c634300081a0033", - "storage": { - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927": "0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4" - } + "code": "0x608060405260043610610093575f3560e01c8063577212fe11610066578063c53925d91161004c578063c53925d914610231578063e12cf4cb14610250578063fea7ab7714610263575f80fd5b8063577212fe146101cc5780639eaffa96146101ed575f80fd5b806301ffc9a7146100975780632dfdf0b5146100cb5780633523f9bd14610103578063560036ec14610126575b5f80fd5b3480156100a2575f80fd5b506100b66100b1366004610c22565b610282565b60405190151581526020015b60405180910390f35b3480156100d6575f80fd5b505f546100ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100c2565b34801561010e575f80fd5b5061011860015481565b6040519081526020016100c2565b348015610131575f80fd5b50610193610140366004610c95565b80516020818301810180516003825292820191909301209152546bffffffffffffffffffffffff8116906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1682565b604080516bffffffffffffffffffffffff909316835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100c2565b3480156101d7575f80fd5b506101eb6101e6366004610dca565b61031a565b005b3480156101f8575f80fd5b5061020c610207366004610dca565b6103f0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c2565b34801561023c575f80fd5b506101eb61024b366004610dca565b610431565b6101eb61025e366004610e2c565b610658565b34801561026e575f80fd5b506101eb61027d366004610edb565b6109ab565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061031457507fffffffff0000000000000000000000000000000000000000000000000000000082167f136f920d00000000000000000000000000000000000000000000000000000000145b92915050565b6002828260405161032c929190610f2b565b908152604051908190036020019020543373ffffffffffffffffffffffffffffffffffffffff9091161461038c576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003828260405161039e929190610f2b565b9081526040519081900360200181205f90556103bd9083908390610f2b565b604051908190038120907f1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db905f90a25050565b5f60028383604051610403929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16905092915050565b5f60038383604051610444929190610f2b565b908152604051908190036020019020805490915073ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000820416906bffffffffffffffffffffffff163382146104c6576040517f819a0d0b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6bffffffffffffffffffffffff42166104e26201518083610f67565b6bffffffffffffffffffffffff161115610528576040517fe8966d7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6002868660405161053b929190610f2b565b9081526040519081900360200181205473ffffffffffffffffffffffffffffffffffffffff16915083906002906105759089908990610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091556003906105da9088908890610f2b565b9081526040519081900360200181205f90556105f99087908790610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a2505050505050565b60308614610692576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146106cc576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608214610706576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff166002888860405161072f929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16036108765773ffffffffffffffffffffffffffffffffffffffff81166107a7576040517f51969a7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600288886040516107ba929190610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff00000000000000000000000000000000000000009093169290921790915561081c9088908890610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff841683525f6020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a26108c4565b73ffffffffffffffffffffffffffffffffffffffff8116156108c4576040517fc4142b4100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108cd610b5d565b9050633b9aca0067ffffffffffffffff82161015610917576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46918a918a918a918a9187918b918b9167ffffffffffffffff16908061095f83610f8b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051610999989796959493929190610ffe565b60405180910390a15050505050505050565b5f600284846040516109be929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff169050338114610a1f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a6c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60038585604051610a7f929190610f2b565b908152604051908190036020018120426bffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff86166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000000000000000161781559150610af79086908690610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff8681168452851660208401524283830152905190917f7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f919081900360600190a25050505050565b5f610b6c633b9aca0034611096565b15610ba3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb2633b9aca00346110a9565b905067ffffffffffffffff811115610bf6576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c005f34610c05565b919050565b5f385f3884865af1610c1e5763b12d13eb5f526004601cfd5b5050565b5f60208284031215610c32575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c61575f80fd5b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215610ca5575f80fd5b813567ffffffffffffffff811115610cbb575f80fd5b8201601f81018413610ccb575f80fd5b803567ffffffffffffffff811115610ce557610ce5610c68565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff82111715610d5157610d51610c68565b604052818152828201602001861015610d68575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f8083601f840112610d95575f80fd5b50813567ffffffffffffffff811115610dac575f80fd5b602083019150836020828501011115610dc3575f80fd5b9250929050565b5f8060208385031215610ddb575f80fd5b823567ffffffffffffffff811115610df1575f80fd5b610dfd85828601610d85565b90969095509350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c00575f80fd5b5f805f805f805f6080888a031215610e42575f80fd5b873567ffffffffffffffff811115610e58575f80fd5b610e648a828b01610d85565b909850965050602088013567ffffffffffffffff811115610e83575f80fd5b610e8f8a828b01610d85565b909650945050604088013567ffffffffffffffff811115610eae575f80fd5b610eba8a828b01610d85565b9094509250610ecd905060608901610e09565b905092959891949750929550565b5f805f60408486031215610eed575f80fd5b833567ffffffffffffffff811115610f03575f80fd5b610f0f86828701610d85565b9094509250610f22905060208501610e09565b90509250925092565b818382375f9101908152919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6bffffffffffffffffffffffff818116838216019081111561031457610314610f3a565b5f67ffffffffffffffff821667ffffffffffffffff8103610fae57610fae610f3a565b60010192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f61101160a083018a8c610fb7565b828103602084015261102481898b610fb7565b905067ffffffffffffffff871660408401528281036060840152611049818688610fb7565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826110a4576110a4611069565b500690565b5f826110b7576110b7611069565b50049056fea264697066735822122069227307258cbe8f29985bb4f3e283b1b03d5c0cbab8add81bf3c22e3d13729664736f6c634300081a0033" } } } diff --git a/testing/files/eth-nether-genesis.json b/testing/files/eth-nether-genesis.json index 6b7a0885a1..e2dec2acc6 100644 --- a/testing/files/eth-nether-genesis.json +++ b/testing/files/eth-nether-genesis.json @@ -397,10 +397,7 @@ "0x4242424242424242424242424242424242424242": { "balance": "0x0", "nonce": "0x1", - "code": "0x6080604052600436106100c3575f3560e01c80635b70fa2911610071578063f04e283e1161004c578063f04e283e14610207578063f2fde38b1461021a578063fee81cf41461022d575f80fd5b80635b70fa2914610199578063715018a6146101ac5780638da5cb5b146101b4575f80fd5b80633198a6b8116100a15780633198a6b81461013d57806354d1f13d146101725780635a7517ad1461017a575f80fd5b806301ffc9a7146100c757806325692962146100fb5780632dfdf0b514610105575b5f80fd5b3480156100d2575f80fd5b506100e66100e1366004610809565b61026c565b60405190151581526020015b60405180910390f35b610103610304565b005b348015610110575f80fd5b505f546101249067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100f2565b348015610148575f80fd5b50610124610157366004610877565b60016020525f908152604090205467ffffffffffffffff1681565b610103610351565b348015610185575f80fd5b506101036101943660046108a7565b61038a565b6101036101a736600461091d565b6103f0565b6101036104a5565b3480156101bf575f80fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100f2565b610103610215366004610877565b6104b8565b610103610228366004610877565b6104f5565b348015610238575f80fd5b5061025e610247366004610877565b63389a75e1600c9081525f91909152602090205490565b6040519081526020016100f2565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b70fa2900000000000000000000000000000000000000000000000000000000145b92915050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61039261051b565b73ffffffffffffffffffffffffffffffffffffffff919091165f90815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff909216919091179055565b335f9081526001602052604081205467ffffffffffffffff169003610441576040517fce7ccd9600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f90815260016020526040812080549091906104679067ffffffffffffffff166109cd565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061049c87878787878787610550565b50505050505050565b6104ad61051b565b6104b65f6106e0565b565b6104c061051b565b63389a75e1600c52805f526020600c2080544211156104e657636f5e88185f526004601cfd5b5f90556104f2816106e0565b50565b6104fd61051b565b8060601b61051257637448fbae5f526004601cfd5b6104f2816106e0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146104b6576382b429005f526004601cfd5b6030861461058a576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146105c4576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606081146105fe576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6106088461074e565b905064077359400067ffffffffffffffff82161015610653576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116600167ffffffffffffffff928316908101909216179091556040517f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46916106ce918b918b918b918b9188918b918b9190610a7a565b60405180910390a15050505050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927805473ffffffffffffffffffffffffffffffffffffffff9092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3811560ff1b8217905550565b5f61075d633b9aca0034610b12565b15610794576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6107a3633b9aca0034610b25565b905067ffffffffffffffff8111156107e7576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6102fe5f345f385f3884865af16108055763b12d13eb5f526004601cfd5b5050565b5f60208284031215610819575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610848575f80fd5b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610872575f80fd5b919050565b5f60208284031215610887575f80fd5b6108488261084f565b803567ffffffffffffffff81168114610872575f80fd5b5f80604083850312156108b8575f80fd5b6108c18361084f565b91506108cf60208401610890565b90509250929050565b5f8083601f8401126108e8575f80fd5b50813567ffffffffffffffff8111156108ff575f80fd5b602083019150836020828501011115610916575f80fd5b9250929050565b5f805f805f805f6080888a031215610933575f80fd5b873567ffffffffffffffff811115610949575f80fd5b6109558a828b016108d8565b909850965050602088013567ffffffffffffffff811115610974575f80fd5b6109808a828b016108d8565b9096509450610993905060408901610890565b9250606088013567ffffffffffffffff8111156109ae575f80fd5b6109ba8a828b016108d8565b989b979a50959850939692959293505050565b5f67ffffffffffffffff821680610a0b577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f610a8d60a083018a8c610a33565b8281036020840152610aa081898b610a33565b905067ffffffffffffffff871660408401528281036060840152610ac5818688610a33565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82610b2057610b20610ae5565b500690565b5f82610b3357610b33610ae5565b50049056fea2646970667358221220b08e6fc3b9c94a2f65976bacf514e878deea80490a6ebe3959e6047117451a1464736f6c634300081a0033", - "storage": { - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927": "0x00000000000000000000000020f33ce90a13a4b5e7697e3544c3083b8f8a51d4" - } + "code": "0x608060405260043610610093575f3560e01c8063577212fe11610066578063c53925d91161004c578063c53925d914610231578063e12cf4cb14610250578063fea7ab7714610263575f80fd5b8063577212fe146101cc5780639eaffa96146101ed575f80fd5b806301ffc9a7146100975780632dfdf0b5146100cb5780633523f9bd14610103578063560036ec14610126575b5f80fd5b3480156100a2575f80fd5b506100b66100b1366004610c22565b610282565b60405190151581526020015b60405180910390f35b3480156100d6575f80fd5b505f546100ea9067ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016100c2565b34801561010e575f80fd5b5061011860015481565b6040519081526020016100c2565b348015610131575f80fd5b50610193610140366004610c95565b80516020818301810180516003825292820191909301209152546bffffffffffffffffffffffff8116906c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff1682565b604080516bffffffffffffffffffffffff909316835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016100c2565b3480156101d7575f80fd5b506101eb6101e6366004610dca565b61031a565b005b3480156101f8575f80fd5b5061020c610207366004610dca565b6103f0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c2565b34801561023c575f80fd5b506101eb61024b366004610dca565b610431565b6101eb61025e366004610e2c565b610658565b34801561026e575f80fd5b506101eb61027d366004610edb565b6109ab565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000148061031457507fffffffff0000000000000000000000000000000000000000000000000000000082167f136f920d00000000000000000000000000000000000000000000000000000000145b92915050565b6002828260405161032c929190610f2b565b908152604051908190036020019020543373ffffffffffffffffffffffffffffffffffffffff9091161461038c576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003828260405161039e929190610f2b565b9081526040519081900360200181205f90556103bd9083908390610f2b565b604051908190038120907f1c0a7e1bd09da292425c039309671a03de56b89a0858598aab6df6ce84b006db905f90a25050565b5f60028383604051610403929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16905092915050565b5f60038383604051610444929190610f2b565b908152604051908190036020019020805490915073ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000820416906bffffffffffffffffffffffff163382146104c6576040517f819a0d0b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6bffffffffffffffffffffffff42166104e26201518083610f67565b6bffffffffffffffffffffffff161115610528576040517fe8966d7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6002868660405161053b929190610f2b565b9081526040519081900360200181205473ffffffffffffffffffffffffffffffffffffffff16915083906002906105759089908990610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff0000000000000000000000000000000000000000909316929092179091556003906105da9088908890610f2b565b9081526040519081900360200181205f90556105f99087908790610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff808716845284166020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a2505050505050565b60308614610692576040517f9f10647200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602084146106cc576040517fb39bca1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608214610706576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff166002888860405161072f929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff16036108765773ffffffffffffffffffffffffffffffffffffffff81166107a7576040517f51969a7a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600288886040516107ba929190610f2b565b908152604051908190036020018120805473ffffffffffffffffffffffffffffffffffffffff939093167fffffffffffffffffffffffff00000000000000000000000000000000000000009093169290921790915561081c9088908890610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff841683525f6020840152917f0adffd98d3072c48341843974dffd7a910bb849ba6ca04163d43bb26feb17403910160405180910390a26108c4565b73ffffffffffffffffffffffffffffffffffffffff8116156108c4576040517fc4142b4100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6108cd610b5d565b9050633b9aca0067ffffffffffffffff82161015610917576040517f0e1eddda00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547f68af751683498a9f9be59fe8b0d52a64dd155255d85cdb29fea30b1e3f891d46918a918a918a918a9187918b918b9167ffffffffffffffff16908061095f83610f8b565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550604051610999989796959493929190610ffe565b60405180910390a15050505050505050565b5f600284846040516109be929190610f2b565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff169050338114610a1f576040517f7c214f0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610a6c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60038585604051610a7f929190610f2b565b908152604051908190036020018120426bffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff86166c01000000000000000000000000027fffffffffffffffffffffffffffffffffffffffff000000000000000000000000161781559150610af79086908690610f2b565b6040805191829003822073ffffffffffffffffffffffffffffffffffffffff8681168452851660208401524283830152905190917f7640ec3c8c4695deadda414dd20400acf275297a7c38715f9237657e97ddba5f919081900360600190a25050505050565b5f610b6c633b9aca0034611096565b15610ba3576040517f40567b3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610bb2633b9aca00346110a9565b905067ffffffffffffffff811115610bf6576040517f2aa6673400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c005f34610c05565b919050565b5f385f3884865af1610c1e5763b12d13eb5f526004601cfd5b5050565b5f60208284031215610c32575f80fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610c61575f80fd5b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215610ca5575f80fd5b813567ffffffffffffffff811115610cbb575f80fd5b8201601f81018413610ccb575f80fd5b803567ffffffffffffffff811115610ce557610ce5610c68565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff82111715610d5157610d51610c68565b604052818152828201602001861015610d68575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f8083601f840112610d95575f80fd5b50813567ffffffffffffffff811115610dac575f80fd5b602083019150836020828501011115610dc3575f80fd5b9250929050565b5f8060208385031215610ddb575f80fd5b823567ffffffffffffffff811115610df1575f80fd5b610dfd85828601610d85565b90969095509350505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c00575f80fd5b5f805f805f805f6080888a031215610e42575f80fd5b873567ffffffffffffffff811115610e58575f80fd5b610e648a828b01610d85565b909850965050602088013567ffffffffffffffff811115610e83575f80fd5b610e8f8a828b01610d85565b909650945050604088013567ffffffffffffffff811115610eae575f80fd5b610eba8a828b01610d85565b9094509250610ecd905060608901610e09565b905092959891949750929550565b5f805f60408486031215610eed575f80fd5b833567ffffffffffffffff811115610f03575f80fd5b610f0f86828701610d85565b9094509250610f22905060208501610e09565b90509250925092565b818382375f9101908152919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6bffffffffffffffffffffffff818116838216019081111561031457610314610f3a565b5f67ffffffffffffffff821667ffffffffffffffff8103610fae57610fae610f3a565b60010192915050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60a081525f61101160a083018a8c610fb7565b828103602084015261102481898b610fb7565b905067ffffffffffffffff871660408401528281036060840152611049818688610fb7565b91505067ffffffffffffffff831660808301529998505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826110a4576110a4611069565b500690565b5f826110b7576110b7611069565b50049056fea264697066735822122069227307258cbe8f29985bb4f3e283b1b03d5c0cbab8add81bf3c22e3d13729664736f6c634300081a0033" } } }