From 08683d907d5cc78b0434b8baf4e106ba2697e9aa Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 02:16:47 -0700 Subject: [PATCH 01/11] implement alias key --- cmd/createAliasKey.go | 41 + contracts/deploy-ap-config.sh | 14 + contracts/src/core/APConfig.sol | 39 + contracts/src/interfaces/IAPConfig.sol | 20 + core/chainio/abis/apconfig.abi | 1 + core/chainio/apconfig/Makefile | 2 + core/chainio/apconfig/apconfig.go | 10 + core/chainio/apconfig/binding.go | 2262 ++++++++++++++++++++++++ operator/alias.go | 70 + operator/envs.go | 10 + operator/operator.go | 6 +- 11 files changed, 2472 insertions(+), 3 deletions(-) create mode 100644 cmd/createAliasKey.go create mode 100644 contracts/deploy-ap-config.sh create mode 100644 contracts/src/core/APConfig.sol create mode 100644 contracts/src/interfaces/IAPConfig.sol create mode 100644 core/chainio/abis/apconfig.abi create mode 100644 core/chainio/apconfig/Makefile create mode 100644 core/chainio/apconfig/apconfig.go create mode 100644 core/chainio/apconfig/binding.go create mode 100644 operator/alias.go create mode 100644 operator/envs.go diff --git a/cmd/createAliasKey.go b/cmd/createAliasKey.go new file mode 100644 index 0000000..5b3b6bd --- /dev/null +++ b/cmd/createAliasKey.go @@ -0,0 +1,41 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + "github.com/spf13/cobra" + + "github.com/AvaProtocol/ap-avs/operator" +) + +var ( + createAliasKeyOption = operator.CreateAliasKeyOption{} +) + +// createAliasKeyCmd represents the createAliasKey command +var createAliasKeyCmd = &cobra.Command{ + Use: "create-alias-key", + Short: "Create an ECDSA private key only for AP AVS operation", + Long: `Generate an ECDSA private key to use for AP AVS operation. + +Instead of using the operator's ECDSA private key to interact with +Ava Protocol AVS, you can generate an alias key and use this key to +interact with Ava Protocol operator. You will still need the EigenLayer +Operator ECDSA key to register or deregister from the AVS. But once +you registered, you don't need that operator key anymore`, + Run: func(cmd *cobra.Command, args []string) { + operator.CreateOrImportAliasKey(createAliasKeyOption) + }, +} + +func init() { + rootCmd.AddCommand(createAliasKeyCmd) + + createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.PrivateKey), "ecdsa-private-key", "k", "", "a private key start with 0x to import as alias key") + + createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.Passphrase), "passphrase", "p", "", "a passpharase to encrypt your generated or import ECDSA key") + createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.Filename), "name", "n", "alias-ecdsa.key.json", "absolute or relative file path to save your ECDSA key to") + createAliasKeyCmd.MarkPersistentFlagRequired("passphrase") + createAliasKeyCmd.MarkPersistentFlagRequired("name") +} diff --git a/contracts/deploy-ap-config.sh b/contracts/deploy-ap-config.sh new file mode 100644 index 0000000..42f4309 --- /dev/null +++ b/contracts/deploy-ap-config.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -xe + +forge script \ + script/DeployAPConfig.s.sol:DeployAPConfig \ + --rpc-url $RPC_URL \ + --private-key $PRIVATE_KEY \ + --etherscan-api-key $ETHSCAN_API_KEY \ + --broadcast --verify \ + --slow \ + -vvvv + + diff --git a/contracts/src/core/APConfig.sol b/contracts/src/core/APConfig.sol new file mode 100644 index 0000000..40c8e3b --- /dev/null +++ b/contracts/src/core/APConfig.sol @@ -0,0 +1,39 @@ +pragma solidity ^0.8.12; + +import "../interfaces/IAPConfig.sol"; + +contract APConfig is IAPConfig { + // Mapping from operator address to alias address + mapping(address => address) private operatorToAlias; + mapping(address => address) private aliasToOperator; + + // Function to declare an alias for the operator + function declareAlias(address _alias) external override { + require(_alias != address(0), "Alias address cannot be the zero address"); + require(_alias != msg.sender, "Alias address cannot be the same with operator address"); + + operatorToAlias[msg.sender] = _alias; + aliasToOperator[_alias] = msg.sender; + + emit AliasDeclared(msg.sender, _alias); + } + + // Function to undeclare an alias for the operator + function undeclare() external override { + require(operatorToAlias[msg.sender] != address(0), "No alias declared for this operator"); + + delete operatorToAlias[msg.sender]; + delete aliasToOperator[operatorToAlias[msg.sender]]; + + emit AliasUndeclared(msg.sender); + } + + // Function to get the alias of an operator + function getAlias(address _operator) external view override returns (address) { + return operatorToAlias[_operator]; + } + + function getOperatorForAlias(address _alias) external view override returns (address) { + return aliasToOperator[_alias]; + } +} diff --git a/contracts/src/interfaces/IAPConfig.sol b/contracts/src/interfaces/IAPConfig.sol new file mode 100644 index 0000000..ed64727 --- /dev/null +++ b/contracts/src/interfaces/IAPConfig.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.9; + +interface IAPConfig { + // Event emitted when an alias is declared + event AliasDeclared(address indexed operator, address indexed aliasAddress); + + // Event emitted when an alias is undeclared + event AliasUndeclared(address indexed operator); + + // Function to declare an alias for the operator + function declareAlias(address _alias) external; + + // Function to undeclare an alias for the operator + function undeclare() external; + + // Function to get the alias of an operator + function getAlias(address _operator) external view returns (address); + function getOperatorForAlias(address _alias) external view returns (address); +} diff --git a/core/chainio/abis/apconfig.abi b/core/chainio/abis/apconfig.abi new file mode 100644 index 0000000..dd2545c --- /dev/null +++ b/core/chainio/abis/apconfig.abi @@ -0,0 +1 @@ +[{"type":"function","name":"declareAlias","inputs":[{"name":"_alias","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"getAlias","inputs":[{"name":"_operator","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"getOperatorForAlias","inputs":[{"name":"_alias","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"undeclare","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"AliasDeclared","inputs":[{"name":"operator","type":"address","indexed":true,"internalType":"address"},{"name":"aliasAddress","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"AliasUndeclared","inputs":[{"name":"operator","type":"address","indexed":true,"internalType":"address"}],"anonymous":false}] diff --git a/core/chainio/apconfig/Makefile b/core/chainio/apconfig/Makefile new file mode 100644 index 0000000..591272f --- /dev/null +++ b/core/chainio/apconfig/Makefile @@ -0,0 +1,2 @@ +genabi: + abigen --abi=../abis/entrypoint.abi --pkg=apconfig --type=APConfig --out=binding.go diff --git a/core/chainio/apconfig/apconfig.go b/core/chainio/apconfig/apconfig.go new file mode 100644 index 0000000..c576935 --- /dev/null +++ b/core/chainio/apconfig/apconfig.go @@ -0,0 +1,10 @@ +package apconfig + +import ( + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" +) + +func GetContract(conn *ethclient.Client, address common.Address) (*APConfig, error) { + return NewAPConfig(address, conn) +} diff --git a/core/chainio/apconfig/binding.go b/core/chainio/apconfig/binding.go new file mode 100644 index 0000000..c4df54c --- /dev/null +++ b/core/chainio/apconfig/binding.go @@ -0,0 +1,2262 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package apconfig + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// EntryPointMemoryUserOp is an auto generated low-level Go binding around an user-defined struct. +type EntryPointMemoryUserOp struct { + Sender common.Address + Nonce *big.Int + CallGasLimit *big.Int + VerificationGasLimit *big.Int + PreVerificationGas *big.Int + Paymaster common.Address + MaxFeePerGas *big.Int + MaxPriorityFeePerGas *big.Int +} + +// EntryPointUserOpInfo is an auto generated low-level Go binding around an user-defined struct. +type EntryPointUserOpInfo struct { + MUserOp EntryPointMemoryUserOp + UserOpHash [32]byte + Prefund *big.Int + ContextOffset *big.Int + PreOpGas *big.Int +} + +// IEntryPointUserOpsPerAggregator is an auto generated low-level Go binding around an user-defined struct. +type IEntryPointUserOpsPerAggregator struct { + UserOps []UserOperation + Aggregator common.Address + Signature []byte +} + +// IStakeManagerDepositInfo is an auto generated low-level Go binding around an user-defined struct. +type IStakeManagerDepositInfo struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +} + +// UserOperation is an auto generated low-level Go binding around an user-defined struct. +type UserOperation struct { + Sender common.Address + Nonce *big.Int + InitCode []byte + CallData []byte + CallGasLimit *big.Int + VerificationGasLimit *big.Int + PreVerificationGas *big.Int + MaxFeePerGas *big.Int + MaxPriorityFeePerGas *big.Int + PaymasterAndData []byte + Signature []byte +} + +// APConfigMetaData contains all meta data concerning the APConfig contract. +var APConfigMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"targetSuccess\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"targetResult\",\"type\":\"bytes\"}],\"name\":\"ExecutionResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"opIndex\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"FailedOp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderAddressResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureValidationFailed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResult\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"stakeInfo\",\"type\":\"tuple\"}],\"internalType\":\"structIEntryPoint.AggregatorStakeInfo\",\"name\":\"aggregatorInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResultWithAggregation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"}],\"name\":\"AccountDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BeforeExecution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDeposit\",\"type\":\"uint256\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureAggregatorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawTime\",\"type\":\"uint256\"}],\"name\":\"StakeUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasUsed\",\"type\":\"uint256\"}],\"name\":\"UserOperationEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"revertReason\",\"type\":\"bytes\"}],\"name\":\"UserOperationRevertReason\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SIG_VALIDATION_FAILED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"}],\"name\":\"_validateSenderAndPaymaster\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"}],\"name\":\"addStake\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getDepositInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"internalType\":\"structIStakeManager.DepositInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"getNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"getSenderAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"getUserOpHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"userOps\",\"type\":\"tuple[]\"},{\"internalType\":\"contractIAggregator\",\"name\":\"aggregator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.UserOpsPerAggregator[]\",\"name\":\"opsPerAggregator\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleAggregatedOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"ops\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.MemoryUserOp\",\"name\":\"mUserOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"contextOffset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.UserOpInfo\",\"name\":\"opInfo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"}],\"name\":\"innerHandleOp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"}],\"name\":\"nonceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"op\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"targetCallData\",\"type\":\"bytes\"}],\"name\":\"simulateHandleOp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"simulateValidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount\",\"type\":\"uint256\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", +} + +// APConfigABI is the input ABI used to generate the binding from. +// Deprecated: Use APConfigMetaData.ABI instead. +var APConfigABI = APConfigMetaData.ABI + +// APConfig is an auto generated Go binding around an Ethereum contract. +type APConfig struct { + APConfigCaller // Read-only binding to the contract + APConfigTransactor // Write-only binding to the contract + APConfigFilterer // Log filterer for contract events +} + +// APConfigCaller is an auto generated read-only Go binding around an Ethereum contract. +type APConfigCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// APConfigTransactor is an auto generated write-only Go binding around an Ethereum contract. +type APConfigTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// APConfigFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type APConfigFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// APConfigSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type APConfigSession struct { + Contract *APConfig // 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 +} + +// APConfigCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type APConfigCallerSession struct { + Contract *APConfigCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// APConfigTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type APConfigTransactorSession struct { + Contract *APConfigTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// APConfigRaw is an auto generated low-level Go binding around an Ethereum contract. +type APConfigRaw struct { + Contract *APConfig // Generic contract binding to access the raw methods on +} + +// APConfigCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type APConfigCallerRaw struct { + Contract *APConfigCaller // Generic read-only contract binding to access the raw methods on +} + +// APConfigTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type APConfigTransactorRaw struct { + Contract *APConfigTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewAPConfig creates a new instance of APConfig, bound to a specific deployed contract. +func NewAPConfig(address common.Address, backend bind.ContractBackend) (*APConfig, error) { + contract, err := bindAPConfig(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &APConfig{APConfigCaller: APConfigCaller{contract: contract}, APConfigTransactor: APConfigTransactor{contract: contract}, APConfigFilterer: APConfigFilterer{contract: contract}}, nil +} + +// NewAPConfigCaller creates a new read-only instance of APConfig, bound to a specific deployed contract. +func NewAPConfigCaller(address common.Address, caller bind.ContractCaller) (*APConfigCaller, error) { + contract, err := bindAPConfig(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &APConfigCaller{contract: contract}, nil +} + +// NewAPConfigTransactor creates a new write-only instance of APConfig, bound to a specific deployed contract. +func NewAPConfigTransactor(address common.Address, transactor bind.ContractTransactor) (*APConfigTransactor, error) { + contract, err := bindAPConfig(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &APConfigTransactor{contract: contract}, nil +} + +// NewAPConfigFilterer creates a new log filterer instance of APConfig, bound to a specific deployed contract. +func NewAPConfigFilterer(address common.Address, filterer bind.ContractFilterer) (*APConfigFilterer, error) { + contract, err := bindAPConfig(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &APConfigFilterer{contract: contract}, nil +} + +// bindAPConfig binds a generic wrapper to an already deployed contract. +func bindAPConfig(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := APConfigMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// 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 (_APConfig *APConfigRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _APConfig.Contract.APConfigCaller.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 (_APConfig *APConfigRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _APConfig.Contract.APConfigTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_APConfig *APConfigRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _APConfig.Contract.APConfigTransactor.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 (_APConfig *APConfigCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _APConfig.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 (_APConfig *APConfigTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _APConfig.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_APConfig *APConfigTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _APConfig.Contract.contract.Transact(opts, method, params...) +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_APConfig *APConfigCaller) SIGVALIDATIONFAILED(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "SIG_VALIDATION_FAILED") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_APConfig *APConfigSession) SIGVALIDATIONFAILED() (*big.Int, error) { + return _APConfig.Contract.SIGVALIDATIONFAILED(&_APConfig.CallOpts) +} + +// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. +// +// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) +func (_APConfig *APConfigCallerSession) SIGVALIDATIONFAILED() (*big.Int, error) { + return _APConfig.Contract.SIGVALIDATIONFAILED(&_APConfig.CallOpts) +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_APConfig *APConfigCaller) ValidateSenderAndPaymaster(opts *bind.CallOpts, initCode []byte, sender common.Address, paymasterAndData []byte) error { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "_validateSenderAndPaymaster", initCode, sender, paymasterAndData) + + if err != nil { + return err + } + + return err + +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_APConfig *APConfigSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { + return _APConfig.Contract.ValidateSenderAndPaymaster(&_APConfig.CallOpts, initCode, sender, paymasterAndData) +} + +// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. +// +// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() +func (_APConfig *APConfigCallerSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { + return _APConfig.Contract.ValidateSenderAndPaymaster(&_APConfig.CallOpts, initCode, sender, paymasterAndData) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_APConfig *APConfigCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_APConfig *APConfigSession) BalanceOf(account common.Address) (*big.Int, error) { + return _APConfig.Contract.BalanceOf(&_APConfig.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_APConfig *APConfigCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _APConfig.Contract.BalanceOf(&_APConfig.CallOpts, account) +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_APConfig *APConfigCaller) Deposits(opts *bind.CallOpts, arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "deposits", arg0) + + outstruct := new(struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Deposit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Staked = *abi.ConvertType(out[1], new(bool)).(*bool) + outstruct.Stake = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.UnstakeDelaySec = *abi.ConvertType(out[3], new(uint32)).(*uint32) + outstruct.WithdrawTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_APConfig *APConfigSession) Deposits(arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + return _APConfig.Contract.Deposits(&_APConfig.CallOpts, arg0) +} + +// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. +// +// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +func (_APConfig *APConfigCallerSession) Deposits(arg0 common.Address) (struct { + Deposit *big.Int + Staked bool + Stake *big.Int + UnstakeDelaySec uint32 + WithdrawTime *big.Int +}, error) { + return _APConfig.Contract.Deposits(&_APConfig.CallOpts, arg0) +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_APConfig *APConfigCaller) GetDepositInfo(opts *bind.CallOpts, account common.Address) (IStakeManagerDepositInfo, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "getDepositInfo", account) + + if err != nil { + return *new(IStakeManagerDepositInfo), err + } + + out0 := *abi.ConvertType(out[0], new(IStakeManagerDepositInfo)).(*IStakeManagerDepositInfo) + + return out0, err + +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_APConfig *APConfigSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { + return _APConfig.Contract.GetDepositInfo(&_APConfig.CallOpts, account) +} + +// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. +// +// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) +func (_APConfig *APConfigCallerSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { + return _APConfig.Contract.GetDepositInfo(&_APConfig.CallOpts, account) +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_APConfig *APConfigCaller) GetNonce(opts *bind.CallOpts, sender common.Address, key *big.Int) (*big.Int, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "getNonce", sender, key) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_APConfig *APConfigSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { + return _APConfig.Contract.GetNonce(&_APConfig.CallOpts, sender, key) +} + +// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. +// +// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) +func (_APConfig *APConfigCallerSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { + return _APConfig.Contract.GetNonce(&_APConfig.CallOpts, sender, key) +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_APConfig *APConfigCaller) GetUserOpHash(opts *bind.CallOpts, userOp UserOperation) ([32]byte, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "getUserOpHash", userOp) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_APConfig *APConfigSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { + return _APConfig.Contract.GetUserOpHash(&_APConfig.CallOpts, userOp) +} + +// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// +// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) +func (_APConfig *APConfigCallerSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { + return _APConfig.Contract.GetUserOpHash(&_APConfig.CallOpts, userOp) +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_APConfig *APConfigCaller) NonceSequenceNumber(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + var out []interface{} + err := _APConfig.contract.Call(opts, &out, "nonceSequenceNumber", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_APConfig *APConfigSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _APConfig.Contract.NonceSequenceNumber(&_APConfig.CallOpts, arg0, arg1) +} + +// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// +// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) +func (_APConfig *APConfigCallerSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { + return _APConfig.Contract.NonceSequenceNumber(&_APConfig.CallOpts, arg0, arg1) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_APConfig *APConfigTransactor) AddStake(opts *bind.TransactOpts, unstakeDelaySec uint32) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "addStake", unstakeDelaySec) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_APConfig *APConfigSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { + return _APConfig.Contract.AddStake(&_APConfig.TransactOpts, unstakeDelaySec) +} + +// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. +// +// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() +func (_APConfig *APConfigTransactorSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { + return _APConfig.Contract.AddStake(&_APConfig.TransactOpts, unstakeDelaySec) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_APConfig *APConfigTransactor) DepositTo(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "depositTo", account) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_APConfig *APConfigSession) DepositTo(account common.Address) (*types.Transaction, error) { + return _APConfig.Contract.DepositTo(&_APConfig.TransactOpts, account) +} + +// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. +// +// Solidity: function depositTo(address account) payable returns() +func (_APConfig *APConfigTransactorSession) DepositTo(account common.Address) (*types.Transaction, error) { + return _APConfig.Contract.DepositTo(&_APConfig.TransactOpts, account) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_APConfig *APConfigTransactor) GetSenderAddress(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "getSenderAddress", initCode) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_APConfig *APConfigSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { + return _APConfig.Contract.GetSenderAddress(&_APConfig.TransactOpts, initCode) +} + +// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. +// +// Solidity: function getSenderAddress(bytes initCode) returns() +func (_APConfig *APConfigTransactorSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { + return _APConfig.Contract.GetSenderAddress(&_APConfig.TransactOpts, initCode) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_APConfig *APConfigTransactor) HandleAggregatedOps(opts *bind.TransactOpts, opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "handleAggregatedOps", opsPerAggregator, beneficiary) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_APConfig *APConfigSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.Contract.HandleAggregatedOps(&_APConfig.TransactOpts, opsPerAggregator, beneficiary) +} + +// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. +// +// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() +func (_APConfig *APConfigTransactorSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.Contract.HandleAggregatedOps(&_APConfig.TransactOpts, opsPerAggregator, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_APConfig *APConfigTransactor) HandleOps(opts *bind.TransactOpts, ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "handleOps", ops, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_APConfig *APConfigSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.Contract.HandleOps(&_APConfig.TransactOpts, ops, beneficiary) +} + +// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. +// +// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() +func (_APConfig *APConfigTransactorSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { + return _APConfig.Contract.HandleOps(&_APConfig.TransactOpts, ops, beneficiary) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_APConfig *APConfigTransactor) IncrementNonce(opts *bind.TransactOpts, key *big.Int) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "incrementNonce", key) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_APConfig *APConfigSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { + return _APConfig.Contract.IncrementNonce(&_APConfig.TransactOpts, key) +} + +// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. +// +// Solidity: function incrementNonce(uint192 key) returns() +func (_APConfig *APConfigTransactorSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { + return _APConfig.Contract.IncrementNonce(&_APConfig.TransactOpts, key) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_APConfig *APConfigTransactor) InnerHandleOp(opts *bind.TransactOpts, callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "innerHandleOp", callData, opInfo, context) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_APConfig *APConfigSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _APConfig.Contract.InnerHandleOp(&_APConfig.TransactOpts, callData, opInfo, context) +} + +// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. +// +// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) +func (_APConfig *APConfigTransactorSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { + return _APConfig.Contract.InnerHandleOp(&_APConfig.TransactOpts, callData, opInfo, context) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_APConfig *APConfigTransactor) SimulateHandleOp(opts *bind.TransactOpts, op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "simulateHandleOp", op, target, targetCallData) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_APConfig *APConfigSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _APConfig.Contract.SimulateHandleOp(&_APConfig.TransactOpts, op, target, targetCallData) +} + +// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. +// +// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() +func (_APConfig *APConfigTransactorSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { + return _APConfig.Contract.SimulateHandleOp(&_APConfig.TransactOpts, op, target, targetCallData) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_APConfig *APConfigTransactor) SimulateValidation(opts *bind.TransactOpts, userOp UserOperation) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "simulateValidation", userOp) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_APConfig *APConfigSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { + return _APConfig.Contract.SimulateValidation(&_APConfig.TransactOpts, userOp) +} + +// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// +// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() +func (_APConfig *APConfigTransactorSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { + return _APConfig.Contract.SimulateValidation(&_APConfig.TransactOpts, userOp) +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_APConfig *APConfigTransactor) UnlockStake(opts *bind.TransactOpts) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "unlockStake") +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_APConfig *APConfigSession) UnlockStake() (*types.Transaction, error) { + return _APConfig.Contract.UnlockStake(&_APConfig.TransactOpts) +} + +// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// +// Solidity: function unlockStake() returns() +func (_APConfig *APConfigTransactorSession) UnlockStake() (*types.Transaction, error) { + return _APConfig.Contract.UnlockStake(&_APConfig.TransactOpts) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_APConfig *APConfigTransactor) WithdrawStake(opts *bind.TransactOpts, withdrawAddress common.Address) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "withdrawStake", withdrawAddress) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_APConfig *APConfigSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { + return _APConfig.Contract.WithdrawStake(&_APConfig.TransactOpts, withdrawAddress) +} + +// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// +// Solidity: function withdrawStake(address withdrawAddress) returns() +func (_APConfig *APConfigTransactorSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { + return _APConfig.Contract.WithdrawStake(&_APConfig.TransactOpts, withdrawAddress) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_APConfig *APConfigTransactor) WithdrawTo(opts *bind.TransactOpts, withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "withdrawTo", withdrawAddress, withdrawAmount) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_APConfig *APConfigSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _APConfig.Contract.WithdrawTo(&_APConfig.TransactOpts, withdrawAddress, withdrawAmount) +} + +// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// +// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() +func (_APConfig *APConfigTransactorSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { + return _APConfig.Contract.WithdrawTo(&_APConfig.TransactOpts, withdrawAddress, withdrawAmount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_APConfig *APConfigTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _APConfig.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_APConfig *APConfigSession) Receive() (*types.Transaction, error) { + return _APConfig.Contract.Receive(&_APConfig.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_APConfig *APConfigTransactorSession) Receive() (*types.Transaction, error) { + return _APConfig.Contract.Receive(&_APConfig.TransactOpts) +} + +// APConfigAccountDeployedIterator is returned from FilterAccountDeployed and is used to iterate over the raw logs and unpacked data for AccountDeployed events raised by the APConfig contract. +type APConfigAccountDeployedIterator struct { + Event *APConfigAccountDeployed // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigAccountDeployedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigAccountDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigAccountDeployed) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigAccountDeployedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigAccountDeployedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigAccountDeployed represents a AccountDeployed event raised by the APConfig contract. +type APConfigAccountDeployed struct { + UserOpHash [32]byte + Sender common.Address + Factory common.Address + Paymaster common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAccountDeployed is a free log retrieval operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_APConfig *APConfigFilterer) FilterAccountDeployed(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*APConfigAccountDeployedIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "AccountDeployed", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return &APConfigAccountDeployedIterator{contract: _APConfig.contract, event: "AccountDeployed", logs: logs, sub: sub}, nil +} + +// WatchAccountDeployed is a free log subscription operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_APConfig *APConfigFilterer) WatchAccountDeployed(opts *bind.WatchOpts, sink chan<- *APConfigAccountDeployed, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "AccountDeployed", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigAccountDeployed) + if err := _APConfig.contract.UnpackLog(event, "AccountDeployed", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAccountDeployed is a log parse operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. +// +// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +func (_APConfig *APConfigFilterer) ParseAccountDeployed(log types.Log) (*APConfigAccountDeployed, error) { + event := new(APConfigAccountDeployed) + if err := _APConfig.contract.UnpackLog(event, "AccountDeployed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigBeforeExecutionIterator is returned from FilterBeforeExecution and is used to iterate over the raw logs and unpacked data for BeforeExecution events raised by the APConfig contract. +type APConfigBeforeExecutionIterator struct { + Event *APConfigBeforeExecution // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigBeforeExecutionIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigBeforeExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigBeforeExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigBeforeExecutionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigBeforeExecutionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigBeforeExecution represents a BeforeExecution event raised by the APConfig contract. +type APConfigBeforeExecution struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeforeExecution is a free log retrieval operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_APConfig *APConfigFilterer) FilterBeforeExecution(opts *bind.FilterOpts) (*APConfigBeforeExecutionIterator, error) { + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "BeforeExecution") + if err != nil { + return nil, err + } + return &APConfigBeforeExecutionIterator{contract: _APConfig.contract, event: "BeforeExecution", logs: logs, sub: sub}, nil +} + +// WatchBeforeExecution is a free log subscription operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_APConfig *APConfigFilterer) WatchBeforeExecution(opts *bind.WatchOpts, sink chan<- *APConfigBeforeExecution) (event.Subscription, error) { + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "BeforeExecution") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigBeforeExecution) + if err := _APConfig.contract.UnpackLog(event, "BeforeExecution", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBeforeExecution is a log parse operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. +// +// Solidity: event BeforeExecution() +func (_APConfig *APConfigFilterer) ParseBeforeExecution(log types.Log) (*APConfigBeforeExecution, error) { + event := new(APConfigBeforeExecution) + if err := _APConfig.contract.UnpackLog(event, "BeforeExecution", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigDepositedIterator is returned from FilterDeposited and is used to iterate over the raw logs and unpacked data for Deposited events raised by the APConfig contract. +type APConfigDepositedIterator struct { + Event *APConfigDeposited // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigDepositedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigDeposited) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigDepositedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigDepositedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigDeposited represents a Deposited event raised by the APConfig contract. +type APConfigDeposited struct { + Account common.Address + TotalDeposit *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposited is a free log retrieval operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_APConfig *APConfigFilterer) FilterDeposited(opts *bind.FilterOpts, account []common.Address) (*APConfigDepositedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "Deposited", accountRule) + if err != nil { + return nil, err + } + return &APConfigDepositedIterator{contract: _APConfig.contract, event: "Deposited", logs: logs, sub: sub}, nil +} + +// WatchDeposited is a free log subscription operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_APConfig *APConfigFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *APConfigDeposited, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "Deposited", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigDeposited) + if err := _APConfig.contract.UnpackLog(event, "Deposited", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDeposited is a log parse operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. +// +// Solidity: event Deposited(address indexed account, uint256 totalDeposit) +func (_APConfig *APConfigFilterer) ParseDeposited(log types.Log) (*APConfigDeposited, error) { + event := new(APConfigDeposited) + if err := _APConfig.contract.UnpackLog(event, "Deposited", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigSignatureAggregatorChangedIterator is returned from FilterSignatureAggregatorChanged and is used to iterate over the raw logs and unpacked data for SignatureAggregatorChanged events raised by the APConfig contract. +type APConfigSignatureAggregatorChangedIterator struct { + Event *APConfigSignatureAggregatorChanged // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigSignatureAggregatorChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigSignatureAggregatorChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigSignatureAggregatorChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigSignatureAggregatorChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigSignatureAggregatorChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigSignatureAggregatorChanged represents a SignatureAggregatorChanged event raised by the APConfig contract. +type APConfigSignatureAggregatorChanged struct { + Aggregator common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignatureAggregatorChanged is a free log retrieval operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_APConfig *APConfigFilterer) FilterSignatureAggregatorChanged(opts *bind.FilterOpts, aggregator []common.Address) (*APConfigSignatureAggregatorChangedIterator, error) { + + var aggregatorRule []interface{} + for _, aggregatorItem := range aggregator { + aggregatorRule = append(aggregatorRule, aggregatorItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "SignatureAggregatorChanged", aggregatorRule) + if err != nil { + return nil, err + } + return &APConfigSignatureAggregatorChangedIterator{contract: _APConfig.contract, event: "SignatureAggregatorChanged", logs: logs, sub: sub}, nil +} + +// WatchSignatureAggregatorChanged is a free log subscription operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_APConfig *APConfigFilterer) WatchSignatureAggregatorChanged(opts *bind.WatchOpts, sink chan<- *APConfigSignatureAggregatorChanged, aggregator []common.Address) (event.Subscription, error) { + + var aggregatorRule []interface{} + for _, aggregatorItem := range aggregator { + aggregatorRule = append(aggregatorRule, aggregatorItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "SignatureAggregatorChanged", aggregatorRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigSignatureAggregatorChanged) + if err := _APConfig.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSignatureAggregatorChanged is a log parse operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. +// +// Solidity: event SignatureAggregatorChanged(address indexed aggregator) +func (_APConfig *APConfigFilterer) ParseSignatureAggregatorChanged(log types.Log) (*APConfigSignatureAggregatorChanged, error) { + event := new(APConfigSignatureAggregatorChanged) + if err := _APConfig.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigStakeLockedIterator is returned from FilterStakeLocked and is used to iterate over the raw logs and unpacked data for StakeLocked events raised by the APConfig contract. +type APConfigStakeLockedIterator struct { + Event *APConfigStakeLocked // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigStakeLockedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigStakeLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigStakeLocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigStakeLockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigStakeLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigStakeLocked represents a StakeLocked event raised by the APConfig contract. +type APConfigStakeLocked struct { + Account common.Address + TotalStaked *big.Int + UnstakeDelaySec *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeLocked is a free log retrieval operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_APConfig *APConfigFilterer) FilterStakeLocked(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeLockedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeLocked", accountRule) + if err != nil { + return nil, err + } + return &APConfigStakeLockedIterator{contract: _APConfig.contract, event: "StakeLocked", logs: logs, sub: sub}, nil +} + +// WatchStakeLocked is a free log subscription operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_APConfig *APConfigFilterer) WatchStakeLocked(opts *bind.WatchOpts, sink chan<- *APConfigStakeLocked, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeLocked", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigStakeLocked) + if err := _APConfig.contract.UnpackLog(event, "StakeLocked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeLocked is a log parse operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. +// +// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +func (_APConfig *APConfigFilterer) ParseStakeLocked(log types.Log) (*APConfigStakeLocked, error) { + event := new(APConfigStakeLocked) + if err := _APConfig.contract.UnpackLog(event, "StakeLocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigStakeUnlockedIterator is returned from FilterStakeUnlocked and is used to iterate over the raw logs and unpacked data for StakeUnlocked events raised by the APConfig contract. +type APConfigStakeUnlockedIterator struct { + Event *APConfigStakeUnlocked // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigStakeUnlockedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigStakeUnlocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigStakeUnlocked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigStakeUnlockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigStakeUnlockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigStakeUnlocked represents a StakeUnlocked event raised by the APConfig contract. +type APConfigStakeUnlocked struct { + Account common.Address + WithdrawTime *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeUnlocked is a free log retrieval operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_APConfig *APConfigFilterer) FilterStakeUnlocked(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeUnlockedIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeUnlocked", accountRule) + if err != nil { + return nil, err + } + return &APConfigStakeUnlockedIterator{contract: _APConfig.contract, event: "StakeUnlocked", logs: logs, sub: sub}, nil +} + +// WatchStakeUnlocked is a free log subscription operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_APConfig *APConfigFilterer) WatchStakeUnlocked(opts *bind.WatchOpts, sink chan<- *APConfigStakeUnlocked, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeUnlocked", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigStakeUnlocked) + if err := _APConfig.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeUnlocked is a log parse operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. +// +// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) +func (_APConfig *APConfigFilterer) ParseStakeUnlocked(log types.Log) (*APConfigStakeUnlocked, error) { + event := new(APConfigStakeUnlocked) + if err := _APConfig.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigStakeWithdrawnIterator is returned from FilterStakeWithdrawn and is used to iterate over the raw logs and unpacked data for StakeWithdrawn events raised by the APConfig contract. +type APConfigStakeWithdrawnIterator struct { + Event *APConfigStakeWithdrawn // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigStakeWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigStakeWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigStakeWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigStakeWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigStakeWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigStakeWithdrawn represents a StakeWithdrawn event raised by the APConfig contract. +type APConfigStakeWithdrawn struct { + Account common.Address + WithdrawAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStakeWithdrawn is a free log retrieval operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) FilterStakeWithdrawn(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeWithdrawnIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeWithdrawn", accountRule) + if err != nil { + return nil, err + } + return &APConfigStakeWithdrawnIterator{contract: _APConfig.contract, event: "StakeWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchStakeWithdrawn is a free log subscription operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) WatchStakeWithdrawn(opts *bind.WatchOpts, sink chan<- *APConfigStakeWithdrawn, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeWithdrawn", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigStakeWithdrawn) + if err := _APConfig.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseStakeWithdrawn is a log parse operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. +// +// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) ParseStakeWithdrawn(log types.Log) (*APConfigStakeWithdrawn, error) { + event := new(APConfigStakeWithdrawn) + if err := _APConfig.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigUserOperationEventIterator is returned from FilterUserOperationEvent and is used to iterate over the raw logs and unpacked data for UserOperationEvent events raised by the APConfig contract. +type APConfigUserOperationEventIterator struct { + Event *APConfigUserOperationEvent // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigUserOperationEventIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigUserOperationEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigUserOperationEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigUserOperationEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigUserOperationEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigUserOperationEvent represents a UserOperationEvent event raised by the APConfig contract. +type APConfigUserOperationEvent struct { + UserOpHash [32]byte + Sender common.Address + Paymaster common.Address + Nonce *big.Int + Success bool + ActualGasCost *big.Int + ActualGasUsed *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUserOperationEvent is a free log retrieval operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_APConfig *APConfigFilterer) FilterUserOperationEvent(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (*APConfigUserOperationEventIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var paymasterRule []interface{} + for _, paymasterItem := range paymaster { + paymasterRule = append(paymasterRule, paymasterItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) + if err != nil { + return nil, err + } + return &APConfigUserOperationEventIterator{contract: _APConfig.contract, event: "UserOperationEvent", logs: logs, sub: sub}, nil +} + +// WatchUserOperationEvent is a free log subscription operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_APConfig *APConfigFilterer) WatchUserOperationEvent(opts *bind.WatchOpts, sink chan<- *APConfigUserOperationEvent, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var paymasterRule []interface{} + for _, paymasterItem := range paymaster { + paymasterRule = append(paymasterRule, paymasterItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigUserOperationEvent) + if err := _APConfig.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUserOperationEvent is a log parse operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. +// +// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +func (_APConfig *APConfigFilterer) ParseUserOperationEvent(log types.Log) (*APConfigUserOperationEvent, error) { + event := new(APConfigUserOperationEvent) + if err := _APConfig.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigUserOperationRevertReasonIterator is returned from FilterUserOperationRevertReason and is used to iterate over the raw logs and unpacked data for UserOperationRevertReason events raised by the APConfig contract. +type APConfigUserOperationRevertReasonIterator struct { + Event *APConfigUserOperationRevertReason // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigUserOperationRevertReasonIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigUserOperationRevertReason) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigUserOperationRevertReason) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigUserOperationRevertReasonIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigUserOperationRevertReasonIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigUserOperationRevertReason represents a UserOperationRevertReason event raised by the APConfig contract. +type APConfigUserOperationRevertReason struct { + UserOpHash [32]byte + Sender common.Address + Nonce *big.Int + RevertReason []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUserOperationRevertReason is a free log retrieval operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_APConfig *APConfigFilterer) FilterUserOperationRevertReason(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*APConfigUserOperationRevertReasonIterator, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return &APConfigUserOperationRevertReasonIterator{contract: _APConfig.contract, event: "UserOperationRevertReason", logs: logs, sub: sub}, nil +} + +// WatchUserOperationRevertReason is a free log subscription operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_APConfig *APConfigFilterer) WatchUserOperationRevertReason(opts *bind.WatchOpts, sink chan<- *APConfigUserOperationRevertReason, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { + + var userOpHashRule []interface{} + for _, userOpHashItem := range userOpHash { + userOpHashRule = append(userOpHashRule, userOpHashItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigUserOperationRevertReason) + if err := _APConfig.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUserOperationRevertReason is a log parse operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// +// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +func (_APConfig *APConfigFilterer) ParseUserOperationRevertReason(log types.Log) (*APConfigUserOperationRevertReason, error) { + event := new(APConfigUserOperationRevertReason) + if err := _APConfig.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// APConfigWithdrawnIterator is returned from FilterWithdrawn and is used to iterate over the raw logs and unpacked data for Withdrawn events raised by the APConfig contract. +type APConfigWithdrawnIterator struct { + Event *APConfigWithdrawn // 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 + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// 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 *APConfigWithdrawnIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(APConfigWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(APConfigWithdrawn) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *APConfigWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *APConfigWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// APConfigWithdrawn represents a Withdrawn event raised by the APConfig contract. +type APConfigWithdrawn struct { + Account common.Address + WithdrawAddress common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdrawn is a free log retrieval operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) FilterWithdrawn(opts *bind.FilterOpts, account []common.Address) (*APConfigWithdrawnIterator, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.FilterLogs(opts, "Withdrawn", accountRule) + if err != nil { + return nil, err + } + return &APConfigWithdrawnIterator{contract: _APConfig.contract, event: "Withdrawn", logs: logs, sub: sub}, nil +} + +// WatchWithdrawn is a free log subscription operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *APConfigWithdrawn, account []common.Address) (event.Subscription, error) { + + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + + logs, sub, err := _APConfig.contract.WatchLogs(opts, "Withdrawn", accountRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(APConfigWithdrawn) + if err := _APConfig.contract.UnpackLog(event, "Withdrawn", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseWithdrawn is a log parse operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// +// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +func (_APConfig *APConfigFilterer) ParseWithdrawn(log types.Log) (*APConfigWithdrawn, error) { + event := new(APConfigWithdrawn) + if err := _APConfig.contract.UnpackLog(event, "Withdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/operator/alias.go b/operator/alias.go new file mode 100644 index 0000000..a0b7f00 --- /dev/null +++ b/operator/alias.go @@ -0,0 +1,70 @@ +package operator + +import ( + "crypto/ecdsa" + "fmt" + + "github.com/ethereum/go-ethereum/crypto" + + eigensdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" +) + +type CreateAliasKeyOption struct { + Filename string // full path to the ecdsa json key file + Passphrase string + PrivateKey string +} + +// Create or import +func CreateOrImportAliasKey(o CreateAliasKeyOption) { + var err error + var aliasEcdsaPair *ecdsa.PrivateKey + + if len(o.Passphrase) == 0 { + fmt.Printf("missing pass phrase. aborted\n") + return + } + + if len(o.Passphrase) <= 12 { + fmt.Printf("Pass pharease is too short, it should have at least 12 character. aborted\n") + return + } + + aliasEcdsaPair, err = eigensdkecdsa.ReadKey(o.Filename, o.Passphrase) + if err == nil { + fmt.Printf("%s key already existed. we won't override the key.\nTo write to a different file, set the `--name` parameter.\nUse `--help` to view parameter detail.\n", o.Filename) + return + } + + if o.PrivateKey == "" { + aliasEcdsaPair, err = crypto.GenerateKey() + if err != nil { + panic(fmt.Errorf("cannot generate key %w", err)) + } + } else { + aliasEcdsaPair, err = crypto.HexToECDSA(o.PrivateKey) + if err != nil { + panic(fmt.Errorf("cannot import provided private key %s with error: %w", o.PrivateKey, err)) + } + } + + if err = eigensdkecdsa.WriteKey(o.Filename, aliasEcdsaPair, o.Passphrase); err != nil { + fmt.Printf("Error writing the file %s: %v\n", o.Filename, err) + return + } + + fmt.Printf("alias key is succesfully written to %s and encrypted with your provider passphrease.\n", o.Filename) +} + +// Declare alias key for the operator +func DeclareAliasKey(configPath, address string) { + operator, err := NewOperatorFromConfigFile(configPath) + if err != nil { + fmt.Errorf("error creator operator from config: %w", err) + } + + err = operator.DeclareAlias(address) +} + +func (o *Operator) DeclareAlias(address string) { +} diff --git a/operator/envs.go b/operator/envs.go new file mode 100644 index 0000000..3d46d3a --- /dev/null +++ b/operator/envs.go @@ -0,0 +1,10 @@ +package operator + +import "math/big" + +// Populate configuration based on known env +// TODO: We can fetch this dynamically from aggregator so we can upgrade the +// config without the need to release operator +func (o *Operator) PopulateKnownConfigByChainID(chainID big.Int) error { + +} diff --git a/operator/operator.go b/operator/operator.go index e1bc66f..d3782aa 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -173,15 +173,15 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { logger.Errorf("Cannot parse bls private key: %s err: %w", c.BlsPrivateKeyStorePath, err) return nil, err } - // TODO(samlaf): should we add the chainId to the config instead? - // this way we can prevent creating a signer that signs on mainnet by mistake - // if the config says chainId=5, then we can only create a goerli signer + chainId, err := ethRpcClient.ChainID(context.Background()) if err != nil { logger.Error("Cannot get chainId", "err", err) return nil, err } + o.PopulateKnownConfigByChainID(chainId) + ecdsaKeyPassword, ok := os.LookupEnv("OPERATOR_ECDSA_KEY_PASSWORD") if !ok { logger.Warnf("OPERATOR_ECDSA_KEY_PASSWORD env var not set. using empty string") From b43aa19f736679f2ab7c2c6074db78a30a71e218 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 03:33:45 -0700 Subject: [PATCH 02/11] send onchain transaction to register alias --- README.md | 1 + cmd/createAliasKey.go | 10 +- cmd/declareAlias.go | 30 + core/chainio/apconfig/Makefile | 2 +- core/chainio/apconfig/binding.go | 1934 ++---------------------------- operator/alias.go | 64 +- operator/envs.go | 20 +- operator/operator.go | 26 +- operator/password.go | 21 + 9 files changed, 275 insertions(+), 1833 deletions(-) create mode 100644 cmd/declareAlias.go create mode 100644 operator/password.go diff --git a/README.md b/README.md index facdda4..e85a510 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ Coming soon | OperatorStateRetriever | [`0xb7bb920538e038DFFEfcB55caBf713652ED2031F`](https://holesky.etherscan.io/address/0xb7bb920538e038DFFEfcB55caBf713652ED2031F) | | PauserRegistry | [`0x3A8ea6e4202CdDe4a9e0cCE19c4Dc1739ba2cF0b`](https://holesky.etherscan.io/address/0x3A8ea6e4202CdDe4a9e0cCE19c4Dc1739ba2cF0b) | | StakeRegistry | [`0x7BacD5dd5A7C3acf8bf1a3c88fB0D00B68EE626A`](https://holesky.etherscan.io/address/0x7BacD5dd5A7C3acf8bf1a3c88fB0D00B68EE626A) | +| ApConfig | [`0xb8abbb082ecaae8d1cd68378cf3b060f6f0e07eb`](https://holesky.etherscan.io/address/0xb8abbb082ecaae8d1cd68378cf3b060f6f0e07eb) | diff --git a/cmd/createAliasKey.go b/cmd/createAliasKey.go index 5b3b6bd..efb9710 100644 --- a/cmd/createAliasKey.go +++ b/cmd/createAliasKey.go @@ -10,7 +10,7 @@ import ( ) var ( - createAliasKeyOption = operator.CreateAliasKeyOption{} + aliasKeyOption = operator.CreateAliasKeyOption{} ) // createAliasKeyCmd represents the createAliasKey command @@ -25,17 +25,15 @@ interact with Ava Protocol operator. You will still need the EigenLayer Operator ECDSA key to register or deregister from the AVS. But once you registered, you don't need that operator key anymore`, Run: func(cmd *cobra.Command, args []string) { - operator.CreateOrImportAliasKey(createAliasKeyOption) + operator.CreateOrImportAliasKey(aliasKeyOption) }, } func init() { rootCmd.AddCommand(createAliasKeyCmd) - createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.PrivateKey), "ecdsa-private-key", "k", "", "a private key start with 0x to import as alias key") + createAliasKeyCmd.Flags().StringVarP(&(aliasKeyOption.PrivateKey), "ecdsa-private-key", "k", "", "a private key start with 0x to import as alias key") - createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.Passphrase), "passphrase", "p", "", "a passpharase to encrypt your generated or import ECDSA key") - createAliasKeyCmd.Flags().StringVarP(&(createAliasKeyOption.Filename), "name", "n", "alias-ecdsa.key.json", "absolute or relative file path to save your ECDSA key to") - createAliasKeyCmd.MarkPersistentFlagRequired("passphrase") + createAliasKeyCmd.Flags().StringVarP(&(aliasKeyOption.Filename), "name", "n", "alias-ecdsa.key.json", "absolute or relative file path to save your ECDSA key to") createAliasKeyCmd.MarkPersistentFlagRequired("name") } diff --git a/cmd/declareAlias.go b/cmd/declareAlias.go new file mode 100644 index 0000000..54aa1df --- /dev/null +++ b/cmd/declareAlias.go @@ -0,0 +1,30 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + "github.com/spf13/cobra" + + "github.com/AvaProtocol/ap-avs/operator" +) + +// declareAliasCmd represents the declareAlias command +var declareAliasCmd = &cobra.Command{ + Use: "declare-alias", + Short: "Declare an alias ecdsa key file for the operator address", + Long: `Declare an alias ecdsa key file for the operator address + +After creating an alias key, they key can be declare as +an alias for the operator address`, + Run: func(cmd *cobra.Command, args []string) { + operator.DeclareAlias(config, aliasKeyOption.Filename) + }, +} + +func init() { + rootCmd.AddCommand(declareAliasCmd) + + declareAliasCmd.Flags().StringVarP(&(aliasKeyOption.Filename), "name", "n", "alias-ecdsa.key.json", "absolute or relative file path to alias ECDSA key to declare alias") + declareAliasCmd.MarkPersistentFlagRequired("name") +} diff --git a/core/chainio/apconfig/Makefile b/core/chainio/apconfig/Makefile index 591272f..5e672a0 100644 --- a/core/chainio/apconfig/Makefile +++ b/core/chainio/apconfig/Makefile @@ -1,2 +1,2 @@ genabi: - abigen --abi=../abis/entrypoint.abi --pkg=apconfig --type=APConfig --out=binding.go + abigen --abi=../abis/apconfig.abi --pkg=apconfig --type=APConfig --out=binding.go diff --git a/core/chainio/apconfig/binding.go b/core/chainio/apconfig/binding.go index c4df54c..60aa47a 100644 --- a/core/chainio/apconfig/binding.go +++ b/core/chainio/apconfig/binding.go @@ -29,61 +29,9 @@ var ( _ = abi.ConvertType ) -// EntryPointMemoryUserOp is an auto generated low-level Go binding around an user-defined struct. -type EntryPointMemoryUserOp struct { - Sender common.Address - Nonce *big.Int - CallGasLimit *big.Int - VerificationGasLimit *big.Int - PreVerificationGas *big.Int - Paymaster common.Address - MaxFeePerGas *big.Int - MaxPriorityFeePerGas *big.Int -} - -// EntryPointUserOpInfo is an auto generated low-level Go binding around an user-defined struct. -type EntryPointUserOpInfo struct { - MUserOp EntryPointMemoryUserOp - UserOpHash [32]byte - Prefund *big.Int - ContextOffset *big.Int - PreOpGas *big.Int -} - -// IEntryPointUserOpsPerAggregator is an auto generated low-level Go binding around an user-defined struct. -type IEntryPointUserOpsPerAggregator struct { - UserOps []UserOperation - Aggregator common.Address - Signature []byte -} - -// IStakeManagerDepositInfo is an auto generated low-level Go binding around an user-defined struct. -type IStakeManagerDepositInfo struct { - Deposit *big.Int - Staked bool - Stake *big.Int - UnstakeDelaySec uint32 - WithdrawTime *big.Int -} - -// UserOperation is an auto generated low-level Go binding around an user-defined struct. -type UserOperation struct { - Sender common.Address - Nonce *big.Int - InitCode []byte - CallData []byte - CallGasLimit *big.Int - VerificationGasLimit *big.Int - PreVerificationGas *big.Int - MaxFeePerGas *big.Int - MaxPriorityFeePerGas *big.Int - PaymasterAndData []byte - Signature []byte -} - // APConfigMetaData contains all meta data concerning the APConfig contract. var APConfigMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"paid\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"targetSuccess\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"targetResult\",\"type\":\"bytes\"}],\"name\":\"ExecutionResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"opIndex\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"FailedOp\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderAddressResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureValidationFailed\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResult\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sigFailed\",\"type\":\"bool\"},{\"internalType\":\"uint48\",\"name\":\"validAfter\",\"type\":\"uint48\"},{\"internalType\":\"uint48\",\"name\":\"validUntil\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"paymasterContext\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.ReturnInfo\",\"name\":\"returnInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"senderInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"factoryInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"paymasterInfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"stake\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"internalType\":\"structIStakeManager.StakeInfo\",\"name\":\"stakeInfo\",\"type\":\"tuple\"}],\"internalType\":\"structIEntryPoint.AggregatorStakeInfo\",\"name\":\"aggregatorInfo\",\"type\":\"tuple\"}],\"name\":\"ValidationResultWithAggregation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"}],\"name\":\"AccountDeployed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"BeforeExecution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDeposit\",\"type\":\"uint256\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"aggregator\",\"type\":\"address\"}],\"name\":\"SignatureAggregatorChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalStaked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unstakeDelaySec\",\"type\":\"uint256\"}],\"name\":\"StakeLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawTime\",\"type\":\"uint256\"}],\"name\":\"StakeUnlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"StakeWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"actualGasUsed\",\"type\":\"uint256\"}],\"name\":\"UserOperationEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"revertReason\",\"type\":\"bytes\"}],\"name\":\"UserOperationRevertReason\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SIG_VALIDATION_FAILED\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"}],\"name\":\"_validateSenderAndPaymaster\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"}],\"name\":\"addStake\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"depositTo\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getDepositInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint112\",\"name\":\"deposit\",\"type\":\"uint112\"},{\"internalType\":\"bool\",\"name\":\"staked\",\"type\":\"bool\"},{\"internalType\":\"uint112\",\"name\":\"stake\",\"type\":\"uint112\"},{\"internalType\":\"uint32\",\"name\":\"unstakeDelaySec\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"withdrawTime\",\"type\":\"uint48\"}],\"internalType\":\"structIStakeManager.DepositInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"getNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"}],\"name\":\"getSenderAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"getUserOpHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"userOps\",\"type\":\"tuple[]\"},{\"internalType\":\"contractIAggregator\",\"name\":\"aggregator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structIEntryPoint.UserOpsPerAggregator[]\",\"name\":\"opsPerAggregator\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleAggregatedOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation[]\",\"name\":\"ops\",\"type\":\"tuple[]\"},{\"internalType\":\"addresspayable\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"handleOps\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint192\",\"name\":\"key\",\"type\":\"uint192\"}],\"name\":\"incrementNonce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"paymaster\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.MemoryUserOp\",\"name\":\"mUserOp\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"userOpHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"prefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"contextOffset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preOpGas\",\"type\":\"uint256\"}],\"internalType\":\"structEntryPoint.UserOpInfo\",\"name\":\"opInfo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"context\",\"type\":\"bytes\"}],\"name\":\"innerHandleOp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"}],\"name\":\"nonceSequenceNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"op\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"targetCallData\",\"type\":\"bytes\"}],\"name\":\"simulateHandleOp\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"initCode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"callGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"verificationGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preVerificationGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxPriorityFeePerGas\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"paymasterAndData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structUserOperation\",\"name\":\"userOp\",\"type\":\"tuple\"}],\"name\":\"simulateValidation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"}],\"name\":\"withdrawStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"withdrawAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount\",\"type\":\"uint256\"}],\"name\":\"withdrawTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"type\":\"function\",\"name\":\"declareAlias\",\"inputs\":[{\"name\":\"_alias\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getAlias\",\"inputs\":[{\"name\":\"_operator\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorForAlias\",\"inputs\":[{\"name\":\"_alias\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"undeclare\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AliasDeclared\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"aliasAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"AliasUndeclared\",\"inputs\":[{\"name\":\"operator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", } // APConfigABI is the input ABI used to generate the binding from. @@ -232,1737 +180,113 @@ func (_APConfig *APConfigTransactorRaw) Transact(opts *bind.TransactOpts, method return _APConfig.Contract.contract.Transact(opts, method, params...) } -// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. -// -// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) -func (_APConfig *APConfigCaller) SIGVALIDATIONFAILED(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "SIG_VALIDATION_FAILED") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. -// -// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) -func (_APConfig *APConfigSession) SIGVALIDATIONFAILED() (*big.Int, error) { - return _APConfig.Contract.SIGVALIDATIONFAILED(&_APConfig.CallOpts) -} - -// SIGVALIDATIONFAILED is a free data retrieval call binding the contract method 0x8f41ec5a. -// -// Solidity: function SIG_VALIDATION_FAILED() view returns(uint256) -func (_APConfig *APConfigCallerSession) SIGVALIDATIONFAILED() (*big.Int, error) { - return _APConfig.Contract.SIGVALIDATIONFAILED(&_APConfig.CallOpts) -} - -// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. -// -// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() -func (_APConfig *APConfigCaller) ValidateSenderAndPaymaster(opts *bind.CallOpts, initCode []byte, sender common.Address, paymasterAndData []byte) error { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "_validateSenderAndPaymaster", initCode, sender, paymasterAndData) - - if err != nil { - return err - } - - return err - -} - -// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. -// -// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() -func (_APConfig *APConfigSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { - return _APConfig.Contract.ValidateSenderAndPaymaster(&_APConfig.CallOpts, initCode, sender, paymasterAndData) -} - -// ValidateSenderAndPaymaster is a free data retrieval call binding the contract method 0x957122ab. -// -// Solidity: function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) view returns() -func (_APConfig *APConfigCallerSession) ValidateSenderAndPaymaster(initCode []byte, sender common.Address, paymasterAndData []byte) error { - return _APConfig.Contract.ValidateSenderAndPaymaster(&_APConfig.CallOpts, initCode, sender, paymasterAndData) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_APConfig *APConfigCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "balanceOf", account) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_APConfig *APConfigSession) BalanceOf(account common.Address) (*big.Int, error) { - return _APConfig.Contract.BalanceOf(&_APConfig.CallOpts, account) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_APConfig *APConfigCallerSession) BalanceOf(account common.Address) (*big.Int, error) { - return _APConfig.Contract.BalanceOf(&_APConfig.CallOpts, account) -} - -// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. -// -// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) -func (_APConfig *APConfigCaller) Deposits(opts *bind.CallOpts, arg0 common.Address) (struct { - Deposit *big.Int - Staked bool - Stake *big.Int - UnstakeDelaySec uint32 - WithdrawTime *big.Int -}, error) { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "deposits", arg0) - - outstruct := new(struct { - Deposit *big.Int - Staked bool - Stake *big.Int - UnstakeDelaySec uint32 - WithdrawTime *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.Deposit = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.Staked = *abi.ConvertType(out[1], new(bool)).(*bool) - outstruct.Stake = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.UnstakeDelaySec = *abi.ConvertType(out[3], new(uint32)).(*uint32) - outstruct.WithdrawTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. -// -// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) -func (_APConfig *APConfigSession) Deposits(arg0 common.Address) (struct { - Deposit *big.Int - Staked bool - Stake *big.Int - UnstakeDelaySec uint32 - WithdrawTime *big.Int -}, error) { - return _APConfig.Contract.Deposits(&_APConfig.CallOpts, arg0) -} - -// Deposits is a free data retrieval call binding the contract method 0xfc7e286d. -// -// Solidity: function deposits(address ) view returns(uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) -func (_APConfig *APConfigCallerSession) Deposits(arg0 common.Address) (struct { - Deposit *big.Int - Staked bool - Stake *big.Int - UnstakeDelaySec uint32 - WithdrawTime *big.Int -}, error) { - return _APConfig.Contract.Deposits(&_APConfig.CallOpts, arg0) -} - -// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. -// -// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) -func (_APConfig *APConfigCaller) GetDepositInfo(opts *bind.CallOpts, account common.Address) (IStakeManagerDepositInfo, error) { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "getDepositInfo", account) - - if err != nil { - return *new(IStakeManagerDepositInfo), err - } - - out0 := *abi.ConvertType(out[0], new(IStakeManagerDepositInfo)).(*IStakeManagerDepositInfo) - - return out0, err - -} - -// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. -// -// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) -func (_APConfig *APConfigSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { - return _APConfig.Contract.GetDepositInfo(&_APConfig.CallOpts, account) -} - -// GetDepositInfo is a free data retrieval call binding the contract method 0x5287ce12. -// -// Solidity: function getDepositInfo(address account) view returns((uint112,bool,uint112,uint32,uint48) info) -func (_APConfig *APConfigCallerSession) GetDepositInfo(account common.Address) (IStakeManagerDepositInfo, error) { - return _APConfig.Contract.GetDepositInfo(&_APConfig.CallOpts, account) -} - -// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. -// -// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) -func (_APConfig *APConfigCaller) GetNonce(opts *bind.CallOpts, sender common.Address, key *big.Int) (*big.Int, error) { - var out []interface{} - err := _APConfig.contract.Call(opts, &out, "getNonce", sender, key) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. -// -// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) -func (_APConfig *APConfigSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { - return _APConfig.Contract.GetNonce(&_APConfig.CallOpts, sender, key) -} - -// GetNonce is a free data retrieval call binding the contract method 0x35567e1a. -// -// Solidity: function getNonce(address sender, uint192 key) view returns(uint256 nonce) -func (_APConfig *APConfigCallerSession) GetNonce(sender common.Address, key *big.Int) (*big.Int, error) { - return _APConfig.Contract.GetNonce(&_APConfig.CallOpts, sender, key) -} - -// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// GetAlias is a free data retrieval call binding the contract method 0x99900d11. // -// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) -func (_APConfig *APConfigCaller) GetUserOpHash(opts *bind.CallOpts, userOp UserOperation) ([32]byte, error) { +// Solidity: function getAlias(address _operator) view returns(address) +func (_APConfig *APConfigCaller) GetAlias(opts *bind.CallOpts, _operator common.Address) (common.Address, error) { var out []interface{} - err := _APConfig.contract.Call(opts, &out, "getUserOpHash", userOp) + err := _APConfig.contract.Call(opts, &out, "getAlias", _operator) if err != nil { - return *new([32]byte), err + return *new(common.Address), err } - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } -// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// GetAlias is a free data retrieval call binding the contract method 0x99900d11. // -// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) -func (_APConfig *APConfigSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { - return _APConfig.Contract.GetUserOpHash(&_APConfig.CallOpts, userOp) +// Solidity: function getAlias(address _operator) view returns(address) +func (_APConfig *APConfigSession) GetAlias(_operator common.Address) (common.Address, error) { + return _APConfig.Contract.GetAlias(&_APConfig.CallOpts, _operator) } -// GetUserOpHash is a free data retrieval call binding the contract method 0xa6193531. +// GetAlias is a free data retrieval call binding the contract method 0x99900d11. // -// Solidity: function getUserOpHash((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) view returns(bytes32) -func (_APConfig *APConfigCallerSession) GetUserOpHash(userOp UserOperation) ([32]byte, error) { - return _APConfig.Contract.GetUserOpHash(&_APConfig.CallOpts, userOp) +// Solidity: function getAlias(address _operator) view returns(address) +func (_APConfig *APConfigCallerSession) GetAlias(_operator common.Address) (common.Address, error) { + return _APConfig.Contract.GetAlias(&_APConfig.CallOpts, _operator) } -// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. +// GetOperatorForAlias is a free data retrieval call binding the contract method 0x8139d05b. // -// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) -func (_APConfig *APConfigCaller) NonceSequenceNumber(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (*big.Int, error) { +// Solidity: function getOperatorForAlias(address _alias) view returns(address) +func (_APConfig *APConfigCaller) GetOperatorForAlias(opts *bind.CallOpts, _alias common.Address) (common.Address, error) { var out []interface{} - err := _APConfig.contract.Call(opts, &out, "nonceSequenceNumber", arg0, arg1) + err := _APConfig.contract.Call(opts, &out, "getOperatorForAlias", _alias) if err != nil { - return *new(*big.Int), err + return *new(common.Address), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } -// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. -// -// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) -func (_APConfig *APConfigSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { - return _APConfig.Contract.NonceSequenceNumber(&_APConfig.CallOpts, arg0, arg1) -} - -// NonceSequenceNumber is a free data retrieval call binding the contract method 0x1b2e01b8. -// -// Solidity: function nonceSequenceNumber(address , uint192 ) view returns(uint256) -func (_APConfig *APConfigCallerSession) NonceSequenceNumber(arg0 common.Address, arg1 *big.Int) (*big.Int, error) { - return _APConfig.Contract.NonceSequenceNumber(&_APConfig.CallOpts, arg0, arg1) -} - -// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. -// -// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() -func (_APConfig *APConfigTransactor) AddStake(opts *bind.TransactOpts, unstakeDelaySec uint32) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "addStake", unstakeDelaySec) -} - -// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. -// -// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() -func (_APConfig *APConfigSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { - return _APConfig.Contract.AddStake(&_APConfig.TransactOpts, unstakeDelaySec) -} - -// AddStake is a paid mutator transaction binding the contract method 0x0396cb60. -// -// Solidity: function addStake(uint32 unstakeDelaySec) payable returns() -func (_APConfig *APConfigTransactorSession) AddStake(unstakeDelaySec uint32) (*types.Transaction, error) { - return _APConfig.Contract.AddStake(&_APConfig.TransactOpts, unstakeDelaySec) -} - -// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. -// -// Solidity: function depositTo(address account) payable returns() -func (_APConfig *APConfigTransactor) DepositTo(opts *bind.TransactOpts, account common.Address) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "depositTo", account) -} - -// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. -// -// Solidity: function depositTo(address account) payable returns() -func (_APConfig *APConfigSession) DepositTo(account common.Address) (*types.Transaction, error) { - return _APConfig.Contract.DepositTo(&_APConfig.TransactOpts, account) -} - -// DepositTo is a paid mutator transaction binding the contract method 0xb760faf9. -// -// Solidity: function depositTo(address account) payable returns() -func (_APConfig *APConfigTransactorSession) DepositTo(account common.Address) (*types.Transaction, error) { - return _APConfig.Contract.DepositTo(&_APConfig.TransactOpts, account) -} - -// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. -// -// Solidity: function getSenderAddress(bytes initCode) returns() -func (_APConfig *APConfigTransactor) GetSenderAddress(opts *bind.TransactOpts, initCode []byte) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "getSenderAddress", initCode) -} - -// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. -// -// Solidity: function getSenderAddress(bytes initCode) returns() -func (_APConfig *APConfigSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { - return _APConfig.Contract.GetSenderAddress(&_APConfig.TransactOpts, initCode) -} - -// GetSenderAddress is a paid mutator transaction binding the contract method 0x9b249f69. -// -// Solidity: function getSenderAddress(bytes initCode) returns() -func (_APConfig *APConfigTransactorSession) GetSenderAddress(initCode []byte) (*types.Transaction, error) { - return _APConfig.Contract.GetSenderAddress(&_APConfig.TransactOpts, initCode) -} - -// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. -// -// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() -func (_APConfig *APConfigTransactor) HandleAggregatedOps(opts *bind.TransactOpts, opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "handleAggregatedOps", opsPerAggregator, beneficiary) -} - -// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. -// -// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() -func (_APConfig *APConfigSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.Contract.HandleAggregatedOps(&_APConfig.TransactOpts, opsPerAggregator, beneficiary) -} - -// HandleAggregatedOps is a paid mutator transaction binding the contract method 0x4b1d7cf5. -// -// Solidity: function handleAggregatedOps(((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address,bytes)[] opsPerAggregator, address beneficiary) returns() -func (_APConfig *APConfigTransactorSession) HandleAggregatedOps(opsPerAggregator []IEntryPointUserOpsPerAggregator, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.Contract.HandleAggregatedOps(&_APConfig.TransactOpts, opsPerAggregator, beneficiary) -} - -// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. -// -// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() -func (_APConfig *APConfigTransactor) HandleOps(opts *bind.TransactOpts, ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "handleOps", ops, beneficiary) -} - -// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. -// -// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() -func (_APConfig *APConfigSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.Contract.HandleOps(&_APConfig.TransactOpts, ops, beneficiary) -} - -// HandleOps is a paid mutator transaction binding the contract method 0x1fad948c. -// -// Solidity: function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[] ops, address beneficiary) returns() -func (_APConfig *APConfigTransactorSession) HandleOps(ops []UserOperation, beneficiary common.Address) (*types.Transaction, error) { - return _APConfig.Contract.HandleOps(&_APConfig.TransactOpts, ops, beneficiary) -} - -// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. -// -// Solidity: function incrementNonce(uint192 key) returns() -func (_APConfig *APConfigTransactor) IncrementNonce(opts *bind.TransactOpts, key *big.Int) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "incrementNonce", key) -} - -// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. -// -// Solidity: function incrementNonce(uint192 key) returns() -func (_APConfig *APConfigSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { - return _APConfig.Contract.IncrementNonce(&_APConfig.TransactOpts, key) -} - -// IncrementNonce is a paid mutator transaction binding the contract method 0x0bd28e3b. -// -// Solidity: function incrementNonce(uint192 key) returns() -func (_APConfig *APConfigTransactorSession) IncrementNonce(key *big.Int) (*types.Transaction, error) { - return _APConfig.Contract.IncrementNonce(&_APConfig.TransactOpts, key) -} - -// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. -// -// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) -func (_APConfig *APConfigTransactor) InnerHandleOp(opts *bind.TransactOpts, callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "innerHandleOp", callData, opInfo, context) -} - -// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. -// -// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) -func (_APConfig *APConfigSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { - return _APConfig.Contract.InnerHandleOp(&_APConfig.TransactOpts, callData, opInfo, context) -} - -// InnerHandleOp is a paid mutator transaction binding the contract method 0x1d732756. -// -// Solidity: function innerHandleOp(bytes callData, ((address,uint256,uint256,uint256,uint256,address,uint256,uint256),bytes32,uint256,uint256,uint256) opInfo, bytes context) returns(uint256 actualGasCost) -func (_APConfig *APConfigTransactorSession) InnerHandleOp(callData []byte, opInfo EntryPointUserOpInfo, context []byte) (*types.Transaction, error) { - return _APConfig.Contract.InnerHandleOp(&_APConfig.TransactOpts, callData, opInfo, context) -} - -// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. -// -// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() -func (_APConfig *APConfigTransactor) SimulateHandleOp(opts *bind.TransactOpts, op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "simulateHandleOp", op, target, targetCallData) -} - -// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. -// -// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() -func (_APConfig *APConfigSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { - return _APConfig.Contract.SimulateHandleOp(&_APConfig.TransactOpts, op, target, targetCallData) -} - -// SimulateHandleOp is a paid mutator transaction binding the contract method 0xd6383f94. -// -// Solidity: function simulateHandleOp((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) op, address target, bytes targetCallData) returns() -func (_APConfig *APConfigTransactorSession) SimulateHandleOp(op UserOperation, target common.Address, targetCallData []byte) (*types.Transaction, error) { - return _APConfig.Contract.SimulateHandleOp(&_APConfig.TransactOpts, op, target, targetCallData) -} - -// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. -// -// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() -func (_APConfig *APConfigTransactor) SimulateValidation(opts *bind.TransactOpts, userOp UserOperation) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "simulateValidation", userOp) -} - -// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. -// -// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() -func (_APConfig *APConfigSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { - return _APConfig.Contract.SimulateValidation(&_APConfig.TransactOpts, userOp) -} - -// SimulateValidation is a paid mutator transaction binding the contract method 0xee219423. +// GetOperatorForAlias is a free data retrieval call binding the contract method 0x8139d05b. // -// Solidity: function simulateValidation((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes) userOp) returns() -func (_APConfig *APConfigTransactorSession) SimulateValidation(userOp UserOperation) (*types.Transaction, error) { - return _APConfig.Contract.SimulateValidation(&_APConfig.TransactOpts, userOp) +// Solidity: function getOperatorForAlias(address _alias) view returns(address) +func (_APConfig *APConfigSession) GetOperatorForAlias(_alias common.Address) (common.Address, error) { + return _APConfig.Contract.GetOperatorForAlias(&_APConfig.CallOpts, _alias) } -// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// GetOperatorForAlias is a free data retrieval call binding the contract method 0x8139d05b. // -// Solidity: function unlockStake() returns() -func (_APConfig *APConfigTransactor) UnlockStake(opts *bind.TransactOpts) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "unlockStake") +// Solidity: function getOperatorForAlias(address _alias) view returns(address) +func (_APConfig *APConfigCallerSession) GetOperatorForAlias(_alias common.Address) (common.Address, error) { + return _APConfig.Contract.GetOperatorForAlias(&_APConfig.CallOpts, _alias) } -// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// DeclareAlias is a paid mutator transaction binding the contract method 0xf405566d. // -// Solidity: function unlockStake() returns() -func (_APConfig *APConfigSession) UnlockStake() (*types.Transaction, error) { - return _APConfig.Contract.UnlockStake(&_APConfig.TransactOpts) +// Solidity: function declareAlias(address _alias) returns() +func (_APConfig *APConfigTransactor) DeclareAlias(opts *bind.TransactOpts, _alias common.Address) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "declareAlias", _alias) } -// UnlockStake is a paid mutator transaction binding the contract method 0xbb9fe6bf. +// DeclareAlias is a paid mutator transaction binding the contract method 0xf405566d. // -// Solidity: function unlockStake() returns() -func (_APConfig *APConfigTransactorSession) UnlockStake() (*types.Transaction, error) { - return _APConfig.Contract.UnlockStake(&_APConfig.TransactOpts) +// Solidity: function declareAlias(address _alias) returns() +func (_APConfig *APConfigSession) DeclareAlias(_alias common.Address) (*types.Transaction, error) { + return _APConfig.Contract.DeclareAlias(&_APConfig.TransactOpts, _alias) } -// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// DeclareAlias is a paid mutator transaction binding the contract method 0xf405566d. // -// Solidity: function withdrawStake(address withdrawAddress) returns() -func (_APConfig *APConfigTransactor) WithdrawStake(opts *bind.TransactOpts, withdrawAddress common.Address) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "withdrawStake", withdrawAddress) +// Solidity: function declareAlias(address _alias) returns() +func (_APConfig *APConfigTransactorSession) DeclareAlias(_alias common.Address) (*types.Transaction, error) { + return _APConfig.Contract.DeclareAlias(&_APConfig.TransactOpts, _alias) } -// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// Undeclare is a paid mutator transaction binding the contract method 0x2c46b3e1. // -// Solidity: function withdrawStake(address withdrawAddress) returns() -func (_APConfig *APConfigSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { - return _APConfig.Contract.WithdrawStake(&_APConfig.TransactOpts, withdrawAddress) +// Solidity: function undeclare() returns() +func (_APConfig *APConfigTransactor) Undeclare(opts *bind.TransactOpts) (*types.Transaction, error) { + return _APConfig.contract.Transact(opts, "undeclare") } -// WithdrawStake is a paid mutator transaction binding the contract method 0xc23a5cea. +// Undeclare is a paid mutator transaction binding the contract method 0x2c46b3e1. // -// Solidity: function withdrawStake(address withdrawAddress) returns() -func (_APConfig *APConfigTransactorSession) WithdrawStake(withdrawAddress common.Address) (*types.Transaction, error) { - return _APConfig.Contract.WithdrawStake(&_APConfig.TransactOpts, withdrawAddress) +// Solidity: function undeclare() returns() +func (_APConfig *APConfigSession) Undeclare() (*types.Transaction, error) { + return _APConfig.Contract.Undeclare(&_APConfig.TransactOpts) } -// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. +// Undeclare is a paid mutator transaction binding the contract method 0x2c46b3e1. // -// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() -func (_APConfig *APConfigTransactor) WithdrawTo(opts *bind.TransactOpts, withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { - return _APConfig.contract.Transact(opts, "withdrawTo", withdrawAddress, withdrawAmount) -} - -// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. -// -// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() -func (_APConfig *APConfigSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { - return _APConfig.Contract.WithdrawTo(&_APConfig.TransactOpts, withdrawAddress, withdrawAmount) -} - -// WithdrawTo is a paid mutator transaction binding the contract method 0x205c2878. -// -// Solidity: function withdrawTo(address withdrawAddress, uint256 withdrawAmount) returns() -func (_APConfig *APConfigTransactorSession) WithdrawTo(withdrawAddress common.Address, withdrawAmount *big.Int) (*types.Transaction, error) { - return _APConfig.Contract.WithdrawTo(&_APConfig.TransactOpts, withdrawAddress, withdrawAmount) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_APConfig *APConfigTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { - return _APConfig.contract.RawTransact(opts, nil) // calldata is disallowed for receive function -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_APConfig *APConfigSession) Receive() (*types.Transaction, error) { - return _APConfig.Contract.Receive(&_APConfig.TransactOpts) -} - -// Receive is a paid mutator transaction binding the contract receive function. -// -// Solidity: receive() payable returns() -func (_APConfig *APConfigTransactorSession) Receive() (*types.Transaction, error) { - return _APConfig.Contract.Receive(&_APConfig.TransactOpts) -} - -// APConfigAccountDeployedIterator is returned from FilterAccountDeployed and is used to iterate over the raw logs and unpacked data for AccountDeployed events raised by the APConfig contract. -type APConfigAccountDeployedIterator struct { - Event *APConfigAccountDeployed // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigAccountDeployedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigAccountDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigAccountDeployed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigAccountDeployedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigAccountDeployedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigAccountDeployed represents a AccountDeployed event raised by the APConfig contract. -type APConfigAccountDeployed struct { - UserOpHash [32]byte - Sender common.Address - Factory common.Address - Paymaster common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterAccountDeployed is a free log retrieval operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. -// -// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) -func (_APConfig *APConfigFilterer) FilterAccountDeployed(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*APConfigAccountDeployedIterator, error) { - - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "AccountDeployed", userOpHashRule, senderRule) - if err != nil { - return nil, err - } - return &APConfigAccountDeployedIterator{contract: _APConfig.contract, event: "AccountDeployed", logs: logs, sub: sub}, nil -} - -// WatchAccountDeployed is a free log subscription operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. -// -// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) -func (_APConfig *APConfigFilterer) WatchAccountDeployed(opts *bind.WatchOpts, sink chan<- *APConfigAccountDeployed, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { - - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "AccountDeployed", userOpHashRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigAccountDeployed) - if err := _APConfig.contract.UnpackLog(event, "AccountDeployed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseAccountDeployed is a log parse operation binding the contract event 0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d. -// -// Solidity: event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) -func (_APConfig *APConfigFilterer) ParseAccountDeployed(log types.Log) (*APConfigAccountDeployed, error) { - event := new(APConfigAccountDeployed) - if err := _APConfig.contract.UnpackLog(event, "AccountDeployed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigBeforeExecutionIterator is returned from FilterBeforeExecution and is used to iterate over the raw logs and unpacked data for BeforeExecution events raised by the APConfig contract. -type APConfigBeforeExecutionIterator struct { - Event *APConfigBeforeExecution // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigBeforeExecutionIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigBeforeExecution) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigBeforeExecution) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigBeforeExecutionIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigBeforeExecutionIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigBeforeExecution represents a BeforeExecution event raised by the APConfig contract. -type APConfigBeforeExecution struct { - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBeforeExecution is a free log retrieval operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. -// -// Solidity: event BeforeExecution() -func (_APConfig *APConfigFilterer) FilterBeforeExecution(opts *bind.FilterOpts) (*APConfigBeforeExecutionIterator, error) { - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "BeforeExecution") - if err != nil { - return nil, err - } - return &APConfigBeforeExecutionIterator{contract: _APConfig.contract, event: "BeforeExecution", logs: logs, sub: sub}, nil -} - -// WatchBeforeExecution is a free log subscription operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. -// -// Solidity: event BeforeExecution() -func (_APConfig *APConfigFilterer) WatchBeforeExecution(opts *bind.WatchOpts, sink chan<- *APConfigBeforeExecution) (event.Subscription, error) { - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "BeforeExecution") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigBeforeExecution) - if err := _APConfig.contract.UnpackLog(event, "BeforeExecution", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBeforeExecution is a log parse operation binding the contract event 0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972. -// -// Solidity: event BeforeExecution() -func (_APConfig *APConfigFilterer) ParseBeforeExecution(log types.Log) (*APConfigBeforeExecution, error) { - event := new(APConfigBeforeExecution) - if err := _APConfig.contract.UnpackLog(event, "BeforeExecution", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigDepositedIterator is returned from FilterDeposited and is used to iterate over the raw logs and unpacked data for Deposited events raised by the APConfig contract. -type APConfigDepositedIterator struct { - Event *APConfigDeposited // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigDepositedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigDeposited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigDeposited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigDepositedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigDepositedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigDeposited represents a Deposited event raised by the APConfig contract. -type APConfigDeposited struct { - Account common.Address - TotalDeposit *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposited is a free log retrieval operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. -// -// Solidity: event Deposited(address indexed account, uint256 totalDeposit) -func (_APConfig *APConfigFilterer) FilterDeposited(opts *bind.FilterOpts, account []common.Address) (*APConfigDepositedIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "Deposited", accountRule) - if err != nil { - return nil, err - } - return &APConfigDepositedIterator{contract: _APConfig.contract, event: "Deposited", logs: logs, sub: sub}, nil -} - -// WatchDeposited is a free log subscription operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. -// -// Solidity: event Deposited(address indexed account, uint256 totalDeposit) -func (_APConfig *APConfigFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *APConfigDeposited, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "Deposited", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigDeposited) - if err := _APConfig.contract.UnpackLog(event, "Deposited", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseDeposited is a log parse operation binding the contract event 0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4. -// -// Solidity: event Deposited(address indexed account, uint256 totalDeposit) -func (_APConfig *APConfigFilterer) ParseDeposited(log types.Log) (*APConfigDeposited, error) { - event := new(APConfigDeposited) - if err := _APConfig.contract.UnpackLog(event, "Deposited", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigSignatureAggregatorChangedIterator is returned from FilterSignatureAggregatorChanged and is used to iterate over the raw logs and unpacked data for SignatureAggregatorChanged events raised by the APConfig contract. -type APConfigSignatureAggregatorChangedIterator struct { - Event *APConfigSignatureAggregatorChanged // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigSignatureAggregatorChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigSignatureAggregatorChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigSignatureAggregatorChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigSignatureAggregatorChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigSignatureAggregatorChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigSignatureAggregatorChanged represents a SignatureAggregatorChanged event raised by the APConfig contract. -type APConfigSignatureAggregatorChanged struct { - Aggregator common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSignatureAggregatorChanged is a free log retrieval operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. -// -// Solidity: event SignatureAggregatorChanged(address indexed aggregator) -func (_APConfig *APConfigFilterer) FilterSignatureAggregatorChanged(opts *bind.FilterOpts, aggregator []common.Address) (*APConfigSignatureAggregatorChangedIterator, error) { - - var aggregatorRule []interface{} - for _, aggregatorItem := range aggregator { - aggregatorRule = append(aggregatorRule, aggregatorItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "SignatureAggregatorChanged", aggregatorRule) - if err != nil { - return nil, err - } - return &APConfigSignatureAggregatorChangedIterator{contract: _APConfig.contract, event: "SignatureAggregatorChanged", logs: logs, sub: sub}, nil -} - -// WatchSignatureAggregatorChanged is a free log subscription operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. -// -// Solidity: event SignatureAggregatorChanged(address indexed aggregator) -func (_APConfig *APConfigFilterer) WatchSignatureAggregatorChanged(opts *bind.WatchOpts, sink chan<- *APConfigSignatureAggregatorChanged, aggregator []common.Address) (event.Subscription, error) { - - var aggregatorRule []interface{} - for _, aggregatorItem := range aggregator { - aggregatorRule = append(aggregatorRule, aggregatorItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "SignatureAggregatorChanged", aggregatorRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigSignatureAggregatorChanged) - if err := _APConfig.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseSignatureAggregatorChanged is a log parse operation binding the contract event 0x575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d. -// -// Solidity: event SignatureAggregatorChanged(address indexed aggregator) -func (_APConfig *APConfigFilterer) ParseSignatureAggregatorChanged(log types.Log) (*APConfigSignatureAggregatorChanged, error) { - event := new(APConfigSignatureAggregatorChanged) - if err := _APConfig.contract.UnpackLog(event, "SignatureAggregatorChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigStakeLockedIterator is returned from FilterStakeLocked and is used to iterate over the raw logs and unpacked data for StakeLocked events raised by the APConfig contract. -type APConfigStakeLockedIterator struct { - Event *APConfigStakeLocked // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigStakeLockedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigStakeLocked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigStakeLocked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigStakeLockedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigStakeLockedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigStakeLocked represents a StakeLocked event raised by the APConfig contract. -type APConfigStakeLocked struct { - Account common.Address - TotalStaked *big.Int - UnstakeDelaySec *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterStakeLocked is a free log retrieval operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. -// -// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) -func (_APConfig *APConfigFilterer) FilterStakeLocked(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeLockedIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeLocked", accountRule) - if err != nil { - return nil, err - } - return &APConfigStakeLockedIterator{contract: _APConfig.contract, event: "StakeLocked", logs: logs, sub: sub}, nil -} - -// WatchStakeLocked is a free log subscription operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. -// -// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) -func (_APConfig *APConfigFilterer) WatchStakeLocked(opts *bind.WatchOpts, sink chan<- *APConfigStakeLocked, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeLocked", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigStakeLocked) - if err := _APConfig.contract.UnpackLog(event, "StakeLocked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseStakeLocked is a log parse operation binding the contract event 0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01. -// -// Solidity: event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) -func (_APConfig *APConfigFilterer) ParseStakeLocked(log types.Log) (*APConfigStakeLocked, error) { - event := new(APConfigStakeLocked) - if err := _APConfig.contract.UnpackLog(event, "StakeLocked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigStakeUnlockedIterator is returned from FilterStakeUnlocked and is used to iterate over the raw logs and unpacked data for StakeUnlocked events raised by the APConfig contract. -type APConfigStakeUnlockedIterator struct { - Event *APConfigStakeUnlocked // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigStakeUnlockedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigStakeUnlocked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigStakeUnlocked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigStakeUnlockedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigStakeUnlockedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigStakeUnlocked represents a StakeUnlocked event raised by the APConfig contract. -type APConfigStakeUnlocked struct { - Account common.Address - WithdrawTime *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterStakeUnlocked is a free log retrieval operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. -// -// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) -func (_APConfig *APConfigFilterer) FilterStakeUnlocked(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeUnlockedIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeUnlocked", accountRule) - if err != nil { - return nil, err - } - return &APConfigStakeUnlockedIterator{contract: _APConfig.contract, event: "StakeUnlocked", logs: logs, sub: sub}, nil -} - -// WatchStakeUnlocked is a free log subscription operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. -// -// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) -func (_APConfig *APConfigFilterer) WatchStakeUnlocked(opts *bind.WatchOpts, sink chan<- *APConfigStakeUnlocked, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeUnlocked", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigStakeUnlocked) - if err := _APConfig.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseStakeUnlocked is a log parse operation binding the contract event 0xfa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a. -// -// Solidity: event StakeUnlocked(address indexed account, uint256 withdrawTime) -func (_APConfig *APConfigFilterer) ParseStakeUnlocked(log types.Log) (*APConfigStakeUnlocked, error) { - event := new(APConfigStakeUnlocked) - if err := _APConfig.contract.UnpackLog(event, "StakeUnlocked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigStakeWithdrawnIterator is returned from FilterStakeWithdrawn and is used to iterate over the raw logs and unpacked data for StakeWithdrawn events raised by the APConfig contract. -type APConfigStakeWithdrawnIterator struct { - Event *APConfigStakeWithdrawn // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigStakeWithdrawnIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigStakeWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigStakeWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigStakeWithdrawnIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigStakeWithdrawnIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigStakeWithdrawn represents a StakeWithdrawn event raised by the APConfig contract. -type APConfigStakeWithdrawn struct { - Account common.Address - WithdrawAddress common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterStakeWithdrawn is a free log retrieval operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. -// -// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) FilterStakeWithdrawn(opts *bind.FilterOpts, account []common.Address) (*APConfigStakeWithdrawnIterator, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "StakeWithdrawn", accountRule) - if err != nil { - return nil, err - } - return &APConfigStakeWithdrawnIterator{contract: _APConfig.contract, event: "StakeWithdrawn", logs: logs, sub: sub}, nil -} - -// WatchStakeWithdrawn is a free log subscription operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. -// -// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) WatchStakeWithdrawn(opts *bind.WatchOpts, sink chan<- *APConfigStakeWithdrawn, account []common.Address) (event.Subscription, error) { - - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "StakeWithdrawn", accountRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigStakeWithdrawn) - if err := _APConfig.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseStakeWithdrawn is a log parse operation binding the contract event 0xb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3. -// -// Solidity: event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) ParseStakeWithdrawn(log types.Log) (*APConfigStakeWithdrawn, error) { - event := new(APConfigStakeWithdrawn) - if err := _APConfig.contract.UnpackLog(event, "StakeWithdrawn", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// APConfigUserOperationEventIterator is returned from FilterUserOperationEvent and is used to iterate over the raw logs and unpacked data for UserOperationEvent events raised by the APConfig contract. -type APConfigUserOperationEventIterator struct { - Event *APConfigUserOperationEvent // 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 - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// 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 *APConfigUserOperationEventIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(APConfigUserOperationEvent) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(APConfigUserOperationEvent) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigUserOperationEventIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *APConfigUserOperationEventIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// APConfigUserOperationEvent represents a UserOperationEvent event raised by the APConfig contract. -type APConfigUserOperationEvent struct { - UserOpHash [32]byte - Sender common.Address - Paymaster common.Address - Nonce *big.Int - Success bool - ActualGasCost *big.Int - ActualGasUsed *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUserOperationEvent is a free log retrieval operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. -// -// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) -func (_APConfig *APConfigFilterer) FilterUserOperationEvent(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (*APConfigUserOperationEventIterator, error) { - - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var paymasterRule []interface{} - for _, paymasterItem := range paymaster { - paymasterRule = append(paymasterRule, paymasterItem) - } - - logs, sub, err := _APConfig.contract.FilterLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) - if err != nil { - return nil, err - } - return &APConfigUserOperationEventIterator{contract: _APConfig.contract, event: "UserOperationEvent", logs: logs, sub: sub}, nil -} - -// WatchUserOperationEvent is a free log subscription operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. -// -// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) -func (_APConfig *APConfigFilterer) WatchUserOperationEvent(opts *bind.WatchOpts, sink chan<- *APConfigUserOperationEvent, userOpHash [][32]byte, sender []common.Address, paymaster []common.Address) (event.Subscription, error) { - - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - var paymasterRule []interface{} - for _, paymasterItem := range paymaster { - paymasterRule = append(paymasterRule, paymasterItem) - } - - logs, sub, err := _APConfig.contract.WatchLogs(opts, "UserOperationEvent", userOpHashRule, senderRule, paymasterRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(APConfigUserOperationEvent) - if err := _APConfig.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseUserOperationEvent is a log parse operation binding the contract event 0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f. -// -// Solidity: event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) -func (_APConfig *APConfigFilterer) ParseUserOperationEvent(log types.Log) (*APConfigUserOperationEvent, error) { - event := new(APConfigUserOperationEvent) - if err := _APConfig.contract.UnpackLog(event, "UserOperationEvent", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil +// Solidity: function undeclare() returns() +func (_APConfig *APConfigTransactorSession) Undeclare() (*types.Transaction, error) { + return _APConfig.Contract.Undeclare(&_APConfig.TransactOpts) } -// APConfigUserOperationRevertReasonIterator is returned from FilterUserOperationRevertReason and is used to iterate over the raw logs and unpacked data for UserOperationRevertReason events raised by the APConfig contract. -type APConfigUserOperationRevertReasonIterator struct { - Event *APConfigUserOperationRevertReason // Event containing the contract specifics and raw log +// APConfigAliasDeclaredIterator is returned from FilterAliasDeclared and is used to iterate over the raw logs and unpacked data for AliasDeclared events raised by the APConfig contract. +type APConfigAliasDeclaredIterator struct { + Event *APConfigAliasDeclared // 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 @@ -1976,7 +300,7 @@ type APConfigUserOperationRevertReasonIterator 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 *APConfigUserOperationRevertReasonIterator) Next() bool { +func (it *APConfigAliasDeclaredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1985,7 +309,7 @@ func (it *APConfigUserOperationRevertReasonIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(APConfigUserOperationRevertReason) + it.Event = new(APConfigAliasDeclared) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2000,7 +324,7 @@ func (it *APConfigUserOperationRevertReasonIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(APConfigUserOperationRevertReason) + it.Event = new(APConfigAliasDeclared) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2016,62 +340,60 @@ func (it *APConfigUserOperationRevertReasonIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigUserOperationRevertReasonIterator) Error() error { +func (it *APConfigAliasDeclaredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *APConfigUserOperationRevertReasonIterator) Close() error { +func (it *APConfigAliasDeclaredIterator) Close() error { it.sub.Unsubscribe() return nil } -// APConfigUserOperationRevertReason represents a UserOperationRevertReason event raised by the APConfig contract. -type APConfigUserOperationRevertReason struct { - UserOpHash [32]byte - Sender common.Address - Nonce *big.Int - RevertReason []byte +// APConfigAliasDeclared represents a AliasDeclared event raised by the APConfig contract. +type APConfigAliasDeclared struct { + Operator common.Address + AliasAddress common.Address Raw types.Log // Blockchain specific contextual infos } -// FilterUserOperationRevertReason is a free log retrieval operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// FilterAliasDeclared is a free log retrieval operation binding the contract event 0xf9528232876ca43a75b6f0ae52cdae8a80b29a7a53569f2e9966c414fa029195. // -// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) -func (_APConfig *APConfigFilterer) FilterUserOperationRevertReason(opts *bind.FilterOpts, userOpHash [][32]byte, sender []common.Address) (*APConfigUserOperationRevertReasonIterator, error) { +// Solidity: event AliasDeclared(address indexed operator, address indexed aliasAddress) +func (_APConfig *APConfigFilterer) FilterAliasDeclared(opts *bind.FilterOpts, operator []common.Address, aliasAddress []common.Address) (*APConfigAliasDeclaredIterator, error) { - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) + var aliasAddressRule []interface{} + for _, aliasAddressItem := range aliasAddress { + aliasAddressRule = append(aliasAddressRule, aliasAddressItem) } - logs, sub, err := _APConfig.contract.FilterLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + logs, sub, err := _APConfig.contract.FilterLogs(opts, "AliasDeclared", operatorRule, aliasAddressRule) if err != nil { return nil, err } - return &APConfigUserOperationRevertReasonIterator{contract: _APConfig.contract, event: "UserOperationRevertReason", logs: logs, sub: sub}, nil + return &APConfigAliasDeclaredIterator{contract: _APConfig.contract, event: "AliasDeclared", logs: logs, sub: sub}, nil } -// WatchUserOperationRevertReason is a free log subscription operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// WatchAliasDeclared is a free log subscription operation binding the contract event 0xf9528232876ca43a75b6f0ae52cdae8a80b29a7a53569f2e9966c414fa029195. // -// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) -func (_APConfig *APConfigFilterer) WatchUserOperationRevertReason(opts *bind.WatchOpts, sink chan<- *APConfigUserOperationRevertReason, userOpHash [][32]byte, sender []common.Address) (event.Subscription, error) { +// Solidity: event AliasDeclared(address indexed operator, address indexed aliasAddress) +func (_APConfig *APConfigFilterer) WatchAliasDeclared(opts *bind.WatchOpts, sink chan<- *APConfigAliasDeclared, operator []common.Address, aliasAddress []common.Address) (event.Subscription, error) { - var userOpHashRule []interface{} - for _, userOpHashItem := range userOpHash { - userOpHashRule = append(userOpHashRule, userOpHashItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) + var aliasAddressRule []interface{} + for _, aliasAddressItem := range aliasAddress { + aliasAddressRule = append(aliasAddressRule, aliasAddressItem) } - logs, sub, err := _APConfig.contract.WatchLogs(opts, "UserOperationRevertReason", userOpHashRule, senderRule) + logs, sub, err := _APConfig.contract.WatchLogs(opts, "AliasDeclared", operatorRule, aliasAddressRule) if err != nil { return nil, err } @@ -2081,8 +403,8 @@ func (_APConfig *APConfigFilterer) WatchUserOperationRevertReason(opts *bind.Wat select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(APConfigUserOperationRevertReason) - if err := _APConfig.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { + event := new(APConfigAliasDeclared) + if err := _APConfig.contract.UnpackLog(event, "AliasDeclared", log); err != nil { return err } event.Raw = log @@ -2103,21 +425,21 @@ func (_APConfig *APConfigFilterer) WatchUserOperationRevertReason(opts *bind.Wat }), nil } -// ParseUserOperationRevertReason is a log parse operation binding the contract event 0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201. +// ParseAliasDeclared is a log parse operation binding the contract event 0xf9528232876ca43a75b6f0ae52cdae8a80b29a7a53569f2e9966c414fa029195. // -// Solidity: event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) -func (_APConfig *APConfigFilterer) ParseUserOperationRevertReason(log types.Log) (*APConfigUserOperationRevertReason, error) { - event := new(APConfigUserOperationRevertReason) - if err := _APConfig.contract.UnpackLog(event, "UserOperationRevertReason", log); err != nil { +// Solidity: event AliasDeclared(address indexed operator, address indexed aliasAddress) +func (_APConfig *APConfigFilterer) ParseAliasDeclared(log types.Log) (*APConfigAliasDeclared, error) { + event := new(APConfigAliasDeclared) + if err := _APConfig.contract.UnpackLog(event, "AliasDeclared", log); err != nil { return nil, err } event.Raw = log return event, nil } -// APConfigWithdrawnIterator is returned from FilterWithdrawn and is used to iterate over the raw logs and unpacked data for Withdrawn events raised by the APConfig contract. -type APConfigWithdrawnIterator struct { - Event *APConfigWithdrawn // Event containing the contract specifics and raw log +// APConfigAliasUndeclaredIterator is returned from FilterAliasUndeclared and is used to iterate over the raw logs and unpacked data for AliasUndeclared events raised by the APConfig contract. +type APConfigAliasUndeclaredIterator struct { + Event *APConfigAliasUndeclared // 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 @@ -2131,7 +453,7 @@ type APConfigWithdrawnIterator 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 *APConfigWithdrawnIterator) Next() bool { +func (it *APConfigAliasUndeclaredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2140,7 +462,7 @@ func (it *APConfigWithdrawnIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(APConfigWithdrawn) + it.Event = new(APConfigAliasUndeclared) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2155,7 +477,7 @@ func (it *APConfigWithdrawnIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(APConfigWithdrawn) + it.Event = new(APConfigAliasUndeclared) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2171,53 +493,51 @@ func (it *APConfigWithdrawnIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *APConfigWithdrawnIterator) Error() error { +func (it *APConfigAliasUndeclaredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *APConfigWithdrawnIterator) Close() error { +func (it *APConfigAliasUndeclaredIterator) Close() error { it.sub.Unsubscribe() return nil } -// APConfigWithdrawn represents a Withdrawn event raised by the APConfig contract. -type APConfigWithdrawn struct { - Account common.Address - WithdrawAddress common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos +// APConfigAliasUndeclared represents a AliasUndeclared event raised by the APConfig contract. +type APConfigAliasUndeclared struct { + Operator common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterWithdrawn is a free log retrieval operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// FilterAliasUndeclared is a free log retrieval operation binding the contract event 0x8f92aba3a92a6e1c96ff1ae5812518155f45d1baf5651a7653e2250371805c0d. // -// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) FilterWithdrawn(opts *bind.FilterOpts, account []common.Address) (*APConfigWithdrawnIterator, error) { +// Solidity: event AliasUndeclared(address indexed operator) +func (_APConfig *APConfigFilterer) FilterAliasUndeclared(opts *bind.FilterOpts, operator []common.Address) (*APConfigAliasUndeclaredIterator, error) { - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _APConfig.contract.FilterLogs(opts, "Withdrawn", accountRule) + logs, sub, err := _APConfig.contract.FilterLogs(opts, "AliasUndeclared", operatorRule) if err != nil { return nil, err } - return &APConfigWithdrawnIterator{contract: _APConfig.contract, event: "Withdrawn", logs: logs, sub: sub}, nil + return &APConfigAliasUndeclaredIterator{contract: _APConfig.contract, event: "AliasUndeclared", logs: logs, sub: sub}, nil } -// WatchWithdrawn is a free log subscription operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// WatchAliasUndeclared is a free log subscription operation binding the contract event 0x8f92aba3a92a6e1c96ff1ae5812518155f45d1baf5651a7653e2250371805c0d. // -// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *APConfigWithdrawn, account []common.Address) (event.Subscription, error) { +// Solidity: event AliasUndeclared(address indexed operator) +func (_APConfig *APConfigFilterer) WatchAliasUndeclared(opts *bind.WatchOpts, sink chan<- *APConfigAliasUndeclared, operator []common.Address) (event.Subscription, error) { - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) } - logs, sub, err := _APConfig.contract.WatchLogs(opts, "Withdrawn", accountRule) + logs, sub, err := _APConfig.contract.WatchLogs(opts, "AliasUndeclared", operatorRule) if err != nil { return nil, err } @@ -2227,8 +547,8 @@ func (_APConfig *APConfigFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink cha select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(APConfigWithdrawn) - if err := _APConfig.contract.UnpackLog(event, "Withdrawn", log); err != nil { + event := new(APConfigAliasUndeclared) + if err := _APConfig.contract.UnpackLog(event, "AliasUndeclared", log); err != nil { return err } event.Raw = log @@ -2249,12 +569,12 @@ func (_APConfig *APConfigFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink cha }), nil } -// ParseWithdrawn is a log parse operation binding the contract event 0xd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb. +// ParseAliasUndeclared is a log parse operation binding the contract event 0x8f92aba3a92a6e1c96ff1ae5812518155f45d1baf5651a7653e2250371805c0d. // -// Solidity: event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) -func (_APConfig *APConfigFilterer) ParseWithdrawn(log types.Log) (*APConfigWithdrawn, error) { - event := new(APConfigWithdrawn) - if err := _APConfig.contract.UnpackLog(event, "Withdrawn", log); err != nil { +// Solidity: event AliasUndeclared(address indexed operator) +func (_APConfig *APConfigFilterer) ParseAliasUndeclared(log types.Log) (*APConfigAliasUndeclared, error) { + event := new(APConfigAliasUndeclared) + if err := _APConfig.contract.UnpackLog(event, "AliasUndeclared", log); err != nil { return nil, err } event.Raw = log diff --git a/operator/alias.go b/operator/alias.go index a0b7f00..844e22a 100644 --- a/operator/alias.go +++ b/operator/alias.go @@ -1,17 +1,19 @@ package operator import ( + "context" "crypto/ecdsa" "fmt" + "github.com/AvaProtocol/ap-avs/core/chainio/apconfig" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" eigensdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" ) type CreateAliasKeyOption struct { Filename string // full path to the ecdsa json key file - Passphrase string PrivateKey string } @@ -20,17 +22,19 @@ func CreateOrImportAliasKey(o CreateAliasKeyOption) { var err error var aliasEcdsaPair *ecdsa.PrivateKey - if len(o.Passphrase) == 0 { + passphrase := loadECDSAPassword() + + if len(passphrase) == 0 { fmt.Printf("missing pass phrase. aborted\n") return } - if len(o.Passphrase) <= 12 { + if len(passphrase) <= 12 { fmt.Printf("Pass pharease is too short, it should have at least 12 character. aborted\n") return } - aliasEcdsaPair, err = eigensdkecdsa.ReadKey(o.Filename, o.Passphrase) + aliasEcdsaPair, err = eigensdkecdsa.ReadKey(o.Filename, passphrase) if err == nil { fmt.Printf("%s key already existed. we won't override the key.\nTo write to a different file, set the `--name` parameter.\nUse `--help` to view parameter detail.\n", o.Filename) return @@ -48,7 +52,7 @@ func CreateOrImportAliasKey(o CreateAliasKeyOption) { } } - if err = eigensdkecdsa.WriteKey(o.Filename, aliasEcdsaPair, o.Passphrase); err != nil { + if err = eigensdkecdsa.WriteKey(o.Filename, aliasEcdsaPair, passphrase); err != nil { fmt.Printf("Error writing the file %s: %v\n", o.Filename, err) return } @@ -57,14 +61,58 @@ func CreateOrImportAliasKey(o CreateAliasKeyOption) { } // Declare alias key for the operator -func DeclareAliasKey(configPath, address string) { +func DeclareAlias(configPath, address string) { operator, err := NewOperatorFromConfigFile(configPath) if err != nil { fmt.Errorf("error creator operator from config: %w", err) } - err = operator.DeclareAlias(address) + if err = operator.DeclareAlias(address); err != nil { + panic(err) + } } -func (o *Operator) DeclareAlias(address string) { +func (o *Operator) DeclareAlias(filepath string) error { + ethRpcClient, err := ethclient.Dial(o.config.EthRpcUrl) + if err != nil { + return err + } + + apConfigContract, err := apconfig.GetContract(ethRpcClient, o.apConfigAddr) + if err != nil { + panic(fmt.Errorf("cannot create apconfig contract writer: %w", err)) + } + + noSendTxOpts, err := o.txManager.GetNoSendTxOpts() + if err != nil { + return fmt.Errorf("Error creating transaction object %v", err) + } + + passphrase := loadECDSAPassword() + + aliasEcdsaPair, err := eigensdkecdsa.ReadKey(filepath, passphrase) + if err != nil { + return fmt.Errorf("cannot parse the alias ecdsa key file %v", err) + } + + tx, err := apConfigContract.DeclareAlias( + noSendTxOpts, + crypto.PubkeyToAddress(aliasEcdsaPair.PublicKey), + ) + if err != nil { + return fmt.Errorf("Failed to create APConfig.declareAlias transaction %v", err) + } + + ctx := context.Background() + receipt, err := o.txManager.Send(ctx, tx) + if err != nil { + return fmt.Errorf("declareAlias transaction failed %w", err) + } + + if receipt.Status != 1 { + return fmt.Errorf("declareAlias transaction %w reverted", receipt.TxHash.Hex()) + } + + fmt.Printf("succesfully declared an alias for operator %s alias address %s at tx %s ", o.operatorAddr.String(), crypto.PubkeyToAddress(aliasEcdsaPair.PublicKey), receipt.TxHash.Hex()) + return nil } diff --git a/operator/envs.go b/operator/envs.go index 3d46d3a..c2f00b2 100644 --- a/operator/envs.go +++ b/operator/envs.go @@ -1,10 +1,26 @@ package operator -import "math/big" +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" +) // Populate configuration based on known env // TODO: We can fetch this dynamically from aggregator so we can upgrade the // config without the need to release operator -func (o *Operator) PopulateKnownConfigByChainID(chainID big.Int) error { +var ( + mainnetChainID = big.NewInt(0) +) + +func (o *Operator) PopulateKnownConfigByChainID(chainID *big.Int) error { + if chainID.Cmp(mainnetChainID) == 0 { + // TODO: fill in with deployment later on + o.apConfigAddr = common.HexToAddress("") + } else { + // Testnet + o.apConfigAddr = common.HexToAddress("0xb8abbb082ecaae8d1cd68378cf3b060f6f0e07eb") + } + return nil } diff --git a/operator/operator.go b/operator/operator.go index d3782aa..6c757ab 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -69,6 +69,7 @@ type Operator struct { logger logging.Logger ethClient eth.Client ethWsClient eth.Client + txManager *txmgr.SimpleTxManager // TODO(samlaf): remove both avsWriter and eigenlayerWrite from operator // they are only used for registration, so we should make a special registration package @@ -96,6 +97,9 @@ type Operator struct { aggregatorConn *grpc.ClientConn // needed when opting in to avs (allow this service manager contract to slash operator) credibleSquaringServiceManagerAddr common.Address + + // contract that hold our configuration. Currently only alias key mapping + apConfigAddr common.Address } func RunWithConfig(configPath string) { @@ -180,20 +184,17 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { return nil, err } - o.PopulateKnownConfigByChainID(chainId) + ecdsaKeyPassword := loadECDSAPassword() - ecdsaKeyPassword, ok := os.LookupEnv("OPERATOR_ECDSA_KEY_PASSWORD") - if !ok { - logger.Warnf("OPERATOR_ECDSA_KEY_PASSWORD env var not set. using empty string") - } - - signerV2, _, err := signerv2.SignerFromConfig(signerv2.Config{ + signerV2, signerAddress, err := signerv2.SignerFromConfig(signerv2.Config{ KeystorePath: c.EcdsaPrivateKeyStorePath, Password: ecdsaKeyPassword, }, chainId) + if err != nil { panic(err) } + chainioConfig := clients.BuildAllConfig{ EthHttpUrl: c.EthRpcUrl, EthWsUrl: c.EthWsUrl, @@ -214,11 +215,11 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { if err != nil { panic(err) } - skWallet, err := wallet.NewPrivateKeyWallet(ethRpcClient, signerV2, common.HexToAddress(c.OperatorAddress), logger) + skWallet, err := wallet.NewPrivateKeyWallet(ethRpcClient, signerV2, signerAddress, logger) if err != nil { panic(err) } - txMgr := txmgr.NewSimpleTxManager(skWallet, ethRpcClient, logger, common.HexToAddress(c.OperatorAddress)) + txMgr := txmgr.NewSimpleTxManager(skWallet, ethRpcClient, logger, signerAddress) avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(c.AVSRegistryCoordinatorAddress), @@ -293,6 +294,13 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { credibleSquaringServiceManagerAddr: common.HexToAddress(c.AVSRegistryCoordinatorAddress), operatorId: [32]byte{0}, // this is set below operatorEcdsaPrivateKey: operatorEcdsaPrivateKey, + + txManager: txMgr, + } + + operator.PopulateKnownConfigByChainID(chainId) + if signerAddress.Cmp(operator.operatorAddr) != 0 { + panic(fmt.Errorf("ECDSA private key doesn't match operator address")) } // OperatorId is set in contract during registration so we get it after registering operator. diff --git a/operator/password.go b/operator/password.go new file mode 100644 index 0000000..8d0f0df --- /dev/null +++ b/operator/password.go @@ -0,0 +1,21 @@ +package operator + +import ( + "fmt" + "os" +) + +// lookup and return passphrase from env var. panic to fail fast if a passphrase +// isn't existed in the env +func loadECDSAPassword() string { + passphrase, ok := os.LookupEnv("OPERATOR_ECDSA_KEY_PASSWORD") + if !ok { + panic(fmt.Errorf("missing OPERATOR_ECDSA_KEY_PASSWORD env var")) + } + + if passphrase == "" { + panic("passphrase is empty. pleae make sure you define OPERATOR_ECDSA_KEY_PASSWORD") + } + + return passphrase +} From 6ea7841cbca836b451e8e5c46596fbf6ee2b2214 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 03:49:59 -0700 Subject: [PATCH 03/11] verify operator vs alias on boot --- core/chainio/apconfig/apconfig.go | 9 +++++++-- operator/alias.go | 8 +------- operator/operator.go | 14 +++++++++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/core/chainio/apconfig/apconfig.go b/core/chainio/apconfig/apconfig.go index c576935..77c8f86 100644 --- a/core/chainio/apconfig/apconfig.go +++ b/core/chainio/apconfig/apconfig.go @@ -5,6 +5,11 @@ import ( "github.com/ethereum/go-ethereum/ethclient" ) -func GetContract(conn *ethclient.Client, address common.Address) (*APConfig, error) { - return NewAPConfig(address, conn) +func GetContract(ethRpcURL string, address common.Address) (*APConfig, error) { + ethRpcClient, err := ethclient.Dial(ethRpcURL) + if err != nil { + return nil, err + } + + return NewAPConfig(address, ethRpcClient) } diff --git a/operator/alias.go b/operator/alias.go index 844e22a..17204b6 100644 --- a/operator/alias.go +++ b/operator/alias.go @@ -7,7 +7,6 @@ import ( "github.com/AvaProtocol/ap-avs/core/chainio/apconfig" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" eigensdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa" ) @@ -73,12 +72,7 @@ func DeclareAlias(configPath, address string) { } func (o *Operator) DeclareAlias(filepath string) error { - ethRpcClient, err := ethclient.Dial(o.config.EthRpcUrl) - if err != nil { - return err - } - - apConfigContract, err := apconfig.GetContract(ethRpcClient, o.apConfigAddr) + apConfigContract, err := apconfig.GetContract(o.config.EthRpcUrl, o.apConfigAddr) if err != nil { panic(fmt.Errorf("cannot create apconfig contract writer: %w", err)) } diff --git a/operator/operator.go b/operator/operator.go index 6c757ab..fd79a7e 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc" "github.com/AvaProtocol/ap-avs/core/chainio" + "github.com/AvaProtocol/ap-avs/core/chainio/apconfig" "github.com/AvaProtocol/ap-avs/metrics" "github.com/Layr-Labs/eigensdk-go/metrics/collectors/economic" rpccalls "github.com/Layr-Labs/eigensdk-go/metrics/collectors/rpc_calls" @@ -300,7 +301,18 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { operator.PopulateKnownConfigByChainID(chainId) if signerAddress.Cmp(operator.operatorAddr) != 0 { - panic(fmt.Errorf("ECDSA private key doesn't match operator address")) + logger.Infof("checking operator alias address. operator: %s alias %s", operator.operatorAddr, signerAddress) + apConfigContract, err := apconfig.GetContract(c.EthRpcUrl, operator.apConfigAddr) + aliasAddress, err := apConfigContract.GetAlias(nil, operator.operatorAddr) + if err != nil { + panic(err) + } + + if signerAddress.Cmp(aliasAddress) == 0 { + logger.Infof("Confirm operator %s matches alias %s", operator.operatorAddr, signerAddress) + } else { + panic(fmt.Errorf("ECDSA private key doesn't match operator address")) + } } // OperatorId is set in contract during registration so we get it after registering operator. From 59593112671d8c5cf2d0b87e1b2498e3c30f3d90 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 03:54:39 -0700 Subject: [PATCH 04/11] add header --- cmd/createAliasKey.go | 2 +- cmd/declareAlias.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/createAliasKey.go b/cmd/createAliasKey.go index efb9710..dcbca2a 100644 --- a/cmd/createAliasKey.go +++ b/cmd/createAliasKey.go @@ -1,5 +1,5 @@ /* -Copyright © 2024 NAME HERE +Copyright © 2024 Ava Protocol */ package cmd diff --git a/cmd/declareAlias.go b/cmd/declareAlias.go index 54aa1df..0ec113f 100644 --- a/cmd/declareAlias.go +++ b/cmd/declareAlias.go @@ -1,5 +1,5 @@ /* -Copyright © 2024 NAME HERE +Copyright © 2024 Ava Protocol */ package cmd From e617c4341c2975451f8b8b7cf3e38c8cf682bac1 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 03:55:07 -0700 Subject: [PATCH 05/11] add deploy script --- contracts/script/DeployAPConfig.s.sol | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 contracts/script/DeployAPConfig.s.sol diff --git a/contracts/script/DeployAPConfig.s.sol b/contracts/script/DeployAPConfig.s.sol new file mode 100644 index 0000000..65cac2c --- /dev/null +++ b/contracts/script/DeployAPConfig.s.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.12; + +import "forge-std/Script.sol"; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; + +import {APConfig} from "../src/core/APConfig.sol"; + +contract DeployAPConfig is Script { + function run() external { + address oakAVSProxyAdmin = vm.envAddress("PROXY_ADMIN_ADDRESS"); + + vm.startBroadcast(); + + // 1. Deploy the implementation + APConfig apConfig = new APConfig(); + + // 1. Deploy the proxy contract first if needed + // When re-deploying we won't need to run this but get the address from + TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( + address(apConfig), + address(oakAVSProxyAdmin), + "" + ); + + string memory output = "APConfig deployment output"; + vm.serializeAddress(output, "apConfigImpl", address(apConfig)); + vm.serializeAddress(output, "apConfigProxy", address(proxy)); + + string memory registryJson = vm.serializeString(output, "object", output); + vm.writeJson(registryJson, "./script/output/ap_config.json"); + + } +} From 248ebe8a9317dbf3fe158b8fd0a9ceb8bb93f739 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 03:55:59 -0700 Subject: [PATCH 06/11] update ignore file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fb007bb..2463d30 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ metadata.json # Ignores yaml configuration files in the config directory config/*.yaml + +contracts/script/output/ From f47a3ff2f43815a3e17c2901d1523ac0e3860b60 Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 16:34:10 -0700 Subject: [PATCH 07/11] handle swap impl for ap config --- contracts/script/DeployAPConfig.s.sol | 48 +++++++++++++++++++-------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/contracts/script/DeployAPConfig.s.sol b/contracts/script/DeployAPConfig.s.sol index 65cac2c..9a7b0d3 100644 --- a/contracts/script/DeployAPConfig.s.sol +++ b/contracts/script/DeployAPConfig.s.sol @@ -8,29 +8,51 @@ import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import {APConfig} from "../src/core/APConfig.sol"; +// To deployment and swap the implementation set 2 envs: +// CREATE_PROXY=false +// AP_PROXY_ADDRESS=0x123 +// PROXY_ADMIN_ADDRESS=0x456 +// When seeing the two env, the script will upgrade the underlying contract +// +// Example: +// AP_PROXY_ADDRESS=0xb8abbb082ecaae8d1cd68378cf3b060f6f0e07eb \ +// SWAP_IMPL=true bash deploy-ap-config.sh contract DeployAPConfig is Script { function run() external { - address oakAVSProxyAdmin = vm.envAddress("PROXY_ADMIN_ADDRESS"); + address oakAVSProxyAdmin = vm.envAddress("PROXY_ADMIN_ADDRESS"); + bool swapImpl = vm.envBool("SWAP_IMPL"); vm.startBroadcast(); - // 1. Deploy the implementation - APConfig apConfig = new APConfig(); - - // 1. Deploy the proxy contract first if needed - // When re-deploying we won't need to run this but get the address from - TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( - address(apConfig), - address(oakAVSProxyAdmin), - "" - ); - string memory output = "APConfig deployment output"; + + // 1. Deploy the implementation + APConfig apConfig = new APConfig(); vm.serializeAddress(output, "apConfigImpl", address(apConfig)); - vm.serializeAddress(output, "apConfigProxy", address(proxy)); + + if (swapImpl) { + ProxyAdmin oakProxyAdmin = + ProxyAdmin(oakAVSProxyAdmin); + + // 3. Here we want + address apProxyAddress = vm.envAddress("AP_PROXY_ADDRESS"); + oakProxyAdmin.upgrade( + TransparentUpgradeableProxy(payable(apProxyAddress)), + address(apConfig) + ); + } else { + // 2. Deploy the proxy contract + TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy( + address(apConfig), + address(oakAVSProxyAdmin), + "" + ); + vm.serializeAddress(output, "apConfigProxy", address(proxy)); + } string memory registryJson = vm.serializeString(output, "object", output); vm.writeJson(registryJson, "./script/output/ap_config.json"); + vm.stopBroadcast(); } } From 849fb2c60ab78e4536b63f5c36c526b11d431a6e Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 16:34:47 -0700 Subject: [PATCH 08/11] handle remove alias --- cmd/removeAlias.go | 29 +++++++++++++++++++++++++++ operator/alias.go | 47 ++++++++++++++++++++++++++++++++++++++++++++ operator/operator.go | 5 +++++ 3 files changed, 81 insertions(+) create mode 100644 cmd/removeAlias.go diff --git a/cmd/removeAlias.go b/cmd/removeAlias.go new file mode 100644 index 0000000..ac4e12a --- /dev/null +++ b/cmd/removeAlias.go @@ -0,0 +1,29 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + "github.com/spf13/cobra" + + "github.com/AvaProtocol/ap-avs/operator" +) + +// removeAliasCmd represents the removeAlias command +var removeAliasCmd = &cobra.Command{ + Use: "remove-alias", + Short: "Unbind alias address from your operator", + Long: `Unbind alias key from your operator address + +After removal, you will either need to setup another alias key, or to use your operator ECDSA key. + +When removing alias, you can run it with alias key +`, + Run: func(cmd *cobra.Command, args []string) { + operator.RemoveAlias(config) + }, +} + +func init() { + rootCmd.AddCommand(removeAliasCmd) +} diff --git a/operator/alias.go b/operator/alias.go index 17204b6..0d023d4 100644 --- a/operator/alias.go +++ b/operator/alias.go @@ -110,3 +110,50 @@ func (o *Operator) DeclareAlias(filepath string) error { fmt.Printf("succesfully declared an alias for operator %s alias address %s at tx %s ", o.operatorAddr.String(), crypto.PubkeyToAddress(aliasEcdsaPair.PublicKey), receipt.TxHash.Hex()) return nil } + +// Remove alias key for the operator +func RemoveAlias(configPath string) { + operator, err := NewOperatorFromConfigFile(configPath) + fmt.Println(configPath) + if err != nil { + fmt.Errorf("error creator operator from config: %w", err) + } + + if err = operator.RemoveAlias(); err != nil { + panic(err) + } +} + +func (o *Operator) RemoveAlias() error { + apConfigContract, err := apconfig.GetContract(o.config.EthRpcUrl, o.apConfigAddr) + if err != nil { + panic(fmt.Errorf("cannot create apconfig contract writer: %w", err)) + } + + if o.signerAddress.Cmp(o.operatorAddr) == 0 { + return fmt.Errorf("not using alias key") + } + + noSendTxOpts, err := o.txManager.GetNoSendTxOpts() + if err != nil { + return fmt.Errorf("Error creating transaction object %v", err) + } + + tx, err := apConfigContract.Undeclare(noSendTxOpts) + if err != nil { + return fmt.Errorf("Failed to create APConfig.declareAlias transaction %v", err) + } + + ctx := context.Background() + receipt, err := o.txManager.Send(ctx, tx) + if err != nil { + return fmt.Errorf("declareAlias transaction failed %w", err) + } + + if receipt.Status != 1 { + return fmt.Errorf("declareAlias transaction %w reverted", receipt.TxHash.Hex()) + } + + fmt.Printf("succesfully remove alias %s for operator %s at tx %s ", o.signerAddress.String(), o.operatorAddr.String(), receipt.TxHash.Hex()) + return nil +} diff --git a/operator/operator.go b/operator/operator.go index fd79a7e..3c1a33d 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -91,6 +91,9 @@ type Operator struct { // Through the passpharese of operator ecdsa, we can compute the private key operatorEcdsaPrivateKey *ecdsa.PrivateKey + // signerAddress match operatorAddr unless the operator use alias key + signerAddress common.Address + // receive new tasks in this chan (typically from listening to onchain event) newTaskCreatedChan chan *cstaskmanager.ContractAutomationTaskManagerNewTaskCreated // rpc client to send signed task responses to aggregator @@ -287,6 +290,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { eigenlayerWriter: sdkClients.ElChainWriter, blsKeypair: blsKeyPair, operatorAddr: common.HexToAddress(c.OperatorAddress), + signerAddress: signerAddress, aggregatorRpcClient: aggregatorRpcClient, aggregatorConn: aggregatorConn, @@ -325,6 +329,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { logger.Info("Operator info", "operatorId", operatorId, "operatorAddr", c.OperatorAddress, + "signerAddr", operator.signerAddress, "operatorG1Pubkey", operator.blsKeypair.GetPubKeyG1(), "operatorG2Pubkey", operator.blsKeypair.GetPubKeyG2(), ) From 79c4045d5e9c98e37af7dd7045176a6f93764e6d Mon Sep 17 00:00:00 2001 From: Vinh Date: Thu, 11 Jul 2024 16:35:07 -0700 Subject: [PATCH 09/11] update remove alias --- contracts/src/core/APConfig.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/src/core/APConfig.sol b/contracts/src/core/APConfig.sol index 40c8e3b..dc2dfe5 100644 --- a/contracts/src/core/APConfig.sol +++ b/contracts/src/core/APConfig.sol @@ -20,10 +20,10 @@ contract APConfig is IAPConfig { // Function to undeclare an alias for the operator function undeclare() external override { - require(operatorToAlias[msg.sender] != address(0), "No alias declared for this operator"); + require(aliasToOperator[msg.sender] != address(0), "No alias declared for this operator"); - delete operatorToAlias[msg.sender]; - delete aliasToOperator[operatorToAlias[msg.sender]]; + delete operatorToAlias[aliasToOperator[msg.sender]]; + delete aliasToOperator[msg.sender]; emit AliasUndeclared(msg.sender); } From e4b4f38b825d1032e4ba8df5b2c98394d119c232 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 12 Jul 2024 12:03:15 -0700 Subject: [PATCH 10/11] move alias key verification to start --- operator/operator.go | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/operator/operator.go b/operator/operator.go index 3c1a33d..f38ea52 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -156,7 +156,7 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { } ethWsClient, err = eth.NewInstrumentedClient(c.EthWsUrl, rpcCallsCollector) if err != nil { - logger.Errorf("Cannot create ws ethclient", "err", err) + logger.Errorf("Cannot create ws ethclient %s %w", c.EthWsUrl, err) return nil, err } } else { @@ -304,20 +304,6 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { } operator.PopulateKnownConfigByChainID(chainId) - if signerAddress.Cmp(operator.operatorAddr) != 0 { - logger.Infof("checking operator alias address. operator: %s alias %s", operator.operatorAddr, signerAddress) - apConfigContract, err := apconfig.GetContract(c.EthRpcUrl, operator.apConfigAddr) - aliasAddress, err := apConfigContract.GetAlias(nil, operator.operatorAddr) - if err != nil { - panic(err) - } - - if signerAddress.Cmp(aliasAddress) == 0 { - logger.Infof("Confirm operator %s matches alias %s", operator.operatorAddr, signerAddress) - } else { - panic(fmt.Errorf("ECDSA private key doesn't match operator address")) - } - } // OperatorId is set in contract during registration so we get it after registering operator. operatorId, err := sdkClients.AvsRegistryChainReader.GetOperatorId(&bind.CallOpts{}, operator.operatorAddr) @@ -339,6 +325,22 @@ func NewOperatorFromConfig(c OperatorConfig) (*Operator, error) { } func (o *Operator) Start(ctx context.Context) error { + if o.signerAddress.Cmp(o.operatorAddr) != 0 { + // Ensure alias key is correctly bind to operator address + o.logger.Infof("checking operator alias address. operator: %s alias %s", o.operatorAddr, o.signerAddress) + apConfigContract, err := apconfig.GetContract(o.config.EthRpcUrl, o.apConfigAddr) + aliasAddress, err := apConfigContract.GetAlias(nil, o.operatorAddr) + if err != nil { + panic(err) + } + + if o.signerAddress.Cmp(aliasAddress) == 0 { + o.logger.Infof("Confirm operator %s matches alias %s", o.operatorAddr, o.signerAddress) + } else { + panic(fmt.Errorf("ECDSA private key doesn't match operator address")) + } + } + operatorIsRegistered, err := o.avsReader.IsOperatorRegistered(&bind.CallOpts{}, o.operatorAddr) if err != nil { o.logger.Error("Error checking if operator is registered", "err", err) From 72198cd1f5c7717ebe882488af0b250193151065 Mon Sep 17 00:00:00 2001 From: Vinh Date: Fri, 12 Jul 2024 12:52:28 -0700 Subject: [PATCH 11/11] update mainnet contract for APConfig --- README.md | 1 + operator/envs.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e85a510..acbb42d 100644 --- a/README.md +++ b/README.md @@ -173,3 +173,4 @@ Coming soon | PauserRegistry | [`0xeec585186c37c517030ba371deac5c17e728c135`](https://etherscan.io/address/0xeec585186c37c517030ba371deac5c17e728c135) | | StakeRegistry | [`0x363b3604fE8c2323a98c00906115c8b87a512a12`](https://etherscan.io/address/0x363b3604fE8c2323a98c00906115c8b87a512a12) | | TaskManager | [`0x940f62f75cbbbd723d37c9171dc681dfba653b49`](https://etherscan.io/address/0x940f62f75cbbbd723d37c9171dc681dfba653b49) | +| ApConfig | [`0x9c02dfc92eea988902a98919bf4f035e4aaefced`](https://etherscan.io/address/0x9c02dfc92eea988902a98919bf4f035e4aaefced) | diff --git a/operator/envs.go b/operator/envs.go index c2f00b2..09ebdc0 100644 --- a/operator/envs.go +++ b/operator/envs.go @@ -16,7 +16,7 @@ var ( func (o *Operator) PopulateKnownConfigByChainID(chainID *big.Int) error { if chainID.Cmp(mainnetChainID) == 0 { // TODO: fill in with deployment later on - o.apConfigAddr = common.HexToAddress("") + o.apConfigAddr = common.HexToAddress("0x9c02dfc92eea988902a98919bf4f035e4aaefced") } else { // Testnet o.apConfigAddr = common.HexToAddress("0xb8abbb082ecaae8d1cd68378cf3b060f6f0e07eb")