From 6d3ed6fcc943e33c9e5eda9bfbe1f948e32c492a Mon Sep 17 00:00:00 2001 From: Wagmi Date: Mon, 6 May 2024 15:28:02 +0800 Subject: [PATCH 1/7] feat: support ethda da option --- cmd/run.go | 27 ++++++---- dataavailability/config.go | 1 + dataavailability/ethda/ethda.go | 79 ++++++++++++++++++++++++++++ dataavailability/ethda/ethda_test.go | 46 ++++++++++++++++ go.mod | 11 ++-- go.sum | 13 +++++ 6 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 dataavailability/ethda/ethda.go create mode 100644 dataavailability/ethda/ethda_test.go diff --git a/cmd/run.go b/cmd/run.go index 047724163a..e4f3315d2f 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -5,6 +5,7 @@ import ( "crypto/ecdsa" "errors" "fmt" + "github.com/0xPolygonHermez/zkevm-node/dataavailability/ethda" "net" "net/http" "net/http/pprof" @@ -322,6 +323,16 @@ func newDataAvailability(c config.Config, st *state.State, etherman *etherman.Cl } zkEVMClient := client.NewClient(trustedSequencerURL) + var ( + pk *ecdsa.PrivateKey + ) + if isSequenceSender { + _, pk, err = etherman.LoadAuthFromKeyStore(c.SequenceSender.PrivateKey.Path, c.SequenceSender.PrivateKey.Password) + if err != nil { + return nil, err + } + } + dataSourcePriority = c.Synchronizer.L2Synchronization.DataSourcePriority if len(dataSourcePriority) == 0 { dataSourcePriority = dataavailability.DefaultPriority @@ -335,16 +346,6 @@ func newDataAvailability(c config.Config, st *state.State, etherman *etherman.Cl var daBackend dataavailability.DABackender switch daProtocolName { case string(dataavailability.DataAvailabilityCommittee): - var ( - pk *ecdsa.PrivateKey - err error - ) - if isSequenceSender { - _, pk, err = etherman.LoadAuthFromKeyStore(c.SequenceSender.PrivateKey.Path, c.SequenceSender.PrivateKey.Password) - if err != nil { - return nil, err - } - } dacAddr, err := etherman.GetDAProtocolAddr() if err != nil { return nil, fmt.Errorf("error getting trusted sequencer URI. Error: %v", err) @@ -359,6 +360,12 @@ func newDataAvailability(c config.Config, st *state.State, etherman *etherman.Cl if err != nil { return nil, err } + case string(dataavailability.ETHDA): + rpcUrl := "https://rpc-devnet2.ethda.io" + daBackend, err = ethda.New(rpcUrl, pk) + if err != nil { + return nil, err + } default: return nil, fmt.Errorf("unexpected / unsupported DA protocol: %s", daProtocolName) } diff --git a/dataavailability/config.go b/dataavailability/config.go index 8163e7bcf4..02fe9a920b 100644 --- a/dataavailability/config.go +++ b/dataavailability/config.go @@ -6,4 +6,5 @@ type DABackendType string const ( // DataAvailabilityCommittee is the DAC protocol backend DataAvailabilityCommittee DABackendType = "DataAvailabilityCommittee" + ETHDA DABackendType = "Ethda" ) diff --git a/dataavailability/ethda/ethda.go b/dataavailability/ethda/ethda.go new file mode 100644 index 0000000000..056ebc4760 --- /dev/null +++ b/dataavailability/ethda/ethda.go @@ -0,0 +1,79 @@ +package ethda + +import ( + "context" + "crypto/ecdsa" + "fmt" + blobutils "github.com/crustio/blob-utils" + "github.com/ethereum/go-ethereum/common" + "math/big" +) + +type EthdaBackend struct { + ethdaClient *blobutils.Client + chainId *big.Int + ethdaRPCURL string + privKey *ecdsa.PrivateKey +} + +func New( + ethdaRPCURL string, + privKey *ecdsa.PrivateKey, +) (*EthdaBackend, error) { + if ethdaRPCURL == "" { + return nil, fmt.Errorf("empty ethda rpc url") + } + + if privKey == nil { + return nil, fmt.Errorf("empty private key") + } + + return &EthdaBackend{ + privKey: privKey, + ethdaRPCURL: ethdaRPCURL, + }, nil +} + +func (d *EthdaBackend) Init() error { + ethdaClient, err := blobutils.New(d.ethdaRPCURL, d.privKey) + if err != nil { + return fmt.Errorf("create ethda client: %w", err) + } + + d.ethdaClient = ethdaClient + + return nil +} + +func (d *EthdaBackend) PostSequence(ctx context.Context, batchesData [][]byte) ([]byte, error) { + var hashes []byte + for _, batch := range batchesData { + hash, err := d.ethdaClient.PostBlob(ctx, batch) + if err != nil { + return nil, fmt.Errorf("post batch to ethda: %w", err) + } + hashes = append(hashes, hash.Bytes()...) + } + + return hashes, nil +} + +func (d *EthdaBackend) GetSequence(ctx context.Context, batchHashes []common.Hash, dataAvailabilityMessage []byte) ([][]byte, error) { + if len(dataAvailabilityMessage)%common.HashLength != 0 { + return nil, fmt.Errorf("wrong da message length: %d", len(dataAvailabilityMessage)) + } + + var data [][]byte + for i := 0; i < len(dataAvailabilityMessage)/common.HashLength; i++ { + start := common.HashLength * i + hash := common.BytesToHash(dataAvailabilityMessage[start : start+common.HashLength]) + + r, err := d.ethdaClient.GetBlob(hash) + if err != nil { + return nil, fmt.Errorf("get blob from ethda: %w", err) + } + data = append(data, r) + } + + return data, nil +} diff --git a/dataavailability/ethda/ethda_test.go b/dataavailability/ethda/ethda_test.go new file mode 100644 index 0000000000..2174cf73a4 --- /dev/null +++ b/dataavailability/ethda/ethda_test.go @@ -0,0 +1,46 @@ +package ethda + +import ( + "context" + "fmt" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/require" + "testing" +) + +func TestPostSequence(t *testing.T) { + rpcUrl := "https://rpc-devnet2.ethda.io" + + // test key + key, err := crypto.HexToECDSA("f26d6aca18e0c75ac948a262d4b9435a8173515f84c258d1f90d171143039024") + require.NoError(t, err) + + da, err := New(rpcUrl, key) + require.NoError(t, err) + + err = da.Init() + require.NoError(t, err) + + batchData := [][]byte{[]byte("ethda")} + msg, err := da.PostSequence(context.Background(), batchData) + require.NoError(t, err) + fmt.Println(common.Bytes2Hex(msg)) +} + +func TestGetSequence(t *testing.T) { + rpcUrl := "https://rpc-devnet2.ethda.io" + + // test key + key, err := crypto.HexToECDSA("f26d6aca18e0c75ac948a262d4b9435a8173515f84c258d1f90d171143039024") + require.NoError(t, err) + da, err := New(rpcUrl, key) + require.NoError(t, err) + + err = da.Init() + require.NoError(t, err) + + data, err := da.GetSequence(context.Background(), nil, common.Hex2Bytes("76b56f65beab1cfe55242eb97eebfe2f32aacd957f202122835026bffb3ba282")) + require.NoError(t, err) + fmt.Println(data) +} diff --git a/go.mod b/go.mod index 046855af4d..64d1d25da1 100644 --- a/go.mod +++ b/go.mod @@ -60,6 +60,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect + github.com/crustio/blob-utils v0.2.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect @@ -69,7 +70,7 @@ require ( github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect + github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -115,7 +116,7 @@ require ( github.com/markbates/safe v1.0.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/miguelmota/go-solidity-sha3 v0.1.1 // indirect github.com/mitchellh/pointerstructure v1.2.0 // indirect @@ -126,14 +127,14 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.3 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.7.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sergi/go-diff v1.2.0 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/skeema/knownhosts v1.2.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -147,10 +148,12 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect + github.com/urfave/cli v1.22.9 // indirect github.com/valyala/fastjson v1.4.1 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/multierr v1.10.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/sys v0.16.0 // indirect diff --git a/go.sum b/go.sum index f56238aada..0a9cf7efc5 100644 --- a/go.sum +++ b/go.sum @@ -153,6 +153,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -162,6 +163,8 @@ github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBS github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/crustio/blob-utils v0.2.0 h1:cDBcKSbo160Ty6rX+jafCwK3Bhh7wfpjyKcE/c+EAak= +github.com/crustio/blob-utils v0.2.0/go.mod h1:7BcdCxXDgJ2xPNRLgVxlBXQ3eWZ0oFTcwZ+h3dpj58g= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -225,6 +228,7 @@ github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyT github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= @@ -256,6 +260,7 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-pg/pg/v10 v10.11.0 h1:CMKJqLgTrfpE/aOVeLdybezR2om071Vh38OLZjsyMI0= @@ -578,6 +583,7 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= @@ -671,6 +677,7 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -704,6 +711,8 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= +github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= @@ -787,6 +796,8 @@ github.com/umbracle/ethgo v0.1.4-0.20230712173909-df37dddf16f0 h1:wE2g4ydxJk8kdR github.com/umbracle/ethgo v0.1.4-0.20230712173909-df37dddf16f0/go.mod h1:J+OZNfRCtbaYW3AEc0m47GhwAzlNJjcr9vO86nzOr6E= github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 h1:10Nbw6cACsnQm7r34zlpJky+IzxVLRk6MKTS2d3Vp0E= github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722/go.mod h1:c8J0h9aULj2i3umrfyestM6jCq0LK0U6ly6bWy96nd4= +github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw= +github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI= github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= @@ -826,6 +837,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= +github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= From 3aa3ccf4d07318733bc60600dd9576d81fcb8dcb Mon Sep 17 00:00:00 2001 From: Wagmi Date: Thu, 9 May 2024 17:00:51 +0800 Subject: [PATCH 2/7] feat: update blob utils --- dataavailability/ethda/ethda_test.go | 2 +- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dataavailability/ethda/ethda_test.go b/dataavailability/ethda/ethda_test.go index 2174cf73a4..67433602a0 100644 --- a/dataavailability/ethda/ethda_test.go +++ b/dataavailability/ethda/ethda_test.go @@ -42,5 +42,5 @@ func TestGetSequence(t *testing.T) { data, err := da.GetSequence(context.Background(), nil, common.Hex2Bytes("76b56f65beab1cfe55242eb97eebfe2f32aacd957f202122835026bffb3ba282")) require.NoError(t, err) - fmt.Println(data) + require.Equal(t, "ethda", string(data[0])) } diff --git a/go.mod b/go.mod index 64d1d25da1..2eea847c71 100644 --- a/go.mod +++ b/go.mod @@ -60,7 +60,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect - github.com/crustio/blob-utils v0.2.0 // indirect + github.com/crustio/blob-utils v0.2.1 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index 0a9cf7efc5..cb920dd9d1 100644 --- a/go.sum +++ b/go.sum @@ -165,6 +165,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/crustio/blob-utils v0.2.0 h1:cDBcKSbo160Ty6rX+jafCwK3Bhh7wfpjyKcE/c+EAak= github.com/crustio/blob-utils v0.2.0/go.mod h1:7BcdCxXDgJ2xPNRLgVxlBXQ3eWZ0oFTcwZ+h3dpj58g= +github.com/crustio/blob-utils v0.2.1 h1:kDiV8kPjyyjzIk64ezB6VN+H6fbtK9eAUcSmF94RJ5M= +github.com/crustio/blob-utils v0.2.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From eacd29368e6605f3479688cc7ead5220f40b7497 Mon Sep 17 00:00:00 2001 From: Wagmi Date: Sun, 12 May 2024 00:06:10 +0800 Subject: [PATCH 3/7] feat: append sig to da message --- dataavailability/ethda/ethda.go | 32 +++++++++++++++++++++++----- dataavailability/ethda/ethda_test.go | 3 ++- go.mod | 2 +- go.sum | 4 ++++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/dataavailability/ethda/ethda.go b/dataavailability/ethda/ethda.go index 056ebc4760..a758b3486b 100644 --- a/dataavailability/ethda/ethda.go +++ b/dataavailability/ethda/ethda.go @@ -6,6 +6,8 @@ import ( "fmt" blobutils "github.com/crustio/blob-utils" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + solsha3 "github.com/miguelmota/go-solidity-sha3" "math/big" ) @@ -55,17 +57,37 @@ func (d *EthdaBackend) PostSequence(ctx context.Context, batchesData [][]byte) ( hashes = append(hashes, hash.Bytes()...) } - return hashes, nil + currentHash := common.Hash{}.Bytes() + for _, batchData := range batchesData { + types := []string{ + "bytes32", + "bytes32", + } + values := []interface{}{ + currentHash, + crypto.Keccak256(batchData), + } + currentHash = solsha3.SoliditySHA3(types, values) + } + + sig, err := d.ethdaClient.SignBatchHash(common.BytesToHash(currentHash)) + if err != nil { + return nil, err + } + + return append(sig, hashes...), nil } func (d *EthdaBackend) GetSequence(ctx context.Context, batchHashes []common.Hash, dataAvailabilityMessage []byte) ([][]byte, error) { - if len(dataAvailabilityMessage)%common.HashLength != 0 { - return nil, fmt.Errorf("wrong da message length: %d", len(dataAvailabilityMessage)) + msgLen := len(dataAvailabilityMessage) + + if msgLen < crypto.SignatureLength || (msgLen-crypto.SignatureLength)%common.HashLength != 0 { + return nil, fmt.Errorf("wrong da message length: %d", msgLen) } var data [][]byte - for i := 0; i < len(dataAvailabilityMessage)/common.HashLength; i++ { - start := common.HashLength * i + for i := 0; i < (msgLen-crypto.SignatureLength)/common.HashLength; i++ { + start := common.HashLength*i + crypto.SignatureLength hash := common.BytesToHash(dataAvailabilityMessage[start : start+common.HashLength]) r, err := d.ethdaClient.GetBlob(hash) diff --git a/dataavailability/ethda/ethda_test.go b/dataavailability/ethda/ethda_test.go index 67433602a0..c268d59337 100644 --- a/dataavailability/ethda/ethda_test.go +++ b/dataavailability/ethda/ethda_test.go @@ -29,6 +29,7 @@ func TestPostSequence(t *testing.T) { } func TestGetSequence(t *testing.T) { + daMessage := "b1e79a75baadbd688f97213920a01980e37e4fbf464cf9ffc94e6d10be2ee69253f1acb077c8355d30f4d8046ccbe4eb5f4eb05643ef31c4fe6e531c0ca7dc8e1bdb919f0ef6ffe754f3dfdfdfc4d1789b0bf2aee713567b550d330527eab00522" rpcUrl := "https://rpc-devnet2.ethda.io" // test key @@ -40,7 +41,7 @@ func TestGetSequence(t *testing.T) { err = da.Init() require.NoError(t, err) - data, err := da.GetSequence(context.Background(), nil, common.Hex2Bytes("76b56f65beab1cfe55242eb97eebfe2f32aacd957f202122835026bffb3ba282")) + data, err := da.GetSequence(context.Background(), nil, common.Hex2Bytes(daMessage)) require.NoError(t, err) require.Equal(t, "ethda", string(data[0])) } diff --git a/go.mod b/go.mod index 2eea847c71..4d08dd0ffb 100644 --- a/go.mod +++ b/go.mod @@ -60,7 +60,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect - github.com/crustio/blob-utils v0.2.1 // indirect + github.com/crustio/blob-utils v0.3.1 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index cb920dd9d1..b6915f5b06 100644 --- a/go.sum +++ b/go.sum @@ -167,6 +167,10 @@ github.com/crustio/blob-utils v0.2.0 h1:cDBcKSbo160Ty6rX+jafCwK3Bhh7wfpjyKcE/c+E github.com/crustio/blob-utils v0.2.0/go.mod h1:7BcdCxXDgJ2xPNRLgVxlBXQ3eWZ0oFTcwZ+h3dpj58g= github.com/crustio/blob-utils v0.2.1 h1:kDiV8kPjyyjzIk64ezB6VN+H6fbtK9eAUcSmF94RJ5M= github.com/crustio/blob-utils v0.2.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= +github.com/crustio/blob-utils v0.3.0 h1:7Uh7FmZQLZFcacfmqZhV2Z5J6P88CeLoSwtoBcLRvsE= +github.com/crustio/blob-utils v0.3.0/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= +github.com/crustio/blob-utils v0.3.1 h1:T++x9rKRqB7mlQp9nZpfadQd0UvKH6zMgV1695EvkUE= +github.com/crustio/blob-utils v0.3.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 3e9d835d18dab9f174f15939647a5669afebc1b5 Mon Sep 17 00:00:00 2001 From: Wagmi Date: Sun, 12 May 2024 23:46:20 +0800 Subject: [PATCH 4/7] feat: add ethda smart contract --- etherman/smartcontracts/abi/ethda.abi | 146 ++++++ etherman/smartcontracts/bin/ethda.bin | 1 + etherman/smartcontracts/ethda/ethda.go | 696 +++++++++++++++++++++++++ etherman/smartcontracts/script.sh | 1 + 4 files changed, 844 insertions(+) create mode 100644 etherman/smartcontracts/abi/ethda.abi create mode 100644 etherman/smartcontracts/bin/ethda.bin create mode 100644 etherman/smartcontracts/ethda/ethda.go diff --git a/etherman/smartcontracts/abi/ethda.abi b/etherman/smartcontracts/abi/ethda.abi new file mode 100644 index 0000000000..a197b7fdbe --- /dev/null +++ b/etherman/smartcontracts/abi/ethda.abi @@ -0,0 +1,146 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "UnexpectedAddrsAndSignaturesSize", + "type": "error" + }, + { + "inputs": [], + "name": "WrongSignature", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "ethdaSequencerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProcotolName", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_ethdaSequencerAddress", + "type": "address" + } + ], + "name": "setEthdaSequencerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "signedHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signaturesAndAddrs", + "type": "bytes" + } + ], + "name": "verifyMessage", + "outputs": [], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/etherman/smartcontracts/bin/ethda.bin b/etherman/smartcontracts/bin/ethda.bin new file mode 100644 index 0000000000..150861c563 --- /dev/null +++ b/etherman/smartcontracts/bin/ethda.bin @@ -0,0 +1 @@ +608060405234801561000f575f80fd5b5061001861001d565b6100da565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811610156100d8575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610bce806100e75f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b146100f8578063d5deff3014610116578063e4f1712014610129578063f2fde38b14610168575f80fd5b80633b51be4b14610089578063715018a61461009e5780637e585d3e146100a65780638129fc1c146100f0575b5f80fd5b61009c6100973660046109bc565b61017b565b005b61009c61027f565b6065546100c69073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009c610292565b60335473ffffffffffffffffffffffffffffffffffffffff166100c6565b61009c610124366004610a31565b610423565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100e79190610a6b565b61009c610176366004610a31565b610472565b60418082108061019f575060206101928284610ad4565b61019c9190610b0c565b15155b156101d6576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610221856101e86041848789610b44565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061052692505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff808316911614610278576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028761054a565b6102905f6105cb565b565b5f54610100900460ff16158080156102b057505f54600160ff909116105b806102c95750303b1580156102c957505f5460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103be610641565b8015610420575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b61042b61054a565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61047a61054a565b73ffffffffffffffffffffffffffffffffffffffff811661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b610420816105cb565b5f805f61053385856106e0565b9150915061054081610722565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610351565b610290336105cb565b5f808251604103610714576020830151604084015160608501515f1a610708878285856108d4565b9450945050505061071b565b505f905060025b9250929050565b5f81600481111561073557610735610b6b565b0361073d5750565b600181600481111561075157610751610b6b565b036107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610351565b60028160048111156107cc576107cc610b6b565b03610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610351565b600381600481111561084757610847610b6b565b03610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610351565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561090957505f905060036109b3565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561095a573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109ad575f600192509250506109b3565b91505f90505b94509492505050565b5f805f604084860312156109ce575f80fd5b83359250602084013567ffffffffffffffff808211156109ec575f80fd5b818601915086601f8301126109ff575f80fd5b813581811115610a0d575f80fd5b876020828501011115610a1e575f80fd5b6020830194508093505050509250925092565b5f60208284031215610a41575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a64575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610a9657858101830151858201604001528201610a7a565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610544577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610b3f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b5f8085851115610b52575f80fd5b83861115610b5e575f80fd5b5050820193919092039150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffdfea264697066735822122010fdd197f73d092becd782054513afc2e54a220206a28c0f0f39e31fe955dcca64736f6c63430008140033 \ No newline at end of file diff --git a/etherman/smartcontracts/ethda/ethda.go b/etherman/smartcontracts/ethda/ethda.go new file mode 100644 index 0000000000..1ad0631a55 --- /dev/null +++ b/etherman/smartcontracts/ethda/ethda.go @@ -0,0 +1,696 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package ethda + +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 +) + +// EthdaMetaData contains all meta data concerning the Ethda contract. +var EthdaMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"UnexpectedAddrsAndSignaturesSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongSignature\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ethdaSequencerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProcotolName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ethdaSequencerAddress\",\"type\":\"address\"}],\"name\":\"setEthdaSequencerAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signedHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signaturesAndAddrs\",\"type\":\"bytes\"}],\"name\":\"verifyMessage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x608060405234801561000f575f80fd5b5061001861001d565b6100da565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811610156100d8575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610bce806100e75f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b146100f8578063d5deff3014610116578063e4f1712014610129578063f2fde38b14610168575f80fd5b80633b51be4b14610089578063715018a61461009e5780637e585d3e146100a65780638129fc1c146100f0575b5f80fd5b61009c6100973660046109bc565b61017b565b005b61009c61027f565b6065546100c69073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009c610292565b60335473ffffffffffffffffffffffffffffffffffffffff166100c6565b61009c610124366004610a31565b610423565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100e79190610a6b565b61009c610176366004610a31565b610472565b60418082108061019f575060206101928284610ad4565b61019c9190610b0c565b15155b156101d6576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610221856101e86041848789610b44565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061052692505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff808316911614610278576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028761054a565b6102905f6105cb565b565b5f54610100900460ff16158080156102b057505f54600160ff909116105b806102c95750303b1580156102c957505f5460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103be610641565b8015610420575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b61042b61054a565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61047a61054a565b73ffffffffffffffffffffffffffffffffffffffff811661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b610420816105cb565b5f805f61053385856106e0565b9150915061054081610722565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610351565b610290336105cb565b5f808251604103610714576020830151604084015160608501515f1a610708878285856108d4565b9450945050505061071b565b505f905060025b9250929050565b5f81600481111561073557610735610b6b565b0361073d5750565b600181600481111561075157610751610b6b565b036107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610351565b60028160048111156107cc576107cc610b6b565b03610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610351565b600381600481111561084757610847610b6b565b03610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610351565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561090957505f905060036109b3565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561095a573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109ad575f600192509250506109b3565b91505f90505b94509492505050565b5f805f604084860312156109ce575f80fd5b83359250602084013567ffffffffffffffff808211156109ec575f80fd5b818601915086601f8301126109ff575f80fd5b813581811115610a0d575f80fd5b876020828501011115610a1e575f80fd5b6020830194508093505050509250925092565b5f60208284031215610a41575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a64575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610a9657858101830151858201604001528201610a7a565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610544577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610b3f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b5f8085851115610b52575f80fd5b83861115610b5e575f80fd5b5050820193919092039150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffdfea264697066735822122010fdd197f73d092becd782054513afc2e54a220206a28c0f0f39e31fe955dcca64736f6c63430008140033", +} + +// EthdaABI is the input ABI used to generate the binding from. +// Deprecated: Use EthdaMetaData.ABI instead. +var EthdaABI = EthdaMetaData.ABI + +// EthdaBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EthdaMetaData.Bin instead. +var EthdaBin = EthdaMetaData.Bin + +// DeployEthda deploys a new Ethereum contract, binding an instance of Ethda to it. +func DeployEthda(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Ethda, error) { + parsed, err := EthdaMetaData.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(EthdaBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Ethda{EthdaCaller: EthdaCaller{contract: contract}, EthdaTransactor: EthdaTransactor{contract: contract}, EthdaFilterer: EthdaFilterer{contract: contract}}, nil +} + +// Ethda is an auto generated Go binding around an Ethereum contract. +type Ethda struct { + EthdaCaller // Read-only binding to the contract + EthdaTransactor // Write-only binding to the contract + EthdaFilterer // Log filterer for contract events +} + +// EthdaCaller is an auto generated read-only Go binding around an Ethereum contract. +type EthdaCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EthdaTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EthdaTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EthdaFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EthdaFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EthdaSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EthdaSession struct { + Contract *Ethda // 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 +} + +// EthdaCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EthdaCallerSession struct { + Contract *EthdaCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EthdaTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EthdaTransactorSession struct { + Contract *EthdaTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EthdaRaw is an auto generated low-level Go binding around an Ethereum contract. +type EthdaRaw struct { + Contract *Ethda // Generic contract binding to access the raw methods on +} + +// EthdaCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EthdaCallerRaw struct { + Contract *EthdaCaller // Generic read-only contract binding to access the raw methods on +} + +// EthdaTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EthdaTransactorRaw struct { + Contract *EthdaTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEthda creates a new instance of Ethda, bound to a specific deployed contract. +func NewEthda(address common.Address, backend bind.ContractBackend) (*Ethda, error) { + contract, err := bindEthda(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Ethda{EthdaCaller: EthdaCaller{contract: contract}, EthdaTransactor: EthdaTransactor{contract: contract}, EthdaFilterer: EthdaFilterer{contract: contract}}, nil +} + +// NewEthdaCaller creates a new read-only instance of Ethda, bound to a specific deployed contract. +func NewEthdaCaller(address common.Address, caller bind.ContractCaller) (*EthdaCaller, error) { + contract, err := bindEthda(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EthdaCaller{contract: contract}, nil +} + +// NewEthdaTransactor creates a new write-only instance of Ethda, bound to a specific deployed contract. +func NewEthdaTransactor(address common.Address, transactor bind.ContractTransactor) (*EthdaTransactor, error) { + contract, err := bindEthda(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EthdaTransactor{contract: contract}, nil +} + +// NewEthdaFilterer creates a new log filterer instance of Ethda, bound to a specific deployed contract. +func NewEthdaFilterer(address common.Address, filterer bind.ContractFilterer) (*EthdaFilterer, error) { + contract, err := bindEthda(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EthdaFilterer{contract: contract}, nil +} + +// bindEthda binds a generic wrapper to an already deployed contract. +func bindEthda(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := EthdaMetaData.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 (_Ethda *EthdaRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Ethda.Contract.EthdaCaller.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 (_Ethda *EthdaRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ethda.Contract.EthdaTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Ethda *EthdaRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Ethda.Contract.EthdaTransactor.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 (_Ethda *EthdaCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Ethda.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 (_Ethda *EthdaTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ethda.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Ethda *EthdaTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Ethda.Contract.contract.Transact(opts, method, params...) +} + +// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. +// +// Solidity: function ethdaSequencerAddress() view returns(address) +func (_Ethda *EthdaCaller) EthdaSequencerAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ethda.contract.Call(opts, &out, "ethdaSequencerAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. +// +// Solidity: function ethdaSequencerAddress() view returns(address) +func (_Ethda *EthdaSession) EthdaSequencerAddress() (common.Address, error) { + return _Ethda.Contract.EthdaSequencerAddress(&_Ethda.CallOpts) +} + +// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. +// +// Solidity: function ethdaSequencerAddress() view returns(address) +func (_Ethda *EthdaCallerSession) EthdaSequencerAddress() (common.Address, error) { + return _Ethda.Contract.EthdaSequencerAddress(&_Ethda.CallOpts) +} + +// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. +// +// Solidity: function getProcotolName() pure returns(string) +func (_Ethda *EthdaCaller) GetProcotolName(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Ethda.contract.Call(opts, &out, "getProcotolName") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. +// +// Solidity: function getProcotolName() pure returns(string) +func (_Ethda *EthdaSession) GetProcotolName() (string, error) { + return _Ethda.Contract.GetProcotolName(&_Ethda.CallOpts) +} + +// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. +// +// Solidity: function getProcotolName() pure returns(string) +func (_Ethda *EthdaCallerSession) GetProcotolName() (string, error) { + return _Ethda.Contract.GetProcotolName(&_Ethda.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Ethda *EthdaCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Ethda.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 (_Ethda *EthdaSession) Owner() (common.Address, error) { + return _Ethda.Contract.Owner(&_Ethda.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Ethda *EthdaCallerSession) Owner() (common.Address, error) { + return _Ethda.Contract.Owner(&_Ethda.CallOpts) +} + +// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. +// +// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() +func (_Ethda *EthdaCaller) VerifyMessage(opts *bind.CallOpts, signedHash [32]byte, signaturesAndAddrs []byte) error { + var out []interface{} + err := _Ethda.contract.Call(opts, &out, "verifyMessage", signedHash, signaturesAndAddrs) + + if err != nil { + return err + } + + return err + +} + +// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. +// +// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() +func (_Ethda *EthdaSession) VerifyMessage(signedHash [32]byte, signaturesAndAddrs []byte) error { + return _Ethda.Contract.VerifyMessage(&_Ethda.CallOpts, signedHash, signaturesAndAddrs) +} + +// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. +// +// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() +func (_Ethda *EthdaCallerSession) VerifyMessage(signedHash [32]byte, signaturesAndAddrs []byte) error { + return _Ethda.Contract.VerifyMessage(&_Ethda.CallOpts, signedHash, signaturesAndAddrs) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Ethda *EthdaTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ethda.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Ethda *EthdaSession) Initialize() (*types.Transaction, error) { + return _Ethda.Contract.Initialize(&_Ethda.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Ethda *EthdaTransactorSession) Initialize() (*types.Transaction, error) { + return _Ethda.Contract.Initialize(&_Ethda.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Ethda *EthdaTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Ethda.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Ethda *EthdaSession) RenounceOwnership() (*types.Transaction, error) { + return _Ethda.Contract.RenounceOwnership(&_Ethda.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Ethda *EthdaTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Ethda.Contract.RenounceOwnership(&_Ethda.TransactOpts) +} + +// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. +// +// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() +func (_Ethda *EthdaTransactor) SetEthdaSequencerAddress(opts *bind.TransactOpts, _ethdaSequencerAddress common.Address) (*types.Transaction, error) { + return _Ethda.contract.Transact(opts, "setEthdaSequencerAddress", _ethdaSequencerAddress) +} + +// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. +// +// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() +func (_Ethda *EthdaSession) SetEthdaSequencerAddress(_ethdaSequencerAddress common.Address) (*types.Transaction, error) { + return _Ethda.Contract.SetEthdaSequencerAddress(&_Ethda.TransactOpts, _ethdaSequencerAddress) +} + +// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. +// +// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() +func (_Ethda *EthdaTransactorSession) SetEthdaSequencerAddress(_ethdaSequencerAddress common.Address) (*types.Transaction, error) { + return _Ethda.Contract.SetEthdaSequencerAddress(&_Ethda.TransactOpts, _ethdaSequencerAddress) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Ethda *EthdaTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Ethda.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Ethda *EthdaSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Ethda.Contract.TransferOwnership(&_Ethda.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Ethda *EthdaTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Ethda.Contract.TransferOwnership(&_Ethda.TransactOpts, newOwner) +} + +// EthdaInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Ethda contract. +type EthdaInitializedIterator struct { + Event *EthdaInitialized // 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 *EthdaInitializedIterator) 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(EthdaInitialized) + 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(EthdaInitialized) + 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 *EthdaInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EthdaInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EthdaInitialized represents a Initialized event raised by the Ethda contract. +type EthdaInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ethda *EthdaFilterer) FilterInitialized(opts *bind.FilterOpts) (*EthdaInitializedIterator, error) { + + logs, sub, err := _Ethda.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &EthdaInitializedIterator{contract: _Ethda.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ethda *EthdaFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EthdaInitialized) (event.Subscription, error) { + + logs, sub, err := _Ethda.contract.WatchLogs(opts, "Initialized") + 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(EthdaInitialized) + if err := _Ethda.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_Ethda *EthdaFilterer) ParseInitialized(log types.Log) (*EthdaInitialized, error) { + event := new(EthdaInitialized) + if err := _Ethda.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EthdaOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Ethda contract. +type EthdaOwnershipTransferredIterator struct { + Event *EthdaOwnershipTransferred // 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 *EthdaOwnershipTransferredIterator) 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(EthdaOwnershipTransferred) + 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(EthdaOwnershipTransferred) + 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 *EthdaOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EthdaOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EthdaOwnershipTransferred represents a OwnershipTransferred event raised by the Ethda contract. +type EthdaOwnershipTransferred 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 (_Ethda *EthdaFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EthdaOwnershipTransferredIterator, 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 := _Ethda.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EthdaOwnershipTransferredIterator{contract: _Ethda.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 (_Ethda *EthdaFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EthdaOwnershipTransferred, 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 := _Ethda.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(EthdaOwnershipTransferred) + if err := _Ethda.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 (_Ethda *EthdaFilterer) ParseOwnershipTransferred(log types.Log) (*EthdaOwnershipTransferred, error) { + event := new(EthdaOwnershipTransferred) + if err := _Ethda.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/etherman/smartcontracts/script.sh b/etherman/smartcontracts/script.sh index fea535224a..c299d2694f 100755 --- a/etherman/smartcontracts/script.sh +++ b/etherman/smartcontracts/script.sh @@ -28,3 +28,4 @@ gen mockverifier gen polygondatacommittee genNoBin dataavailabilityprotocol gen proxy +gen ethda From 5719f5fc9d11357ef599bfcda5e26abbbe961f41 Mon Sep 17 00:00:00 2001 From: Wagmi Date: Mon, 13 May 2024 00:11:59 +0800 Subject: [PATCH 5/7] script: add ethda deploy script --- dataavailability/ethda/ethda.go | 10 +-- etherman/smartcontracts/bin/ethda.bin | 2 +- etherman/smartcontracts/ethda/ethda.go | 2 +- go.sum | 17 +---- test/Makefile | 23 +++++++ test/scripts/ethda/main.go | 87 ++++++++++++++++++++++++++ 6 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 test/scripts/ethda/main.go diff --git a/dataavailability/ethda/ethda.go b/dataavailability/ethda/ethda.go index a758b3486b..9d59275429 100644 --- a/dataavailability/ethda/ethda.go +++ b/dataavailability/ethda/ethda.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ecdsa" "fmt" + "github.com/0xPolygonHermez/zkevm-node/log" blobutils "github.com/crustio/blob-utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -26,10 +27,6 @@ func New( return nil, fmt.Errorf("empty ethda rpc url") } - if privKey == nil { - return nil, fmt.Errorf("empty private key") - } - return &EthdaBackend{ privKey: privKey, ethdaRPCURL: ethdaRPCURL, @@ -37,6 +34,10 @@ func New( } func (d *EthdaBackend) Init() error { + if d.privKey == nil { + return nil + } + ethdaClient, err := blobutils.New(d.ethdaRPCURL, d.privKey) if err != nil { return fmt.Errorf("create ethda client: %w", err) @@ -55,6 +56,7 @@ func (d *EthdaBackend) PostSequence(ctx context.Context, batchesData [][]byte) ( return nil, fmt.Errorf("post batch to ethda: %w", err) } hashes = append(hashes, hash.Bytes()...) + log.Infof("Post da to ethda: %s", hash.Hex()) } currentHash := common.Hash{}.Bytes() diff --git a/etherman/smartcontracts/bin/ethda.bin b/etherman/smartcontracts/bin/ethda.bin index 150861c563..80d0a86364 100644 --- a/etherman/smartcontracts/bin/ethda.bin +++ b/etherman/smartcontracts/bin/ethda.bin @@ -1 +1 @@ -608060405234801561000f575f80fd5b5061001861001d565b6100da565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811610156100d8575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610bce806100e75f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b146100f8578063d5deff3014610116578063e4f1712014610129578063f2fde38b14610168575f80fd5b80633b51be4b14610089578063715018a61461009e5780637e585d3e146100a65780638129fc1c146100f0575b5f80fd5b61009c6100973660046109bc565b61017b565b005b61009c61027f565b6065546100c69073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009c610292565b60335473ffffffffffffffffffffffffffffffffffffffff166100c6565b61009c610124366004610a31565b610423565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100e79190610a6b565b61009c610176366004610a31565b610472565b60418082108061019f575060206101928284610ad4565b61019c9190610b0c565b15155b156101d6576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610221856101e86041848789610b44565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061052692505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff808316911614610278576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028761054a565b6102905f6105cb565b565b5f54610100900460ff16158080156102b057505f54600160ff909116105b806102c95750303b1580156102c957505f5460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103be610641565b8015610420575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b61042b61054a565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61047a61054a565b73ffffffffffffffffffffffffffffffffffffffff811661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b610420816105cb565b5f805f61053385856106e0565b9150915061054081610722565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610351565b610290336105cb565b5f808251604103610714576020830151604084015160608501515f1a610708878285856108d4565b9450945050505061071b565b505f905060025b9250929050565b5f81600481111561073557610735610b6b565b0361073d5750565b600181600481111561075157610751610b6b565b036107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610351565b60028160048111156107cc576107cc610b6b565b03610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610351565b600381600481111561084757610847610b6b565b03610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610351565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561090957505f905060036109b3565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561095a573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109ad575f600192509250506109b3565b91505f90505b94509492505050565b5f805f604084860312156109ce575f80fd5b83359250602084013567ffffffffffffffff808211156109ec575f80fd5b818601915086601f8301126109ff575f80fd5b813581811115610a0d575f80fd5b876020828501011115610a1e575f80fd5b6020830194508093505050509250925092565b5f60208284031215610a41575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a64575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610a9657858101830151858201604001528201610a7a565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610544577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610b3f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b5f8085851115610b52575f80fd5b83861115610b5e575f80fd5b5050820193919092039150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffdfea264697066735822122010fdd197f73d092becd782054513afc2e54a220206a28c0f0f39e31fe955dcca64736f6c63430008140033 \ No newline at end of file +6080604052606580546001600160a01b03191673f39fd6e51aad88f6f4ce6ab8827279cfffb9226617905534801561003657600080fd5b5061003f610044565b610104565b600054610100900460ff16156100b05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610102576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610c01806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc578063d5deff301461011a578063e4f171201461012d578063f2fde38b1461016c57600080fd5b80633b51be4b1461008d578063715018a6146100a25780637e585d3e146100aa5780638129fc1c146100f4575b600080fd5b6100a061009b3660046109d8565b61017f565b005b6100a0610285565b6065546100ca9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a0610299565b60335473ffffffffffffffffffffffffffffffffffffffff166100ca565b6100a0610128366004610a54565b610430565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100eb9190610a91565b6100a061017a366004610a54565b61047f565b6041808210806101a3575060206101968284610afd565b6101a09190610b37565b15155b156101da576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610227856101ed6041848789610b72565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061053392505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff80831691161461027e576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028d610559565b61029760006105da565b565b600054610100900460ff16158080156102b95750600054600160ff909116105b806102d35750303b1580156102d3575060005460ff166001145b610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103c257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103ca610651565b801561042d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610438610559565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610487610559565b73ffffffffffffffffffffffffffffffffffffffff811661052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035b565b61042d816105da565b600080600061054285856106f1565b9150915061054f81610736565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161035b565b610297336105da565b60008082516041036107275760208301516040840151606085015160001a61071b878285856108e9565b9450945050505061072f565b506000905060025b9250929050565b600081600481111561074a5761074a610b9c565b036107525750565b600181600481111561076657610766610b9c565b036107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161035b565b60028160048111156107e1576107e1610b9c565b03610848576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161035b565b600381600481111561085c5761085c610b9c565b0361042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161035b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561092057506000905060036109cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610974573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109c8576000600192509250506109cf565b9150600090505b94509492505050565b6000806000604084860312156109ed57600080fd5b83359250602084013567ffffffffffffffff80821115610a0c57600080fd5b818601915086601f830112610a2057600080fd5b813581811115610a2f57600080fd5b876020828501011115610a4157600080fd5b6020830194508093505050509250925092565b600060208284031215610a6657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b9392505050565b600060208083528351808285015260005b81811015610abe57858101830151858201604001528201610aa2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610553577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082610b6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008085851115610b8257600080fd5b83861115610b8f57600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122031cde34584e7676e8f672335a3a4fd3d2b0ce9c76233c5b38113ce5535de00ef64736f6c63430008110033 \ No newline at end of file diff --git a/etherman/smartcontracts/ethda/ethda.go b/etherman/smartcontracts/ethda/ethda.go index 1ad0631a55..5ee4c9bb43 100644 --- a/etherman/smartcontracts/ethda/ethda.go +++ b/etherman/smartcontracts/ethda/ethda.go @@ -32,7 +32,7 @@ var ( // EthdaMetaData contains all meta data concerning the Ethda contract. var EthdaMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"UnexpectedAddrsAndSignaturesSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongSignature\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ethdaSequencerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProcotolName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ethdaSequencerAddress\",\"type\":\"address\"}],\"name\":\"setEthdaSequencerAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signedHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signaturesAndAddrs\",\"type\":\"bytes\"}],\"name\":\"verifyMessage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x608060405234801561000f575f80fd5b5061001861001d565b6100da565b5f54610100900460ff16156100885760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811610156100d8575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610bce806100e75f395ff3fe608060405234801561000f575f80fd5b5060043610610085575f3560e01c80638da5cb5b116100585780638da5cb5b146100f8578063d5deff3014610116578063e4f1712014610129578063f2fde38b14610168575f80fd5b80633b51be4b14610089578063715018a61461009e5780637e585d3e146100a65780638129fc1c146100f0575b5f80fd5b61009c6100973660046109bc565b61017b565b005b61009c61027f565b6065546100c69073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009c610292565b60335473ffffffffffffffffffffffffffffffffffffffff166100c6565b61009c610124366004610a31565b610423565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100e79190610a6b565b61009c610176366004610a31565b610472565b60418082108061019f575060206101928284610ad4565b61019c9190610b0c565b15155b156101d6576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610221856101e86041848789610b44565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061052692505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff808316911614610278576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028761054a565b6102905f6105cb565b565b5f54610100900460ff16158080156102b057505f54600160ff909116105b806102c95750303b1580156102c957505f5460ff166001145b61035a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103b6575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103be610641565b8015610420575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b61042b61054a565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61047a61054a565b73ffffffffffffffffffffffffffffffffffffffff811661051d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b610420816105cb565b5f805f61053385856106e0565b9150915061054081610722565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610290576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166106d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610351565b610290336105cb565b5f808251604103610714576020830151604084015160608501515f1a610708878285856108d4565b9450945050505061071b565b505f905060025b9250929050565b5f81600481111561073557610735610b6b565b0361073d5750565b600181600481111561075157610751610b6b565b036107b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610351565b60028160048111156107cc576107cc610b6b565b03610833576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610351565b600381600481111561084757610847610b6b565b03610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610351565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561090957505f905060036109b3565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561095a573d5f803e3d5ffd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109ad575f600192509250506109b3565b91505f90505b94509492505050565b5f805f604084860312156109ce575f80fd5b83359250602084013567ffffffffffffffff808211156109ec575f80fd5b818601915086601f8301126109ff575f80fd5b813581811115610a0d575f80fd5b876020828501011115610a1e575f80fd5b6020830194508093505050509250925092565b5f60208284031215610a41575f80fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a64575f80fd5b9392505050565b5f6020808352835180828501525f5b81811015610a9657858101830151858201604001528201610a7a565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610544577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82610b3f577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500690565b5f8085851115610b52575f80fd5b83861115610b5e575f80fd5b5050820193919092039150565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffdfea264697066735822122010fdd197f73d092becd782054513afc2e54a220206a28c0f0f39e31fe955dcca64736f6c63430008140033", + Bin: "0x6080604052606580546001600160a01b03191673f39fd6e51aad88f6f4ce6ab8827279cfffb9226617905534801561003657600080fd5b5061003f610044565b610104565b600054610100900460ff16156100b05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610102576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610c01806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc578063d5deff301461011a578063e4f171201461012d578063f2fde38b1461016c57600080fd5b80633b51be4b1461008d578063715018a6146100a25780637e585d3e146100aa5780638129fc1c146100f4575b600080fd5b6100a061009b3660046109d8565b61017f565b005b6100a0610285565b6065546100ca9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a0610299565b60335473ffffffffffffffffffffffffffffffffffffffff166100ca565b6100a0610128366004610a54565b610430565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100eb9190610a91565b6100a061017a366004610a54565b61047f565b6041808210806101a3575060206101968284610afd565b6101a09190610b37565b15155b156101da576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610227856101ed6041848789610b72565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061053392505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff80831691161461027e576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028d610559565b61029760006105da565b565b600054610100900460ff16158080156102b95750600054600160ff909116105b806102d35750303b1580156102d3575060005460ff166001145b610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103c257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103ca610651565b801561042d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610438610559565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610487610559565b73ffffffffffffffffffffffffffffffffffffffff811661052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035b565b61042d816105da565b600080600061054285856106f1565b9150915061054f81610736565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161035b565b610297336105da565b60008082516041036107275760208301516040840151606085015160001a61071b878285856108e9565b9450945050505061072f565b506000905060025b9250929050565b600081600481111561074a5761074a610b9c565b036107525750565b600181600481111561076657610766610b9c565b036107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161035b565b60028160048111156107e1576107e1610b9c565b03610848576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161035b565b600381600481111561085c5761085c610b9c565b0361042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161035b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561092057506000905060036109cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610974573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109c8576000600192509250506109cf565b9150600090505b94509492505050565b6000806000604084860312156109ed57600080fd5b83359250602084013567ffffffffffffffff80821115610a0c57600080fd5b818601915086601f830112610a2057600080fd5b813581811115610a2f57600080fd5b876020828501011115610a4157600080fd5b6020830194508093505050509250925092565b600060208284031215610a6657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b9392505050565b600060208083528351808285015260005b81811015610abe57858101830151858201604001528201610aa2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610553577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082610b6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008085851115610b8257600080fd5b83861115610b8f57600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122031cde34584e7676e8f672335a3a4fd3d2b0ce9c76233c5b38113ce5535de00ef64736f6c63430008110033", } // EthdaABI is the input ABI used to generate the binding from. diff --git a/go.sum b/go.sum index b6915f5b06..d763c898c1 100644 --- a/go.sum +++ b/go.sum @@ -70,7 +70,6 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= @@ -163,12 +162,6 @@ github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBS github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crustio/blob-utils v0.2.0 h1:cDBcKSbo160Ty6rX+jafCwK3Bhh7wfpjyKcE/c+EAak= -github.com/crustio/blob-utils v0.2.0/go.mod h1:7BcdCxXDgJ2xPNRLgVxlBXQ3eWZ0oFTcwZ+h3dpj58g= -github.com/crustio/blob-utils v0.2.1 h1:kDiV8kPjyyjzIk64ezB6VN+H6fbtK9eAUcSmF94RJ5M= -github.com/crustio/blob-utils v0.2.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= -github.com/crustio/blob-utils v0.3.0 h1:7Uh7FmZQLZFcacfmqZhV2Z5J6P88CeLoSwtoBcLRvsE= -github.com/crustio/blob-utils v0.3.0/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= github.com/crustio/blob-utils v0.3.1 h1:T++x9rKRqB7mlQp9nZpfadQd0UvKH6zMgV1695EvkUE= github.com/crustio/blob-utils v0.3.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= @@ -232,8 +225,7 @@ github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmV github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= @@ -587,8 +579,7 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= @@ -681,8 +672,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -715,8 +706,6 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= diff --git a/test/Makefile b/test/Makefile index 35cd659924..86d19973d7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -694,6 +694,29 @@ generate-mocks-sequencesender: ## Generates mocks for sequencesender , using moc export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=etherman --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthermanMock --filename=mock_etherman.go export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthTxManagerMock --filename=mock_ethtxmanager.go +deploy-ethda: + go run ./scripts/ethda/main.go . + +.PHONY: run-ethda +run-ethda: ## Runs a full node + $(RUNSTATEDB) + $(RUNPOOLDB) + $(RUNEVENTDB) + $(RUNL1NETWORK) + sleep 1 + make deploy-ethda + $(RUNZKPROVER) + $(RUNAPPROVE) + sleep 3 + $(RUNSYNC) + sleep 4 + $(RUNETHTXMANAGER) + $(RUNSEQUENCER) + $(RUNSEQUENCESENDER) + $(RUNL2GASPRICER) + $(RUNAGGREGATOR) + $(RUNJSONRPC) + SYNC_L1_PARALLEL_FOLDER="../synchronizer/l1_parallel_sync" SYNC_L1_PARALLEL_MOCKS_FOLDER="../synchronizer/l1_parallel_sync/mocks" diff --git a/test/scripts/ethda/main.go b/test/scripts/ethda/main.go new file mode 100644 index 0000000000..0d9082a6bd --- /dev/null +++ b/test/scripts/ethda/main.go @@ -0,0 +1,87 @@ +package main + +import ( + "context" + "math/big" + "strings" + "time" + + "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/ethda" + etrog "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/etrogpolygonzkevm" + "github.com/0xPolygonHermez/zkevm-node/log" + "github.com/0xPolygonHermez/zkevm-node/test/operations" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" +) + +type Deployments struct { + ethdaContract *ethda.Ethda + ethdaAddr common.Address +} + +func main() { + ctx := context.Background() + client, err := ethclient.Dial("http://localhost:8545") + if err != nil { + log.Fatal(err) + } + + chainId, err := client.ChainID(ctx) + if err != nil { + log.Fatal(err) + } + + privateKey, err := crypto.HexToECDSA(strings.TrimPrefix(operations.DefaultSequencerPrivateKey, "0x")) + if err != nil { + log.Fatal(err) + } + + auth, err := bind.NewKeyedTransactorWithChainID(privateKey, chainId) + if err != nil { + log.Fatal(err) + } + + nonce, err := client.PendingNonceAt(ctx, auth.From) + if err != nil { + log.Fatal(err) + } + + auth.Nonce = big.NewInt(int64(nonce)) + deployments := DeployContractsAndSetDAP(client, auth) + + log.Infof("Deploy contract: %v", deployments.ethdaAddr.Hex()) +} + +func DeployContractsAndSetDAP(client *ethclient.Client, auth *bind.TransactOpts) Deployments { + addr, tx, ethdaContract, err := ethda.DeployEthda(auth, client) + if err != nil { + log.Fatal(err) + } + + err = operations.WaitTxToBeMined(context.Background(), client, tx, 20*time.Second) + if err != nil { + log.Fatal(err) + } + + auth.Nonce = nil + auth.Value = nil + log.Debugf("Deploy tx: %v", tx.Hash().Hex()) + log.Debugf("Addr: %v", addr.Hex()) + // Set DAP + log.Debugf("Setting DAP", operations.DefaultL1ZkEVMSmartContract, addr) + etrog, err := etrog.NewEtrogpolygonzkevm(common.HexToAddress(operations.DefaultL1ZkEVMSmartContract), client) + if err != nil { + log.Fatal(err) + } + _, err = etrog.SetDataAvailabilityProtocol(auth, addr) + if err != nil { + log.Fatal(err) + } + + return Deployments{ + ethdaContract: ethdaContract, + ethdaAddr: addr, + } +} From 8719a9f420dc94bead9f6be17777e0709b8226d3 Mon Sep 17 00:00:00 2001 From: Wagmi Date: Sat, 1 Jun 2024 23:23:39 +0800 Subject: [PATCH 6/7] feat: import ethda module --- cmd/run.go | 2 +- dataavailability/ethda/ethda.go | 103 ---- dataavailability/ethda/ethda_test.go | 47 -- etherman/smartcontracts/abi/ethda.abi | 146 ------ etherman/smartcontracts/bin/ethda.bin | 1 - etherman/smartcontracts/ethda/ethda.go | 696 ------------------------- etherman/smartcontracts/script.sh | 1 - go.mod | 3 +- go.sum | 2 + test/Makefile | 23 - test/scripts/ethda/main.go | 87 ---- 11 files changed, 5 insertions(+), 1106 deletions(-) delete mode 100644 dataavailability/ethda/ethda.go delete mode 100644 dataavailability/ethda/ethda_test.go delete mode 100644 etherman/smartcontracts/abi/ethda.abi delete mode 100644 etherman/smartcontracts/bin/ethda.bin delete mode 100644 etherman/smartcontracts/ethda/ethda.go delete mode 100644 test/scripts/ethda/main.go diff --git a/cmd/run.go b/cmd/run.go index e4f3315d2f..01ecfeda3e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -5,7 +5,7 @@ import ( "crypto/ecdsa" "errors" "fmt" - "github.com/0xPolygonHermez/zkevm-node/dataavailability/ethda" + "github.com/crustio/cdk-ethda-backend" "net" "net/http" "net/http/pprof" diff --git a/dataavailability/ethda/ethda.go b/dataavailability/ethda/ethda.go deleted file mode 100644 index 9d59275429..0000000000 --- a/dataavailability/ethda/ethda.go +++ /dev/null @@ -1,103 +0,0 @@ -package ethda - -import ( - "context" - "crypto/ecdsa" - "fmt" - "github.com/0xPolygonHermez/zkevm-node/log" - blobutils "github.com/crustio/blob-utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - solsha3 "github.com/miguelmota/go-solidity-sha3" - "math/big" -) - -type EthdaBackend struct { - ethdaClient *blobutils.Client - chainId *big.Int - ethdaRPCURL string - privKey *ecdsa.PrivateKey -} - -func New( - ethdaRPCURL string, - privKey *ecdsa.PrivateKey, -) (*EthdaBackend, error) { - if ethdaRPCURL == "" { - return nil, fmt.Errorf("empty ethda rpc url") - } - - return &EthdaBackend{ - privKey: privKey, - ethdaRPCURL: ethdaRPCURL, - }, nil -} - -func (d *EthdaBackend) Init() error { - if d.privKey == nil { - return nil - } - - ethdaClient, err := blobutils.New(d.ethdaRPCURL, d.privKey) - if err != nil { - return fmt.Errorf("create ethda client: %w", err) - } - - d.ethdaClient = ethdaClient - - return nil -} - -func (d *EthdaBackend) PostSequence(ctx context.Context, batchesData [][]byte) ([]byte, error) { - var hashes []byte - for _, batch := range batchesData { - hash, err := d.ethdaClient.PostBlob(ctx, batch) - if err != nil { - return nil, fmt.Errorf("post batch to ethda: %w", err) - } - hashes = append(hashes, hash.Bytes()...) - log.Infof("Post da to ethda: %s", hash.Hex()) - } - - currentHash := common.Hash{}.Bytes() - for _, batchData := range batchesData { - types := []string{ - "bytes32", - "bytes32", - } - values := []interface{}{ - currentHash, - crypto.Keccak256(batchData), - } - currentHash = solsha3.SoliditySHA3(types, values) - } - - sig, err := d.ethdaClient.SignBatchHash(common.BytesToHash(currentHash)) - if err != nil { - return nil, err - } - - return append(sig, hashes...), nil -} - -func (d *EthdaBackend) GetSequence(ctx context.Context, batchHashes []common.Hash, dataAvailabilityMessage []byte) ([][]byte, error) { - msgLen := len(dataAvailabilityMessage) - - if msgLen < crypto.SignatureLength || (msgLen-crypto.SignatureLength)%common.HashLength != 0 { - return nil, fmt.Errorf("wrong da message length: %d", msgLen) - } - - var data [][]byte - for i := 0; i < (msgLen-crypto.SignatureLength)/common.HashLength; i++ { - start := common.HashLength*i + crypto.SignatureLength - hash := common.BytesToHash(dataAvailabilityMessage[start : start+common.HashLength]) - - r, err := d.ethdaClient.GetBlob(hash) - if err != nil { - return nil, fmt.Errorf("get blob from ethda: %w", err) - } - data = append(data, r) - } - - return data, nil -} diff --git a/dataavailability/ethda/ethda_test.go b/dataavailability/ethda/ethda_test.go deleted file mode 100644 index c268d59337..0000000000 --- a/dataavailability/ethda/ethda_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package ethda - -import ( - "context" - "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/require" - "testing" -) - -func TestPostSequence(t *testing.T) { - rpcUrl := "https://rpc-devnet2.ethda.io" - - // test key - key, err := crypto.HexToECDSA("f26d6aca18e0c75ac948a262d4b9435a8173515f84c258d1f90d171143039024") - require.NoError(t, err) - - da, err := New(rpcUrl, key) - require.NoError(t, err) - - err = da.Init() - require.NoError(t, err) - - batchData := [][]byte{[]byte("ethda")} - msg, err := da.PostSequence(context.Background(), batchData) - require.NoError(t, err) - fmt.Println(common.Bytes2Hex(msg)) -} - -func TestGetSequence(t *testing.T) { - daMessage := "b1e79a75baadbd688f97213920a01980e37e4fbf464cf9ffc94e6d10be2ee69253f1acb077c8355d30f4d8046ccbe4eb5f4eb05643ef31c4fe6e531c0ca7dc8e1bdb919f0ef6ffe754f3dfdfdfc4d1789b0bf2aee713567b550d330527eab00522" - rpcUrl := "https://rpc-devnet2.ethda.io" - - // test key - key, err := crypto.HexToECDSA("f26d6aca18e0c75ac948a262d4b9435a8173515f84c258d1f90d171143039024") - require.NoError(t, err) - da, err := New(rpcUrl, key) - require.NoError(t, err) - - err = da.Init() - require.NoError(t, err) - - data, err := da.GetSequence(context.Background(), nil, common.Hex2Bytes(daMessage)) - require.NoError(t, err) - require.Equal(t, "ethda", string(data[0])) -} diff --git a/etherman/smartcontracts/abi/ethda.abi b/etherman/smartcontracts/abi/ethda.abi deleted file mode 100644 index a197b7fdbe..0000000000 --- a/etherman/smartcontracts/abi/ethda.abi +++ /dev/null @@ -1,146 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "UnexpectedAddrsAndSignaturesSize", - "type": "error" - }, - { - "inputs": [], - "name": "WrongSignature", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "ethdaSequencerAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getProcotolName", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_ethdaSequencerAddress", - "type": "address" - } - ], - "name": "setEthdaSequencerAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "signedHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signaturesAndAddrs", - "type": "bytes" - } - ], - "name": "verifyMessage", - "outputs": [], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/etherman/smartcontracts/bin/ethda.bin b/etherman/smartcontracts/bin/ethda.bin deleted file mode 100644 index 80d0a86364..0000000000 --- a/etherman/smartcontracts/bin/ethda.bin +++ /dev/null @@ -1 +0,0 @@ -6080604052606580546001600160a01b03191673f39fd6e51aad88f6f4ce6ab8827279cfffb9226617905534801561003657600080fd5b5061003f610044565b610104565b600054610100900460ff16156100b05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610102576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610c01806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc578063d5deff301461011a578063e4f171201461012d578063f2fde38b1461016c57600080fd5b80633b51be4b1461008d578063715018a6146100a25780637e585d3e146100aa5780638129fc1c146100f4575b600080fd5b6100a061009b3660046109d8565b61017f565b005b6100a0610285565b6065546100ca9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a0610299565b60335473ffffffffffffffffffffffffffffffffffffffff166100ca565b6100a0610128366004610a54565b610430565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100eb9190610a91565b6100a061017a366004610a54565b61047f565b6041808210806101a3575060206101968284610afd565b6101a09190610b37565b15155b156101da576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610227856101ed6041848789610b72565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061053392505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff80831691161461027e576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028d610559565b61029760006105da565b565b600054610100900460ff16158080156102b95750600054600160ff909116105b806102d35750303b1580156102d3575060005460ff166001145b610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103c257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103ca610651565b801561042d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610438610559565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610487610559565b73ffffffffffffffffffffffffffffffffffffffff811661052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035b565b61042d816105da565b600080600061054285856106f1565b9150915061054f81610736565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161035b565b610297336105da565b60008082516041036107275760208301516040840151606085015160001a61071b878285856108e9565b9450945050505061072f565b506000905060025b9250929050565b600081600481111561074a5761074a610b9c565b036107525750565b600181600481111561076657610766610b9c565b036107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161035b565b60028160048111156107e1576107e1610b9c565b03610848576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161035b565b600381600481111561085c5761085c610b9c565b0361042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161035b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561092057506000905060036109cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610974573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109c8576000600192509250506109cf565b9150600090505b94509492505050565b6000806000604084860312156109ed57600080fd5b83359250602084013567ffffffffffffffff80821115610a0c57600080fd5b818601915086601f830112610a2057600080fd5b813581811115610a2f57600080fd5b876020828501011115610a4157600080fd5b6020830194508093505050509250925092565b600060208284031215610a6657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b9392505050565b600060208083528351808285015260005b81811015610abe57858101830151858201604001528201610aa2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610553577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082610b6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008085851115610b8257600080fd5b83861115610b8f57600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122031cde34584e7676e8f672335a3a4fd3d2b0ce9c76233c5b38113ce5535de00ef64736f6c63430008110033 \ No newline at end of file diff --git a/etherman/smartcontracts/ethda/ethda.go b/etherman/smartcontracts/ethda/ethda.go deleted file mode 100644 index 5ee4c9bb43..0000000000 --- a/etherman/smartcontracts/ethda/ethda.go +++ /dev/null @@ -1,696 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package ethda - -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 -) - -// EthdaMetaData contains all meta data concerning the Ethda contract. -var EthdaMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"UnexpectedAddrsAndSignaturesSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"WrongSignature\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ethdaSequencerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProcotolName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ethdaSequencerAddress\",\"type\":\"address\"}],\"name\":\"setEthdaSequencerAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signedHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signaturesAndAddrs\",\"type\":\"bytes\"}],\"name\":\"verifyMessage\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080604052606580546001600160a01b03191673f39fd6e51aad88f6f4ce6ab8827279cfffb9226617905534801561003657600080fd5b5061003f610044565b610104565b600054610100900460ff16156100b05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015610102576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b610c01806101136000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100fc578063d5deff301461011a578063e4f171201461012d578063f2fde38b1461016c57600080fd5b80633b51be4b1461008d578063715018a6146100a25780637e585d3e146100aa5780638129fc1c146100f4575b600080fd5b6100a061009b3660046109d8565b61017f565b005b6100a0610285565b6065546100ca9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100a0610299565b60335473ffffffffffffffffffffffffffffffffffffffff166100ca565b6100a0610128366004610a54565b610430565b604080518082018252600581527f4574686461000000000000000000000000000000000000000000000000000000602082015290516100eb9190610a91565b6100a061017a366004610a54565b61047f565b6041808210806101a3575060206101968284610afd565b6101a09190610b37565b15155b156101da576040517f6b8eec4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610227856101ed6041848789610b72565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061053392505050565b60655490915073ffffffffffffffffffffffffffffffffffffffff80831691161461027e576040517f356a441800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b61028d610559565b61029760006105da565b565b600054610100900460ff16158080156102b95750600054600160ff909116105b806102d35750303b1580156102d3575060005460ff166001145b610364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156103c257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6103ca610651565b801561042d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b610438610559565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610487610559565b73ffffffffffffffffffffffffffffffffffffffff811661052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035b565b61042d816105da565b600080600061054285856106f1565b9150915061054f81610736565b5090505b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161035b565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161035b565b610297336105da565b60008082516041036107275760208301516040840151606085015160001a61071b878285856108e9565b9450945050505061072f565b506000905060025b9250929050565b600081600481111561074a5761074a610b9c565b036107525750565b600181600481111561076657610766610b9c565b036107cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161035b565b60028160048111156107e1576107e1610b9c565b03610848576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161035b565b600381600481111561085c5761085c610b9c565b0361042d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161035b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561092057506000905060036109cf565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610974573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166109c8576000600192509250506109cf565b9150600090505b94509492505050565b6000806000604084860312156109ed57600080fd5b83359250602084013567ffffffffffffffff80821115610a0c57600080fd5b818601915086601f830112610a2057600080fd5b813581811115610a2f57600080fd5b876020828501011115610a4157600080fd5b6020830194508093505050509250925092565b600060208284031215610a6657600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b9392505050565b600060208083528351808285015260005b81811015610abe57858101830151858201604001528201610aa2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b81810381811115610553577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082610b6d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b60008085851115610b8257600080fd5b83861115610b8f57600080fd5b5050820193919092039150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122031cde34584e7676e8f672335a3a4fd3d2b0ce9c76233c5b38113ce5535de00ef64736f6c63430008110033", -} - -// EthdaABI is the input ABI used to generate the binding from. -// Deprecated: Use EthdaMetaData.ABI instead. -var EthdaABI = EthdaMetaData.ABI - -// EthdaBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use EthdaMetaData.Bin instead. -var EthdaBin = EthdaMetaData.Bin - -// DeployEthda deploys a new Ethereum contract, binding an instance of Ethda to it. -func DeployEthda(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Ethda, error) { - parsed, err := EthdaMetaData.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(EthdaBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Ethda{EthdaCaller: EthdaCaller{contract: contract}, EthdaTransactor: EthdaTransactor{contract: contract}, EthdaFilterer: EthdaFilterer{contract: contract}}, nil -} - -// Ethda is an auto generated Go binding around an Ethereum contract. -type Ethda struct { - EthdaCaller // Read-only binding to the contract - EthdaTransactor // Write-only binding to the contract - EthdaFilterer // Log filterer for contract events -} - -// EthdaCaller is an auto generated read-only Go binding around an Ethereum contract. -type EthdaCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EthdaTransactor is an auto generated write-only Go binding around an Ethereum contract. -type EthdaTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EthdaFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type EthdaFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EthdaSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type EthdaSession struct { - Contract *Ethda // 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 -} - -// EthdaCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type EthdaCallerSession struct { - Contract *EthdaCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// EthdaTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type EthdaTransactorSession struct { - Contract *EthdaTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EthdaRaw is an auto generated low-level Go binding around an Ethereum contract. -type EthdaRaw struct { - Contract *Ethda // Generic contract binding to access the raw methods on -} - -// EthdaCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type EthdaCallerRaw struct { - Contract *EthdaCaller // Generic read-only contract binding to access the raw methods on -} - -// EthdaTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type EthdaTransactorRaw struct { - Contract *EthdaTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewEthda creates a new instance of Ethda, bound to a specific deployed contract. -func NewEthda(address common.Address, backend bind.ContractBackend) (*Ethda, error) { - contract, err := bindEthda(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Ethda{EthdaCaller: EthdaCaller{contract: contract}, EthdaTransactor: EthdaTransactor{contract: contract}, EthdaFilterer: EthdaFilterer{contract: contract}}, nil -} - -// NewEthdaCaller creates a new read-only instance of Ethda, bound to a specific deployed contract. -func NewEthdaCaller(address common.Address, caller bind.ContractCaller) (*EthdaCaller, error) { - contract, err := bindEthda(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &EthdaCaller{contract: contract}, nil -} - -// NewEthdaTransactor creates a new write-only instance of Ethda, bound to a specific deployed contract. -func NewEthdaTransactor(address common.Address, transactor bind.ContractTransactor) (*EthdaTransactor, error) { - contract, err := bindEthda(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &EthdaTransactor{contract: contract}, nil -} - -// NewEthdaFilterer creates a new log filterer instance of Ethda, bound to a specific deployed contract. -func NewEthdaFilterer(address common.Address, filterer bind.ContractFilterer) (*EthdaFilterer, error) { - contract, err := bindEthda(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &EthdaFilterer{contract: contract}, nil -} - -// bindEthda binds a generic wrapper to an already deployed contract. -func bindEthda(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := EthdaMetaData.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 (_Ethda *EthdaRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Ethda.Contract.EthdaCaller.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 (_Ethda *EthdaRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Ethda.Contract.EthdaTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Ethda *EthdaRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Ethda.Contract.EthdaTransactor.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 (_Ethda *EthdaCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Ethda.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 (_Ethda *EthdaTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Ethda.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Ethda *EthdaTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Ethda.Contract.contract.Transact(opts, method, params...) -} - -// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. -// -// Solidity: function ethdaSequencerAddress() view returns(address) -func (_Ethda *EthdaCaller) EthdaSequencerAddress(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Ethda.contract.Call(opts, &out, "ethdaSequencerAddress") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. -// -// Solidity: function ethdaSequencerAddress() view returns(address) -func (_Ethda *EthdaSession) EthdaSequencerAddress() (common.Address, error) { - return _Ethda.Contract.EthdaSequencerAddress(&_Ethda.CallOpts) -} - -// EthdaSequencerAddress is a free data retrieval call binding the contract method 0x7e585d3e. -// -// Solidity: function ethdaSequencerAddress() view returns(address) -func (_Ethda *EthdaCallerSession) EthdaSequencerAddress() (common.Address, error) { - return _Ethda.Contract.EthdaSequencerAddress(&_Ethda.CallOpts) -} - -// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. -// -// Solidity: function getProcotolName() pure returns(string) -func (_Ethda *EthdaCaller) GetProcotolName(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Ethda.contract.Call(opts, &out, "getProcotolName") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. -// -// Solidity: function getProcotolName() pure returns(string) -func (_Ethda *EthdaSession) GetProcotolName() (string, error) { - return _Ethda.Contract.GetProcotolName(&_Ethda.CallOpts) -} - -// GetProcotolName is a free data retrieval call binding the contract method 0xe4f17120. -// -// Solidity: function getProcotolName() pure returns(string) -func (_Ethda *EthdaCallerSession) GetProcotolName() (string, error) { - return _Ethda.Contract.GetProcotolName(&_Ethda.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Ethda *EthdaCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Ethda.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 (_Ethda *EthdaSession) Owner() (common.Address, error) { - return _Ethda.Contract.Owner(&_Ethda.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Ethda *EthdaCallerSession) Owner() (common.Address, error) { - return _Ethda.Contract.Owner(&_Ethda.CallOpts) -} - -// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. -// -// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() -func (_Ethda *EthdaCaller) VerifyMessage(opts *bind.CallOpts, signedHash [32]byte, signaturesAndAddrs []byte) error { - var out []interface{} - err := _Ethda.contract.Call(opts, &out, "verifyMessage", signedHash, signaturesAndAddrs) - - if err != nil { - return err - } - - return err - -} - -// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. -// -// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() -func (_Ethda *EthdaSession) VerifyMessage(signedHash [32]byte, signaturesAndAddrs []byte) error { - return _Ethda.Contract.VerifyMessage(&_Ethda.CallOpts, signedHash, signaturesAndAddrs) -} - -// VerifyMessage is a free data retrieval call binding the contract method 0x3b51be4b. -// -// Solidity: function verifyMessage(bytes32 signedHash, bytes signaturesAndAddrs) view returns() -func (_Ethda *EthdaCallerSession) VerifyMessage(signedHash [32]byte, signaturesAndAddrs []byte) error { - return _Ethda.Contract.VerifyMessage(&_Ethda.CallOpts, signedHash, signaturesAndAddrs) -} - -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. -// -// Solidity: function initialize() returns() -func (_Ethda *EthdaTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Ethda.contract.Transact(opts, "initialize") -} - -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. -// -// Solidity: function initialize() returns() -func (_Ethda *EthdaSession) Initialize() (*types.Transaction, error) { - return _Ethda.Contract.Initialize(&_Ethda.TransactOpts) -} - -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. -// -// Solidity: function initialize() returns() -func (_Ethda *EthdaTransactorSession) Initialize() (*types.Transaction, error) { - return _Ethda.Contract.Initialize(&_Ethda.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Ethda *EthdaTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Ethda.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Ethda *EthdaSession) RenounceOwnership() (*types.Transaction, error) { - return _Ethda.Contract.RenounceOwnership(&_Ethda.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Ethda *EthdaTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Ethda.Contract.RenounceOwnership(&_Ethda.TransactOpts) -} - -// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. -// -// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() -func (_Ethda *EthdaTransactor) SetEthdaSequencerAddress(opts *bind.TransactOpts, _ethdaSequencerAddress common.Address) (*types.Transaction, error) { - return _Ethda.contract.Transact(opts, "setEthdaSequencerAddress", _ethdaSequencerAddress) -} - -// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. -// -// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() -func (_Ethda *EthdaSession) SetEthdaSequencerAddress(_ethdaSequencerAddress common.Address) (*types.Transaction, error) { - return _Ethda.Contract.SetEthdaSequencerAddress(&_Ethda.TransactOpts, _ethdaSequencerAddress) -} - -// SetEthdaSequencerAddress is a paid mutator transaction binding the contract method 0xd5deff30. -// -// Solidity: function setEthdaSequencerAddress(address _ethdaSequencerAddress) returns() -func (_Ethda *EthdaTransactorSession) SetEthdaSequencerAddress(_ethdaSequencerAddress common.Address) (*types.Transaction, error) { - return _Ethda.Contract.SetEthdaSequencerAddress(&_Ethda.TransactOpts, _ethdaSequencerAddress) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Ethda *EthdaTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Ethda.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Ethda *EthdaSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Ethda.Contract.TransferOwnership(&_Ethda.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Ethda *EthdaTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Ethda.Contract.TransferOwnership(&_Ethda.TransactOpts, newOwner) -} - -// EthdaInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Ethda contract. -type EthdaInitializedIterator struct { - Event *EthdaInitialized // 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 *EthdaInitializedIterator) 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(EthdaInitialized) - 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(EthdaInitialized) - 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 *EthdaInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EthdaInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EthdaInitialized represents a Initialized event raised by the Ethda contract. -type EthdaInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Ethda *EthdaFilterer) FilterInitialized(opts *bind.FilterOpts) (*EthdaInitializedIterator, error) { - - logs, sub, err := _Ethda.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &EthdaInitializedIterator{contract: _Ethda.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Ethda *EthdaFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EthdaInitialized) (event.Subscription, error) { - - logs, sub, err := _Ethda.contract.WatchLogs(opts, "Initialized") - 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(EthdaInitialized) - if err := _Ethda.contract.UnpackLog(event, "Initialized", 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 -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Ethda *EthdaFilterer) ParseInitialized(log types.Log) (*EthdaInitialized, error) { - event := new(EthdaInitialized) - if err := _Ethda.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// EthdaOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Ethda contract. -type EthdaOwnershipTransferredIterator struct { - Event *EthdaOwnershipTransferred // 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 *EthdaOwnershipTransferredIterator) 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(EthdaOwnershipTransferred) - 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(EthdaOwnershipTransferred) - 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 *EthdaOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *EthdaOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// EthdaOwnershipTransferred represents a OwnershipTransferred event raised by the Ethda contract. -type EthdaOwnershipTransferred 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 (_Ethda *EthdaFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EthdaOwnershipTransferredIterator, 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 := _Ethda.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &EthdaOwnershipTransferredIterator{contract: _Ethda.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 (_Ethda *EthdaFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EthdaOwnershipTransferred, 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 := _Ethda.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(EthdaOwnershipTransferred) - if err := _Ethda.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 (_Ethda *EthdaFilterer) ParseOwnershipTransferred(log types.Log) (*EthdaOwnershipTransferred, error) { - event := new(EthdaOwnershipTransferred) - if err := _Ethda.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/etherman/smartcontracts/script.sh b/etherman/smartcontracts/script.sh index c299d2694f..fea535224a 100755 --- a/etherman/smartcontracts/script.sh +++ b/etherman/smartcontracts/script.sh @@ -28,4 +28,3 @@ gen mockverifier gen polygondatacommittee genNoBin dataavailabilityprotocol gen proxy -gen ethda diff --git a/go.mod b/go.mod index 4d08dd0ffb..682beeb83d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/0xPolygonHermez/zkevm-node -go 1.21 +go 1.22.2 require ( github.com/0xPolygonHermez/zkevm-data-streamer v0.2.3-0.20240426122934-6f47d2485fc1 @@ -61,6 +61,7 @@ require ( github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/crustio/blob-utils v0.3.1 // indirect + github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index d763c898c1..92e384781b 100644 --- a/go.sum +++ b/go.sum @@ -164,6 +164,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/crustio/blob-utils v0.3.1 h1:T++x9rKRqB7mlQp9nZpfadQd0UvKH6zMgV1695EvkUE= github.com/crustio/blob-utils v0.3.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= +github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd h1:0X5RJH4GG/8ZOoURPxaELD0swbmQj/f/3cvb8GzC4Es= +github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd/go.mod h1:bNuruVIBNVe4ceRCCUDfMf7OxTVsvAZDl1/meESrWMI= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/test/Makefile b/test/Makefile index 86d19973d7..35cd659924 100644 --- a/test/Makefile +++ b/test/Makefile @@ -694,29 +694,6 @@ generate-mocks-sequencesender: ## Generates mocks for sequencesender , using moc export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=etherman --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthermanMock --filename=mock_etherman.go export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthTxManagerMock --filename=mock_ethtxmanager.go -deploy-ethda: - go run ./scripts/ethda/main.go . - -.PHONY: run-ethda -run-ethda: ## Runs a full node - $(RUNSTATEDB) - $(RUNPOOLDB) - $(RUNEVENTDB) - $(RUNL1NETWORK) - sleep 1 - make deploy-ethda - $(RUNZKPROVER) - $(RUNAPPROVE) - sleep 3 - $(RUNSYNC) - sleep 4 - $(RUNETHTXMANAGER) - $(RUNSEQUENCER) - $(RUNSEQUENCESENDER) - $(RUNL2GASPRICER) - $(RUNAGGREGATOR) - $(RUNJSONRPC) - SYNC_L1_PARALLEL_FOLDER="../synchronizer/l1_parallel_sync" SYNC_L1_PARALLEL_MOCKS_FOLDER="../synchronizer/l1_parallel_sync/mocks" diff --git a/test/scripts/ethda/main.go b/test/scripts/ethda/main.go deleted file mode 100644 index 0d9082a6bd..0000000000 --- a/test/scripts/ethda/main.go +++ /dev/null @@ -1,87 +0,0 @@ -package main - -import ( - "context" - "math/big" - "strings" - "time" - - "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/ethda" - etrog "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/etrogpolygonzkevm" - "github.com/0xPolygonHermez/zkevm-node/log" - "github.com/0xPolygonHermez/zkevm-node/test/operations" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" -) - -type Deployments struct { - ethdaContract *ethda.Ethda - ethdaAddr common.Address -} - -func main() { - ctx := context.Background() - client, err := ethclient.Dial("http://localhost:8545") - if err != nil { - log.Fatal(err) - } - - chainId, err := client.ChainID(ctx) - if err != nil { - log.Fatal(err) - } - - privateKey, err := crypto.HexToECDSA(strings.TrimPrefix(operations.DefaultSequencerPrivateKey, "0x")) - if err != nil { - log.Fatal(err) - } - - auth, err := bind.NewKeyedTransactorWithChainID(privateKey, chainId) - if err != nil { - log.Fatal(err) - } - - nonce, err := client.PendingNonceAt(ctx, auth.From) - if err != nil { - log.Fatal(err) - } - - auth.Nonce = big.NewInt(int64(nonce)) - deployments := DeployContractsAndSetDAP(client, auth) - - log.Infof("Deploy contract: %v", deployments.ethdaAddr.Hex()) -} - -func DeployContractsAndSetDAP(client *ethclient.Client, auth *bind.TransactOpts) Deployments { - addr, tx, ethdaContract, err := ethda.DeployEthda(auth, client) - if err != nil { - log.Fatal(err) - } - - err = operations.WaitTxToBeMined(context.Background(), client, tx, 20*time.Second) - if err != nil { - log.Fatal(err) - } - - auth.Nonce = nil - auth.Value = nil - log.Debugf("Deploy tx: %v", tx.Hash().Hex()) - log.Debugf("Addr: %v", addr.Hex()) - // Set DAP - log.Debugf("Setting DAP", operations.DefaultL1ZkEVMSmartContract, addr) - etrog, err := etrog.NewEtrogpolygonzkevm(common.HexToAddress(operations.DefaultL1ZkEVMSmartContract), client) - if err != nil { - log.Fatal(err) - } - _, err = etrog.SetDataAvailabilityProtocol(auth, addr) - if err != nil { - log.Fatal(err) - } - - return Deployments{ - ethdaContract: ethdaContract, - ethdaAddr: addr, - } -} From f280bf2d80e800967e901d52332932bf363713ef Mon Sep 17 00:00:00 2001 From: Wagmi Date: Wed, 12 Jun 2024 15:44:38 +0800 Subject: [PATCH 7/7] feat: update ethda config --- cmd/run.go | 4 ++-- dataavailability/config.go | 2 +- go.mod | 8 ++++---- go.sum | 7 +++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 01ecfeda3e..1011072d95 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -360,8 +360,8 @@ func newDataAvailability(c config.Config, st *state.State, etherman *etherman.Cl if err != nil { return nil, err } - case string(dataavailability.ETHDA): - rpcUrl := "https://rpc-devnet2.ethda.io" + case string(dataavailability.EthDA): + rpcUrl := "https://rpc-testnet.ethda.io" daBackend, err = ethda.New(rpcUrl, pk) if err != nil { return nil, err diff --git a/dataavailability/config.go b/dataavailability/config.go index 02fe9a920b..5f9ef6642c 100644 --- a/dataavailability/config.go +++ b/dataavailability/config.go @@ -6,5 +6,5 @@ type DABackendType string const ( // DataAvailabilityCommittee is the DAC protocol backend DataAvailabilityCommittee DABackendType = "DataAvailabilityCommittee" - ETHDA DABackendType = "Ethda" + EthDA DABackendType = "EthDA" ) diff --git a/go.mod b/go.mod index 682beeb83d..48d994956b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/rubenv/sql-migrate v1.6.1 github.com/spf13/afero v1.11.0 github.com/spf13/viper v1.18.2 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/umbracle/ethgo v0.1.4-0.20230712173909-df37dddf16f0 github.com/urfave/cli/v2 v2.26.0 go.uber.org/zap v1.26.0 @@ -60,8 +60,8 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect - github.com/crustio/blob-utils v0.3.1 // indirect - github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd // indirect + github.com/crustio/blob-utils v0.3.3 // indirect + github.com/crustio/cdk-ethda-backend v0.1.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect @@ -142,7 +142,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/status-im/keycard-go v0.2.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/supranational/blst v0.3.11 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect diff --git a/go.sum b/go.sum index 92e384781b..244ee8e460 100644 --- a/go.sum +++ b/go.sum @@ -164,8 +164,12 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/crustio/blob-utils v0.3.1 h1:T++x9rKRqB7mlQp9nZpfadQd0UvKH6zMgV1695EvkUE= github.com/crustio/blob-utils v0.3.1/go.mod h1:d0x/5NSSocyvkRXkVJUnRGsB3EkZ0YuI/Nn8wN4l44g= +github.com/crustio/blob-utils v0.3.3 h1:oKATdFDyEGaYG8dXi+C7eqvCcdwT/Bc5Xb31jXl4Nzo= +github.com/crustio/blob-utils v0.3.3/go.mod h1:Iz9PwnJtTC70bNMoM0z7aCoylrfZc5SkkS3SsIgAOh0= github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd h1:0X5RJH4GG/8ZOoURPxaELD0swbmQj/f/3cvb8GzC4Es= github.com/crustio/cdk-ethda-backend v0.0.0-20240601151809-4c014822dcbd/go.mod h1:bNuruVIBNVe4ceRCCUDfMf7OxTVsvAZDl1/meESrWMI= +github.com/crustio/cdk-ethda-backend v0.1.0 h1:l8omYG6iEnbhSM65AjhUwLB0xctYjQuwkmh3gu7NWA4= +github.com/crustio/cdk-ethda-backend v0.1.0/go.mod h1:Xwz+NGyif0LD0bx0wjbC5AbgosrMxsLNlESsyRfROIU= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -758,6 +762,8 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -770,6 +776,7 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=