diff --git a/docker-bake.hcl b/docker-bake.hcl index 4639425dd62..2484a26fc34 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -112,6 +112,19 @@ target "op-batcher" { tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-batcher:${tag}"] } +target "op-batcher-enclave" { + dockerfile = "ops/docker/op-stack-go/Dockerfile" + context = "." + args = { + GIT_COMMIT = "${GIT_COMMIT}" + GIT_DATE = "${GIT_DATE}" + OP_BATCHER_VERSION = "${OP_BATCHER_VERSION}" + } + target = "op-batcher-enclave-target" + platforms = split(",", PLATFORMS) + tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-batcher-enclave:${tag}"] +} + target "op-proposer" { dockerfile = "ops/docker/op-stack-go/Dockerfile" context = "." diff --git a/espresso/enclave-tests/enclave_smoke_test.go b/espresso/enclave-tests/enclave_smoke_test.go new file mode 100644 index 00000000000..b8746f8ebcc --- /dev/null +++ b/espresso/enclave-tests/enclave_smoke_test.go @@ -0,0 +1,46 @@ +// Steps to run these tests on a Nitro-enabled EC2 machine: +// +// - Run `just op-batcher-enclave-image` in kurtosis-devnet/ folder +// This is just to warm up the docker build cache, otherwise +// tests may time out building the batcher image from scratch +// +// - `export ESPRESSO_RUN_ENCLAVE_TESTS=true` +// Enclave tests are skipped by default +// +// - `go test ./espresso/enclave-tests/...` +// Run the tests +package enclave_tests + +import ( + "context" + "testing" + + env "github.com/ethereum-optimism/optimism/espresso/environment" +) + +// TestE2eDevNetWithEspressoSimpleTransactions launches the e2e Dev Net with the Espresso Dev Node +// and runs a couple of simple transactions to it. +func TestE2eDevNetWithEspressoSimpleTransactions(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + env.RunOnlyWithEnclave(t) + + launcher := new(env.EspressoDevNodeLauncherDocker) + launcher.EnclaveBatcher = true + + system, espressoDevNode, err := launcher.StartDevNet(ctx, t) + if have, want := err, error(nil); have != want { + t.Fatalf("failed to start dev environment with espresso dev node:\nhave:\n\t\"%v\"\nwant:\n\t\"%v\"\n", have, want) + } + + // Signal the testnet to shut down on exit + defer env.Stop(t, espressoDevNode) + defer env.Stop(t, system) + // Send Transaction on L1, and wait for verification on the L2 Verifier + env.RunSimpleL1TransferAndVerifier(ctx, t, system) + + // Submit a Transaction on the L2 Sequencer node, to a Burn Address + env.RunSimpleL2Burn(ctx, t, system) + +} diff --git a/espresso/environment/enclave_helpers.go b/espresso/environment/enclave_helpers.go new file mode 100644 index 00000000000..db999328571 --- /dev/null +++ b/espresso/environment/enclave_helpers.go @@ -0,0 +1,416 @@ +package environment + +import ( + "bytes" + "context" + _ "embed" + "encoding/json" + "fmt" + "os" + "os/exec" + "regexp" + "strings" + "testing" + "time" + + altda "github.com/ethereum-optimism/optimism/op-alt-da" + "github.com/ethereum-optimism/optimism/op-batcher/batcher" + "github.com/ethereum-optimism/optimism/op-batcher/bindings" + "github.com/ethereum-optimism/optimism/op-batcher/flags" + "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth" + "github.com/ethereum-optimism/optimism/op-e2e/system/e2esys" + "github.com/ethereum-optimism/optimism/op-service/endpoint" + "github.com/ethereum-optimism/optimism/op-service/log" + "github.com/ethereum-optimism/optimism/op-service/metrics" + "github.com/ethereum-optimism/optimism/op-service/oppprof" + "github.com/ethereum-optimism/optimism/op-service/rpc" + "github.com/ethereum-optimism/optimism/op-service/txmgr" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/google/uuid" + "gopkg.in/yaml.v3" +) + +const ENCLAVE_INTERMEDIATE_IMAGE_TAG = "op-batcher-enclave:tests" +const ENCLAVE_IMAGE_TAG = "op-batcher-enclaver:tests" +const ESPRESSO_ENABLE_ENCLAVE_TESTS = "ESPRESSO_RUN_ENCLAVE_TESTS" + +// Skips the calling test if `ESPRESSO_ENABLE_ENCLAVE_TESTS` is not set. +func RunOnlyWithEnclave(t *testing.T) { + _, doRun := os.LookupEnv(ESPRESSO_ENABLE_ENCLAVE_TESTS) + if !doRun { + t.SkipNow() + } +} + +// Formats a configuration flag name and it's value for use in commandline, +// then adds to the args slice. +// Example: appendArg(&args, "people", []{"Alice", "Bob"}) will append +// {'--people', 'Alice,Bob'} to args +func appendArg(args *[]string, flagName string, value any) { + boolValue, isBool := value.(bool) + if isBool { + if boolValue { + *args = append(*args, fmt.Sprintf("--%s", flagName)) + } + return + } + + strSliceValue, isStrSlice := value.([]string) + if isStrSlice { + *args = append(*args, fmt.Sprintf("--%s", flagName), strings.Join(strSliceValue, ",")) + return + } + + formattedValue := fmt.Sprintf("%v", value) + if formattedValue != "" { + *args = append(*args, fmt.Sprintf("--%s", flagName), formattedValue) + } +} + +func LaunchBatcherInEnclave() DevNetLauncherOption { + return func(ct *DevNetLauncherContext) E2eSystemOption { + return E2eSystemOption{ + SysConfigOption: func(cfg *e2esys.SystemConfig) { + cfg.DisableBatcher = true + // TODO(AG): currently op-batcher calls `registerSigner` directly, + // which on the first run results in verifying the full certificate + // chain in a single transaction, which runs over gas limit. This is + // a workaround for the issue, real solution will invole verifying + // each cerficiate separately before calling `registerSigner` + cfg.DeployConfig.L1GenesisBlockGasLimit = 90_000_000 + }, + StartOptions: []e2esys.StartOption{ + { + Role: "launch-batcher-in-enclave", + + BatcherMod: func(c *batcher.CLIConfig, sys *e2esys.System) { + // We will manually convert CLIConfig back to commandline arguments + var args []string + + // We don't want to stop this batcher + appendArg(&args, flags.StoppedFlag.Name, false) + + // These flags require separate handling: we want to use HTTP endpoints, + // as Odyn proxy inside the enclave doesn't support websocket + l1Rpc := sys.L1.UserRPC().(endpoint.HttpRPC).HttpRPC() + appendArg(&args, flags.L1EthRpcFlag.Name, l1Rpc) + appendArg(&args, txmgr.L1RPCFlagName, l1Rpc) + l2EthRpc := sys.EthInstances[e2esys.RoleSeq].UserRPC().(endpoint.HttpRPC).HttpRPC() + appendArg(&args, flags.L2EthRpcFlag.Name, l2EthRpc) + rollupRpc := sys.RollupNodes[e2esys.RoleSeq].UserRPC().(endpoint.HttpRPC).HttpRPC() + appendArg(&args, flags.RollupRpcFlag.Name, rollupRpc) + + // Batcher flags + appendArg(&args, flags.ActiveSequencerCheckDurationFlag.Name, c.ActiveSequencerCheckDuration) + appendArg(&args, flags.ApproxComprRatioFlag.Name, c.ApproxComprRatio) + appendArg(&args, flags.BatchTypeFlag.Name, c.BatchType) + appendArg(&args, flags.CheckRecentTxsDepthFlag.Name, c.CheckRecentTxsDepth) + appendArg(&args, flags.CompressionAlgoFlag.Name, c.CompressionAlgo.String()) + appendArg(&args, flags.CompressorFlag.Name, c.Compressor) + appendArg(&args, flags.DataAvailabilityTypeFlag.Name, c.DataAvailabilityType.String()) + appendArg(&args, flags.EspressoLCAddrFlag.Name, c.EspressoLightClientAddr) + appendArg(&args, flags.EspressoPollIntervalFlag.Name, c.EspressoPollInterval) + appendArg(&args, flags.MaxBlocksPerSpanBatch.Name, c.MaxBlocksPerSpanBatch) + appendArg(&args, flags.MaxChannelDurationFlag.Name, c.MaxChannelDuration) + appendArg(&args, flags.MaxL1TxSizeBytesFlag.Name, c.MaxL1TxSize) + appendArg(&args, flags.MaxPendingTransactionsFlag.Name, c.MaxPendingTransactions) + appendArg(&args, flags.PollIntervalFlag.Name, c.PollInterval) + appendArg(&args, flags.PreferLocalSafeL2Flag.Name, c.PreferLocalSafeL2) + appendArg(&args, flags.SubSafetyMarginFlag.Name, c.SubSafetyMargin) + appendArg(&args, flags.TargetNumFramesFlag.Name, c.TargetNumFrames) + appendArg(&args, flags.ThrottleAlwaysBlockSizeFlag.Name, c.ThrottleAlwaysBlockSize) + appendArg(&args, flags.ThrottleBlockSizeFlag.Name, c.ThrottleBlockSize) + appendArg(&args, flags.ThrottleThresholdFlag.Name, c.ThrottleThreshold) + appendArg(&args, flags.ThrottleTxSizeFlag.Name, c.ThrottleTxSize) + appendArg(&args, flags.WaitNodeSyncFlag.Name, c.WaitNodeSync) + appendArg(&args, flags.EspressoUrlsFlag.Name, c.EspressoUrls) + appendArg(&args, flags.EspressoLCAddrFlag.Name, c.EspressoLightClientAddr) + appendArg(&args, flags.TestingEspressoBatcherPrivateKeyFlag.Name, c.TestingEspressoBatcherPrivateKey) + + // TxMgr flags + appendArg(&args, txmgr.MnemonicFlagName, c.TxMgrConfig.Mnemonic) + appendArg(&args, txmgr.HDPathFlagName, c.TxMgrConfig.HDPath) + appendArg(&args, txmgr.SequencerHDPathFlag.Name, c.TxMgrConfig.SequencerHDPath) + appendArg(&args, txmgr.L2OutputHDPathFlag.Name, c.TxMgrConfig.L2OutputHDPath) + appendArg(&args, txmgr.PrivateKeyFlagName, c.TxMgrConfig.PrivateKey) + appendArg(&args, txmgr.NumConfirmationsFlagName, c.TxMgrConfig.NumConfirmations) + appendArg(&args, txmgr.SafeAbortNonceTooLowCountFlagName, c.TxMgrConfig.SafeAbortNonceTooLowCount) + appendArg(&args, txmgr.FeeLimitMultiplierFlagName, c.TxMgrConfig.FeeLimitMultiplier) + appendArg(&args, txmgr.FeeLimitThresholdFlagName, c.TxMgrConfig.FeeLimitThresholdGwei) + appendArg(&args, txmgr.MinBaseFeeFlagName, c.TxMgrConfig.MinBaseFeeGwei) + appendArg(&args, txmgr.MinTipCapFlagName, c.TxMgrConfig.MinTipCapGwei) + appendArg(&args, txmgr.ResubmissionTimeoutFlagName, c.TxMgrConfig.ResubmissionTimeout) + appendArg(&args, txmgr.ReceiptQueryIntervalFlagName, c.TxMgrConfig.ReceiptQueryInterval) + appendArg(&args, txmgr.NetworkTimeoutFlagName, c.TxMgrConfig.NetworkTimeout) + appendArg(&args, txmgr.TxNotInMempoolTimeoutFlagName, c.TxMgrConfig.TxNotInMempoolTimeout) + appendArg(&args, txmgr.TxSendTimeoutFlagName, c.TxMgrConfig.TxSendTimeout) + + // Log flags + appendArg(&args, log.LevelFlagName, c.LogConfig.Level) + appendArg(&args, log.ColorFlagName, c.LogConfig.Color) + appendArg(&args, log.FormatFlagName, c.LogConfig.Format.String()) + appendArg(&args, log.PidFlagName, c.LogConfig.Pid) + + // Metrics flags + appendArg(&args, metrics.EnabledFlagName, c.MetricsConfig.Enabled) + appendArg(&args, metrics.ListenAddrFlagName, c.MetricsConfig.ListenAddr) + appendArg(&args, metrics.PortFlagName, c.MetricsConfig.ListenPort) + + // Pprof flags + appendArg(&args, oppprof.EnabledFlagName, c.PprofConfig.ListenEnabled) + appendArg(&args, oppprof.ListenAddrFlagName, c.PprofConfig.ListenAddr) + appendArg(&args, oppprof.PortFlagName, c.PprofConfig.ListenPort) + appendArg(&args, oppprof.ProfileTypeFlagName, c.PprofConfig.ProfileType.String()) + appendArg(&args, oppprof.ProfilePathFlagName, c.PprofConfig.ProfileDir+"/"+c.PprofConfig.ProfileFilename) + + // RPC flags + appendArg(&args, rpc.ListenAddrFlagName, c.RPC.ListenAddr) + appendArg(&args, rpc.PortFlagName, c.RPC.ListenPort) + appendArg(&args, rpc.EnableAdminFlagName, c.RPC.EnableAdmin) + + // AltDA flags + appendArg(&args, altda.EnabledFlagName, c.AltDA.Enabled) + appendArg(&args, altda.DaServerAddressFlagName, c.AltDA.DAServerURL) + appendArg(&args, altda.VerifyOnReadFlagName, c.AltDA.VerifyOnRead) + appendArg(&args, altda.PutTimeoutFlagName, c.AltDA.PutTimeout) + appendArg(&args, altda.GetTimeoutFlagName, c.AltDA.GetTimeout) + appendArg(&args, altda.MaxConcurrentRequestsFlagName, c.AltDA.MaxConcurrentRequests) + + err := SetupEnclaver(ct.Ctx, sys, args...) + if err != nil { + panic(fmt.Sprintf("failed to setup enclaver: %v", err)) + } + + cli := new(EnclaverCli) + cli.RunEnclave(ct.Ctx, ENCLAVE_IMAGE_TAG) + }, + }, + }, + } + } +} + +// Builds docker and enclaver EIF image for op-batcher and registers EIF's PCR0 with +// EspressoNitroTEEVerifier. args... are command-line arguments to op-batcher +// to be baked into the image. +func SetupEnclaver(ctx context.Context, sys *e2esys.System, args ...string) error { + // Build underlying batcher docker image with baked-in arguments + dockerCli := new(DockerCli) + err := dockerCli.Build(ctx, + ENCLAVE_INTERMEDIATE_IMAGE_TAG, + "../../ops/docker/op-stack-go/Dockerfile", + "op-batcher-enclave-target", + "../../", + DockerBuildArg{ + Name: "ENCLAVE_BATCHER_ARGS", + Value: strings.Join(args, " "), + }) + if err != nil { + return fmt.Errorf("failed to build docker image: %w", err) + } + + // Build EIF image based on the docker image we just built + enclaverCli := new(EnclaverCli) + manifest := DefaultManifest("op-batcher", ENCLAVE_IMAGE_TAG, ENCLAVE_INTERMEDIATE_IMAGE_TAG) + measurements, err := enclaverCli.BuildEnclave(ctx, manifest) + if err != nil { + return fmt.Errorf("failed to build enclave image: %w", err) + } + pcr0Bytes, err := hexutil.Decode("0x" + measurements.PCR0) + if err != nil { + return fmt.Errorf("failed to decode PCR0: %w", err) + } + + return RegisterEnclaveHash(ctx, sys, pcr0Bytes) +} + +// RegisterEnclaveHash registers the enclave PCR0 hash with the EspressoNitroTEEVerifier. +func RegisterEnclaveHash(ctx context.Context, sys *e2esys.System, pcr0Bytes []byte) error { + l1Client := sys.NodeClient(e2esys.RoleL1) + authenticator, err := bindings.NewBatchAuthenticator(sys.RollupConfig.BatchAuthenticatorAddress, l1Client) + if err != nil { + return fmt.Errorf("failed to create batch authenticator: %w", err) + } + + verifierAddress, err := authenticator.EspressoTEEVerifier(&bind.CallOpts{}) + if err != nil { + return fmt.Errorf("failed to get verifier address: %w", err) + } + + verifier, err := bindings.NewEspressoTEEVerifier(verifierAddress, l1Client) + if err != nil { + return fmt.Errorf("failed to create verifier: %w", err) + } + + nitroVerifierAddress, err := verifier.EspressoNitroTEEVerifier(&bind.CallOpts{}) + if err != nil { + return fmt.Errorf("failed to get nitro verifier address: %w", err) + } + + nitroVerifier, err := bindings.NewEspressoNitroTEEVerifier(nitroVerifierAddress, l1Client) + if err != nil { + return fmt.Errorf("failed to create nitro verifier: %w", err) + } + + opts, err := bind.NewKeyedTransactorWithChainID(sys.Cfg.Secrets.Deployer, sys.Cfg.L1ChainIDBig()) + if err != nil { + return fmt.Errorf("failed to create transactor: %w", err) + } + registrationTx, err := nitroVerifier.SetEnclaveHash(opts, crypto.Keccak256Hash(pcr0Bytes), true) + if err != nil { + return fmt.Errorf("failed to create registration transaction: %w", err) + } + + receipt, err := geth.WaitForTransaction(registrationTx.Hash(), l1Client, 2*time.Minute) + if err != nil { + return fmt.Errorf("failed to wait for registration transaction: %w", err) + } + + if receipt.Status != types.ReceiptStatusSuccessful { + return fmt.Errorf("registration transaction failed") + } + + return nil +} + +type EnclaverManifestSources struct { + App string `yaml:"app"` +} + +type EnclaverManifestDefaults struct { + CpuCount uint `yaml:"cpu_count"` + MemoryMb uint `yaml:"memory_mb"` +} + +type EnclaverManifestKmsProxy struct { + ListenPort uint16 `yaml:"listen_port,omitempty"` +} + +type EnclaverManifestEgress struct { + Allow []string `yaml:"allow"` + Deny []string `yaml:"deny"` + ProxyPort uint16 `yaml:"proxy_port,omitempty"` +} + +type EnclaverManifestIngress struct { + ListenPort uint16 `yaml:"listen_port"` +} + +type EnclaverManifest struct { + Version string `yaml:"version"` + Name string `yaml:"name"` + Target string `yaml:"target"` + Sources *EnclaverManifestSources `yaml:"sources,omitempty"` + Defaults *EnclaverManifestDefaults `yaml:"defaults,omitempty"` + KmsProxy *EnclaverManifestKmsProxy `yaml:"kms_proxy,omitempty"` + Egress *EnclaverManifestEgress `yaml:"egress,omitempty"` + Ingress []EnclaverManifestIngress `yaml:"ingress"` +} + +func DefaultManifest(name string, target string, source string) EnclaverManifest { + return EnclaverManifest{ + Version: "v1", + Name: name, + Target: target, + Sources: &EnclaverManifestSources{ + App: source, + }, + Defaults: &EnclaverManifestDefaults{ + CpuCount: 2, + MemoryMb: 4096, + }, + Egress: &EnclaverManifestEgress{ + ProxyPort: 10000, + Allow: []string{"0.0.0.0/0", "**", "::/0"}, + }, + } +} + +type EnclaveMeasurements struct { + PCR0 string `json:"PCR0"` + PCR1 string `json:"PCR1"` + PCR2 string `json:"PCR2"` +} + +type EnclaverBuildOutput struct { + Measurements EnclaveMeasurements `json:"Measurements"` +} + +type EnclaverCli struct{} + +// BuildEnclave builds an enclaver EIF image using the provided manifest. If build is successful, +// it returns the image's Measurements. +func (*EnclaverCli) BuildEnclave(ctx context.Context, manifest EnclaverManifest) (*EnclaveMeasurements, error) { + tempfile, err := os.CreateTemp("", "enclaver-manifest") + if err != nil { + return nil, err + } + defer os.Remove(tempfile.Name()) + + if err := yaml.NewEncoder(tempfile).Encode(manifest); err != nil { + return nil, err + } + + var stdout bytes.Buffer + cmd := exec.CommandContext( + ctx, + "enclaver", + "build", + "--file", + tempfile.Name(), + ) + cmd.Stdout = &stdout + cmd.Stderr = os.Stderr + + err = cmd.Run() + if err != nil { + return nil, err + } + + // Find measurements in the output + re := regexp.MustCompile(`\{[\s\S]*"Measurements"[\s\S]*\}`) + jsonMatch := re.Find(stdout.Bytes()) + if jsonMatch == nil { + return nil, fmt.Errorf("could not find measurements JSON in output") + } + + var output EnclaverBuildOutput + if err := json.Unmarshal(jsonMatch, &output); err != nil { + return nil, fmt.Errorf("failed to parse measurements JSON: %v", err) + } + + return &output.Measurements, nil +} + +// RunEnclave runs an enclaver EIF image `name`. Stdout and stderr are redirected to the parent process. +func (*EnclaverCli) RunEnclave(ctx context.Context, name string) { + // We'll append this to container name to avoid conflicts + nameSuffix := uuid.New().String()[:8] + + // We don't use 'enclaver run' here, because it doesn't + // support --net=host, which is required for Odyn to + // correctly resolve 'host' to parent machine's localhost + cmd := exec.CommandContext( + ctx, + "docker", + "run", + "--rm", + "--privileged", + "--net=host", + fmt.Sprintf("--name=batcher-enclaver-%s", nameSuffix), + "--device=/dev/nitro_enclaves", + name, + ) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + go func() { + err := cmd.Run() + if err != nil { + panic(fmt.Errorf("enclave exited with an error: %w", err)) + } + }() +} diff --git a/espresso/environment/espresso_docker_helpers.go b/espresso/environment/espresso_docker_helpers.go index 312dc323186..063ffce89cc 100644 --- a/espresso/environment/espresso_docker_helpers.go +++ b/espresso/environment/espresso_docker_helpers.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "log" + "os" "os/exec" "runtime" "strings" @@ -47,6 +48,13 @@ type DockerContainerConfig struct { AutoRM bool } +// DockerBuildArg is a configuration struct that is used to pass +// 'ARG' parameters when building a Docker Image +type DockerBuildArg struct { + Name string + Value string +} + // DockerCli is a simple implementation of a Docker Client that is used to // launch Docker Containers type DockerCli struct{} @@ -364,3 +372,25 @@ func (d *DockerCli) Logs(ctx context.Context, containerID string) (io.Reader, er return reader, err } + +// Build builds a Docker Image with the given tag, dockerfile, target, context, and build arguments. +func (d *DockerCli) Build(ctx context.Context, tag string, dockerfile string, target string, context string, buildArgs ...DockerBuildArg) error { + args := []string{ + "build", + "--tag", + tag, + "--file", + dockerfile, + "--target", + target, + } + for _, arg := range buildArgs { + args = append(args, "--build-arg", arg.Name+"="+arg.Value) + } + args = append(args, context) + + build := exec.CommandContext(ctx, "docker", args...) + build.Stdout = os.Stdout + build.Stderr = os.Stderr + return build.Run() +} diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index 13aa3413a75..d343f73f1bc 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -139,7 +139,10 @@ func WaitForEspressoBlockHeightToBePositive(ctx context.Context, url string) err // EspressoDevNodeLauncherDocker is an implementation of EspressoDevNodeLauncher // that uses Docker to launch the Espresso Dev Node -type EspressoDevNodeLauncherDocker struct{} +type EspressoDevNodeLauncherDocker struct { + // Whether to run batcher in enclave. + EnclaveBatcher bool +} var _ EspressoDevNetLauncher = (*EspressoDevNodeLauncherDocker)(nil) @@ -245,7 +248,14 @@ var ErrUnableToDetermineEspressoDevNodeSequencerHost = errors.New("unable to det func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *testing.T, options ...DevNetLauncherOption) (*e2esys.System, EspressoDevNode, error) { originalCtx := ctx - sysConfig := e2esys.DefaultSystemConfig(t, e2esys.WithAllocType(config.AllocTypeEspresso)) + var allocOpt e2esys.SystemConfigOpt + if l.EnclaveBatcher { + allocOpt = e2esys.WithAllocType(config.AllocTypeEspressoWithEnclave) + } else { + allocOpt = e2esys.WithAllocType(config.AllocTypeEspressoWithoutEnclave) + } + + sysConfig := e2esys.DefaultSystemConfig(t, allocOpt) // Set a short L1 block time and finalized distance to make tests faster and reach finality sooner sysConfig.DeployConfig.L1BlockTime = 2 @@ -271,6 +281,10 @@ func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *test launchEspressoDevNodeDocker(), } + if l.EnclaveBatcher { + initialOptions = append(initialOptions, LaunchBatcherInEnclave()) + } + launchContext := DevNetLauncherContext{ Ctx: originalCtx, SystemCfg: &sysConfig, @@ -307,6 +321,7 @@ func (l *EspressoDevNodeLauncherDocker) StartDevNet(ctx context.Context, t *test startOptions..., ) + launchContext.System = system if err != nil { if system != nil { @@ -422,7 +437,7 @@ func SetBatcherKey(privateKey ecdsa.PrivateKey) DevNetLauncherOption { StartOptions: []e2esys.StartOption{ { Role: "set-batcher-key", - BatcherMod: func(c *batcher.CLIConfig) { + BatcherMod: func(c *batcher.CLIConfig, sys *e2esys.System) { c.TestingEspressoBatcherPrivateKey = hexutil.Encode(crypto.FromECDSA(&privateKey)) }, }, @@ -440,7 +455,7 @@ func SetEspressoUrls(numGood int, numBad int, badServerUrl string) DevNetLaunche return E2eSystemOption{ StartOptions: []e2esys.StartOption{ { - BatcherMod: func(c *batcher.CLIConfig) { + BatcherMod: func(c *batcher.CLIConfig, sys *e2esys.System) { goodUrl := c.EspressoUrls[0] var urls []string @@ -477,7 +492,7 @@ func launchEspressoDevNodeDocker() DevNetLauncherOption { StartOptions: []e2esys.StartOption{ { Role: "launch-espresso-dev-node", - BatcherMod: func(c *batcher.CLIConfig) { + BatcherMod: func(c *batcher.CLIConfig, sys *e2esys.System) { if ct.Error != nil { // Early Return if we already have an Error set return diff --git a/espresso/environment/query_service_intercept.go b/espresso/environment/query_service_intercept.go index 0a25e2d23b5..acc48b0de3d 100644 --- a/espresso/environment/query_service_intercept.go +++ b/espresso/environment/query_service_intercept.go @@ -330,8 +330,8 @@ func (e *EspressoDevNodeIntercept) ServeHTTP(w http.ResponseWriter, r *http.Requ // createEspressoProxyOption will return a Batch CLIConfig option that will // replace the Espresso URL with the URL of the proxy server. -func createEspressoProxyOption(ctx *DevNetLauncherContext, proxy *EspressoDevNodeIntercept, server *httptest.Server) func(*batcher.CLIConfig) { - return func(cfg *batcher.CLIConfig) { +func createEspressoProxyOption(ctx *DevNetLauncherContext, proxy *EspressoDevNodeIntercept, server *httptest.Server) func(*batcher.CLIConfig, *e2esys.System) { + return func(cfg *batcher.CLIConfig, sys *e2esys.System) { if ctx.Error != nil { return } diff --git a/flake.nix b/flake.nix index 55923a8f5b9..98bd82cb451 100644 --- a/flake.nix +++ b/flake.nix @@ -5,46 +5,75 @@ foundry.url = "github:shazow/foundry.nix/main"; }; - - outputs = inputs: - inputs.flake-utils.lib.eachDefaultSystem (system: + outputs = + inputs: + inputs.flake-utils.lib.eachDefaultSystem ( + system: let - overlays = [ - inputs.foundry.overlay - ]; - espresso_go_lib_version = "v0.0.35"; - pkgs = import inputs.nixpkgs { inherit overlays system;}; - espressoGoLibFile = if system == "x86_64-linux" - then pkgs.fetchurl { - url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-x86_64-unknown-linux-gnu.a"; - sha256 = "sha256:07yfsrphfpq7w40x2rnldswzzbd4j0p5jdmm74132cqbf02pn8y8"; - } - else if system == "x86_64-darwin" then - pkgs.fetchurl { - url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-x86_64-apple-darwin.a"; - sha256 = "sha256:1va49y81p3yrf9z61srw6rfysmbbk2vix0r7l8i2mz8b3ln0gsgy"; - } - else # aarch64-darwin - pkgs.fetchurl { - url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-aarch64-apple-darwin.a"; - sha256 = "sha256:1fp0v9d3b41lkfpva6rz35xi832xq4355pw5785ym2jm69pcsnnn"; - } - ; - cgo_ld_flags = if system == "x86_64-linux" - then "-L/tmp -lespresso_crypto_helper-x86_64-unknown-linux-gnu" - else if system == "x86_64-darwin" then "-L/tmp -lespresso_crypto_helper-x86_64-apple-darwin -framework Foundation -framework SystemConfiguration" - else "-L/tmp -lespresso_crypto_helper-aarch64-apple-darwin -framework Foundation -framework SystemConfiguration" # aarch64-darwin - ; + overlays = [ + inputs.foundry.overlay + ]; + espresso_go_lib_version = "v0.0.35"; + pkgs = import inputs.nixpkgs { inherit overlays system; }; + espressoGoLibFile = + if system == "x86_64-linux" then + pkgs.fetchurl { + url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-x86_64-unknown-linux-gnu.a"; + sha256 = "sha256:07yfsrphfpq7w40x2rnldswzzbd4j0p5jdmm74132cqbf02pn8y8"; + } + else if system == "x86_64-darwin" then + pkgs.fetchurl { + url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-x86_64-apple-darwin.a"; + sha256 = "sha256:1va49y81p3yrf9z61srw6rfysmbbk2vix0r7l8i2mz8b3ln0gsgy"; + } + # aarch64-darwin + else + pkgs.fetchurl { + url = "https://github.com/EspressoSystems/espresso-network-go/releases/download/${espresso_go_lib_version}/libespresso_crypto_helper-aarch64-apple-darwin.a"; + sha256 = "sha256:1fp0v9d3b41lkfpva6rz35xi832xq4355pw5785ym2jm69pcsnnn"; + }; + cgo_ld_flags = + if system == "x86_64-linux" then + "-L/tmp -lespresso_crypto_helper-x86_64-unknown-linux-gnu" + else if system == "x86_64-darwin" then + "-L/tmp -lespresso_crypto_helper-x86_64-apple-darwin -framework Foundation -framework SystemConfiguration" + else + "-L/tmp -lespresso_crypto_helper-aarch64-apple-darwin -framework Foundation -framework SystemConfiguration" # aarch64-darwin + ; + + target_link = + if system == "x86_64-linux" then + "/tmp/libespresso_crypto_helper-x86_64-unknown-linux-gnu.a" + else if system == "x86_64-darwin" then + "/tmp/libespresso_crypto_helper-x86_64-apple-darwin.a" + else + "/tmp/libespresso_crypto_helper-aarch64-apple-darwin.a" # aarch64-darwin + ; + + enclaver = pkgs.rustPlatform.buildRustPackage rec { + pname = "enclaver"; + version = "0.5.0"; - target_link = if system == "x86_64-linux" then "/tmp/libespresso_crypto_helper-x86_64-unknown-linux-gnu.a" - else if system == "x86_64-darwin" then "/tmp/libespresso_crypto_helper-x86_64-apple-darwin.a" - else "/tmp/libespresso_crypto_helper-aarch64-apple-darwin.a" # aarch64-darwin - ; + src = pkgs.fetchFromGitHub { + owner = "enclaver-io"; + repo = pname; + rev = "v${version}"; + hash = "sha256-gfzfgcnVDRqywAJ/SC2Af6VfHPELDkoVlkhaKElMP2g="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-o+CzTn5++Mj6SP9yFeTOBn4feapnL2m1EsYmXQBqTuc="; + cargoRoot = "enclaver"; + buildAndTestSubdir = cargoRoot; + }; in { + formatter = pkgs.nixfmt-rfc-style; + devShell = pkgs.mkShell { packages = [ + enclaver pkgs.jq pkgs.yq-go pkgs.uv diff --git a/justfile b/justfile index 3d1eeef651a..43fd6bc798c 100644 --- a/justfile +++ b/justfile @@ -20,13 +20,18 @@ run-test12: compile-contracts compile-contracts: (cd packages/contracts-bedrock && just build-dev) +build-batcher-enclave-image: + (cd kurtosis-devnet && just op-batcher-enclave-image) + run-test4: compile-contracts go test ./espresso/environment/4_confirmation_integrity_with_reorgs_test.go -v - espresso-tests: compile-contracts go test -timeout=30m -p=1 -count=1 ./espresso/environment +espresso-enclave-tests: compile-contracts build-batcher-enclave-image + ESPRESSO_RUN_ENCLAVE_TESTS=true go test -timeout=30m -p=1 -count=1 ./espresso/enclave-tests/... + IMAGE_NAME := "ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:release-colorful-snake" remove-espresso-containers: docker remove --force $(docker ps -q --filter ancestor={{IMAGE_NAME}}) diff --git a/kurtosis-devnet/justfile b/kurtosis-devnet/justfile index 98d24ec373d..fbd18f64604 100644 --- a/kurtosis-devnet/justfile +++ b/kurtosis-devnet/justfile @@ -32,6 +32,7 @@ cannon-image TAG='cannon:devnet': (_docker_build_stack TAG "cannon-target") da-server-image TAG='da-server:devnet': (_docker_build_stack TAG "da-server-target") op-batcher-image TAG='op-batcher:devnet': (_docker_build_stack TAG "op-batcher-target") # TODO: this is a temporary hack to get the kona + asterisc version right. +op-batcher-enclave-image TAG='op-batcher-enclave:devnet': (_docker_build_stack TAG "op-batcher-enclave-target") # Ideally the Dockerfile should be self-sufficient (right now we depend on # docker-bake.hcl to do the right thing). op-challenger-image TAG='op-challenger:devnet': (_docker_build_stack TAG "op-challenger-target" "--build-arg" "KONA_VERSION=0.1.0-beta.15" "--build-arg" "ASTERISC_VERSION=v1.2.0") @@ -47,8 +48,6 @@ op-wheel-image TAG='op-wheel:devnet': (_docker_build_stack TAG "op-wheel-target" op-program-builder-image TAG='op-program-builder:devnet': just op-program-svc/op-program-svc {{TAG}} -KURTOSIS_PACKAGE := "github.com/ethpandaops/optimism-package" - # Devnet template recipe devnet TEMPLATE_FILE DATA_FILE="" NAME="" PACKAGE=KURTOSIS_PACKAGE: #!/usr/bin/env bash diff --git a/op-batcher/batcher/config.go b/op-batcher/batcher/config.go index e3d24dcc968..440649bad1a 100644 --- a/op-batcher/batcher/config.go +++ b/op-batcher/batcher/config.go @@ -226,7 +226,7 @@ func NewConfig(ctx *cli.Context) *CLIConfig { ThrottleBlockSize: ctx.Uint64(flags.ThrottleBlockSizeFlag.Name), ThrottleAlwaysBlockSize: ctx.Uint64(flags.ThrottleAlwaysBlockSizeFlag.Name), PreferLocalSafeL2: ctx.Bool(flags.PreferLocalSafeL2Flag.Name), - EspressoUrls: ctx.StringSlice(flags.EspressoUrlFlag.Name), + EspressoUrls: ctx.StringSlice(flags.EspressoUrlsFlag.Name), EspressoLightClientAddr: ctx.String(flags.EspressoLCAddrFlag.Name), TestingEspressoBatcherPrivateKey: ctx.String(flags.TestingEspressoBatcherPrivateKeyFlag.Name), } diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 4385c271cf4..cb8df55fd79 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -715,15 +715,15 @@ func (l *BlockLoader) EnqueueBlocks(ctx context.Context, blocksToQueue inclusive l.batcher.Log.Info("Loading and queueing blocks", "range", blocksToQueue) for i := blocksToQueue.start; i <= blocksToQueue.end; i++ { block, err := l.batcher.fetchBlock(ctx, i) - for _, txn := range block.Transactions() { - l.batcher.Log.Info("tx hash before submitting to Espresso", "hash", txn.Hash().String()) - } - if err != nil { l.batcher.Log.Warn("Failed to fetch block", "err", err) break } + for _, txn := range block.Transactions() { + l.batcher.Log.Info("tx hash before submitting to Espresso", "hash", txn.Hash().String()) + } + if len(l.queuedBlocks) > 0 && block.ParentHash() != l.queuedBlocks[len(l.queuedBlocks)-1].Hash { l.batcher.Log.Warn("Found L2 reorg", "block_number", i) l.reset(ctx) @@ -907,20 +907,19 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return fmt.Errorf("failed to decode attestation: %w", err) } - txOpts, err := bind.NewKeyedTransactorWithChainID(l.Config.BatcherPrivateKey, l.RollupConfig.L1ChainID) + abi, err := bindings.BatchAuthenticatorMetaData.GetAbi() if err != nil { - return fmt.Errorf("failed to create transactor: %w", err) + return fmt.Errorf("failed to get Batch Authenticator ABI: %w", err) } - // Submit decoded attestation to batch inbox contract - tx, err := batchAuthenticator.RegisterSigner(txOpts, attestationTbs, signature) + txData, err := abi.Pack("registerSigner", attestationTbs, signature) if err != nil { return fmt.Errorf("failed to create RegisterSigner transaction: %w", err) } candidate := txmgr.TxCandidate{ - TxData: tx.Data(), - To: tx.To(), + TxData: txData, + To: &l.RollupConfig.BatchAuthenticatorAddress, } _, err = l.Txmgr.Send(ctx, candidate) diff --git a/op-batcher/bindings/espresso_nitro_tee_verifier.go b/op-batcher/bindings/espresso_nitro_tee_verifier.go new file mode 100644 index 00000000000..8cb065f66e1 --- /dev/null +++ b/op-batcher/bindings/espresso_nitro_tee_verifier.go @@ -0,0 +1,1645 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +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 +) + +// NitroValidatorPtrs is an auto generated low-level Go binding around an user-defined struct. +type NitroValidatorPtrs struct { + ModuleID *big.Int + Timestamp uint64 + Digest *big.Int + Pcrs []*big.Int + Cert *big.Int + Cabundle []*big.Int + PublicKey *big.Int + UserData *big.Int + Nonce *big.Int +} + +// EspressoNitroTEEVerifierMetaData contains all meta data concerning the EspressoNitroTEEVerifier contract. +var EspressoNitroTEEVerifierMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"enclaveHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"certManager\",\"type\":\"address\",\"internalType\":\"contractCertManager\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ATTESTATION_DIGEST\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ATTESTATION_TBS_PREFIX\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"CABUNDLE_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"CERTIFICATE_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"DIGEST_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_AGE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MODULE_ID_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"NONCE_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PCRS_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"PUBLIC_KEY_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"TIMESTAMP_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"USER_DATA_KEY\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"certManager\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractICertManager\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"deleteRegisteredSigners\",\"inputs\":[{\"name\":\"signers\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredEnclaveHash\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registeredSigners\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEnclaveHash\",\"inputs\":[{\"name\":\"enclaveHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"valid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validateAttestation\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structNitroValidator.Ptrs\",\"components\":[{\"name\":\"moduleID\",\"type\":\"uint256\",\"internalType\":\"CborElement\"},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"digest\",\"type\":\"uint256\",\"internalType\":\"CborElement\"},{\"name\":\"pcrs\",\"type\":\"uint256[]\",\"internalType\":\"CborElement[]\"},{\"name\":\"cert\",\"type\":\"uint256\",\"internalType\":\"CborElement\"},{\"name\":\"cabundle\",\"type\":\"uint256[]\",\"internalType\":\"CborElement[]\"},{\"name\":\"publicKey\",\"type\":\"uint256\",\"internalType\":\"CborElement\"},{\"name\":\"userData\",\"type\":\"uint256\",\"internalType\":\"CborElement\"},{\"name\":\"nonce\",\"type\":\"uint256\",\"internalType\":\"CborElement\"}]}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"DeletedRegisteredSigner\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"EnclaveHashSet\",\"inputs\":[{\"name\":\"enclaveHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"},{\"name\":\"valid\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignerRegistered\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"enclaveHash\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AttestationTooOld\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedToParseEnclaveReport\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDataLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidEnclaveHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidHeaderVersion\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidReportDataHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignerAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReportDataTooShort\",\"inputs\":[]}]", + Bin: "0x60a060405234801562000010575f80fd5b5060405162005603380380620056038339810160408190526200003391620000e3565b6001600160a01b0381166080526200004b3362000076565b5f828152600260205260409020805460ff191660011790556200006e3362000076565b50506200011f565b600180546001600160a01b0319169055620000918162000094565b50565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8060408385031215620000f5575f80fd5b825160208401519092506001600160a01b038116811462000114575f80fd5b809150509250929050565b6080516154bd620001465f395f81816102b7015281816119fc0152611af601526154bd5ff3fe608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063966989ee116100e8578063ba58e82a11610093578063e30c39781161006e578063e30c397814610476578063e7370be014610494578063e8b6d3fe146104a7578063f2fde38b146104ce575f80fd5b8063ba58e82a14610415578063cebf08d714610428578063e0a655ff1461044f575f80fd5b8063a903a277116100c3578063a903a277146103a6578063ae951149146103c7578063b22bed7e146103ee575f80fd5b8063966989ee146103365780639adb2d68146103585780639cc3eb481461037f575f80fd5b80636be1e68b1161014857806379ba50971161012357806379ba5097146102fe5780638da5cb5b1461030657806393b5552e14610323575f80fd5b80636be1e68b14610281578063715018a6146102a8578063739e8484146102b2575f80fd5b80632d4bad8a116101785780632d4bad8a1461020c5780633893af6d146102335780636378aad51461025a575f80fd5b80630123d0c11461019e57806305f7aead146101d55780630dcaeaf2146101f5575b5f80fd5b6101c06101ac366004614a44565b60036020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6101e86101e3366004614b99565b6104e1565b6040516101cc9190614c33565b6101fe61070881565b6040519081526020016101cc565b6101fe7f63ce814bd924c1ef12c43686e4cbf48ed1639a78387b0570c23ca921e8ce071c81565b6101fe7f501a3a7a4e0cf54b03f2488098bdd59bc1c2e8d741a300d6b25926d531733fef81565b6101fe7f7ab1577440dd7bedf920cb6de2f9fc6bf7ba98c78c85a3fa1f8311aac95e175981565b6101fe7f682a7e258d80bd2421d3103cbe71e3e3b82138116756b97b8256f061dc2f11fb81565b6102b0610c19565b005b6102d97f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101cc565b6102b0610c2c565b5f5473ffffffffffffffffffffffffffffffffffffffff166102d9565b6102b0610331366004614cff565b610ce1565b6101c0610344366004614d2d565b60026020525f908152604090205460ff1681565b6101fe7f8ce577cf664c36ba5130242bf5790c2675e9f4e6986a842b607821bee25372ee81565b6101fe7f8a8cb7aa1da17ada103546ae6b4e13ccc2fafa17adf5f93925e0a0a4e5681a6a81565b6103b96103b4366004614d44565b610d5f565b6040516101cc929190614de1565b6101fe7f925cec779426f44d8d555e01d2683a3a765ce2fa7562ca7352aeb09dfc57ea6a81565b6101fe7f61585f8bc67a4b6d5891a4639a074964ac66fc2241dc0b36c157dc101325367a81565b6102b0610423366004614e53565b610e9c565b6101fe7f5e4ea5393e4327b3014bc32f2264336b0d1ee84a4cfd197c8ad7e1e16829a16a81565b6101fe7f4ebf727c48eac2c66272456b06a885c5cc03e54d140f63b63b6fd10c1227958e81565b60015473ffffffffffffffffffffffffffffffffffffffff166102d9565b6102b06104a2366004614eba565b6110e1565b6101fe7fc7b28019ccfdbd30ffc65951d94bb85c9e2b8434111a000b5afd533ce65f57a481565b6102b06104dc366004614a44565b6111d1565b6105336040518061012001604052805f81526020015f67ffffffffffffffff1681526020015f8152602001606081526020015f8152602001606081526020015f81526020015f81526020015f81525090565b5f61053d84611280565b90505f61054c825f0151611916565b116105b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f6e6f206d6f64756c65206964000000000000000000000000000000000000000060448201526064015b60405180910390fd5b5f816020015167ffffffffffffffff161161062f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f6e6f2074696d657374616d70000000000000000000000000000000000000000060448201526064016105af565b5f8160a00151511161069d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f6e6f20636162756e646c6500000000000000000000000000000000000000000060448201526064016105af565b60408101517f501a3a7a4e0cf54b03f2488098bdd59bc1c2e8d741a300d6b25926d531733fef906106cf908690611955565b14610736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e76616c69642064696765737400000000000000000000000000000000000060448201526064016105af565b8060600151516001111580156107525750602081606001515111155b6107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f696e76616c69642070637273000000000000000000000000000000000000000060448201526064016105af565b6107c58160c00151611982565b806107f657506107d88160c00151611916565b6001111580156107f657506104006107f38260c00151611916565b11155b61085c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c696420707562206b6579000000000000000000000000000000000060448201526064016105af565b6108698160e00151611982565b80610882575061020061087f8260e00151611916565b11155b6108e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c69642075736572206461746100000000000000000000000000000060448201526064016105af565b6108f6816101000151611982565b80610910575061020061090d826101000151611916565b11155b610976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016105af565b5f5b816060015151811015610a62576109ab8260600151828151811061099e5761099e614f62565b6020026020010151611916565b602014806109d157506109cd8260600151828151811061099e5761099e614f62565b6030145b806109f457506109f08260600151828151811061099e5761099e614f62565b6040145b610a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f696e76616c69642070637200000000000000000000000000000000000000000060448201526064016105af565b600101610978565b505f610a7b82608001518661199f90919063ffffffff16565b90505f8260a001515167ffffffffffffffff811115610a9c57610a9c614a5d565b604051908082528060200260200182016040528015610acf57816020015b6060815260200190600190039081610aba5790505b5090505f5b8360a0015151811015610bdf57610afa8460a00151828151811061099e5761099e614f62565b600111158015610b245750610400610b218560a00151838151811061099e5761099e614f62565b11155b610b8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c696420636162756e646c652063657274000000000000000000000060448201526064016105af565b610bba8460a001518281518110610ba357610ba3614f62565b60200260200101518861199f90919063ffffffff16565b828281518110610bcc57610bcc614f62565b6020908102919091010152600101610ad4565b505f610beb83836119c6565b90505f610bfa885f8a51611b95565b9050610c0b82608001518289611cbc565b509293505050505b92915050565b610c21611d3a565b610c2a5f611dba565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610cd5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016105af565b610cde81611dba565b50565b610ce9611d3a565b5f8281526002602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168415159081179091558251858152918201527f2282c24f65eac8254df1107716a961b677b872ed0e1d2a9f6bafc154441eb7fd910160405180910390a15050565b6060805f60019050835f81518110610d7957610d79614f62565b01602001517fff00000000000000000000000000000000000000000000000000000000000000167fd20000000000000000000000000000000000000000000000000000000000000003610dca575060025b5f610dd58583611deb565b90505f610de28683611dfa565b90505f610def8783611e0d565b90505f610dfc8883611e0d565b90505f85610e0986611e24565b610e139190614fbc565b90505f610e1f85611e24565b610e2885611e24565b610e329190614fbc565b90505f610e408b8985611e48565b90505f610e57610e4f88611e24565b8d9085611e48565b9050610e6582858386611f23565b9a50610e8c605086901c69ffffffffffffffffffff16610e8487611916565b8e9190611e48565b9950505050505050505050915091565b5f610f0e85858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050604080516020601f890181900481028201810190925287815292508791508690819084018382808284375f920191909152506104e192505050565b90505f610f7082606001515f81518110610f2a57610f2a614f62565b602002602001015187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525092939250506119559050565b5f8181526002602052604090205490915060ff16610fba576040517f8911a9fc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b42610708836020015167ffffffffffffffff16610fd79190614fcf565b101561100f576040517f696bbf1f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c08201515f9061108c9060501c69ffffffffffffffffffff16611034906001614fcf565b60016110438660c00151611916565b61104d9190614fbc565b89898080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152509294939250506121109050565b73ffffffffffffffffffffffffffffffffffffffff165f90815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550505050505050565b6110e9611d3a565b5f5b81518110156111cd5760035f83838151811061110957611109614f62565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81549060ff02191690557f4872495ab7a697b6ed37286c6738fc94eaf291e5e4908abc1e2b479894f002dd82828151811061118c5761118c614f62565b60200260200101516040516111bd919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b60405180910390a16001016110eb565b5050565b6111d9611d3a565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561123b5f5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6112d26040518061012001604052805f81526020015f67ffffffffffffffff1681526020015f8152602001606081526020015f8152602001606081526020015f81526020015f81526020015f81525090565b7f63ce814bd924c1ef12c43686e4cbf48ed1639a78387b0570c23ca921e8ce071c6112ff835f6012612110565b14611366576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c6964206174746573746174696f6e2070726566697800000000000060448201526064016105af565b5f611372836012611deb565b90505f61138f8469ffffffffffffffffffff605085901c16612190565b90506113e36040518061012001604052805f81526020015f67ffffffffffffffff1681526020015f8152602001606081526020015f8152602001606081526020015f81526020015f81526020015f81525090565b5f6113ed84611e24565b90505b806113fa84611e24565b101561190d5761140a868461219f565b92505f6114178785611955565b90507f731a883099b3c945aecfdbd40a86f3d98a160b1967957bd49f87de411dac8d1281016114545761144a878561219f565b8084529350611907565b7f97d581da727f42dbde2cefc3418e1c1c47dec7ee98a946847da90f9e23d0ee05810161149357611485878561219f565b604084018190529350611907565b7f6da313886bd90bb272aaa1fe2d97c5c589a31d058a9d358cad514f6203a8159681016114d2576114c48785611e0d565b608084018190529350611907565b7f384d7fe6330242cf0039a6ae26b447a361d47bcbeee5fff4a502acc319a0a85c81016115115761150387856121b6565b60c084018190529350611907565b7fa1b15ac6c1bcd84cfeb43cd0dd9bcc94f2e117b5b302e68375281e1e97d65e9681016115505761154287856121b6565b60e084018190529350611907565b7f854ea88bbf22841206df34921d06039408456738737a5c05e07cee5536a1e8a781016115905761158187856121b6565b61010084018190529350611907565b7fb1408d83b7153d399d8dba94f9577a3a33fc1ab2ebf09c49c4902ef3edd86a7281016115e1576115c187856121cc565b93506115cd8460a01c90565b67ffffffffffffffff166020840152611907565b7f75734855e25e8525efcab95194b1ec333d0505e8520a06c6da1f5f5b1a97e59681016116ba5761161287856121e2565b935061161e8460a01c90565b67ffffffffffffffff1667ffffffffffffffff81111561164057611640614a5d565b604051908082528060200260200182016040528015611669578160200160208202803683370190505b5060a08401525f5b8360a00151518110156116b4576116888886611e0d565b9450848460a0015182815181106116a1576116a1614f62565b6020908102919091010152600101611671565b50611907565b7f9ea7a0743985b492a76e5b9c65f8b69b539903ddbe23f4c93ea823efecdac98681016118a5576116eb8785611dfa565b93506116f78460a01c90565b67ffffffffffffffff1667ffffffffffffffff81111561171957611719614a5d565b604051908082528060200260200182016040528015611742578160200160208202803683370190505b5060608401525f5b8360600151518110156116b45761176188866121cc565b94505f61176e8660a01c90565b67ffffffffffffffff16905084606001515181106117e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c696420706372206b65792076616c7565000000000000000000000060448201526064016105af565b846060015181815181106117fe576117fe614f62565b60200260200101515f1461186e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6475706c696361746520706372206b657900000000000000000000000000000060448201526064016105af565b6118788987611e0d565b9550858560600151828151811061189157611891614f62565b60209081029190910101525060010161174a565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f696e76616c6964206174746573746174696f6e206b657900000000000000000060448201526064016105af565b506113f0565b50949350505050565b5f81604060ff8216148061192d57508060ff166060145b1561194d5761193c8360a01c90565b67ffffffffffffffff169392505050565b505f92915050565b5f61197b605083901c69ffffffffffffffffffff1661197384611916565b859190612110565b9392505050565b5f8160f660ff8216148061197b57508060ff1660f7149392505050565b606061197b605083901c69ffffffffffffffffffff166119be84611916565b859190611e48565b6040805160a0810182525f808252602082018190529181018290526060808201839052608082015290805b8351811015611ab8577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16630890702c858381518110611a4857611a48614f62565b6020026020010151846040518363ffffffff1660e01b8152600401611a6e929190614fe2565b6020604051808303815f875af1158015611a8a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611aae9190615003565b91506001016119f1565b506040517f28c5463700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906328c5463790611b2d9087908590600401614fe2565b5f604051808303815f875af1158015611b48573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052611b8d919081019061506d565b949350505050565b604080516101008101825267cbbb9d5dc1059ed8815267629a292a367cd5076020820152679159015a3070dd179181019190915267152fecd8f70e59396060828101919091526767332667ffc00b316080830152678eb44a876858151160a083015267db0c2e0d64f98fa760c08301526747b5481dbefa4fa460e083015290611c20858585846121f9565b80516020808301516040808501516060860151608087015160a088015184517fffffffffffffffff00000000000000000000000000000000000000000000000060c0998a1b81169882019890985295881b8716602887015292871b8616603086015290861b85166038850152851b84169183019190915290921b1660488201526050016040516020818303038152906040529150509392505050565b611ccf611cc7612ad2565b838386612bed565b611d35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f696e76616c69642073696700000000000000000000000000000000000000000060448201526064016105af565b505050565b5f5473ffffffffffffffffffffffffffffffffffffffff163314610c2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105af565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610cde81612e7a565b5f61197b838360406001612eee565b5f61197b83611e0884611e24565b612190565b5f61197b83611e1b84611e24565b60406001612eee565b5f611e2e82611916565b610c139069ffffffffffffffffffff605085901c16614fcf565b8251606090611e578385614fcf565b1115611ebf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e64730000000000000000000000000060448201526064016105af565b8167ffffffffffffffff811115611ed857611ed8614a5d565b6040519080825280601f01601f191660200182016040528015611f02576020820181803683370190505b50905060208082019085850101611f1a8282866132bd565b50509392505050565b606081611f3185600d614fcf565b611f3b9190614fcf565b67ffffffffffffffff811115611f5357611f53614a5d565b6040519080825280601f01601f191660200182016040528015611f7d576020820181803683370190505b509050608460f81b815f81518110611f9757611f97614f62565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350606a60f81b81600181518110611fdd57611fdd614f62565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f40000000000000000000000000000000000000000000000000000000000000008161203886600c614fcf565b8151811061204857612048614f62565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535060408051808201909152600a81527f5369676e61747572653100000000000000000000000000000000000000000000602080830191825283810191908881019087016120ce6120c6856002614fcf565b84600a6132bd565b6120e36120dc85600c614fcf565b838b6132bd565b612103896120f286600d614fcf565b6120fc9190614fcf565b82896132bd565b5050505050949350505050565b82515f9061211e8385614fcf565b1115612186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e64730000000000000000000000000060448201526064016105af565b5091016020012090565b5f61197b838360a06001612eee565b5f61197b836121ad84611e24565b60606001612eee565b5f61197b836121c484611e24565b60405f612eee565b5f61197b836121da84611e24565b5f6001612eee565b5f61197b836121f084611e24565b60806001612eee565b60408051610a008101825267428a2f98d728ae228152677137449123ef65cd602082015267b5c0fbcfec4d3b2f9181019190915267e9b5dba58189dbbc6060820152673956c25bf348b53860808201526759f111f1b605d01960a082015267923f82a4af194f9b60c082015267ab1c5ed5da6d811860e082015267d807aa98a30302426101008201526712835b0145706fbe61012082015267243185be4ee4b28c61014082015267550c7dc3d5ffb4e26101608201526772be5d74f27b896f6101808201526780deb1fe3b1696b16101a0820152679bdc06a725c712356101c082015267c19bf174cf6926946101e082015267e49b69c19ef14ad261020082015267efbe4786384f25e3610220820152670fc19dc68b8cd5b561024082015267240ca1cc77ac9c65610260820152672de92c6f592b0275610280820152674a7484aa6ea6e4836102a0820152675cb0a9dcbd41fbd46102c08201526776f988da831153b56102e082015267983e5152ee66dfab61030082015267a831c66d2db4321061032082015267b00327c898fb213f61034082015267bf597fc7beef0ee461036082015267c6e00bf33da88fc261038082015267d5a79147930aa7256103a08201526706ca6351e003826f6103c082015267142929670a0e6e706103e08201526727b70a8546d22ffc610400820152672e1b21385c26c926610420820152674d2c6dfc5ac42aed6104408201526753380d139d95b3df61046082015267650a73548baf63de61048082015267766a0abb3c77b2a86104a08201526781c2c92e47edaee66104c08201526792722c851482353b6104e082015267a2bfe8a14cf1036461050082015267a81a664bbc42300161052082015267c24b8b70d0f8979161054082015267c76c51a30654be3061056082015267d192e819d6ef521861058082015267d69906245565a9106105a082015267f40e35855771202a6105c082015267106aa07032bbd1b86105e08201526719a4c116b8d2d0c8610600820152671e376c085141ab53610620820152672748774cdf8eeb996106408201526734b0bcb5e19b48a861066082015267391c0cb3c5c95a63610680820152674ed8aa4ae3418acb6106a0820152675b9cca4f7763e3736106c082015267682e6ff3d6b2b8a36106e082015267748f82ee5defb2fc6107008201526778a5636f43172f606107208201526784c87814a1f0ab72610740820152678cc702081a6439ec6107608201526790befffa23631e2861078082015267a4506cebde82bde96107a082015267bef9a3f7b2c679156107c082015267c67178f2e372532b6107e082015267ca273eceea26619c61080082015267d186b8c721c0c20761082082015267eada7dd6cde0eb1e61084082015267f57d4f7fee6ed1786108608201526706f067aa72176fba610880820152670a637dc5a2c898a66108a082015267113f9804bef90dae6108c0820152671b710b35131c471b6108e08201526728db77f523047d846109008201526732caab7b40c72493610920820152673c9ebe0a15c9bebc61094082015267431d67c49c100d4c610960820152674cc5d4becb3e42b661098082015267597f299cfc657e2a6109a0820152675fcb6fab3ad6faec6109c0820152676c44198c4a4758176109e082015284516126b78486614fcf565b111561271f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4f55545f4f465f424f554e44530000000000000000000000000000000000000060448201526064016105af565b5f61272b868686613331565b90506080815161273b9190615147565b156127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f50414444494e475f4552524f520000000000000000000000000000000000000060448201526064016105af565b6127aa614973565b6127b2614992565b6127ba6149b1565b5f6127c660808961515a565b6127d190608061516d565b90505f5b85518201811015612ac557818110156127fa576127f58b84838d0161343b565b612807565b612807868484840361343b565b5f5b60108110156128575783816010811061282457612824614f62565b602002015186826050811061283b5761283b614f62565b67ffffffffffffffff9092166020929092020152600101612809565b5060105b605081101561290d5785601082036050811061287957612879614f62565b60200201516128a087600f84036050811061289657612896614f62565b6020020151613499565b8760078403605081106128b5576128b5614f62565b60200201516128dc8960028603605081106128d2576128d2614f62565b60200201516134c7565b0101018682605081106128f1576128f1614f62565b67ffffffffffffffff909216602092909202015260010161285b565b505f5b600881101561295e5788816008811061292b5761292b614f62565b602002015185826008811061294257612942614f62565b67ffffffffffffffff9092166020929092020152600101612910565b505f5b6050811015612a69575f86826050811061297d5761297d614f62565b602002015189836050811061299457612994614f62565b6020020151608088015160a089015160c08a015182191691161860808901516129bc906134ed565b89600760200201510101010190505f6129f4878260200201518860016020020151896002602002015180821690831691909216181890565b87516129ff9061350f565b60c08901805167ffffffffffffffff90811660e08c015260a08b018051821690925260808b018051821690925260608b0180518701821690925260408b018051821690925260208b01805182169092528a5181169091529101909201909116865250600101612961565b505f5b6008811015612abc57848160088110612a8757612a87614f62565b6020020151898260088110612a9e57612a9e614f62565b6020020180519190910167ffffffffffffffff169052600101612a6c565b506080016127d5565b5050505050505050505050565b612b126040518060e00160405280606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081525090565b604080516101408101909152603060e08201818152829161542161010084013981526020016040518060600160405280603081526020016153616030913981526020016040518060600160405280603081526020016153f16030913981526020016040518060600160405280603081526020016153916030913981526020016040518060600160405280603081526020016154816030913981526020016040518060600160405280603081526020016154516030913981526020016040518060600160405280603081526020016153c1603091399052919050565b5f612c1560405180608001604052805f81526020015f81526020015f81526020015f81525090565b612c1e84613531565b60208301528152612c2e83613531565b6060830152604080830191909152805160e0810190915286515f91908190612c55906135e1565b8152602001612c6789602001516135e1565b8152602001612c7989604001516135e1565b8152602001612c8b89606001516135e1565b8152602001612c9d89608001516135e1565b8152602001612caf8960a001516135e1565b8152602001612cc18960c001516135e1565b81525090505f612cd48260800151613675565b8351602081015190519192501590151680612cff57505f612cfc845f01518460a00151613747565b12155b80612d1c5750612d1c83602001515f602082015191511591141690565b80612d3757505f612d3584602001518460c00151613747565b135b15612d47575f9350505050611b8d565b612d68818360800151845f01518560200151876040015188606001516137ec565b612d77575f9350505050611b8d565b86516030811015612dba57604080516030808252606082019092525f9160208201818036833750919250612db791505060208a01838303605001846138cc565b97505b505f612dd882612dc98a6135e1565b86602001518660a001516138da565b90505f612df283865f015187602001518760a001516138da565b90505f612dff60036139ea565b90505f612e2985876080015184895f01518a604001518b606001518d604001518e60600151613a0a565b9050612e4185876080015184895f0151858989613bf3565b50809450505050612e5783838660a00151613de1565b845160208082015190840151915184511491141695505050505050949350505050565b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f80858581518110612f0257612f02614f62565b602001015160f81c60f81b60e060f81b1660f81c90505f868681518110612f2b57612f2b614f62565b60209101015160f81c601f16905060ff821660e003613071578060ff1660161480612f5957508060ff166017145b612fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f6f6e6c79206e756c6c207072696d69746976652076616c75657320617265207360448201527f7570706f7274656400000000000000000000000000000000000000000000000060648201526084016105af565b831561304d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f6e756c6c2076616c756520666f7220726571756972656420656c656d656e740060448201526064016105af565b61306860ff83831716613061886001614fcf565b60501b1790565b92505050611b8d565b8460ff168260ff16146130e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f756e65787065637465642074797065000000000000000000000000000000000060448201526064016105af565b601c8160ff161061314d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f756e737570706f7274656420747970650000000000000000000000000000000060448201526064016105af565b8060ff1660180361319f5761306860ff831661316a886002614fcf565b896131768a6001614fcf565b8151811061318657613186614f62565b016020015160f81c60a01b60509190911b919091171790565b8060ff166019036131e65761306860ff83166131bc886003614fcf565b6131d16131ca8a6001614fcf565b8b90613e2d565b61ffff1660a01b60509190911b919091171790565b8060ff16601a0361322f5761306860ff8316613203886005614fcf565b6132186132118a6001614fcf565b8b90613eaf565b63ffffffff1660a01b60509190911b919091171790565b8060ff16601b0361327c5761306860ff831661324c886009614fcf565b61326161325a8a6001614fcf565b8b90613f31565b67ffffffffffffffff1660a01b60509190911b919091171790565b6132b260ff831661328e886001614fcf565b60501b1774ff000000000000000000000000000000000000000060a084901b161790565b979650505050505050565b602081106132f557815183526132d4602084614fcf565b92506132e1602083614fcf565b91506132ee602082614fbc565b90506132bd565b8015611d35575f6001613309836020614fbc565b613315906101006152a2565b61331f9190614fbc565b83518551821691191617845250505050565b60605f61333f83600861516d565b60c01b90505f613350608085615147565b90505f607082101561336e57613367826077614fbc565b905061337c565b6133798260f7614fbc565b90505b5f8167ffffffffffffffff81111561339657613396614a5d565b6040519080825280601f01601f1916602001820160405280156133c0576020820181803683370190505b5090505f6133e4846133d2898b614fcf565b6133dc9190614fbc565b8a9086611e48565b60405190915061341e9082907f800000000000000000000000000000000000000000000000000000000000000090859089906020016152ad565b604051602081830303815290604052955050505050509392505050565b5f5b60108110156134935761346561345482600861516d565b61345e9084614fcf565b8590613f31565b83826010811061347757613477614f62565b67ffffffffffffffff909216602092909202015260010161343d565b50505050565b5f60078267ffffffffffffffff16901c6134b4836008613fb3565b6134bf846001613fb3565b181892915050565b5f60068267ffffffffffffffff16901c6134e283603d613fb3565b6134bf846013613fb3565b5f6134f9826029613fb3565b613504836012613fb3565b6134bf84600e613fb3565b5f61351b826027613fb3565b613526836022613fb3565b6134bf84601c613fb3565b5f80825160601461359e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f553338343a206e6f74203736380000000000000000000000000000000000000060448201526064016105af565b604080516080810182529250820190505f825260208301516010830152603083015160208301525f81526050830151601082015260608301516020820152915091565b5f815160301461364d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f553338343a206e6f74203338340000000000000000000000000000000000000060448201526064016105af565b6040805180820190915290505f81526020820151601082015260308201516020820152919050565b5f61368861048060408051918201905290565b90506136be8261369860026139ea565b602082810151908201518103610420860181905291519251911191900303610400830152565b6060610120820152602061014082018190526040610160830181905260016101e0840152835161020084015283820180516102208501526102408401829052610260840192909252610280830181905283516103008401528151610320840152610360830181905261038083018190526103a08301529151610440820152905161046082015290565b815181515f91908082111561376157600192505050610c13565b80821015613793577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff92505050610c13565b505060208381015190830151808211156137b257600192505050610c13565b808210156137e4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff92505050610c13565b505092915050565b602082015182515f91159015168061381257506020868101519084015187518551149114165b80613824575060208201518251159015165b8061383d57506020868101519083015187518451149114165b1561384957505f6138c2565b5f61385688846002613fef565b90505f61386589866003613fef565b602088015188519192501590151661388f5761388c816138868b888b614033565b8a614124565b90505b60208601518651159015166138ac576138a981878a614124565b90505b6020818101519083015191519251911491141690505b9695505050505050565b8082828560045afa50505050565b5f6138e6858484614186565b90506139ab8482876060018251602093840151835193850151608081811c6fffffffffffffffffffffffffffffffff80851682810294821695841c86810287830280871c820188810180891b9287169290920160408d01528c8402878c02958e0297909402998b02988210921191909101861b90861c018601878101858101958610981196119590950195909501831b82841c01850184810180851b939092169290920198870198909852959093029086109190941001811b93901c92909201019052565b60608552602085602001526040856040015260018560c0015281518560e0015260208201518561010001526040816101208760055afa50949350505050565b5f6139fb6040808051918201905290565b5f815260208101929092525090565b613a126149d0565b613a1b83614213565b613a2483614213565b6020808401519081019190915252613a3b85614213565b613a4485614213565b6101008301516020810191909152525f5b6008811015613be6575f5b6008811015613bdd57600281830110613bd557600382901b81178215613b2b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830160031b8217613aec8d8d8d8d898660408110613ac157613ac1614f62565b6020020151518a8760408110613ad957613ad9614f62565b6020020151600160200201518f8f614239565b868460408110613afe57613afe614f62565b6020020151878560408110613b1557613b15614f62565b6020020151600160200201919091525250613bd3565b600383901b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff830117613b988d8d8d8d898660408110613b6d57613b6d614f62565b6020020151518a8760408110613b8557613b85614f62565b6020020151600160200201518d8d614239565b868460408110613baa57613baa614f62565b6020020151878560408110613bc157613bc1614f62565b60200201516001602002019190915252505b505b600101613a60565b50600101613a55565b5098975050505050505050565b815181515f918291829190613c0c8c8c8c8c8780614362565b9095509350690ffffffffffffffffff860b483901c1660b782901c1792508215613c7a57613c748c8c8c8c8c8860408110613c4957613c49614f62565b6020020151518d8960408110613c6157613c61614f62565b6020020151600160200201518b8b614239565b90955093505b60045b60b88111613d0f57613c938d8d8d8d8a8a614421565b80965081975050508060b80382901c60071660038260b80385901c600716901b179350835f14613d0757613d018d8d8d8d8d8960408110613cd657613cd6614f62565b6020020151518e8a60408110613cee57613cee614f62565b6020020151600160200201518c8c614239565b90965094505b600301613c7d565b50505060208581015190850151613d2a8c8c8c8c8989614362565b9095509350600860fc83901c1660ff82901c1792508215613d6457613d5e8c8c8c8c8c8860408110613c4957613c49614f62565b90955093505b60045b6101008111613dd157613d7e8d8d8d8d8a8a614421565b8096508197505050806101000382901c6007166003826101000385901c600716901b179350835f14613dc957613dc38d8d8d8d8d8960408110613cd657613cd6614f62565b90965094505b600301613d67565b5050505097509795505050505050565b604083526020836020015260408360400152815183606001526020820151836080015260018360a0015280518360c0015260208101518360e001526040826101008560055afa50505050565b5f613e39826002614fcf565b83511015613ea3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e64730000000000000000000000000060448201526064016105af565b50016020015160f01c90565b5f613ebb826004614fcf565b83511015613f25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e64730000000000000000000000000060448201526064016105af565b50016020015160e01c90565b5f613f3d826008614fcf565b83511015613fa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e64730000000000000000000000000060448201526064016105af565b50016020015160c01c90565b5f67ffffffffffffffff8381169083161c613fcf836040615338565b67ffffffffffffffff168467ffffffffffffffff16901b17905092915050565b5f6140006040808051918201905290565b9050610240840193508251846060015260208301518460800152818460a001526040816101008660055afa509392505050565b5f6140446040808051918201905290565b905061410a838361018087018251602093840151835193850151608081811c6fffffffffffffffffffffffffffffffff80851682810294821695841c86810287830280871c820188810180891b9287169290920160408d01528c8402878c02958e0297909402998b02988210921191909101861b90861c018601878101858101958610981196119590950195909501831b82841c01850184810180851b939092169290920198870198909852959093029086109190941001811b93901c92909201019052565b610120840193506040816101208660055afa509392505050565b5f6141356040808051918201905290565b6020858101518582015181019183018290528551875101911001815290505f61415e8284613747565b1261197b5760208082018051918401518203908190528351835192909111910303815261197b565b5f6141976040808051918201905290565b90506141cb826141a760026139ea565b60208281015190820151810360c089018190529151925191119190030360a0860152565b604084526040846020015260408460400152825184606001526020830151846080015281518460e0015260208201518461010001526040816101208660055afa509392505050565b5f6142246040808051918201905290565b90508151815260208201516020820152919050565b5f80851580614246575083155b1561429e5785158015614257575083155b1561426657505f905080614355565b85156142835761427586614213565b61427e86614213565b614295565b61428c84614213565b61429584614213565b91509150614355565b602084810151908701518551885114911416156142e457602083810151908601518451875114911416156142da576142958a8a8a8a8a8a614362565b505f905080614355565b5f6142f086858c6145fd565b90505f6142fe88878d6145fd565b905061430b8c838361467d565b6143178c836002613fef565b935061432484898d6146b0565b61432f84878d6146b0565b61433a88858d6145fd565b92506143478c8484614726565b61435283888d6146b0565b50505b9850989650505050505050565b5f80835f0361437557505f905080614416565b60208301518351159015161561438f57505f905080614416565b5f61439c89866002613fef565b90506143a9898289614726565b6143b481878a614802565b5f6143bf858a614857565b90506143cc8a838361467d565b6143d88a836002613fef565b93506143e584878b6146b0565b6143f084878b6146b0565b6143fb86858b6145fd565b92506144088a8484614726565b61441383868b6146b0565b50505b965096945050505050565b5f80835f0361443457505f905080614416565b60208301518351159015161561444e57505f905080614416565b5f61445b89866002613fef565b9050614468898289614726565b61447381878a614802565b5f61447e858a614857565b905061448b8a838361467d565b6144978a836002613fef565b93506144a484878b6146b0565b6144af84878b6146b0565b6144ba86858b6145fd565b92506144c78a8484614726565b6144d283868b6146b0565b6020830151835115901516156144ef575f80935093505050614416565b6144fc8a838660026148b7565b6145078a838a614726565b61451282888b614802565b61451d81848b6148e7565b6145288a838361467d565b6145358a878460026148b7565b61454086858b6146b0565b61454b86858b6146b0565b6145578585888c614906565b6145628a8684614726565b61456d85848b6146b0565b60208501518551159015161561458a575f80935093505050614416565b6145978a838860026148b7565b6145a28a838a614726565b6145ad82888b614802565b6145b881868b6148e7565b6145c38a838361467d565b6145d08a858460026148b7565b6145db84878b6146b0565b6145e684878b6146b0565b6145f28387868c614906565b6144088a8484614726565b5f61460e6040808051918201905290565b90505f61461b8585613747565b12614644576020808501518185015181039183018290528451865192909110910303815261197b565b6020848101518382015181018383018181528551885101928210929092018085529286015181039182905285519111910303815261197b565b6103608301925080518360600152602081015183608001526040816101208560055afa50611d3561036084038383614726565b5f6146bb8484613747565b126146e2575060208281018051918301518203908190529151835191909211919003039052565b6147048382602082810180519183015182019081905291518351019110019052565b5060208281018051918301518203908190529151835191909211919003039052565b6147ea828261018086018251602093840151835193850151608081811c6fffffffffffffffffffffffffffffffff80851682810294821695841c86810287830280871c820188810180891b9287169290920160408d01528c8402878c02958e0297909402998b02988210921191909101861b90861c018601878101858101958610981196119590950195909501831b82841c01850184810180851b939092169290920198870198909852959093029086109190941001811b93901c92909201019052565b610120830192506040826101208560055afa50505050565b6148248383602082810180519183015182019081905291518351019110019052565b5f61482f8483613747565b12611d3557602080840180519183015182039081905282518551929091119103038352505050565b5f6148686040808051918201905290565b6020808501518551600190811b60ff83901c1784521b9082015290505f61488f8284613747565b12610c1357602080820180519184015182039081905283518351929091119103038152610c13565b610240840193508151846060015260208201518460800152808460a001526040836101008660055afa5050505050565b6020808301518351600190811b60ff83901c1786521b90840152614824565b5f6149118484613747565b1261493a5760208084015181840151810391860182905283518551929091109103038452613493565b60208381015182820151810186830181815284518751019282109290920180885292850151810391829052845191119103038452613493565b60405180610a0001604052806050906020820280368337509192915050565b6040518061010001604052806008906020820280368337509192915050565b6040518061020001604052806010906020820280368337509192915050565b6040518061080001604052806040905b6149e86149fe565b8152602001906001900390816149e05790505090565b60405180604001604052806002906020820280368337509192915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114614a3f575f80fd5b919050565b5f60208284031215614a54575f80fd5b61197b82614a1c565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60405160a0810167ffffffffffffffff81118282101715614aad57614aad614a5d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715614afa57614afa614a5d565b604052919050565b5f67ffffffffffffffff821115614b1b57614b1b614a5d565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f830112614b56575f80fd5b8135614b69614b6482614b02565b614ab3565b818152846020838601011115614b7d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f8060408385031215614baa575f80fd5b823567ffffffffffffffff80821115614bc1575f80fd5b614bcd86838701614b47565b93506020850135915080821115614be2575f80fd5b50614bef85828601614b47565b9150509250929050565b5f815180845260208085019450602084015f5b83811015614c2857815187529582019590820190600101614c0c565b509495945050505050565b60208152815160208201525f6020830151614c5a604084018267ffffffffffffffff169052565b50604083015160608301526060830151610120806080850152614c81610140850183614bf9565b9150608085015160a085015260a08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08584030160c0860152614cc68382614bf9565b60c087015160e08781019190915287015161010080880191909152909601519190940152509192915050565b8015158114610cde575f80fd5b5f8060408385031215614d10575f80fd5b823591506020830135614d2281614cf2565b809150509250929050565b5f60208284031215614d3d575f80fd5b5035919050565b5f60208284031215614d54575f80fd5b813567ffffffffffffffff811115614d6a575f80fd5b611b8d84828501614b47565b5f5b83811015614d90578181015183820152602001614d78565b50505f910152565b5f8151808452614daf816020860160208601614d76565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b604081525f614df36040830185614d98565b8281036020840152614e058185614d98565b95945050505050565b5f8083601f840112614e1e575f80fd5b50813567ffffffffffffffff811115614e35575f80fd5b602083019150836020828501011115614e4c575f80fd5b9250929050565b5f805f8060408587031215614e66575f80fd5b843567ffffffffffffffff80821115614e7d575f80fd5b614e8988838901614e0e565b90965094506020870135915080821115614ea1575f80fd5b50614eae87828801614e0e565b95989497509550505050565b5f6020808385031215614ecb575f80fd5b823567ffffffffffffffff80821115614ee2575f80fd5b818501915085601f830112614ef5575f80fd5b813581811115614f0757614f07614a5d565b8060051b9150614f18848301614ab3565b8181529183018401918481019088841115614f31575f80fd5b938501935b83851015614f5657614f4785614a1c565b82529385019390850190614f36565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b81810381811115610c1357610c13614f8f565b80820180821115610c1357610c13614f8f565b604081525f614ff46040830185614d98565b90508260208301529392505050565b5f60208284031215615013575f80fd5b5051919050565b8051600781900b8114614a3f575f80fd5b5f82601f83011261503a575f80fd5b8151615048614b6482614b02565b81815284602083860101111561505c575f80fd5b611b8d826020830160208701614d76565b5f6020828403121561507d575f80fd5b815167ffffffffffffffff80821115615094575f80fd5b9083019060a082860312156150a7575f80fd5b6150af614a8a565b82516150ba81614cf2565b8152602083015182811681146150ce575f80fd5b60208201526150df6040840161501a565b6040820152606083015160608201526080830151828111156150ff575f80fd5b61510b8782860161502b565b60808301525095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826151555761515561511a565b500690565b5f826151685761516861511a565b500490565b8082028115828204841417610c1357610c13614f8f565b600181815b808511156151dd57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156151c3576151c3614f8f565b808516156151d057918102915b93841c9390800290615189565b509250929050565b5f826151f357506001610c13565b816151ff57505f610c13565b8160018114615215576002811461521f5761523b565b6001915050610c13565b60ff84111561523057615230614f8f565b50506001821b610c13565b5060208310610133831016604e8410600b841016171561525e575081810a610c13565b6152688383615184565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561529a5761529a614f8f565b029392505050565b5f61197b83836151e5565b5f85516152be818460208a01614d76565b7fff00000000000000000000000000000000000000000000000000000000000000861690830190815284516152fa816001840160208901614d76565b8082019150507fffffffffffffffff000000000000000000000000000000000000000000000000841660018201526009810191505095945050505050565b67ffffffffffffffff82811682821603908082111561535957615359614f8f565b509291505056feb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5fffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffcffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffffa164736f6c6343000816000a", +} + +// EspressoNitroTEEVerifierABI is the input ABI used to generate the binding from. +// Deprecated: Use EspressoNitroTEEVerifierMetaData.ABI instead. +var EspressoNitroTEEVerifierABI = EspressoNitroTEEVerifierMetaData.ABI + +// EspressoNitroTEEVerifierBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EspressoNitroTEEVerifierMetaData.Bin instead. +var EspressoNitroTEEVerifierBin = EspressoNitroTEEVerifierMetaData.Bin + +// DeployEspressoNitroTEEVerifier deploys a new Ethereum contract, binding an instance of EspressoNitroTEEVerifier to it. +func DeployEspressoNitroTEEVerifier(auth *bind.TransactOpts, backend bind.ContractBackend, enclaveHash [32]byte, certManager common.Address) (common.Address, *types.Transaction, *EspressoNitroTEEVerifier, error) { + parsed, err := EspressoNitroTEEVerifierMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EspressoNitroTEEVerifierBin), backend, enclaveHash, certManager) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EspressoNitroTEEVerifier{EspressoNitroTEEVerifierCaller: EspressoNitroTEEVerifierCaller{contract: contract}, EspressoNitroTEEVerifierTransactor: EspressoNitroTEEVerifierTransactor{contract: contract}, EspressoNitroTEEVerifierFilterer: EspressoNitroTEEVerifierFilterer{contract: contract}}, nil +} + +// EspressoNitroTEEVerifier is an auto generated Go binding around an Ethereum contract. +type EspressoNitroTEEVerifier struct { + EspressoNitroTEEVerifierCaller // Read-only binding to the contract + EspressoNitroTEEVerifierTransactor // Write-only binding to the contract + EspressoNitroTEEVerifierFilterer // Log filterer for contract events +} + +// EspressoNitroTEEVerifierCaller is an auto generated read-only Go binding around an Ethereum contract. +type EspressoNitroTEEVerifierCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoNitroTEEVerifierTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EspressoNitroTEEVerifierTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoNitroTEEVerifierFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EspressoNitroTEEVerifierFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoNitroTEEVerifierSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EspressoNitroTEEVerifierSession struct { + Contract *EspressoNitroTEEVerifier // 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 +} + +// EspressoNitroTEEVerifierCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EspressoNitroTEEVerifierCallerSession struct { + Contract *EspressoNitroTEEVerifierCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EspressoNitroTEEVerifierTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EspressoNitroTEEVerifierTransactorSession struct { + Contract *EspressoNitroTEEVerifierTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EspressoNitroTEEVerifierRaw is an auto generated low-level Go binding around an Ethereum contract. +type EspressoNitroTEEVerifierRaw struct { + Contract *EspressoNitroTEEVerifier // Generic contract binding to access the raw methods on +} + +// EspressoNitroTEEVerifierCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EspressoNitroTEEVerifierCallerRaw struct { + Contract *EspressoNitroTEEVerifierCaller // Generic read-only contract binding to access the raw methods on +} + +// EspressoNitroTEEVerifierTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EspressoNitroTEEVerifierTransactorRaw struct { + Contract *EspressoNitroTEEVerifierTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEspressoNitroTEEVerifier creates a new instance of EspressoNitroTEEVerifier, bound to a specific deployed contract. +func NewEspressoNitroTEEVerifier(address common.Address, backend bind.ContractBackend) (*EspressoNitroTEEVerifier, error) { + contract, err := bindEspressoNitroTEEVerifier(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifier{EspressoNitroTEEVerifierCaller: EspressoNitroTEEVerifierCaller{contract: contract}, EspressoNitroTEEVerifierTransactor: EspressoNitroTEEVerifierTransactor{contract: contract}, EspressoNitroTEEVerifierFilterer: EspressoNitroTEEVerifierFilterer{contract: contract}}, nil +} + +// NewEspressoNitroTEEVerifierCaller creates a new read-only instance of EspressoNitroTEEVerifier, bound to a specific deployed contract. +func NewEspressoNitroTEEVerifierCaller(address common.Address, caller bind.ContractCaller) (*EspressoNitroTEEVerifierCaller, error) { + contract, err := bindEspressoNitroTEEVerifier(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierCaller{contract: contract}, nil +} + +// NewEspressoNitroTEEVerifierTransactor creates a new write-only instance of EspressoNitroTEEVerifier, bound to a specific deployed contract. +func NewEspressoNitroTEEVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*EspressoNitroTEEVerifierTransactor, error) { + contract, err := bindEspressoNitroTEEVerifier(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierTransactor{contract: contract}, nil +} + +// NewEspressoNitroTEEVerifierFilterer creates a new log filterer instance of EspressoNitroTEEVerifier, bound to a specific deployed contract. +func NewEspressoNitroTEEVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*EspressoNitroTEEVerifierFilterer, error) { + contract, err := bindEspressoNitroTEEVerifier(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierFilterer{contract: contract}, nil +} + +// bindEspressoNitroTEEVerifier binds a generic wrapper to an already deployed contract. +func bindEspressoNitroTEEVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EspressoNitroTEEVerifierMetaData.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 (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EspressoNitroTEEVerifier.Contract.EspressoNitroTEEVerifierCaller.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 (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.EspressoNitroTEEVerifierTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.EspressoNitroTEEVerifierTransactor.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 (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EspressoNitroTEEVerifier.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 (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.contract.Transact(opts, method, params...) +} + +// ATTESTATIONDIGEST is a free data retrieval call binding the contract method 0x3893af6d. +// +// Solidity: function ATTESTATION_DIGEST() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) ATTESTATIONDIGEST(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "ATTESTATION_DIGEST") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ATTESTATIONDIGEST is a free data retrieval call binding the contract method 0x3893af6d. +// +// Solidity: function ATTESTATION_DIGEST() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) ATTESTATIONDIGEST() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.ATTESTATIONDIGEST(&_EspressoNitroTEEVerifier.CallOpts) +} + +// ATTESTATIONDIGEST is a free data retrieval call binding the contract method 0x3893af6d. +// +// Solidity: function ATTESTATION_DIGEST() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) ATTESTATIONDIGEST() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.ATTESTATIONDIGEST(&_EspressoNitroTEEVerifier.CallOpts) +} + +// ATTESTATIONTBSPREFIX is a free data retrieval call binding the contract method 0x2d4bad8a. +// +// Solidity: function ATTESTATION_TBS_PREFIX() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) ATTESTATIONTBSPREFIX(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "ATTESTATION_TBS_PREFIX") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ATTESTATIONTBSPREFIX is a free data retrieval call binding the contract method 0x2d4bad8a. +// +// Solidity: function ATTESTATION_TBS_PREFIX() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) ATTESTATIONTBSPREFIX() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.ATTESTATIONTBSPREFIX(&_EspressoNitroTEEVerifier.CallOpts) +} + +// ATTESTATIONTBSPREFIX is a free data retrieval call binding the contract method 0x2d4bad8a. +// +// Solidity: function ATTESTATION_TBS_PREFIX() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) ATTESTATIONTBSPREFIX() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.ATTESTATIONTBSPREFIX(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CABUNDLEKEY is a free data retrieval call binding the contract method 0x9cc3eb48. +// +// Solidity: function CABUNDLE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) CABUNDLEKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "CABUNDLE_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CABUNDLEKEY is a free data retrieval call binding the contract method 0x9cc3eb48. +// +// Solidity: function CABUNDLE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) CABUNDLEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.CABUNDLEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CABUNDLEKEY is a free data retrieval call binding the contract method 0x9cc3eb48. +// +// Solidity: function CABUNDLE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) CABUNDLEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.CABUNDLEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CERTIFICATEKEY is a free data retrieval call binding the contract method 0xae951149. +// +// Solidity: function CERTIFICATE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) CERTIFICATEKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "CERTIFICATE_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CERTIFICATEKEY is a free data retrieval call binding the contract method 0xae951149. +// +// Solidity: function CERTIFICATE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) CERTIFICATEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.CERTIFICATEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CERTIFICATEKEY is a free data retrieval call binding the contract method 0xae951149. +// +// Solidity: function CERTIFICATE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) CERTIFICATEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.CERTIFICATEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// DIGESTKEY is a free data retrieval call binding the contract method 0x6be1e68b. +// +// Solidity: function DIGEST_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) DIGESTKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "DIGEST_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DIGESTKEY is a free data retrieval call binding the contract method 0x6be1e68b. +// +// Solidity: function DIGEST_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) DIGESTKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.DIGESTKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// DIGESTKEY is a free data retrieval call binding the contract method 0x6be1e68b. +// +// Solidity: function DIGEST_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) DIGESTKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.DIGESTKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// MAXAGE is a free data retrieval call binding the contract method 0x0dcaeaf2. +// +// Solidity: function MAX_AGE() view returns(uint256) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) MAXAGE(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "MAX_AGE") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXAGE is a free data retrieval call binding the contract method 0x0dcaeaf2. +// +// Solidity: function MAX_AGE() view returns(uint256) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) MAXAGE() (*big.Int, error) { + return _EspressoNitroTEEVerifier.Contract.MAXAGE(&_EspressoNitroTEEVerifier.CallOpts) +} + +// MAXAGE is a free data retrieval call binding the contract method 0x0dcaeaf2. +// +// Solidity: function MAX_AGE() view returns(uint256) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) MAXAGE() (*big.Int, error) { + return _EspressoNitroTEEVerifier.Contract.MAXAGE(&_EspressoNitroTEEVerifier.CallOpts) +} + +// MODULEIDKEY is a free data retrieval call binding the contract method 0x9adb2d68. +// +// Solidity: function MODULE_ID_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) MODULEIDKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "MODULE_ID_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MODULEIDKEY is a free data retrieval call binding the contract method 0x9adb2d68. +// +// Solidity: function MODULE_ID_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) MODULEIDKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.MODULEIDKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// MODULEIDKEY is a free data retrieval call binding the contract method 0x9adb2d68. +// +// Solidity: function MODULE_ID_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) MODULEIDKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.MODULEIDKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// NONCEKEY is a free data retrieval call binding the contract method 0x6378aad5. +// +// Solidity: function NONCE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) NONCEKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "NONCE_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// NONCEKEY is a free data retrieval call binding the contract method 0x6378aad5. +// +// Solidity: function NONCE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) NONCEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.NONCEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// NONCEKEY is a free data retrieval call binding the contract method 0x6378aad5. +// +// Solidity: function NONCE_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) NONCEKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.NONCEKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PCRSKEY is a free data retrieval call binding the contract method 0xb22bed7e. +// +// Solidity: function PCRS_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) PCRSKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "PCRS_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// PCRSKEY is a free data retrieval call binding the contract method 0xb22bed7e. +// +// Solidity: function PCRS_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) PCRSKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.PCRSKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PCRSKEY is a free data retrieval call binding the contract method 0xb22bed7e. +// +// Solidity: function PCRS_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) PCRSKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.PCRSKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PUBLICKEYKEY is a free data retrieval call binding the contract method 0xe8b6d3fe. +// +// Solidity: function PUBLIC_KEY_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) PUBLICKEYKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "PUBLIC_KEY_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// PUBLICKEYKEY is a free data retrieval call binding the contract method 0xe8b6d3fe. +// +// Solidity: function PUBLIC_KEY_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) PUBLICKEYKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.PUBLICKEYKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PUBLICKEYKEY is a free data retrieval call binding the contract method 0xe8b6d3fe. +// +// Solidity: function PUBLIC_KEY_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) PUBLICKEYKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.PUBLICKEYKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// TIMESTAMPKEY is a free data retrieval call binding the contract method 0xe0a655ff. +// +// Solidity: function TIMESTAMP_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) TIMESTAMPKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "TIMESTAMP_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// TIMESTAMPKEY is a free data retrieval call binding the contract method 0xe0a655ff. +// +// Solidity: function TIMESTAMP_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) TIMESTAMPKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.TIMESTAMPKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// TIMESTAMPKEY is a free data retrieval call binding the contract method 0xe0a655ff. +// +// Solidity: function TIMESTAMP_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) TIMESTAMPKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.TIMESTAMPKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// USERDATAKEY is a free data retrieval call binding the contract method 0xcebf08d7. +// +// Solidity: function USER_DATA_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) USERDATAKEY(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "USER_DATA_KEY") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// USERDATAKEY is a free data retrieval call binding the contract method 0xcebf08d7. +// +// Solidity: function USER_DATA_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) USERDATAKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.USERDATAKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// USERDATAKEY is a free data retrieval call binding the contract method 0xcebf08d7. +// +// Solidity: function USER_DATA_KEY() view returns(bytes32) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) USERDATAKEY() ([32]byte, error) { + return _EspressoNitroTEEVerifier.Contract.USERDATAKEY(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CertManager is a free data retrieval call binding the contract method 0x739e8484. +// +// Solidity: function certManager() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) CertManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "certManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// CertManager is a free data retrieval call binding the contract method 0x739e8484. +// +// Solidity: function certManager() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) CertManager() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.CertManager(&_EspressoNitroTEEVerifier.CallOpts) +} + +// CertManager is a free data retrieval call binding the contract method 0x739e8484. +// +// Solidity: function certManager() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) CertManager() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.CertManager(&_EspressoNitroTEEVerifier.CallOpts) +} + +// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. +// +// Solidity: function decodeAttestationTbs(bytes attestation) pure returns(bytes attestationTbs, bytes signature) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) DecodeAttestationTbs(opts *bind.CallOpts, attestation []byte) (struct { + AttestationTbs []byte + Signature []byte +}, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "decodeAttestationTbs", attestation) + + outstruct := new(struct { + AttestationTbs []byte + Signature []byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.AttestationTbs = *abi.ConvertType(out[0], new([]byte)).(*[]byte) + outstruct.Signature = *abi.ConvertType(out[1], new([]byte)).(*[]byte) + + return *outstruct, err + +} + +// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. +// +// Solidity: function decodeAttestationTbs(bytes attestation) pure returns(bytes attestationTbs, bytes signature) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) DecodeAttestationTbs(attestation []byte) (struct { + AttestationTbs []byte + Signature []byte +}, error) { + return _EspressoNitroTEEVerifier.Contract.DecodeAttestationTbs(&_EspressoNitroTEEVerifier.CallOpts, attestation) +} + +// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. +// +// Solidity: function decodeAttestationTbs(bytes attestation) pure returns(bytes attestationTbs, bytes signature) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) DecodeAttestationTbs(attestation []byte) (struct { + AttestationTbs []byte + Signature []byte +}, error) { + return _EspressoNitroTEEVerifier.Contract.DecodeAttestationTbs(&_EspressoNitroTEEVerifier.CallOpts, attestation) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) Owner() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.Owner(&_EspressoNitroTEEVerifier.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) Owner() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.Owner(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) PendingOwner() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.PendingOwner(&_EspressoNitroTEEVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) PendingOwner() (common.Address, error) { + return _EspressoNitroTEEVerifier.Contract.PendingOwner(&_EspressoNitroTEEVerifier.CallOpts) +} + +// RegisteredEnclaveHash is a free data retrieval call binding the contract method 0x966989ee. +// +// Solidity: function registeredEnclaveHash(bytes32 ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) RegisteredEnclaveHash(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "registeredEnclaveHash", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RegisteredEnclaveHash is a free data retrieval call binding the contract method 0x966989ee. +// +// Solidity: function registeredEnclaveHash(bytes32 ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) RegisteredEnclaveHash(arg0 [32]byte) (bool, error) { + return _EspressoNitroTEEVerifier.Contract.RegisteredEnclaveHash(&_EspressoNitroTEEVerifier.CallOpts, arg0) +} + +// RegisteredEnclaveHash is a free data retrieval call binding the contract method 0x966989ee. +// +// Solidity: function registeredEnclaveHash(bytes32 ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) RegisteredEnclaveHash(arg0 [32]byte) (bool, error) { + return _EspressoNitroTEEVerifier.Contract.RegisteredEnclaveHash(&_EspressoNitroTEEVerifier.CallOpts, arg0) +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0x0123d0c1. +// +// Solidity: function registeredSigners(address ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCaller) RegisteredSigners(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _EspressoNitroTEEVerifier.contract.Call(opts, &out, "registeredSigners", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0x0123d0c1. +// +// Solidity: function registeredSigners(address ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) RegisteredSigners(arg0 common.Address) (bool, error) { + return _EspressoNitroTEEVerifier.Contract.RegisteredSigners(&_EspressoNitroTEEVerifier.CallOpts, arg0) +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0x0123d0c1. +// +// Solidity: function registeredSigners(address ) view returns(bool) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierCallerSession) RegisteredSigners(arg0 common.Address) (bool, error) { + return _EspressoNitroTEEVerifier.Contract.RegisteredSigners(&_EspressoNitroTEEVerifier.CallOpts, arg0) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) AcceptOwnership() (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.AcceptOwnership(&_EspressoNitroTEEVerifier.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.AcceptOwnership(&_EspressoNitroTEEVerifier.TransactOpts) +} + +// DeleteRegisteredSigners is a paid mutator transaction binding the contract method 0xe7370be0. +// +// Solidity: function deleteRegisteredSigners(address[] signers) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) DeleteRegisteredSigners(opts *bind.TransactOpts, signers []common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "deleteRegisteredSigners", signers) +} + +// DeleteRegisteredSigners is a paid mutator transaction binding the contract method 0xe7370be0. +// +// Solidity: function deleteRegisteredSigners(address[] signers) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) DeleteRegisteredSigners(signers []common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.DeleteRegisteredSigners(&_EspressoNitroTEEVerifier.TransactOpts, signers) +} + +// DeleteRegisteredSigners is a paid mutator transaction binding the contract method 0xe7370be0. +// +// Solidity: function deleteRegisteredSigners(address[] signers) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) DeleteRegisteredSigners(signers []common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.DeleteRegisteredSigners(&_EspressoNitroTEEVerifier.TransactOpts, signers) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0xba58e82a. +// +// Solidity: function registerSigner(bytes attestationTbs, bytes signature) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) RegisterSigner(opts *bind.TransactOpts, attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "registerSigner", attestationTbs, signature) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0xba58e82a. +// +// Solidity: function registerSigner(bytes attestationTbs, bytes signature) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) RegisterSigner(attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.RegisterSigner(&_EspressoNitroTEEVerifier.TransactOpts, attestationTbs, signature) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0xba58e82a. +// +// Solidity: function registerSigner(bytes attestationTbs, bytes signature) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) RegisterSigner(attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.RegisterSigner(&_EspressoNitroTEEVerifier.TransactOpts, attestationTbs, signature) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) RenounceOwnership() (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.RenounceOwnership(&_EspressoNitroTEEVerifier.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.RenounceOwnership(&_EspressoNitroTEEVerifier.TransactOpts) +} + +// SetEnclaveHash is a paid mutator transaction binding the contract method 0x93b5552e. +// +// Solidity: function setEnclaveHash(bytes32 enclaveHash, bool valid) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) SetEnclaveHash(opts *bind.TransactOpts, enclaveHash [32]byte, valid bool) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "setEnclaveHash", enclaveHash, valid) +} + +// SetEnclaveHash is a paid mutator transaction binding the contract method 0x93b5552e. +// +// Solidity: function setEnclaveHash(bytes32 enclaveHash, bool valid) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) SetEnclaveHash(enclaveHash [32]byte, valid bool) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.SetEnclaveHash(&_EspressoNitroTEEVerifier.TransactOpts, enclaveHash, valid) +} + +// SetEnclaveHash is a paid mutator transaction binding the contract method 0x93b5552e. +// +// Solidity: function setEnclaveHash(bytes32 enclaveHash, bool valid) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) SetEnclaveHash(enclaveHash [32]byte, valid bool) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.SetEnclaveHash(&_EspressoNitroTEEVerifier.TransactOpts, enclaveHash, valid) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.TransferOwnership(&_EspressoNitroTEEVerifier.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.TransferOwnership(&_EspressoNitroTEEVerifier.TransactOpts, newOwner) +} + +// ValidateAttestation is a paid mutator transaction binding the contract method 0x05f7aead. +// +// Solidity: function validateAttestation(bytes attestationTbs, bytes signature) returns((uint256,uint64,uint256,uint256[],uint256,uint256[],uint256,uint256,uint256)) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactor) ValidateAttestation(opts *bind.TransactOpts, attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.contract.Transact(opts, "validateAttestation", attestationTbs, signature) +} + +// ValidateAttestation is a paid mutator transaction binding the contract method 0x05f7aead. +// +// Solidity: function validateAttestation(bytes attestationTbs, bytes signature) returns((uint256,uint64,uint256,uint256[],uint256,uint256[],uint256,uint256,uint256)) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierSession) ValidateAttestation(attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.ValidateAttestation(&_EspressoNitroTEEVerifier.TransactOpts, attestationTbs, signature) +} + +// ValidateAttestation is a paid mutator transaction binding the contract method 0x05f7aead. +// +// Solidity: function validateAttestation(bytes attestationTbs, bytes signature) returns((uint256,uint64,uint256,uint256[],uint256,uint256[],uint256,uint256,uint256)) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierTransactorSession) ValidateAttestation(attestationTbs []byte, signature []byte) (*types.Transaction, error) { + return _EspressoNitroTEEVerifier.Contract.ValidateAttestation(&_EspressoNitroTEEVerifier.TransactOpts, attestationTbs, signature) +} + +// EspressoNitroTEEVerifierDeletedRegisteredSignerIterator is returned from FilterDeletedRegisteredSigner and is used to iterate over the raw logs and unpacked data for DeletedRegisteredSigner events raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierDeletedRegisteredSignerIterator struct { + Event *EspressoNitroTEEVerifierDeletedRegisteredSigner // 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 *EspressoNitroTEEVerifierDeletedRegisteredSignerIterator) 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(EspressoNitroTEEVerifierDeletedRegisteredSigner) + 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(EspressoNitroTEEVerifierDeletedRegisteredSigner) + 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 *EspressoNitroTEEVerifierDeletedRegisteredSignerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoNitroTEEVerifierDeletedRegisteredSignerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoNitroTEEVerifierDeletedRegisteredSigner represents a DeletedRegisteredSigner event raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierDeletedRegisteredSigner struct { + Signer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeletedRegisteredSigner is a free log retrieval operation binding the contract event 0x4872495ab7a697b6ed37286c6738fc94eaf291e5e4908abc1e2b479894f002dd. +// +// Solidity: event DeletedRegisteredSigner(address signer) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) FilterDeletedRegisteredSigner(opts *bind.FilterOpts) (*EspressoNitroTEEVerifierDeletedRegisteredSignerIterator, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.FilterLogs(opts, "DeletedRegisteredSigner") + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierDeletedRegisteredSignerIterator{contract: _EspressoNitroTEEVerifier.contract, event: "DeletedRegisteredSigner", logs: logs, sub: sub}, nil +} + +// WatchDeletedRegisteredSigner is a free log subscription operation binding the contract event 0x4872495ab7a697b6ed37286c6738fc94eaf291e5e4908abc1e2b479894f002dd. +// +// Solidity: event DeletedRegisteredSigner(address signer) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) WatchDeletedRegisteredSigner(opts *bind.WatchOpts, sink chan<- *EspressoNitroTEEVerifierDeletedRegisteredSigner) (event.Subscription, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.WatchLogs(opts, "DeletedRegisteredSigner") + 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(EspressoNitroTEEVerifierDeletedRegisteredSigner) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "DeletedRegisteredSigner", 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 +} + +// ParseDeletedRegisteredSigner is a log parse operation binding the contract event 0x4872495ab7a697b6ed37286c6738fc94eaf291e5e4908abc1e2b479894f002dd. +// +// Solidity: event DeletedRegisteredSigner(address signer) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) ParseDeletedRegisteredSigner(log types.Log) (*EspressoNitroTEEVerifierDeletedRegisteredSigner, error) { + event := new(EspressoNitroTEEVerifierDeletedRegisteredSigner) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "DeletedRegisteredSigner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EspressoNitroTEEVerifierEnclaveHashSetIterator is returned from FilterEnclaveHashSet and is used to iterate over the raw logs and unpacked data for EnclaveHashSet events raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierEnclaveHashSetIterator struct { + Event *EspressoNitroTEEVerifierEnclaveHashSet // 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 *EspressoNitroTEEVerifierEnclaveHashSetIterator) 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(EspressoNitroTEEVerifierEnclaveHashSet) + 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(EspressoNitroTEEVerifierEnclaveHashSet) + 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 *EspressoNitroTEEVerifierEnclaveHashSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoNitroTEEVerifierEnclaveHashSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoNitroTEEVerifierEnclaveHashSet represents a EnclaveHashSet event raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierEnclaveHashSet struct { + EnclaveHash [32]byte + Valid bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEnclaveHashSet is a free log retrieval operation binding the contract event 0x2282c24f65eac8254df1107716a961b677b872ed0e1d2a9f6bafc154441eb7fd. +// +// Solidity: event EnclaveHashSet(bytes32 enclaveHash, bool valid) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) FilterEnclaveHashSet(opts *bind.FilterOpts) (*EspressoNitroTEEVerifierEnclaveHashSetIterator, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.FilterLogs(opts, "EnclaveHashSet") + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierEnclaveHashSetIterator{contract: _EspressoNitroTEEVerifier.contract, event: "EnclaveHashSet", logs: logs, sub: sub}, nil +} + +// WatchEnclaveHashSet is a free log subscription operation binding the contract event 0x2282c24f65eac8254df1107716a961b677b872ed0e1d2a9f6bafc154441eb7fd. +// +// Solidity: event EnclaveHashSet(bytes32 enclaveHash, bool valid) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) WatchEnclaveHashSet(opts *bind.WatchOpts, sink chan<- *EspressoNitroTEEVerifierEnclaveHashSet) (event.Subscription, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.WatchLogs(opts, "EnclaveHashSet") + 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(EspressoNitroTEEVerifierEnclaveHashSet) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "EnclaveHashSet", 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 +} + +// ParseEnclaveHashSet is a log parse operation binding the contract event 0x2282c24f65eac8254df1107716a961b677b872ed0e1d2a9f6bafc154441eb7fd. +// +// Solidity: event EnclaveHashSet(bytes32 enclaveHash, bool valid) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) ParseEnclaveHashSet(log types.Log) (*EspressoNitroTEEVerifierEnclaveHashSet, error) { + event := new(EspressoNitroTEEVerifierEnclaveHashSet) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "EnclaveHashSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EspressoNitroTEEVerifierOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierOwnershipTransferStartedIterator struct { + Event *EspressoNitroTEEVerifierOwnershipTransferStarted // 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 *EspressoNitroTEEVerifierOwnershipTransferStartedIterator) 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(EspressoNitroTEEVerifierOwnershipTransferStarted) + 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(EspressoNitroTEEVerifierOwnershipTransferStarted) + 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 *EspressoNitroTEEVerifierOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoNitroTEEVerifierOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoNitroTEEVerifierOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EspressoNitroTEEVerifierOwnershipTransferStartedIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoNitroTEEVerifier.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierOwnershipTransferStartedIterator{contract: _EspressoNitroTEEVerifier.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *EspressoNitroTEEVerifierOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoNitroTEEVerifier.contract.WatchLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + 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(EspressoNitroTEEVerifierOwnershipTransferStarted) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", 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 +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) ParseOwnershipTransferStarted(log types.Log) (*EspressoNitroTEEVerifierOwnershipTransferStarted, error) { + event := new(EspressoNitroTEEVerifierOwnershipTransferStarted) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EspressoNitroTEEVerifierOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierOwnershipTransferredIterator struct { + Event *EspressoNitroTEEVerifierOwnershipTransferred // 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 *EspressoNitroTEEVerifierOwnershipTransferredIterator) 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(EspressoNitroTEEVerifierOwnershipTransferred) + 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(EspressoNitroTEEVerifierOwnershipTransferred) + 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 *EspressoNitroTEEVerifierOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoNitroTEEVerifierOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoNitroTEEVerifierOwnershipTransferred represents a OwnershipTransferred event raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EspressoNitroTEEVerifierOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoNitroTEEVerifier.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierOwnershipTransferredIterator{contract: _EspressoNitroTEEVerifier.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EspressoNitroTEEVerifierOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoNitroTEEVerifier.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + 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(EspressoNitroTEEVerifierOwnershipTransferred) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "OwnershipTransferred", 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 +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) ParseOwnershipTransferred(log types.Log) (*EspressoNitroTEEVerifierOwnershipTransferred, error) { + event := new(EspressoNitroTEEVerifierOwnershipTransferred) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EspressoNitroTEEVerifierSignerRegisteredIterator is returned from FilterSignerRegistered and is used to iterate over the raw logs and unpacked data for SignerRegistered events raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierSignerRegisteredIterator struct { + Event *EspressoNitroTEEVerifierSignerRegistered // 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 *EspressoNitroTEEVerifierSignerRegisteredIterator) 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(EspressoNitroTEEVerifierSignerRegistered) + 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(EspressoNitroTEEVerifierSignerRegistered) + 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 *EspressoNitroTEEVerifierSignerRegisteredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoNitroTEEVerifierSignerRegisteredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoNitroTEEVerifierSignerRegistered represents a SignerRegistered event raised by the EspressoNitroTEEVerifier contract. +type EspressoNitroTEEVerifierSignerRegistered struct { + Signer common.Address + EnclaveHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignerRegistered is a free log retrieval operation binding the contract event 0xcf848c482fcf6fe3067875f261b92c8f20a9756538ee17b8ef66ad0b7bae208c. +// +// Solidity: event SignerRegistered(address signer, bytes32 enclaveHash) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) FilterSignerRegistered(opts *bind.FilterOpts) (*EspressoNitroTEEVerifierSignerRegisteredIterator, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.FilterLogs(opts, "SignerRegistered") + if err != nil { + return nil, err + } + return &EspressoNitroTEEVerifierSignerRegisteredIterator{contract: _EspressoNitroTEEVerifier.contract, event: "SignerRegistered", logs: logs, sub: sub}, nil +} + +// WatchSignerRegistered is a free log subscription operation binding the contract event 0xcf848c482fcf6fe3067875f261b92c8f20a9756538ee17b8ef66ad0b7bae208c. +// +// Solidity: event SignerRegistered(address signer, bytes32 enclaveHash) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) WatchSignerRegistered(opts *bind.WatchOpts, sink chan<- *EspressoNitroTEEVerifierSignerRegistered) (event.Subscription, error) { + + logs, sub, err := _EspressoNitroTEEVerifier.contract.WatchLogs(opts, "SignerRegistered") + 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(EspressoNitroTEEVerifierSignerRegistered) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "SignerRegistered", 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 +} + +// ParseSignerRegistered is a log parse operation binding the contract event 0xcf848c482fcf6fe3067875f261b92c8f20a9756538ee17b8ef66ad0b7bae208c. +// +// Solidity: event SignerRegistered(address signer, bytes32 enclaveHash) +func (_EspressoNitroTEEVerifier *EspressoNitroTEEVerifierFilterer) ParseSignerRegistered(log types.Log) (*EspressoNitroTEEVerifierSignerRegistered, error) { + event := new(EspressoNitroTEEVerifierSignerRegistered) + if err := _EspressoNitroTEEVerifier.contract.UnpackLog(event, "SignerRegistered", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-batcher/bindings/espresso_tee_verifier.go b/op-batcher/bindings/espresso_tee_verifier.go new file mode 100644 index 00000000000..447501bc3dc --- /dev/null +++ b/op-batcher/bindings/espresso_tee_verifier.go @@ -0,0 +1,850 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +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 +) + +// EspressoTEEVerifierMetaData contains all meta data concerning the EspressoTEEVerifier contract. +var EspressoTEEVerifierMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoSGXTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoSGXTEEVerifier\"},{\"name\":\"_espressoNitroTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoNitroTEEVerifier\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"acceptOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"espressoNitroTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoNitroTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoSGXTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoSGXTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pendingOwner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"teeType\",\"type\":\"uint8\",\"internalType\":\"enumIEspressoTEEVerifier.TeeType\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredEnclaveHashes\",\"inputs\":[{\"name\":\"enclaveHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"teeType\",\"type\":\"uint8\",\"internalType\":\"enumIEspressoTEEVerifier.TeeType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registeredSigners\",\"inputs\":[{\"name\":\"signer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"teeType\",\"type\":\"uint8\",\"internalType\":\"enumIEspressoTEEVerifier.TeeType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEspressoNitroTEEVerifier\",\"inputs\":[{\"name\":\"_espressoNitroTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoNitroTEEVerifier\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setEspressoSGXTEEVerifier\",\"inputs\":[{\"name\":\"_espressoSGXTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoSGXTEEVerifier\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verify\",\"inputs\":[{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"userDataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferStarted\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnsupportedTeeType\",\"inputs\":[]}]", + Bin: "0x6080346100aa57601f61115d38819003918201601f19168301916001600160401b038311848410176100ae5780849260409485528339810103126100aa5780516001600160a01b03811691908290036100aa57602001516001600160a01b03811691908290036100aa57610072336100c2565b60018060a01b0319600254161760025560018060a01b0319600354161760035561009b336100c2565b60405161104690816101178239f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b600180546001600160a01b03199081169091555f80546001600160a01b03938416928116831782559192909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe60806040526004361015610011575f80fd5b5f3560e01c8063330282f5146108c457806335ecb4c11461083c5780633cbe6803146107f35780636b406341146105ad578063715018a6146104eb57806379ba50971461038b57806380710c801461033a5780638da5cb5b146102ea578063bc3a091114610265578063d80a4c2814610214578063e30c3978146101c3578063e9b1a7be146101695763f2fde38b146100a8575f80fd5b346101655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101655773ffffffffffffffffffffffffffffffffffffffff6100f46109b8565b6100fc610d94565b16807fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015573ffffffffffffffffffffffffffffffffffffffff5f54167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a3005b5f80fd5b346101655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610165576101a06109b8565b602435906002821015610165576020916101b991610c8e565b6040519015158152f35b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016557602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016557602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b346101655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101655760043573ffffffffffffffffffffffffffffffffffffffff8116809103610165576102bd610d94565b7fffffffffffffffffffffffff000000000000000000000000000000000000000060025416176002555f80f35b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016557602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016557602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610165573373ffffffffffffffffffffffffffffffffffffffff6001541603610467577fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f54337fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f5573ffffffffffffffffffffffffffffffffffffffff3391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152fd5b34610165575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016557610521610d94565b7fffffffffffffffffffffffff0000000000000000000000000000000000000000600154166001555f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101655760043567ffffffffffffffff811161016557366023820112156101655780600401359067ffffffffffffffff82116107c65760405161064360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160182610977565b8281523660248484010111610165575f60208461067995602461067196018386013783010152602435610e12565b919091610e47565b73ffffffffffffffffffffffffffffffffffffffff60208160025416926024604051809481937f0123d0c100000000000000000000000000000000000000000000000000000000835216958660048301525afa90811561079c575f916107a7575b501561074557602073ffffffffffffffffffffffffffffffffffffffff60035416916024604051809481937f0123d0c100000000000000000000000000000000000000000000000000000000835260048301525afa90811561079c575f9161076d575b501561074557005b7f8baa579f000000000000000000000000000000000000000000000000000000005f5260045ffd5b61078f915060203d602011610795575b6107878183610977565b810190610bc6565b8161073d565b503d61077d565b6040513d5f823e3d90fd5b6107c0915060203d602011610795576107878183610977565b826106da565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b346101655760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610165576024356002811015610165576101b9602091600435610bde565b346101655760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101655760043567ffffffffffffffff81116101655761088b903690600401610949565b60243567ffffffffffffffff8111610165576108ab903690600401610949565b90604435926002841015610165576108c294610a43565b005b346101655760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101655760043573ffffffffffffffffffffffffffffffffffffffff81168091036101655761091c610d94565b7fffffffffffffffffffffffff000000000000000000000000000000000000000060035416176003555f80f35b9181601f840112156101655782359167ffffffffffffffff8311610165576020838186019501011161016557565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107c657604052565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361016557565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe093818652868601375f8582860101520116010190565b9290610a3290610a4095936040865260408601916109db565b9260208185039101526109db565b90565b905f946002811015610b99578015610b1a57600114610a84576004857fd0cb35a1000000000000000000000000000000000000000000000000000000008152fd5b73ffffffffffffffffffffffffffffffffffffffff6003541691823b15610b1657908580949392610ae4604051978896879586947fba58e82a00000000000000000000000000000000000000000000000000000000865260048601610a19565b03925af18015610b0b57610af6575050565b610b01828092610977565b610b085750565b80fd5b6040513d84823e3d90fd5b8580fd5b509092935073ffffffffffffffffffffffffffffffffffffffff6002541690813b15610165575f8094610b7c604051978896879586947fba58e82a00000000000000000000000000000000000000000000000000000000865260048601610a19565b03925af1801561079c57610b8d5750565b5f610b9791610977565b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b90816020910312610165575180151581036101655790565b906002811015610b995715610c15577fd0cb35a1000000000000000000000000000000000000000000000000000000005f5260045ffd5b602073ffffffffffffffffffffffffffffffffffffffff60025416916024604051809481937f966989ee00000000000000000000000000000000000000000000000000000000835260048301525afa90811561079c575f91610c75575090565b610a40915060203d602011610795576107878183610977565b906002811015610b99578015610d3057600114610ccd577fd0cb35a1000000000000000000000000000000000000000000000000000000005f5260045ffd5b602073ffffffffffffffffffffffffffffffffffffffff602481600354169360405194859384927f0123d0c10000000000000000000000000000000000000000000000000000000084521660048301525afa90811561079c575f91610c75575090565b50602073ffffffffffffffffffffffffffffffffffffffff602481600254169360405194859384927f0123d0c10000000000000000000000000000000000000000000000000000000084521660048301525afa90811561079c575f91610c75575090565b73ffffffffffffffffffffffffffffffffffffffff5f54163303610db457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9060418151145f14610e3e57610e3a91602082015190606060408401519301515f1a90610fb1565b9091565b50505f90600290565b6005811015610b995780610e585750565b60018103610ebe5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b60028103610f245760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600314610f2d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841161102e576020935f9360ff60809460405194855216868401526040830152606082015282805260015afa1561079c575f5173ffffffffffffffffffffffffffffffffffffffff81161561102657905f90565b505f90600190565b505050505f9060039056fea164736f6c634300081c000a", +} + +// EspressoTEEVerifierABI is the input ABI used to generate the binding from. +// Deprecated: Use EspressoTEEVerifierMetaData.ABI instead. +var EspressoTEEVerifierABI = EspressoTEEVerifierMetaData.ABI + +// EspressoTEEVerifierBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EspressoTEEVerifierMetaData.Bin instead. +var EspressoTEEVerifierBin = EspressoTEEVerifierMetaData.Bin + +// DeployEspressoTEEVerifier deploys a new Ethereum contract, binding an instance of EspressoTEEVerifier to it. +func DeployEspressoTEEVerifier(auth *bind.TransactOpts, backend bind.ContractBackend, _espressoSGXTEEVerifier common.Address, _espressoNitroTEEVerifier common.Address) (common.Address, *types.Transaction, *EspressoTEEVerifier, error) { + parsed, err := EspressoTEEVerifierMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EspressoTEEVerifierBin), backend, _espressoSGXTEEVerifier, _espressoNitroTEEVerifier) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EspressoTEEVerifier{EspressoTEEVerifierCaller: EspressoTEEVerifierCaller{contract: contract}, EspressoTEEVerifierTransactor: EspressoTEEVerifierTransactor{contract: contract}, EspressoTEEVerifierFilterer: EspressoTEEVerifierFilterer{contract: contract}}, nil +} + +// EspressoTEEVerifier is an auto generated Go binding around an Ethereum contract. +type EspressoTEEVerifier struct { + EspressoTEEVerifierCaller // Read-only binding to the contract + EspressoTEEVerifierTransactor // Write-only binding to the contract + EspressoTEEVerifierFilterer // Log filterer for contract events +} + +// EspressoTEEVerifierCaller is an auto generated read-only Go binding around an Ethereum contract. +type EspressoTEEVerifierCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoTEEVerifierTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EspressoTEEVerifierTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoTEEVerifierFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EspressoTEEVerifierFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EspressoTEEVerifierSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EspressoTEEVerifierSession struct { + Contract *EspressoTEEVerifier // 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 +} + +// EspressoTEEVerifierCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EspressoTEEVerifierCallerSession struct { + Contract *EspressoTEEVerifierCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EspressoTEEVerifierTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EspressoTEEVerifierTransactorSession struct { + Contract *EspressoTEEVerifierTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EspressoTEEVerifierRaw is an auto generated low-level Go binding around an Ethereum contract. +type EspressoTEEVerifierRaw struct { + Contract *EspressoTEEVerifier // Generic contract binding to access the raw methods on +} + +// EspressoTEEVerifierCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EspressoTEEVerifierCallerRaw struct { + Contract *EspressoTEEVerifierCaller // Generic read-only contract binding to access the raw methods on +} + +// EspressoTEEVerifierTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EspressoTEEVerifierTransactorRaw struct { + Contract *EspressoTEEVerifierTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEspressoTEEVerifier creates a new instance of EspressoTEEVerifier, bound to a specific deployed contract. +func NewEspressoTEEVerifier(address common.Address, backend bind.ContractBackend) (*EspressoTEEVerifier, error) { + contract, err := bindEspressoTEEVerifier(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EspressoTEEVerifier{EspressoTEEVerifierCaller: EspressoTEEVerifierCaller{contract: contract}, EspressoTEEVerifierTransactor: EspressoTEEVerifierTransactor{contract: contract}, EspressoTEEVerifierFilterer: EspressoTEEVerifierFilterer{contract: contract}}, nil +} + +// NewEspressoTEEVerifierCaller creates a new read-only instance of EspressoTEEVerifier, bound to a specific deployed contract. +func NewEspressoTEEVerifierCaller(address common.Address, caller bind.ContractCaller) (*EspressoTEEVerifierCaller, error) { + contract, err := bindEspressoTEEVerifier(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EspressoTEEVerifierCaller{contract: contract}, nil +} + +// NewEspressoTEEVerifierTransactor creates a new write-only instance of EspressoTEEVerifier, bound to a specific deployed contract. +func NewEspressoTEEVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*EspressoTEEVerifierTransactor, error) { + contract, err := bindEspressoTEEVerifier(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EspressoTEEVerifierTransactor{contract: contract}, nil +} + +// NewEspressoTEEVerifierFilterer creates a new log filterer instance of EspressoTEEVerifier, bound to a specific deployed contract. +func NewEspressoTEEVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*EspressoTEEVerifierFilterer, error) { + contract, err := bindEspressoTEEVerifier(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EspressoTEEVerifierFilterer{contract: contract}, nil +} + +// bindEspressoTEEVerifier binds a generic wrapper to an already deployed contract. +func bindEspressoTEEVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EspressoTEEVerifierMetaData.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 (_EspressoTEEVerifier *EspressoTEEVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EspressoTEEVerifier.Contract.EspressoTEEVerifierCaller.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 (_EspressoTEEVerifier *EspressoTEEVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.EspressoTEEVerifierTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EspressoTEEVerifier *EspressoTEEVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.EspressoTEEVerifierTransactor.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 (_EspressoTEEVerifier *EspressoTEEVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EspressoTEEVerifier.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 (_EspressoTEEVerifier *EspressoTEEVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.contract.Transact(opts, method, params...) +} + +// EspressoNitroTEEVerifier is a free data retrieval call binding the contract method 0xd80a4c28. +// +// Solidity: function espressoNitroTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) EspressoNitroTEEVerifier(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "espressoNitroTEEVerifier") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EspressoNitroTEEVerifier is a free data retrieval call binding the contract method 0xd80a4c28. +// +// Solidity: function espressoNitroTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) EspressoNitroTEEVerifier() (common.Address, error) { + return _EspressoTEEVerifier.Contract.EspressoNitroTEEVerifier(&_EspressoTEEVerifier.CallOpts) +} + +// EspressoNitroTEEVerifier is a free data retrieval call binding the contract method 0xd80a4c28. +// +// Solidity: function espressoNitroTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) EspressoNitroTEEVerifier() (common.Address, error) { + return _EspressoTEEVerifier.Contract.EspressoNitroTEEVerifier(&_EspressoTEEVerifier.CallOpts) +} + +// EspressoSGXTEEVerifier is a free data retrieval call binding the contract method 0x80710c80. +// +// Solidity: function espressoSGXTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) EspressoSGXTEEVerifier(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "espressoSGXTEEVerifier") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EspressoSGXTEEVerifier is a free data retrieval call binding the contract method 0x80710c80. +// +// Solidity: function espressoSGXTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) EspressoSGXTEEVerifier() (common.Address, error) { + return _EspressoTEEVerifier.Contract.EspressoSGXTEEVerifier(&_EspressoTEEVerifier.CallOpts) +} + +// EspressoSGXTEEVerifier is a free data retrieval call binding the contract method 0x80710c80. +// +// Solidity: function espressoSGXTEEVerifier() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) EspressoSGXTEEVerifier() (common.Address, error) { + return _EspressoTEEVerifier.Contract.EspressoSGXTEEVerifier(&_EspressoTEEVerifier.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) Owner() (common.Address, error) { + return _EspressoTEEVerifier.Contract.Owner(&_EspressoTEEVerifier.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) Owner() (common.Address, error) { + return _EspressoTEEVerifier.Contract.Owner(&_EspressoTEEVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) PendingOwner() (common.Address, error) { + return _EspressoTEEVerifier.Contract.PendingOwner(&_EspressoTEEVerifier.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) PendingOwner() (common.Address, error) { + return _EspressoTEEVerifier.Contract.PendingOwner(&_EspressoTEEVerifier.CallOpts) +} + +// RegisteredEnclaveHashes is a free data retrieval call binding the contract method 0x3cbe6803. +// +// Solidity: function registeredEnclaveHashes(bytes32 enclaveHash, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) RegisteredEnclaveHashes(opts *bind.CallOpts, enclaveHash [32]byte, teeType uint8) (bool, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "registeredEnclaveHashes", enclaveHash, teeType) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RegisteredEnclaveHashes is a free data retrieval call binding the contract method 0x3cbe6803. +// +// Solidity: function registeredEnclaveHashes(bytes32 enclaveHash, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) RegisteredEnclaveHashes(enclaveHash [32]byte, teeType uint8) (bool, error) { + return _EspressoTEEVerifier.Contract.RegisteredEnclaveHashes(&_EspressoTEEVerifier.CallOpts, enclaveHash, teeType) +} + +// RegisteredEnclaveHashes is a free data retrieval call binding the contract method 0x3cbe6803. +// +// Solidity: function registeredEnclaveHashes(bytes32 enclaveHash, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) RegisteredEnclaveHashes(enclaveHash [32]byte, teeType uint8) (bool, error) { + return _EspressoTEEVerifier.Contract.RegisteredEnclaveHashes(&_EspressoTEEVerifier.CallOpts, enclaveHash, teeType) +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0xe9b1a7be. +// +// Solidity: function registeredSigners(address signer, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) RegisteredSigners(opts *bind.CallOpts, signer common.Address, teeType uint8) (bool, error) { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "registeredSigners", signer, teeType) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0xe9b1a7be. +// +// Solidity: function registeredSigners(address signer, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) RegisteredSigners(signer common.Address, teeType uint8) (bool, error) { + return _EspressoTEEVerifier.Contract.RegisteredSigners(&_EspressoTEEVerifier.CallOpts, signer, teeType) +} + +// RegisteredSigners is a free data retrieval call binding the contract method 0xe9b1a7be. +// +// Solidity: function registeredSigners(address signer, uint8 teeType) view returns(bool) +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) RegisteredSigners(signer common.Address, teeType uint8) (bool, error) { + return _EspressoTEEVerifier.Contract.RegisteredSigners(&_EspressoTEEVerifier.CallOpts, signer, teeType) +} + +// Verify is a free data retrieval call binding the contract method 0x6b406341. +// +// Solidity: function verify(bytes signature, bytes32 userDataHash) view returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierCaller) Verify(opts *bind.CallOpts, signature []byte, userDataHash [32]byte) error { + var out []interface{} + err := _EspressoTEEVerifier.contract.Call(opts, &out, "verify", signature, userDataHash) + + if err != nil { + return err + } + + return err + +} + +// Verify is a free data retrieval call binding the contract method 0x6b406341. +// +// Solidity: function verify(bytes signature, bytes32 userDataHash) view returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) Verify(signature []byte, userDataHash [32]byte) error { + return _EspressoTEEVerifier.Contract.Verify(&_EspressoTEEVerifier.CallOpts, signature, userDataHash) +} + +// Verify is a free data retrieval call binding the contract method 0x6b406341. +// +// Solidity: function verify(bytes signature, bytes32 userDataHash) view returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierCallerSession) Verify(signature []byte, userDataHash [32]byte) error { + return _EspressoTEEVerifier.Contract.Verify(&_EspressoTEEVerifier.CallOpts, signature, userDataHash) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) AcceptOwnership() (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.AcceptOwnership(&_EspressoTEEVerifier.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.AcceptOwnership(&_EspressoTEEVerifier.TransactOpts) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x35ecb4c1. +// +// Solidity: function registerSigner(bytes attestation, bytes data, uint8 teeType) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) RegisterSigner(opts *bind.TransactOpts, attestation []byte, data []byte, teeType uint8) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "registerSigner", attestation, data, teeType) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x35ecb4c1. +// +// Solidity: function registerSigner(bytes attestation, bytes data, uint8 teeType) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) RegisterSigner(attestation []byte, data []byte, teeType uint8) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.RegisterSigner(&_EspressoTEEVerifier.TransactOpts, attestation, data, teeType) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x35ecb4c1. +// +// Solidity: function registerSigner(bytes attestation, bytes data, uint8 teeType) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) RegisterSigner(attestation []byte, data []byte, teeType uint8) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.RegisterSigner(&_EspressoTEEVerifier.TransactOpts, attestation, data, teeType) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) RenounceOwnership() (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.RenounceOwnership(&_EspressoTEEVerifier.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.RenounceOwnership(&_EspressoTEEVerifier.TransactOpts) +} + +// SetEspressoNitroTEEVerifier is a paid mutator transaction binding the contract method 0x330282f5. +// +// Solidity: function setEspressoNitroTEEVerifier(address _espressoNitroTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) SetEspressoNitroTEEVerifier(opts *bind.TransactOpts, _espressoNitroTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "setEspressoNitroTEEVerifier", _espressoNitroTEEVerifier) +} + +// SetEspressoNitroTEEVerifier is a paid mutator transaction binding the contract method 0x330282f5. +// +// Solidity: function setEspressoNitroTEEVerifier(address _espressoNitroTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) SetEspressoNitroTEEVerifier(_espressoNitroTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.SetEspressoNitroTEEVerifier(&_EspressoTEEVerifier.TransactOpts, _espressoNitroTEEVerifier) +} + +// SetEspressoNitroTEEVerifier is a paid mutator transaction binding the contract method 0x330282f5. +// +// Solidity: function setEspressoNitroTEEVerifier(address _espressoNitroTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) SetEspressoNitroTEEVerifier(_espressoNitroTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.SetEspressoNitroTEEVerifier(&_EspressoTEEVerifier.TransactOpts, _espressoNitroTEEVerifier) +} + +// SetEspressoSGXTEEVerifier is a paid mutator transaction binding the contract method 0xbc3a0911. +// +// Solidity: function setEspressoSGXTEEVerifier(address _espressoSGXTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) SetEspressoSGXTEEVerifier(opts *bind.TransactOpts, _espressoSGXTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "setEspressoSGXTEEVerifier", _espressoSGXTEEVerifier) +} + +// SetEspressoSGXTEEVerifier is a paid mutator transaction binding the contract method 0xbc3a0911. +// +// Solidity: function setEspressoSGXTEEVerifier(address _espressoSGXTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) SetEspressoSGXTEEVerifier(_espressoSGXTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.SetEspressoSGXTEEVerifier(&_EspressoTEEVerifier.TransactOpts, _espressoSGXTEEVerifier) +} + +// SetEspressoSGXTEEVerifier is a paid mutator transaction binding the contract method 0xbc3a0911. +// +// Solidity: function setEspressoSGXTEEVerifier(address _espressoSGXTEEVerifier) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) SetEspressoSGXTEEVerifier(_espressoSGXTEEVerifier common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.SetEspressoSGXTEEVerifier(&_EspressoTEEVerifier.TransactOpts, _espressoSGXTEEVerifier) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.TransferOwnership(&_EspressoTEEVerifier.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EspressoTEEVerifier *EspressoTEEVerifierTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EspressoTEEVerifier.Contract.TransferOwnership(&_EspressoTEEVerifier.TransactOpts, newOwner) +} + +// EspressoTEEVerifierOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the EspressoTEEVerifier contract. +type EspressoTEEVerifierOwnershipTransferStartedIterator struct { + Event *EspressoTEEVerifierOwnershipTransferStarted // 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 *EspressoTEEVerifierOwnershipTransferStartedIterator) 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(EspressoTEEVerifierOwnershipTransferStarted) + 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(EspressoTEEVerifierOwnershipTransferStarted) + 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 *EspressoTEEVerifierOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoTEEVerifierOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoTEEVerifierOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the EspressoTEEVerifier contract. +type EspressoTEEVerifierOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EspressoTEEVerifierOwnershipTransferStartedIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoTEEVerifier.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EspressoTEEVerifierOwnershipTransferStartedIterator{contract: _EspressoTEEVerifier.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *EspressoTEEVerifierOwnershipTransferStarted, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoTEEVerifier.contract.WatchLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + 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(EspressoTEEVerifierOwnershipTransferStarted) + if err := _EspressoTEEVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", 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 +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) ParseOwnershipTransferStarted(log types.Log) (*EspressoTEEVerifierOwnershipTransferStarted, error) { + event := new(EspressoTEEVerifierOwnershipTransferStarted) + if err := _EspressoTEEVerifier.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EspressoTEEVerifierOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the EspressoTEEVerifier contract. +type EspressoTEEVerifierOwnershipTransferredIterator struct { + Event *EspressoTEEVerifierOwnershipTransferred // 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 *EspressoTEEVerifierOwnershipTransferredIterator) 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(EspressoTEEVerifierOwnershipTransferred) + 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(EspressoTEEVerifierOwnershipTransferred) + 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 *EspressoTEEVerifierOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EspressoTEEVerifierOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EspressoTEEVerifierOwnershipTransferred represents a OwnershipTransferred event raised by the EspressoTEEVerifier contract. +type EspressoTEEVerifierOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EspressoTEEVerifierOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoTEEVerifier.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EspressoTEEVerifierOwnershipTransferredIterator{contract: _EspressoTEEVerifier.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EspressoTEEVerifierOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _EspressoTEEVerifier.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + 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(EspressoTEEVerifierOwnershipTransferred) + if err := _EspressoTEEVerifier.contract.UnpackLog(event, "OwnershipTransferred", 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 +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_EspressoTEEVerifier *EspressoTEEVerifierFilterer) ParseOwnershipTransferred(log types.Log) (*EspressoTEEVerifierOwnershipTransferred, error) { + event := new(EspressoTEEVerifierOwnershipTransferred) + if err := _EspressoTEEVerifier.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/op-batcher/enclave-entrypoint.bash b/op-batcher/enclave-entrypoint.bash new file mode 100644 index 00000000000..f5bb0d8b3a5 --- /dev/null +++ b/op-batcher/enclave-entrypoint.bash @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +# Entrypoint for op-batcher running in enclaver image. +# Main goal of the script is to rewrite the URLs passed to the batcher to use the Odyn proxy +# and recover batcher's CLI arguments from ENCLAVE_BATCHER_ARGS env variable (there's no way +# to directly pass commandline arguments when starting EIF images) + +# We will need to start a proxy for each of those urls +URL_ARG="^(--altda\.da-server|--espresso-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)$" + +# Re-populate the arguments passed through the environment +if [ -n "$ENCLAVE_BATCHER_ARGS" ]; then + eval set -- "$ENCLAVE_BATCHER_ARGS" +fi + +if ! ODYN_PROXY_PORT=$(trurl --url "$http_proxy" --get "{port}"); then + echo "Failed to parse HTTP_PROXY with" >&2 + return 1 + fi + +if nc -z 127.0.0.1 $ODYN_PROXY_PORT 2>/dev/null; then + echo "Odyn proxy functional" +else + echo "Odyn proxy unreachable" + exit 1 +fi + +unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY + +wait_for_port() { + local port="$1" + + for ((i=0; i<100; i++)); do + if nc -z 127.0.0.1 "$port" 2>/dev/null; then + return 0 + fi + sleep 0.3 + done + + echo "Error: socat did not open port $port in time" >&2 + return 1 +} + +launch_socat() { + local original_url="$1" + local socat_port="$2" + + local host port scheme + if ! read -r host port scheme < <(trurl --url "$original_url" --default-port --get "{host} {port} {scheme}"); then + echo "Failed to parse URL" >&2 + return 1 + fi + + # If original host was 127.0.0.1, we need to map it to `host` inside the enclave + if [[ "$host" == "localhost" ]] || [[ "$host" == "127.0.0.1" ]] || [[ "$host" == "::1" ]]; then + echo "Rewriting '$host' to 'host'" >&2 + host="host" + fi + + if [[ "$scheme" != "http" ]] && [[ "$scheme" != "https" ]]; then + echo "Invalid scheme: '$scheme'. Only http and https are supported." >&2 + return 1 + fi + + # start socat + socat -t 10 -d TCP4-LISTEN:"${socat_port}",reuseaddr,fork PROXY:127.0.0.1:"$host":"$port",proxyport="${ODYN_PROXY_PORT}" > /dev/null 2>&1 & + socat_pid=$! + disown "$socat_pid" + + wait_for_port "${socat_port}" || { + kill "$socat_pid" 2>/dev/null + wait "$socat_pid" 2>/dev/null + return 1 + } + + # return socat-proxied url + echo "$(trurl --url "$original_url" --set host="127.0.0.1" --set port="$socat_port")" + + return 0 +} + +# Initialize arrays for filtered arguments and extracted URLs +filtered_args=() +url_args=() + +SOCAT_PORT=10001 +# Process all arguments +while [ $# -gt 0 ]; do + # Check if the argument matches the URL pattern + if [[ $1 =~ $URL_ARG ]]; then + # Extract the flag part and possible value part + flag=${BASH_REMATCH[1]} + + if [ $# -gt 1 ]; then + shift + value="$1" + else + echo "$flag doesn't have a value" + exit 1 + fi + + echo "Rewriting $flag=$value" + if ! new_url=$(launch_socat "$value" "$SOCAT_PORT"); then + echo "Failed to launch socat for $flag=$value" + exit 1 + fi + echo "Rewritten: $new_url" + url_args+=("$flag" "$new_url") + + ((SOCAT_PORT++)) + else + # This is not a URL argument, add it to filtered args + filtered_args+=("$1") + fi + shift +done + +# Combine the rewritten URL arguments with the other arguments +all_args=("${filtered_args[@]}" "${url_args[@]}") + +echo "${all_args[@]}" +op-batcher "${all_args[@]}" diff --git a/op-batcher/flags/flags.go b/op-batcher/flags/flags.go index 947c626df87..486261c8ff9 100644 --- a/op-batcher/flags/flags.go +++ b/op-batcher/flags/flags.go @@ -62,7 +62,7 @@ var ( Name: "espresso-poll-interval", Usage: "How frequently to poll Espresso for new batches", Value: 6 * time.Second, - EnvVars: prefixEnvVars("POLL_INTERVAL"), + EnvVars: prefixEnvVars("ESPRESSO_POLL_INTERVAL"), } MaxPendingTransactionsFlag = &cli.Uint64Flag{ Name: "max-pending-tx", @@ -194,10 +194,9 @@ var ( Value: false, EnvVars: prefixEnvVars("PREFER_LOCAL_SAFE_L2"), } - EspressoUrlFlag = &cli.StringFlag{ + EspressoUrlsFlag = &cli.StringSliceFlag{ Name: "espresso-url", Usage: "URL of Espresso query service", - Value: "", EnvVars: prefixEnvVars("ESPRESSO_URL"), } @@ -246,8 +245,10 @@ var optionalFlags = []cli.Flag{ ThrottleBlockSizeFlag, ThrottleAlwaysBlockSizeFlag, PreferLocalSafeL2Flag, - EspressoUrlFlag, + EspressoUrlsFlag, EspressoLCAddrFlag, + EspressoPollIntervalFlag, + TestingEspressoBatcherPrivateKeyFlag, } func init() { diff --git a/op-e2e/config/init.go b/op-e2e/config/init.go index b3f4223dc19..308cb434279 100644 --- a/op-e2e/config/init.go +++ b/op-e2e/config/init.go @@ -51,11 +51,12 @@ const ( type AllocType string const ( - AllocTypeStandard AllocType = "standard" - AllocTypeAltDA AllocType = "alt-da" - AllocTypeL2OO AllocType = "l2oo" - AllocTypeMTCannon AllocType = "mt-cannon" - AllocTypeEspresso AllocType = "espresso" + AllocTypeStandard AllocType = "standard" + AllocTypeAltDA AllocType = "alt-da" + AllocTypeL2OO AllocType = "l2oo" + AllocTypeMTCannon AllocType = "mt-cannon" + AllocTypeEspressoWithoutEnclave AllocType = "espresso-no-enclave" + AllocTypeEspressoWithEnclave AllocType = "espresso-enclave" DefaultAllocType = AllocTypeStandard ) @@ -69,14 +70,14 @@ func (a AllocType) Check() error { func (a AllocType) UsesProofs() bool { switch a { - case AllocTypeStandard, AllocTypeMTCannon, AllocTypeAltDA, AllocTypeEspresso: + case AllocTypeStandard, AllocTypeMTCannon, AllocTypeAltDA, AllocTypeEspressoWithoutEnclave, AllocTypeEspressoWithEnclave: return true default: return false } } -var allocTypes = []AllocType{AllocTypeStandard, AllocTypeAltDA, AllocTypeL2OO, AllocTypeMTCannon, AllocTypeEspresso} +var allocTypes = []AllocType{AllocTypeStandard, AllocTypeAltDA, AllocTypeL2OO, AllocTypeMTCannon, AllocTypeEspressoWithoutEnclave, AllocTypeEspressoWithEnclave} var ( // All of the following variables are set in the init function @@ -281,7 +282,7 @@ func initAllocType(root string, allocType AllocType) { } } - if allocType == AllocTypeEspresso { + if allocType == AllocTypeEspressoWithoutEnclave { batcherPk, err := crypto.HexToECDSA(ESPRESSO_PRE_APPROVED_BATCHER_PRIVATE_KEY) if err != nil { panic(fmt.Errorf("failed to parse batcher private key: %w", err)) @@ -290,6 +291,10 @@ func initAllocType(root string, allocType AllocType) { intent.Chains[0].PreApprovedBatcherKey = crypto.PubkeyToAddress(batcherPk.PublicKey) } + if allocType == AllocTypeEspressoWithEnclave { + intent.Chains[0].EspressoEnabled = true + } + baseUpgradeSchedule := map[string]any{ "l2GenesisRegolithTimeOffset": nil, "l2GenesisCanyonTimeOffset": nil, diff --git a/op-e2e/system/e2esys/setup.go b/op-e2e/system/e2esys/setup.go index 6eb2018a236..35557c2600d 100644 --- a/op-e2e/system/e2esys/setup.go +++ b/op-e2e/system/e2esys/setup.go @@ -554,7 +554,7 @@ type StartOption struct { Action SystemConfigHook // Batcher CLIConfig modifications to apply before starting the batcher. - BatcherMod func(*bss.CLIConfig) + BatcherMod func(*bss.CLIConfig, *System) } type startOptions struct { @@ -577,7 +577,7 @@ func parseStartOptions(_opts []StartOption) (startOptions, error) { func WithBatcherCompressionAlgo(ca derive.CompressionAlgo) StartOption { return StartOption{ - BatcherMod: func(cfg *bss.CLIConfig) { + BatcherMod: func(cfg *bss.CLIConfig, sys *System) { cfg.CompressionAlgo = ca }, } @@ -585,7 +585,7 @@ func WithBatcherCompressionAlgo(ca derive.CompressionAlgo) StartOption { func WithBatcherThrottling(interval time.Duration, threshold, txSize, blockSize uint64) StartOption { return StartOption{ - BatcherMod: func(cfg *bss.CLIConfig) { + BatcherMod: func(cfg *bss.CLIConfig, sys *System) { cfg.ThrottleThreshold = threshold cfg.ThrottleTxSize = txSize cfg.ThrottleBlockSize = blockSize @@ -1035,7 +1035,7 @@ func (cfg SystemConfig) Start(t *testing.T, startOpts ...StartOption) (*System, // Apply batcher cli modifications for _, opt := range startOpts { if opt.BatcherMod != nil { - opt.BatcherMod(batcherCLIConfig) + opt.BatcherMod(batcherCLIConfig, sys) } } diff --git a/ops/docker/op-stack-go/Dockerfile b/ops/docker/op-stack-go/Dockerfile index 9518d5ddca6..68d0c2a005e 100644 --- a/ops/docker/op-stack-go/Dockerfile +++ b/ops/docker/op-stack-go/Dockerfile @@ -147,7 +147,7 @@ ARG OP_DISPUTE_MON_VERSION=v0.0.0 RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build cd op-dispute-mon && make op-dispute-mon \ GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_DISPUTE_MON_VERSION" -FROM op-cgo-builder as op-batcher-builder +FROM op-cgo-builder AS op-batcher-builder WORKDIR /app/op-batcher ENV GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_BATCHER_VERSION" RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build just op-batcher @@ -233,6 +233,19 @@ ADD "https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0/kzg10-a COPY --from=op-batcher-builder /app/op-batcher/bin/op-batcher /usr/local/bin/ CMD ["op-batcher"] +FROM $TARGET_BASE_IMAGE AS op-batcher-enclave-target +ARG ENCLAVE_BATCHER_ARGS="" +# CGO dependencies +RUN apk add gcc +# enclave-entrypoint dependencies +RUN apk add socat bash trurl curl +ENV AZTEC_SRS_PATH /aztec/kzg10-aztec20-srs-1048584.bin +ADD "https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0/kzg10-aztec20-srs-1048584.bin" /aztec/kzg10-aztec20-srs-1048584.bin +COPY --from=op-batcher-builder /app/op-batcher/bin/op-batcher /usr/local/bin/ +COPY --chmod=555 ./op-batcher/enclave-entrypoint.bash /entrypoint.bash +ENV ENCLAVE_BATCHER_ARGS=$ENCLAVE_BATCHER_ARGS +CMD ["/entrypoint.bash"] + FROM $TARGET_BASE_IMAGE AS op-proposer-target COPY --from=op-proposer-builder /app/op-proposer/bin/op-proposer /usr/local/bin/ CMD ["op-proposer"] @@ -255,4 +268,4 @@ CMD ["op-deployer"] FROM $TARGET_BASE_IMAGE AS op-dripper-target COPY --from=op-dripper-builder /app/op-dripper/bin/op-dripper /usr/local/bin/ -CMD ["op-dripper"] \ No newline at end of file +CMD ["op-dripper"] diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index 0cffd18ffb1..3d25a84a146 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -131,7 +131,19 @@ timeout = 300 [profile.lite] optimizer = false + +# IMPORTANT: +# See the info in the "DEFAULT" profile to understand this section. +additional_compiler_profiles = [ + { name = "dispute", optimizer_runs = 5000 }, + { name = "via-ir", via_ir = true }, +] compilation_restrictions = [ + { paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 5000 }, + { paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 5000 }, + { paths = "src/L1/OPContractsManager.sol", optimizer_runs = 5000 }, + { paths = "src/L1/StandardValidator.sol", optimizer_runs = 5000 }, + { paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 }, { paths = "lib/espresso-tee-contracts/lib/nitro-validator/**", via_ir = false }, { paths = "lib/espresso-tee-contracts/lib/automata-dcap-attestation/**", via_ir = true }, ]