From 920d78b3b04ccef6396ff081c4316e365738c937 Mon Sep 17 00:00:00 2001 From: huangzhiran Date: Thu, 24 Oct 2024 21:37:40 +0800 Subject: [PATCH] tmp --- cmd/apinode/config/config.go | 4 +- cmd/prover/config/config.go | 8 +- cmd/sequencer/api/http.go | 2 +- cmd/sequencer/config/config.go | 56 +- cmd/sequencer/db/db.go | 14 +- cmd/sequencer/sequencer.go | 17 +- monitor/monitor.go | 63 +- .../.openzeppelin/unknown-4690.json | 958 +++++++++- .../W3bstreamBlockHeaderValidator.sol | 10 +- .../contracts/W3bstreamBlockMinter.sol | 2 + .../W3bstreamBlockRewardDistributor.sol | 2 +- smartcontracts/contracts/W3bstreamDebits.sol | 11 +- .../contracts/W3bstreamProjectReward.sol | 2 +- .../contracts/W3bstreamTaskManager.sol | 2 +- .../block_header_validator.abi | 183 ++ .../block_header_validator.go | 809 ++++++++ smartcontracts/go/minter/minter.abi | 100 +- smartcontracts/go/minter/minter.go | 264 +-- smartcontracts/go/prover/prover.abi | 518 +---- smartcontracts/go/prover/prover.go | 1688 ++++------------- .../go/taskmanager/task_manager.abi | 88 + smartcontracts/go/taskmanager/task_manager.go | 188 +- smartcontracts/scripts/deploy.ts | 4 + smartcontracts/scripts/upgrade.ts | 21 + task/assigner/assigner.go | 32 +- task/task.go | 1 + 26 files changed, 2868 insertions(+), 2179 deletions(-) create mode 100644 smartcontracts/go/blockheadervalidator/block_header_validator.abi create mode 100644 smartcontracts/go/blockheadervalidator/block_header_validator.go diff --git a/cmd/apinode/config/config.go b/cmd/apinode/config/config.go index b2498697..31d87100 100644 --- a/cmd/apinode/config/config.go +++ b/cmd/apinode/config/config.go @@ -32,8 +32,8 @@ var defaultTestnetConfig = &Config{ BootNodeMultiAddr: "/dns4/bootnode-0.testnet.iotex.one/tcp/4689/ipfs/12D3KooWFnaTYuLo8Mkbm3wzaWHtUuaxBRe24Uiopu15Wr5EhD3o", IoTeXChainID: 2, ChainEndpoint: "https://babel-api.testnet.iotex.io", - BeginningBlockNumber: 28345000, - TaskManagerContractAddr: "0x65aF86776CCFc60781a70c38F44625853d7A842A", + BeginningBlockNumber: 28685000, + TaskManagerContractAddr: "0x7AEF1Ed51c1EF3f9e118e25De5D65Ff9F7E2fd29", env: "TESTNET", } diff --git a/cmd/prover/config/config.go b/cmd/prover/config/config.go index 56cce1d6..6ef420ec 100644 --- a/cmd/prover/config/config.go +++ b/cmd/prover/config/config.go @@ -29,11 +29,11 @@ var ( VMEndpoints: `{"1":"localhost:4001","2":"localhost:4002","3":"zkwasm:4001","4":"wasm:4001"}`, ChainEndpoint: "https://babel-api.testnet.iotex.io", DatasourceDSN: "postgres://postgres:mysecretpassword@postgres:5432/w3bstream?sslmode=disable", - ProjectContractAddr: "0x4804e93c2A0A44BC055aA6e4b6d5Ead3FC2596Cd", - RouterContractAddr: "0x145C282cCc7f60c6B19664b01e08c5Cae7C97CbB", - TaskManagerContractAddr: "0x65aF86776CCFc60781a70c38F44625853d7A842A", + ProjectContractAddr: "0x2e45132c8fFeBa7490d57A6118Bd060E55161564", + RouterContractAddr: "0xBAB5D88AbECd06c3969fa3CE2597DDD31d13e3C3", + TaskManagerContractAddr: "0x7AEF1Ed51c1EF3f9e118e25De5D65Ff9F7E2fd29", ProverOperatorPrvKey: "a5f4e99aa80342d5451e8f8fd0dc357ccddb70d3827428fb1fc366f70833497f", - BeginningBlockNumber: 28345000, + BeginningBlockNumber: 28685000, LocalDBDir: "./local_db", env: "TESTNET", } diff --git a/cmd/sequencer/api/http.go b/cmd/sequencer/api/http.go index 0cf5e13c..62f23ba1 100644 --- a/cmd/sequencer/api/http.go +++ b/cmd/sequencer/api/http.go @@ -151,7 +151,7 @@ func (s *httpServer) submitBlock(c *gin.Context, req *jsonRpcReq, rsp *jsonRpcRs }, Nonce: new(big.Int).SetUint64(nonce), }, - minter.BlockInfo{ + minter.BlockHeader{ Meta: h.Meta, Prevhash: h.PrevHash, MerkleRoot: h.MerkleRoot, diff --git a/cmd/sequencer/config/config.go b/cmd/sequencer/config/config.go index e3420a68..06aeff2c 100644 --- a/cmd/sequencer/config/config.go +++ b/cmd/sequencer/config/config.go @@ -8,36 +8,40 @@ import ( ) type Config struct { - LogLevel slog.Level `env:"LOG_LEVEL,optional"` - ServiceEndpoint string `env:"HTTP_SERVICE_ENDPOINT"` - BootNodeMultiAddr string `env:"BOOTNODE_MULTIADDR"` - IoTeXChainID int `env:"IOTEX_CHAINID"` - ChainEndpoint string `env:"CHAIN_ENDPOINT,optional"` - OperatorPrvKey string `env:"OPERATOR_PRIVATE_KEY,optional"` - LocalDBDir string `env:"LOCAL_DB_DIRECTORY,optional"` - BeginningBlockNumber uint64 `env:"BEGINNING_BLOCK_NUMBER,optional"` - ProverContractAddr string `env:"PROVER_CONTRACT_ADDRESS,optional"` - DaoContractAddr string `env:"DAO_CONTRACT_ADDRESS,optional"` - MinterContractAddr string `env:"MINTER_CONTRACT_ADDRESS,optional"` - TaskManagerContractAddr string `env:"TASK_MANAGER_CONTRACT_ADDRESS,optional"` - env string `env:"-"` + LogLevel slog.Level `env:"LOG_LEVEL,optional"` + ServiceEndpoint string `env:"HTTP_SERVICE_ENDPOINT"` + BootNodeMultiAddr string `env:"BOOTNODE_MULTIADDR"` + IoTeXChainID int `env:"IOTEX_CHAINID"` + DatasourceDSN string `env:"DATASOURCE_DSN"` + ChainEndpoint string `env:"CHAIN_ENDPOINT,optional"` + OperatorPrvKey string `env:"OPERATOR_PRIVATE_KEY,optional"` + LocalDBDir string `env:"LOCAL_DB_DIRECTORY,optional"` + BeginningBlockNumber uint64 `env:"BEGINNING_BLOCK_NUMBER,optional"` + ProverContractAddr string `env:"PROVER_CONTRACT_ADDRESS,optional"` + DaoContractAddr string `env:"DAO_CONTRACT_ADDRESS,optional"` + MinterContractAddr string `env:"MINTER_CONTRACT_ADDRESS,optional"` + TaskManagerContractAddr string `env:"TASK_MANAGER_CONTRACT_ADDRESS,optional"` + BlockHeaderValidatorContractAddr string `env:"BLOCK_HEADER_VALIDATOR_CONTRACT_ADDRESS,optional"` + env string `env:"-"` } var ( defaultTestnetConfig = &Config{ - LogLevel: slog.LevelInfo, - ServiceEndpoint: ":9001", - BootNodeMultiAddr: "/dns4/bootnode-0.testnet.iotex.one/tcp/4689/ipfs/12D3KooWFnaTYuLo8Mkbm3wzaWHtUuaxBRe24Uiopu15Wr5EhD3o", - IoTeXChainID: 2, - ChainEndpoint: "https://babel-api.testnet.iotex.io", - OperatorPrvKey: "33e6ba3e033131026903f34dfa208feb88c284880530cf76280b68d38041c67b", - ProverContractAddr: "0xf9b850A50Ef236CADf4406Edf5a0B588142D238D", - DaoContractAddr: "0xA7b3c2a257693363a9f043CC9338DbA88E1f83aF", - MinterContractAddr: "0x102a1352557B3f6c65FBb44bF7959F8eacC30992", - TaskManagerContractAddr: "0x65aF86776CCFc60781a70c38F44625853d7A842A", - LocalDBDir: "./local_db", - BeginningBlockNumber: 28345000, - env: "TESTNET", + LogLevel: slog.LevelInfo, + ServiceEndpoint: ":9001", + BootNodeMultiAddr: "/dns4/bootnode-0.testnet.iotex.one/tcp/4689/ipfs/12D3KooWFnaTYuLo8Mkbm3wzaWHtUuaxBRe24Uiopu15Wr5EhD3o", + DatasourceDSN: "postgres://postgres:mysecretpassword@postgres:5432/w3bstream?sslmode=disable", + IoTeXChainID: 2, + ChainEndpoint: "https://babel-api.testnet.iotex.io", + OperatorPrvKey: "33e6ba3e033131026903f34dfa208feb88c284880530cf76280b68d38041c67b", + ProverContractAddr: "0x92aE72A5f15ee8cF61f950A60a600e17875644b2", + DaoContractAddr: "0xAF2C7967BD575C5a4b9a19333faC8d24744775f0", + MinterContractAddr: "0xeC0e0749Ec1434C6B23A7175B1309C8AEBa29da9", + TaskManagerContractAddr: "0x7AEF1Ed51c1EF3f9e118e25De5D65Ff9F7E2fd29", + BlockHeaderValidatorContractAddr: "0xd74263530C4e555CEEb3901d4165D83B4071A5e7", + LocalDBDir: "./local_db", + BeginningBlockNumber: 28685000, + env: "TESTNET", } ) diff --git a/cmd/sequencer/db/db.go b/cmd/sequencer/db/db.go index 6d7fe391..f64bd150 100644 --- a/cmd/sequencer/db/db.go +++ b/cmd/sequencer/db/db.go @@ -27,8 +27,7 @@ type blockHead struct { type prover struct { gorm.Model - ProverID uint64 `gorm:"uniqueIndex:prover_id,not null"` - OperatorAddr common.Address `gorm:"index:prover_operator,not null"` + Prover common.Address `gorm:"uniqueIndex:prover,not null"` } type task struct { @@ -119,19 +118,18 @@ func (p *DB) Provers() ([]common.Address, error) { } res := make([]common.Address, 0, len(ts)) for _, t := range ts { - res = append(res, t.OperatorAddr) + res = append(res, t.Prover) } return res, nil } -func (p *DB) UpsertProver(id uint64, operator common.Address) error { +func (p *DB) UpsertProver(addr common.Address) error { t := prover{ - ProverID: id, - OperatorAddr: operator, + Prover: addr, } err := p.db.Clauses(clause.OnConflict{ - Columns: []clause.Column{{Name: "prover_id"}}, - DoUpdates: clause.AssignmentColumns([]string{"operator_addr"}), + Columns: []clause.Column{{Name: "prover"}}, + DoNothing: true, }).Create(&t).Error return errors.Wrap(err, "failed to upsert prover") } diff --git a/cmd/sequencer/sequencer.go b/cmd/sequencer/sequencer.go index 6723bbde..8e58180d 100644 --- a/cmd/sequencer/sequencer.go +++ b/cmd/sequencer/sequencer.go @@ -10,6 +10,7 @@ import ( "github.com/iotexproject/w3bstream/cmd/sequencer/api" "github.com/iotexproject/w3bstream/cmd/sequencer/config" "github.com/iotexproject/w3bstream/cmd/sequencer/db" + "github.com/iotexproject/w3bstream/datasource" "github.com/iotexproject/w3bstream/monitor" "github.com/iotexproject/w3bstream/p2p" "github.com/iotexproject/w3bstream/task/assigner" @@ -42,10 +43,11 @@ func (s *Sequencer) Start() error { SettleTask: s.database.DeleteTask, }, &monitor.ContractAddr{ - Prover: common.HexToAddress(s.config.ProverContractAddr), - Dao: common.HexToAddress(s.config.DaoContractAddr), - Minter: common.HexToAddress(s.config.MinterContractAddr), - TaskManager: common.HexToAddress(s.config.TaskManagerContractAddr), + Prover: common.HexToAddress(s.config.ProverContractAddr), + Dao: common.HexToAddress(s.config.DaoContractAddr), + Minter: common.HexToAddress(s.config.MinterContractAddr), + TaskManager: common.HexToAddress(s.config.TaskManagerContractAddr), + BlockHeaderValidator: common.HexToAddress(s.config.BlockHeaderValidatorContractAddr), }, s.config.BeginningBlockNumber, s.config.ChainEndpoint, @@ -57,7 +59,12 @@ func (s *Sequencer) Start() error { log.Fatal(errors.Wrap(err, "failed to new p2p pubsub")) } - if err := assigner.Run(s.database, s.privateKey, s.config.ChainEndpoint, common.HexToAddress(s.config.MinterContractAddr)); err != nil { + datasource, err := datasource.NewPostgres(s.config.DatasourceDSN) + if err != nil { + return errors.Wrap(err, "failed to new datasource") + } + + if err := assigner.Run(s.database, s.privateKey, s.config.ChainEndpoint, datasource.Retrieve, common.HexToAddress(s.config.MinterContractAddr)); err != nil { log.Fatal(errors.Wrap(err, "failed to run task assigner")) } diff --git a/monitor/monitor.go b/monitor/monitor.go index 023ae855..cc67b092 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -16,6 +16,7 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/pkg/errors" + "github.com/iotexproject/w3bstream/smartcontracts/go/blockheadervalidator" "github.com/iotexproject/w3bstream/smartcontracts/go/dao" "github.com/iotexproject/w3bstream/smartcontracts/go/minter" "github.com/iotexproject/w3bstream/smartcontracts/go/project" @@ -31,7 +32,7 @@ type ( AssignTask func(uint64, common.Hash, common.Address) error SettleTask func(uint64, common.Hash, common.Hash) error UpsertProject func(uint64, string, common.Hash) error - UpsertProver func(uint64, common.Address) error + UpsertProver func(common.Address) error ) type Handler struct { @@ -46,25 +47,27 @@ type Handler struct { } type ContractAddr struct { - Prover common.Address - Project common.Address - Dao common.Address - Minter common.Address - TaskManager common.Address + Prover common.Address + Project common.Address + Dao common.Address + Minter common.Address + TaskManager common.Address + BlockHeaderValidator common.Address } type contract struct { - h *Handler - addr *ContractAddr - beginningBlockNumber uint64 - listStepSize uint64 - watchInterval time.Duration - client *ethclient.Client - daoInstance *dao.Dao - minterInstance *minter.Minter - taskManagerInstance *taskmanager.Taskmanager - proverInstance *prover.Prover - projectInstance *project.Project + h *Handler + addr *ContractAddr + beginningBlockNumber uint64 + listStepSize uint64 + watchInterval time.Duration + client *ethclient.Client + daoInstance *dao.Dao + minterInstance *minter.Minter + taskManagerInstance *taskmanager.Taskmanager + proverInstance *prover.Prover + projectInstance *project.Project + blockHeaderValidatorInstance *blockheadervalidator.Blockheadervalidator } var ( @@ -73,7 +76,7 @@ var ( taskAssignedTopic = crypto.Keccak256Hash([]byte("TaskAssigned(uint256,bytes32,address,uint256)")) taskSettledTopic = crypto.Keccak256Hash([]byte("TaskSettled(uint256,bytes32,address)")) projectConfigUpdatedTopic = crypto.Keccak256Hash([]byte("ProjectConfigUpdated(uint256,string,bytes32)")) - operatorSetTopic = crypto.Keccak256Hash([]byte("OperatorSet(uint256,address)")) + proverSetTopic = crypto.Keccak256Hash([]byte("BeneficiarySet(address,address)")) ) var allTopic = []common.Hash{ @@ -82,7 +85,7 @@ var allTopic = []common.Hash{ taskAssignedTopic, taskSettledTopic, projectConfigUpdatedTopic, - operatorSetTopic, + proverSetTopic, } var emptyAddr = common.Address{} @@ -104,6 +107,9 @@ func (a *ContractAddr) all() []common.Address { if !bytes.Equal(a.TaskManager[:], emptyAddr[:]) { all = append(all, a.TaskManager) } + if !bytes.Equal(a.BlockHeaderValidator[:], emptyAddr[:]) { + all = append(all, a.BlockHeaderValidator) + } return all } @@ -129,10 +135,10 @@ func (c *contract) processLogs(logs []types.Log) error { return err } case nbitsSetTopic: - if c.minterInstance == nil || c.h.UpsertNBits == nil { + if c.blockHeaderValidatorInstance == nil || c.h.UpsertNBits == nil { continue } - e, err := c.minterInstance.ParseNBitsSet(l) + e, err := c.blockHeaderValidatorInstance.ParseNBitsSet(l) if err != nil { return errors.Wrap(err, "failed to parse nbits set event") } @@ -172,15 +178,15 @@ func (c *contract) processLogs(logs []types.Log) error { if err := c.h.UpsertProject(e.ProjectId.Uint64(), e.Uri, e.Hash); err != nil { return err } - case operatorSetTopic: + case proverSetTopic: if c.proverInstance == nil || c.h.UpsertProver == nil { continue } - e, err := c.proverInstance.ParseOperatorSet(l) + e, err := c.proverInstance.ParseBeneficiarySet(l) if err != nil { - return errors.Wrap(err, "failed to parse operator set event") + return errors.Wrap(err, "failed to parse prover set event") } - if err := c.h.UpsertProver(e.Id.Uint64(), e.Operator); err != nil { + if err := c.h.UpsertProver(e.Prover); err != nil { return err } } @@ -320,6 +326,13 @@ func Run(h *Handler, addr *ContractAddr, beginningBlockNumber uint64, chainEndpo } c.projectInstance = projectInstance } + if !bytes.Equal(addr.BlockHeaderValidator[:], emptyAddr[:]) { + blockHeaderValidatorInstance, err := blockheadervalidator.NewBlockheadervalidator(addr.BlockHeaderValidator, client) + if err != nil { + return errors.Wrap(err, "failed to new block header validator contract instance") + } + c.blockHeaderValidatorInstance = blockHeaderValidatorInstance + } listedBlockNumber, err := c.list() if err != nil { diff --git a/smartcontracts/.openzeppelin/unknown-4690.json b/smartcontracts/.openzeppelin/unknown-4690.json index 7162eed8..522f6dfb 100644 --- a/smartcontracts/.openzeppelin/unknown-4690.json +++ b/smartcontracts/.openzeppelin/unknown-4690.json @@ -142,28 +142,120 @@ "kind": "transparent" }, { - "address": "0x23879E58c729230C899B0f3a8f85Dec48d07f6e2", - "txHash": "0x0d676a1aa7151890797a04bd4e29691a68b7d6b062890650cf823fd26c8c8dd9", + "address": "0xd832E3e15F0C67930AbeB84a713C0Cfe460C5F0b", + "txHash": "0x590d649bb59bf12c207e33ada0ecf0012fda36e540d53b06b383b38742db469a", "kind": "transparent" }, { - "address": "0xd832E3e15F0C67930AbeB84a713C0Cfe460C5F0b", - "txHash": "0x590d649bb59bf12c207e33ada0ecf0012fda36e540d53b06b383b38742db469a", + "address": "0xeE9f7Efae9b746BFC27154e716Ed4C4e60C2fb58", + "txHash": "0xb5ccf7f3f09887cde8904c3fb88275b0ac23c18c9d648137105eab3c6c3446da", "kind": "transparent" }, { - "address": "0x824644A3E1679927358F59db14B8292fdCb834A3", - "txHash": "0x5d3c5077f60e37b1fff2d6f52d5c83e79ad50cce33b9578ef95dc4a0f92ccef1", + "address": "0x23879E58c729230C899B0f3a8f85Dec48d07f6e2", "kind": "transparent" }, { - "address": "0xeE9f7Efae9b746BFC27154e716Ed4C4e60C2fb58", - "txHash": "0xb5ccf7f3f09887cde8904c3fb88275b0ac23c18c9d648137105eab3c6c3446da", + "address": "0x824644A3E1679927358F59db14B8292fdCb834A3", "kind": "transparent" }, { "address": "0x25c61dc3Da8030f84db945a63Bde01b4b860A390", - "txHash": "0x08cffd4f63726f37fce86e58dcaca5d069c4f08a4e17441650309110b17d9be5", + "kind": "transparent" + }, + { + "address": "0xabf669848378f0A3E4B0F85A55C52ABb20f9Bb5B", + "txHash": "0x345b68419f23a70f68972b8b1ed8886c75713b64b88b7d552a5284aa28acb1b0", + "kind": "transparent" + }, + { + "address": "0x16a37e927c556EA53016853179430Bb96a23f2c5", + "txHash": "0xaa8f03adba42cacdb1a8d7858d4354474a8ca64eb0fb75e79d6a64c1257f5781", + "kind": "transparent" + }, + { + "address": "0x7E7C4De4036E1b5Ee655e5c139e65172F8e08d7E", + "txHash": "0xe96d0b4d82de88ff91e90f1efc97473a3f7978c022a747a95d1469331229ad1e", + "kind": "transparent" + }, + { + "address": "0x5100d1040bA51953830407173Ccf2F2499F2dE96", + "txHash": "0x69b144d2601647d7b50180265d9c41076cb2559ae66ade9e387c993467ee0c84", + "kind": "transparent" + }, + { + "address": "0x1B43a2A87EAfa47406f5d804849D826EF391Ec2D", + "txHash": "0xca15d68ae5b9aba0f75ed5b94d905d105f6380066a2459a755a5a7a24287f96c", + "kind": "transparent" + }, + { + "address": "0x712c016B423AFb503b64dae0542bB31932cb6676", + "txHash": "0x62cb8fe6ae4d27e0a47692bb573c5f48b1abba7490785d2babf8c73dc6d116e7", + "kind": "transparent" + }, + { + "address": "0x2e45132c8fFeBa7490d57A6118Bd060E55161564", + "txHash": "0xdebc783b99beab07a12db3e98e1ab54c9c8d17cbbae54117d3d02f4f40acb360", + "kind": "transparent" + }, + { + "address": "0x08630ec955b00C14aC22eC95511Cec6771463F65", + "txHash": "0x48fca6ce816105004cfbbe89c42fe25a6451d68356a9b9a851cb9804688de0e2", + "kind": "transparent" + }, + { + "address": "0x92aE72A5f15ee8cF61f950A60a600e17875644b2", + "txHash": "0x0d8b369fdd0acd91434f9f86f5180950a90b3c8a02ec5349eed0c1ea6c4fb681", + "kind": "transparent" + }, + { + "address": "0xA44588B753Fec966771B3a8c42D619c0617822B8", + "txHash": "0x8dd1232ebda9c42ebfad673cb7968e78c4bb225ba0407b30471eaea5b0391514", + "kind": "transparent" + }, + { + "address": "0xd025C8f5215C0Aa9247aF82B4099c5Eb4550a418", + "txHash": "0x7601a7becdf8855c63b516ff59c0beb82b25c779afcb8ae9edd96b65e0ef943f", + "kind": "transparent" + }, + { + "address": "0xBAB5D88AbECd06c3969fa3CE2597DDD31d13e3C3", + "txHash": "0xd3174340a5284f0e08ae347c24bbaefbca2f3e159dcfdff2dca991c0578dba0a", + "kind": "transparent" + }, + { + "address": "0x9F16FFAb36d62fa23B1b1Ff231F70d5a0a0A2077", + "txHash": "0x94322dca78bd75f5548dda247da46d41f39a09dfc71633722cbeb47da019f6d9", + "kind": "transparent" + }, + { + "address": "0xAF2C7967BD575C5a4b9a19333faC8d24744775f0", + "txHash": "0xc526a86833cfb93446492c7d82634d28b4969d02adc8f5f3da84e77e9689059d", + "kind": "transparent" + }, + { + "address": "0x979cBa6D3f7d404c6Bf7b52ecb40E2EB9E0B4f78", + "txHash": "0x402cb437ad5212e9b49cdfd476525ecd9c7ef66a8984b80bb83d2d6a8a73da6a", + "kind": "transparent" + }, + { + "address": "0x06542362e10d1257f35875c868D38Da77176b28D", + "txHash": "0xd2bf8ab46e66b6fbd00585fe389ed9c86ac66b5412947b01ca065cb79872f7cf", + "kind": "transparent" + }, + { + "address": "0x7AEF1Ed51c1EF3f9e118e25De5D65Ff9F7E2fd29", + "txHash": "0x5fe7f9f68f4ef69fcdb98e95cef7e5a88a8f7484d1efcc4b65dd6ce012c1b227", + "kind": "transparent" + }, + { + "address": "0xca94708669cC419F2f8E8e6Af92043ec54C14EE0", + "txHash": "0x3b9d08d90be4017d01adae2ed8f97e6b537efb64de6274a5741356189d3311fb", + "kind": "transparent" + }, + { + "address": "0xeC0e0749Ec1434C6B23A7175B1309C8AEBa29da9", + "txHash": "0x386059f05ff972740a225c380e44d34dbbce6c84ac2973840929ac1c824d4a27", "kind": "transparent" } ], @@ -1910,6 +2002,854 @@ }, "namespaces": {} } + }, + "f183996731a8c24a265d15b0846549c012ebde502af0deaafc0e348c012ccec9": { + "address": "0x9bDA70073411983f479936080BaE32208E35c4E2", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "operator", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "W3bstreamDebits", + "src": "contracts/W3bstreamDebits.sol:15" + }, + { + "label": "balances", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "W3bstreamDebits", + "src": "contracts/W3bstreamDebits.sol:17" + }, + { + "label": "withholdings", + "offset": 0, + "slot": "103", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "W3bstreamDebits", + "src": "contracts/W3bstreamDebits.sol:18" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "786c46c5ce3f5d78aa8bc2e63701a7fcfbeccdc0f0fc319d4e03ff5b31555bc3": { + "address": "0xE9bD50FBedBF2e79561aB85E7E0cF4414CB47B22", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "records", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Record)2273_storage))", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:54" + }, + { + "label": "operators", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_bool)", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:55" + }, + { + "label": "debits", + "offset": 0, + "slot": "103", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:56" + }, + { + "label": "projectReward", + "offset": 0, + "slot": "104", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:57" + }, + { + "label": "proverStore", + "offset": 0, + "slot": "105", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:58" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(Record)2273_storage)": { + "label": "mapping(bytes32 => struct Record)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Record)2273_storage))": { + "label": "mapping(uint256 => mapping(bytes32 => struct Record))", + "numberOfBytes": "32" + }, + "t_struct(Record)2273_storage": { + "label": "struct Record", + "members": [ + { + "label": "hash", + "type": "t_bytes32", + "offset": 0, + "slot": "0" + }, + { + "label": "owner", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "sequencer", + "type": "t_address", + "offset": 0, + "slot": "2" + }, + { + "label": "prover", + "type": "t_address", + "offset": 0, + "slot": "3" + }, + { + "label": "rewardForProver", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "rewardForSequencer", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "deadline", + "type": "t_uint256", + "offset": 0, + "slot": "6" + }, + { + "label": "settled", + "type": "t_bool", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "8a5f9a7182790a048a05d7552a7ecb5c435af494b24b46694887273d6ca20d9a": { + "address": "0xE9bD50FBedBF2e79561aB85E7E0cF4414CB47B22", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "records", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Record)2273_storage))", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:54" + }, + { + "label": "operators", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_bool)", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:55" + }, + { + "label": "debits", + "offset": 0, + "slot": "103", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:56" + }, + { + "label": "projectReward", + "offset": 0, + "slot": "104", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:57" + }, + { + "label": "proverStore", + "offset": 0, + "slot": "105", + "type": "t_address", + "contract": "W3bstreamTaskManager", + "src": "contracts/W3bstreamTaskManager.sol:58" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_struct(Record)2273_storage)": { + "label": "mapping(bytes32 => struct Record)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_struct(Record)2273_storage))": { + "label": "mapping(uint256 => mapping(bytes32 => struct Record))", + "numberOfBytes": "32" + }, + "t_struct(Record)2273_storage": { + "label": "struct Record", + "members": [ + { + "label": "hash", + "type": "t_bytes32", + "offset": 0, + "slot": "0" + }, + { + "label": "owner", + "type": "t_address", + "offset": 0, + "slot": "1" + }, + { + "label": "sequencer", + "type": "t_address", + "offset": 0, + "slot": "2" + }, + { + "label": "prover", + "type": "t_address", + "offset": 0, + "slot": "3" + }, + { + "label": "rewardForProver", + "type": "t_uint256", + "offset": 0, + "slot": "4" + }, + { + "label": "rewardForSequencer", + "type": "t_uint256", + "offset": 0, + "slot": "5" + }, + { + "label": "deadline", + "type": "t_uint256", + "offset": 0, + "slot": "6" + }, + { + "label": "settled", + "type": "t_bool", + "offset": 0, + "slot": "7" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "ee3e43116291dd2216965a0308f7ab54bafcb6842ac3519a48d4392b93c6314d": { + "address": "0x9B7E21F5AD027B917FeBbaaaf56f0A74AC7F2cE3", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "dao", + "offset": 0, + "slot": "101", + "type": "t_contract(IDAO)709", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:30" + }, + { + "label": "taskManager", + "offset": 0, + "slot": "102", + "type": "t_contract(ITaskManager)1201", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:31" + }, + { + "label": "distributor", + "offset": 0, + "slot": "103", + "type": "t_contract(IBlockRewardDistributor)717", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:32" + }, + { + "label": "headerValidator", + "offset": 0, + "slot": "104", + "type": "t_contract(IBlockHeaderValidator)1156", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:33" + }, + { + "label": "blockReward", + "offset": 0, + "slot": "105", + "type": "t_uint256", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:35" + }, + { + "label": "taskAllowance", + "offset": 0, + "slot": "106", + "type": "t_uint256", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:36" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBlockHeaderValidator)1156": { + "label": "contract IBlockHeaderValidator", + "numberOfBytes": "20" + }, + "t_contract(IBlockRewardDistributor)717": { + "label": "contract IBlockRewardDistributor", + "numberOfBytes": "20" + }, + "t_contract(IDAO)709": { + "label": "contract IDAO", + "numberOfBytes": "20" + }, + "t_contract(ITaskManager)1201": { + "label": "contract ITaskManager", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } + }, + "9b02845aed9bac2060da17cc5f08c633cdb74f565dda8f1be94cc155be340a71": { + "address": "0x9B7E21F5AD027B917FeBbaaaf56f0A74AC7F2cE3", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "dao", + "offset": 0, + "slot": "101", + "type": "t_contract(IDAO)709", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:30" + }, + { + "label": "taskManager", + "offset": 0, + "slot": "102", + "type": "t_contract(ITaskManager)1049", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:31" + }, + { + "label": "distributor", + "offset": 0, + "slot": "103", + "type": "t_contract(IBlockRewardDistributor)717", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:32" + }, + { + "label": "headerValidator", + "offset": 0, + "slot": "104", + "type": "t_contract(IBlockHeaderValidator)1004", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:33" + }, + { + "label": "blockReward", + "offset": 0, + "slot": "105", + "type": "t_uint256", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:35" + }, + { + "label": "taskAllowance", + "offset": 0, + "slot": "106", + "type": "t_uint256", + "contract": "W3bstreamBlockMinter", + "src": "contracts/W3bstreamBlockMinter.sol:36" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IBlockHeaderValidator)1004": { + "label": "contract IBlockHeaderValidator", + "numberOfBytes": "20" + }, + "t_contract(IBlockRewardDistributor)717": { + "label": "contract IBlockRewardDistributor", + "numberOfBytes": "20" + }, + "t_contract(IDAO)709": { + "label": "contract IDAO", + "numberOfBytes": "20" + }, + "t_contract(ITaskManager)1049": { + "label": "contract ITaskManager", + "numberOfBytes": "20" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + }, + "allAddresses": [ + "0x9B7E21F5AD027B917FeBbaaaf56f0A74AC7F2cE3" + ] + }, + "317e9f91eca1f14c59781564d51f00d9ca5eefc6e8125df0341bd0b55b02a144": { + "address": "0x73281Bbc7D3b541fed3322740cd3E20929340Cf1", + "txHash": "0x5927d17d165c9f22ace5df15c55d20396b2f68a82fde05b17ccd6f0a9b35f828", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "operator", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "W3bstreamBlockRewardDistributor", + "src": "contracts/W3bstreamBlockRewardDistributor.sol:11" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/smartcontracts/contracts/W3bstreamBlockHeaderValidator.sol b/smartcontracts/contracts/W3bstreamBlockHeaderValidator.sol index dff1c55e..a157785e 100644 --- a/smartcontracts/contracts/W3bstreamBlockHeaderValidator.sol +++ b/smartcontracts/contracts/W3bstreamBlockHeaderValidator.sol @@ -34,7 +34,13 @@ contract W3bstreamBlockHeaderValidator is IBlockHeaderValidator, Ownable { function validate(BlockHeader calldata header) public view returns (bytes memory) { require(header.nbits == currentNBits, "invalid nbits"); - bytes memory encodedHeader = abi.encodePacked(header.meta, header.prevhash, header.merkleRoot, header.nbits, header.nonce); + bytes memory encodedHeader = abi.encodePacked( + header.meta, + header.prevhash, + header.merkleRoot, + header.nbits, + header.nonce + ); bytes memory headerHash = scrypt.hash(encodedHeader, encodedHeader, 1024, 1, 1, 32, 224); require(headerHash.length == 32, "invalid header hash length"); require(uint256(bytes32(headerHash)) <= _currentTarget, "invalid proof of work"); @@ -69,7 +75,7 @@ contract W3bstreamBlockHeaderValidator is IBlockHeaderValidator, Ownable { } function updateDuration(uint256 duration) public { - require(msg.sender == operator, "not operator"); + require(msg.sender == operator, "not block header validator operator"); _durationSum += duration - _durations[_durationIndex]; _durations[_durationIndex] = duration; _durationIndex = (_durationIndex + 1) % _durations.length; diff --git a/smartcontracts/contracts/W3bstreamBlockMinter.sol b/smartcontracts/contracts/W3bstreamBlockMinter.sol index 69e7a0fb..ef887d69 100644 --- a/smartcontracts/contracts/W3bstreamBlockMinter.sol +++ b/smartcontracts/contracts/W3bstreamBlockMinter.sol @@ -55,6 +55,7 @@ contract W3bstreamBlockMinter is OwnableUpgradeable { Sequencer calldata coinbase, TaskAssignment[] calldata assignments ) public { + //require(false, "i am here 1"); require(coinbase.operator == msg.sender, "invalid operator"); (uint256 tipBlockNumber, bytes32 tiphash, ) = dao.tip(); require(tipBlockNumber != block.number); @@ -64,6 +65,7 @@ contract W3bstreamBlockMinter is OwnableUpgradeable { "invalid merkle root" ); bytes memory encodedHeader = headerValidator.validate(header); + //require(1 < 0, "i am here 2"); bytes32 blockHash = keccak256(abi.encode(encodedHeader, assignments)); taskManager.assign(assignments, coinbase.beneficiary, block.number + taskAllowance); headerValidator.updateDuration(block.number - tipBlockNumber); diff --git a/smartcontracts/contracts/W3bstreamBlockRewardDistributor.sol b/smartcontracts/contracts/W3bstreamBlockRewardDistributor.sol index 0ecc74a9..7a217a98 100644 --- a/smartcontracts/contracts/W3bstreamBlockRewardDistributor.sol +++ b/smartcontracts/contracts/W3bstreamBlockRewardDistributor.sol @@ -11,7 +11,7 @@ contract W3bstreamBlockRewardDistributor is OwnableUpgradeable { address public operator; modifier onlyOperator() { - require(msg.sender == operator, "not operator"); + require(msg.sender == operator, "not block reward distributor operator"); _; } diff --git a/smartcontracts/contracts/W3bstreamDebits.sol b/smartcontracts/contracts/W3bstreamDebits.sol index 49894436..5abe99a6 100644 --- a/smartcontracts/contracts/W3bstreamDebits.sol +++ b/smartcontracts/contracts/W3bstreamDebits.sol @@ -18,9 +18,9 @@ contract W3bstreamDebits is OwnableUpgradeable { mapping(address => mapping(address => uint256)) withholdings; modifier onlyOperator() { - require(msg.sender == operator, "not operator"); + require(msg.sender == operator, "not debits operator"); _; - } + } function initialize() public initializer { __Ownable_init(); @@ -47,7 +47,12 @@ contract W3bstreamDebits is OwnableUpgradeable { emit Withheld(token, owner, amount); } - function distribute(address token, address _owner, address[] calldata _recipients, uint256[] calldata _amounts) external onlyOperator { + function distribute( + address token, + address _owner, + address[] calldata _recipients, + uint256[] calldata _amounts + ) external onlyOperator { require(token != address(0), "reward token not set"); require(_recipients.length == _amounts.length, "length mismatch"); for (uint256 i = 0; i < _recipients.length; i++) { diff --git a/smartcontracts/contracts/W3bstreamProjectReward.sol b/smartcontracts/contracts/W3bstreamProjectReward.sol index 56defc49..5219d32a 100644 --- a/smartcontracts/contracts/W3bstreamProjectReward.sol +++ b/smartcontracts/contracts/W3bstreamProjectReward.sol @@ -22,7 +22,7 @@ contract W3bstreamProjectReward is OwnableUpgradeable { mapping(address => mapping(uint256 => uint256)) _rewardAmounts; modifier onlyOperator() { - require(msg.sender == operator, "not operator"); + require(msg.sender == operator, "not project reward operator"); _; } diff --git a/smartcontracts/contracts/W3bstreamTaskManager.sol b/smartcontracts/contracts/W3bstreamTaskManager.sol index 1333a7f4..77609a8e 100644 --- a/smartcontracts/contracts/W3bstreamTaskManager.sol +++ b/smartcontracts/contracts/W3bstreamTaskManager.sol @@ -58,7 +58,7 @@ contract W3bstreamTaskManager is OwnableUpgradeable, ITaskManager { address public proverStore; modifier onlyOperator() { - require(operators[msg.sender], "not operator"); + require(operators[msg.sender], "not task manager operator"); _; } diff --git a/smartcontracts/go/blockheadervalidator/block_header_validator.abi b/smartcontracts/go/blockheadervalidator/block_header_validator.abi new file mode 100644 index 00000000..956b2cd0 --- /dev/null +++ b/smartcontracts/go/blockheadervalidator/block_header_validator.abi @@ -0,0 +1,183 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "nbits", + "type": "uint32" + } + ], + "name": "NBitsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "OperatorSet", + "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": "operator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "uint32", + "name": "nbits", + "type": "uint32" + } + ], + "name": "setAdhocNBits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_operator", + "type": "address" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "updateDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes4", + "name": "meta", + "type": "bytes4" + }, + { + "internalType": "bytes32", + "name": "prevhash", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "merkleRoot", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "nbits", + "type": "uint32" + }, + { + "internalType": "bytes8", + "name": "nonce", + "type": "bytes8" + } + ], + "internalType": "struct BlockHeader", + "name": "header", + "type": "tuple" + } + ], + "name": "validate", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + } + ] \ No newline at end of file diff --git a/smartcontracts/go/blockheadervalidator/block_header_validator.go b/smartcontracts/go/blockheadervalidator/block_header_validator.go new file mode 100644 index 00000000..eb6b2608 --- /dev/null +++ b/smartcontracts/go/blockheadervalidator/block_header_validator.go @@ -0,0 +1,809 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package blockheadervalidator + +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 +) + +// BlockHeader is an auto generated low-level Go binding around an user-defined struct. +type BlockHeader struct { + Meta [4]byte + Prevhash [32]byte + MerkleRoot [32]byte + Nbits uint32 + Nonce [8]byte +} + +// BlockheadervalidatorMetaData contains all meta data concerning the Blockheadervalidator contract. +var BlockheadervalidatorMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"NBitsSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorSet\",\"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\":\"operator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"setAdhocNBits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"setOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"updateDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"meta\",\"type\":\"bytes4\"},{\"internalType\":\"bytes32\",\"name\":\"prevhash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"nonce\",\"type\":\"bytes8\"}],\"internalType\":\"structBlockHeader\",\"name\":\"header\",\"type\":\"tuple\"}],\"name\":\"validate\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}]", +} + +// BlockheadervalidatorABI is the input ABI used to generate the binding from. +// Deprecated: Use BlockheadervalidatorMetaData.ABI instead. +var BlockheadervalidatorABI = BlockheadervalidatorMetaData.ABI + +// Blockheadervalidator is an auto generated Go binding around an Ethereum contract. +type Blockheadervalidator struct { + BlockheadervalidatorCaller // Read-only binding to the contract + BlockheadervalidatorTransactor // Write-only binding to the contract + BlockheadervalidatorFilterer // Log filterer for contract events +} + +// BlockheadervalidatorCaller is an auto generated read-only Go binding around an Ethereum contract. +type BlockheadervalidatorCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockheadervalidatorTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BlockheadervalidatorTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockheadervalidatorFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BlockheadervalidatorFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockheadervalidatorSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BlockheadervalidatorSession struct { + Contract *Blockheadervalidator // 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 +} + +// BlockheadervalidatorCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BlockheadervalidatorCallerSession struct { + Contract *BlockheadervalidatorCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BlockheadervalidatorTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BlockheadervalidatorTransactorSession struct { + Contract *BlockheadervalidatorTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BlockheadervalidatorRaw is an auto generated low-level Go binding around an Ethereum contract. +type BlockheadervalidatorRaw struct { + Contract *Blockheadervalidator // Generic contract binding to access the raw methods on +} + +// BlockheadervalidatorCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BlockheadervalidatorCallerRaw struct { + Contract *BlockheadervalidatorCaller // Generic read-only contract binding to access the raw methods on +} + +// BlockheadervalidatorTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BlockheadervalidatorTransactorRaw struct { + Contract *BlockheadervalidatorTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBlockheadervalidator creates a new instance of Blockheadervalidator, bound to a specific deployed contract. +func NewBlockheadervalidator(address common.Address, backend bind.ContractBackend) (*Blockheadervalidator, error) { + contract, err := bindBlockheadervalidator(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Blockheadervalidator{BlockheadervalidatorCaller: BlockheadervalidatorCaller{contract: contract}, BlockheadervalidatorTransactor: BlockheadervalidatorTransactor{contract: contract}, BlockheadervalidatorFilterer: BlockheadervalidatorFilterer{contract: contract}}, nil +} + +// NewBlockheadervalidatorCaller creates a new read-only instance of Blockheadervalidator, bound to a specific deployed contract. +func NewBlockheadervalidatorCaller(address common.Address, caller bind.ContractCaller) (*BlockheadervalidatorCaller, error) { + contract, err := bindBlockheadervalidator(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BlockheadervalidatorCaller{contract: contract}, nil +} + +// NewBlockheadervalidatorTransactor creates a new write-only instance of Blockheadervalidator, bound to a specific deployed contract. +func NewBlockheadervalidatorTransactor(address common.Address, transactor bind.ContractTransactor) (*BlockheadervalidatorTransactor, error) { + contract, err := bindBlockheadervalidator(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BlockheadervalidatorTransactor{contract: contract}, nil +} + +// NewBlockheadervalidatorFilterer creates a new log filterer instance of Blockheadervalidator, bound to a specific deployed contract. +func NewBlockheadervalidatorFilterer(address common.Address, filterer bind.ContractFilterer) (*BlockheadervalidatorFilterer, error) { + contract, err := bindBlockheadervalidator(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BlockheadervalidatorFilterer{contract: contract}, nil +} + +// bindBlockheadervalidator binds a generic wrapper to an already deployed contract. +func bindBlockheadervalidator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BlockheadervalidatorMetaData.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 (_Blockheadervalidator *BlockheadervalidatorRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockheadervalidator.Contract.BlockheadervalidatorCaller.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 (_Blockheadervalidator *BlockheadervalidatorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.BlockheadervalidatorTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockheadervalidator *BlockheadervalidatorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.BlockheadervalidatorTransactor.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 (_Blockheadervalidator *BlockheadervalidatorCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockheadervalidator.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 (_Blockheadervalidator *BlockheadervalidatorTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockheadervalidator *BlockheadervalidatorTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.contract.Transact(opts, method, params...) +} + +// Operator is a free data retrieval call binding the contract method 0x570ca735. +// +// Solidity: function operator() view returns(address) +func (_Blockheadervalidator *BlockheadervalidatorCaller) Operator(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Blockheadervalidator.contract.Call(opts, &out, "operator") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Operator is a free data retrieval call binding the contract method 0x570ca735. +// +// Solidity: function operator() view returns(address) +func (_Blockheadervalidator *BlockheadervalidatorSession) Operator() (common.Address, error) { + return _Blockheadervalidator.Contract.Operator(&_Blockheadervalidator.CallOpts) +} + +// Operator is a free data retrieval call binding the contract method 0x570ca735. +// +// Solidity: function operator() view returns(address) +func (_Blockheadervalidator *BlockheadervalidatorCallerSession) Operator() (common.Address, error) { + return _Blockheadervalidator.Contract.Operator(&_Blockheadervalidator.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Blockheadervalidator *BlockheadervalidatorCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Blockheadervalidator.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 (_Blockheadervalidator *BlockheadervalidatorSession) Owner() (common.Address, error) { + return _Blockheadervalidator.Contract.Owner(&_Blockheadervalidator.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Blockheadervalidator *BlockheadervalidatorCallerSession) Owner() (common.Address, error) { + return _Blockheadervalidator.Contract.Owner(&_Blockheadervalidator.CallOpts) +} + +// Validate is a free data retrieval call binding the contract method 0x39e9bce8. +// +// Solidity: function validate((bytes4,bytes32,bytes32,uint32,bytes8) header) pure returns(bytes) +func (_Blockheadervalidator *BlockheadervalidatorCaller) Validate(opts *bind.CallOpts, header BlockHeader) ([]byte, error) { + var out []interface{} + err := _Blockheadervalidator.contract.Call(opts, &out, "validate", header) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// Validate is a free data retrieval call binding the contract method 0x39e9bce8. +// +// Solidity: function validate((bytes4,bytes32,bytes32,uint32,bytes8) header) pure returns(bytes) +func (_Blockheadervalidator *BlockheadervalidatorSession) Validate(header BlockHeader) ([]byte, error) { + return _Blockheadervalidator.Contract.Validate(&_Blockheadervalidator.CallOpts, header) +} + +// Validate is a free data retrieval call binding the contract method 0x39e9bce8. +// +// Solidity: function validate((bytes4,bytes32,bytes32,uint32,bytes8) header) pure returns(bytes) +func (_Blockheadervalidator *BlockheadervalidatorCallerSession) Validate(header BlockHeader) ([]byte, error) { + return _Blockheadervalidator.Contract.Validate(&_Blockheadervalidator.CallOpts, header) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockheadervalidator.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Blockheadervalidator *BlockheadervalidatorSession) RenounceOwnership() (*types.Transaction, error) { + return _Blockheadervalidator.Contract.RenounceOwnership(&_Blockheadervalidator.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Blockheadervalidator.Contract.RenounceOwnership(&_Blockheadervalidator.TransactOpts) +} + +// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. +// +// Solidity: function setAdhocNBits(uint32 nbits) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactor) SetAdhocNBits(opts *bind.TransactOpts, nbits uint32) (*types.Transaction, error) { + return _Blockheadervalidator.contract.Transact(opts, "setAdhocNBits", nbits) +} + +// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. +// +// Solidity: function setAdhocNBits(uint32 nbits) returns() +func (_Blockheadervalidator *BlockheadervalidatorSession) SetAdhocNBits(nbits uint32) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.SetAdhocNBits(&_Blockheadervalidator.TransactOpts, nbits) +} + +// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. +// +// Solidity: function setAdhocNBits(uint32 nbits) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactorSession) SetAdhocNBits(nbits uint32) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.SetAdhocNBits(&_Blockheadervalidator.TransactOpts, nbits) +} + +// SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. +// +// Solidity: function setOperator(address _operator) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactor) SetOperator(opts *bind.TransactOpts, _operator common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.contract.Transact(opts, "setOperator", _operator) +} + +// SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. +// +// Solidity: function setOperator(address _operator) returns() +func (_Blockheadervalidator *BlockheadervalidatorSession) SetOperator(_operator common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.SetOperator(&_Blockheadervalidator.TransactOpts, _operator) +} + +// SetOperator is a paid mutator transaction binding the contract method 0xb3ab15fb. +// +// Solidity: function setOperator(address _operator) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactorSession) SetOperator(_operator common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.SetOperator(&_Blockheadervalidator.TransactOpts, _operator) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Blockheadervalidator *BlockheadervalidatorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.TransferOwnership(&_Blockheadervalidator.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.TransferOwnership(&_Blockheadervalidator.TransactOpts, newOwner) +} + +// UpdateDuration is a paid mutator transaction binding the contract method 0x1b50ad09. +// +// Solidity: function updateDuration(uint256 duration) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactor) UpdateDuration(opts *bind.TransactOpts, duration *big.Int) (*types.Transaction, error) { + return _Blockheadervalidator.contract.Transact(opts, "updateDuration", duration) +} + +// UpdateDuration is a paid mutator transaction binding the contract method 0x1b50ad09. +// +// Solidity: function updateDuration(uint256 duration) returns() +func (_Blockheadervalidator *BlockheadervalidatorSession) UpdateDuration(duration *big.Int) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.UpdateDuration(&_Blockheadervalidator.TransactOpts, duration) +} + +// UpdateDuration is a paid mutator transaction binding the contract method 0x1b50ad09. +// +// Solidity: function updateDuration(uint256 duration) returns() +func (_Blockheadervalidator *BlockheadervalidatorTransactorSession) UpdateDuration(duration *big.Int) (*types.Transaction, error) { + return _Blockheadervalidator.Contract.UpdateDuration(&_Blockheadervalidator.TransactOpts, duration) +} + +// BlockheadervalidatorNBitsSetIterator is returned from FilterNBitsSet and is used to iterate over the raw logs and unpacked data for NBitsSet events raised by the Blockheadervalidator contract. +type BlockheadervalidatorNBitsSetIterator struct { + Event *BlockheadervalidatorNBitsSet // 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 *BlockheadervalidatorNBitsSetIterator) 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(BlockheadervalidatorNBitsSet) + 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(BlockheadervalidatorNBitsSet) + 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 *BlockheadervalidatorNBitsSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlockheadervalidatorNBitsSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlockheadervalidatorNBitsSet represents a NBitsSet event raised by the Blockheadervalidator contract. +type BlockheadervalidatorNBitsSet struct { + Nbits uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNBitsSet is a free log retrieval operation binding the contract event 0xe8dd26f51ea2466f2a2a2bad6b1065a8ba4f43f587f210d03bc7ee3c24b25a98. +// +// Solidity: event NBitsSet(uint32 nbits) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) FilterNBitsSet(opts *bind.FilterOpts) (*BlockheadervalidatorNBitsSetIterator, error) { + + logs, sub, err := _Blockheadervalidator.contract.FilterLogs(opts, "NBitsSet") + if err != nil { + return nil, err + } + return &BlockheadervalidatorNBitsSetIterator{contract: _Blockheadervalidator.contract, event: "NBitsSet", logs: logs, sub: sub}, nil +} + +// WatchNBitsSet is a free log subscription operation binding the contract event 0xe8dd26f51ea2466f2a2a2bad6b1065a8ba4f43f587f210d03bc7ee3c24b25a98. +// +// Solidity: event NBitsSet(uint32 nbits) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) WatchNBitsSet(opts *bind.WatchOpts, sink chan<- *BlockheadervalidatorNBitsSet) (event.Subscription, error) { + + logs, sub, err := _Blockheadervalidator.contract.WatchLogs(opts, "NBitsSet") + 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(BlockheadervalidatorNBitsSet) + if err := _Blockheadervalidator.contract.UnpackLog(event, "NBitsSet", 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 +} + +// ParseNBitsSet is a log parse operation binding the contract event 0xe8dd26f51ea2466f2a2a2bad6b1065a8ba4f43f587f210d03bc7ee3c24b25a98. +// +// Solidity: event NBitsSet(uint32 nbits) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) ParseNBitsSet(log types.Log) (*BlockheadervalidatorNBitsSet, error) { + event := new(BlockheadervalidatorNBitsSet) + if err := _Blockheadervalidator.contract.UnpackLog(event, "NBitsSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BlockheadervalidatorOperatorSetIterator is returned from FilterOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorSet events raised by the Blockheadervalidator contract. +type BlockheadervalidatorOperatorSetIterator struct { + Event *BlockheadervalidatorOperatorSet // 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 *BlockheadervalidatorOperatorSetIterator) 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(BlockheadervalidatorOperatorSet) + 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(BlockheadervalidatorOperatorSet) + 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 *BlockheadervalidatorOperatorSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlockheadervalidatorOperatorSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlockheadervalidatorOperatorSet represents a OperatorSet event raised by the Blockheadervalidator contract. +type BlockheadervalidatorOperatorSet struct { + Operator common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOperatorSet is a free log retrieval operation binding the contract event 0x99d737e0adf2c449d71890b86772885ec7959b152ddb265f76325b6e68e105d3. +// +// Solidity: event OperatorSet(address operator) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) FilterOperatorSet(opts *bind.FilterOpts) (*BlockheadervalidatorOperatorSetIterator, error) { + + logs, sub, err := _Blockheadervalidator.contract.FilterLogs(opts, "OperatorSet") + if err != nil { + return nil, err + } + return &BlockheadervalidatorOperatorSetIterator{contract: _Blockheadervalidator.contract, event: "OperatorSet", logs: logs, sub: sub}, nil +} + +// WatchOperatorSet is a free log subscription operation binding the contract event 0x99d737e0adf2c449d71890b86772885ec7959b152ddb265f76325b6e68e105d3. +// +// Solidity: event OperatorSet(address operator) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan<- *BlockheadervalidatorOperatorSet) (event.Subscription, error) { + + logs, sub, err := _Blockheadervalidator.contract.WatchLogs(opts, "OperatorSet") + 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(BlockheadervalidatorOperatorSet) + if err := _Blockheadervalidator.contract.UnpackLog(event, "OperatorSet", 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 +} + +// ParseOperatorSet is a log parse operation binding the contract event 0x99d737e0adf2c449d71890b86772885ec7959b152ddb265f76325b6e68e105d3. +// +// Solidity: event OperatorSet(address operator) +func (_Blockheadervalidator *BlockheadervalidatorFilterer) ParseOperatorSet(log types.Log) (*BlockheadervalidatorOperatorSet, error) { + event := new(BlockheadervalidatorOperatorSet) + if err := _Blockheadervalidator.contract.UnpackLog(event, "OperatorSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BlockheadervalidatorOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Blockheadervalidator contract. +type BlockheadervalidatorOwnershipTransferredIterator struct { + Event *BlockheadervalidatorOwnershipTransferred // 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 *BlockheadervalidatorOwnershipTransferredIterator) 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(BlockheadervalidatorOwnershipTransferred) + 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(BlockheadervalidatorOwnershipTransferred) + 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 *BlockheadervalidatorOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlockheadervalidatorOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlockheadervalidatorOwnershipTransferred represents a OwnershipTransferred event raised by the Blockheadervalidator contract. +type BlockheadervalidatorOwnershipTransferred 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 (_Blockheadervalidator *BlockheadervalidatorFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BlockheadervalidatorOwnershipTransferredIterator, 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 := _Blockheadervalidator.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &BlockheadervalidatorOwnershipTransferredIterator{contract: _Blockheadervalidator.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 (_Blockheadervalidator *BlockheadervalidatorFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BlockheadervalidatorOwnershipTransferred, 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 := _Blockheadervalidator.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(BlockheadervalidatorOwnershipTransferred) + if err := _Blockheadervalidator.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 (_Blockheadervalidator *BlockheadervalidatorFilterer) ParseOwnershipTransferred(log types.Log) (*BlockheadervalidatorOwnershipTransferred, error) { + event := new(BlockheadervalidatorOwnershipTransferred) + if err := _Blockheadervalidator.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/smartcontracts/go/minter/minter.abi b/smartcontracts/go/minter/minter.abi index a1712da8..648f21ab 100644 --- a/smartcontracts/go/minter/minter.abi +++ b/smartcontracts/go/minter/minter.abi @@ -9,7 +9,7 @@ "type": "uint256" } ], - "name": "BlockRewardfSet", + "name": "BlockRewardSet", "type": "event" }, { @@ -98,12 +98,12 @@ }, { "inputs": [], - "name": "currentNBits", + "name": "dao", "outputs": [ { - "internalType": "uint32", + "internalType": "contract IDAO", "name": "", - "type": "uint32" + "type": "address" } ], "stateMutability": "view", @@ -111,10 +111,10 @@ }, { "inputs": [], - "name": "dao", + "name": "distributor", "outputs": [ { - "internalType": "contract IDAO", + "internalType": "contract IBlockRewardDistributor", "name": "", "type": "address" } @@ -124,10 +124,10 @@ }, { "inputs": [], - "name": "distributor", + "name": "headerValidator", "outputs": [ { - "internalType": "contract IBlockRewardDistributor", + "internalType": "contract IBlockHeaderValidator", "name": "", "type": "address" } @@ -153,8 +153,8 @@ "type": "address" }, { - "internalType": "contract IScrypt", - "name": "_scrypt", + "internalType": "contract IBlockHeaderValidator", + "name": "_headerValidator", "type": "address" } ], @@ -193,8 +193,8 @@ "type": "bytes8" } ], - "internalType": "struct BlockInfo", - "name": "blockinfo", + "internalType": "struct BlockHeader", + "name": "header", "type": "tuple" }, { @@ -236,6 +236,11 @@ "name": "hash", "type": "bytes32" }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, { "internalType": "address", "name": "prover", @@ -252,25 +257,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "nbits", - "type": "uint32" - } - ], - "name": "nbitsToTarget", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, { "inputs": [], "name": "owner", @@ -291,19 +277,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "nbits", - "type": "uint32" - } - ], - "name": "setAdhocNBits", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -317,19 +290,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "setTargetDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -343,19 +303,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "targetDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "taskAllowance", @@ -394,18 +341,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [], - "name": "useAdhocNBits", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" } ] \ No newline at end of file diff --git a/smartcontracts/go/minter/minter.go b/smartcontracts/go/minter/minter.go index 187523a4..1991492d 100644 --- a/smartcontracts/go/minter/minter.go +++ b/smartcontracts/go/minter/minter.go @@ -29,8 +29,8 @@ var ( _ = abi.ConvertType ) -// BlockInfo is an auto generated low-level Go binding around an user-defined struct. -type BlockInfo struct { +// BlockHeader is an auto generated low-level Go binding around an user-defined struct. +type BlockHeader struct { Meta [4]byte Prevhash [32]byte MerkleRoot [32]byte @@ -50,12 +50,13 @@ type TaskAssignment struct { ProjectId *big.Int TaskId [32]byte Hash [32]byte + Signature []byte Prover common.Address } // MinterMetaData contains all meta data concerning the Minter contract. var MinterMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"name\":\"BlockRewardfSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"NBitsSet\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"TargetDurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"}],\"name\":\"TaskAllowanceSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"blockReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentNBits\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dao\",\"outputs\":[{\"internalType\":\"contractIDAO\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"distributor\",\"outputs\":[{\"internalType\":\"contractIBlockRewardDistributor\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIDAO\",\"name\":\"_dao\",\"type\":\"address\"},{\"internalType\":\"contractITaskManager\",\"name\":\"_taskManager\",\"type\":\"address\"},{\"internalType\":\"contractIBlockRewardDistributor\",\"name\":\"_distributor\",\"type\":\"address\"},{\"internalType\":\"contractIScrypt\",\"name\":\"_scrypt\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"meta\",\"type\":\"bytes4\"},{\"internalType\":\"bytes32\",\"name\":\"prevhash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"nonce\",\"type\":\"bytes8\"}],\"internalType\":\"structBlockInfo\",\"name\":\"blockinfo\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"internalType\":\"structSequencer\",\"name\":\"coinbase\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment[]\",\"name\":\"assignments\",\"type\":\"tuple[]\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"nbitsToTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"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\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"setAdhocNBits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"name\":\"setBlockReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"setTargetDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"}],\"name\":\"setTaskAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"targetDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"taskAllowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"taskManager\",\"outputs\":[{\"internalType\":\"contractITaskManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"useAdhocNBits\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"name\":\"BlockRewardSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"}],\"name\":\"NBitsSet\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"TargetDurationSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"}],\"name\":\"TaskAllowanceSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"blockReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dao\",\"outputs\":[{\"internalType\":\"contractIDAO\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"distributor\",\"outputs\":[{\"internalType\":\"contractIBlockRewardDistributor\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"headerValidator\",\"outputs\":[{\"internalType\":\"contractIBlockHeaderValidator\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIDAO\",\"name\":\"_dao\",\"type\":\"address\"},{\"internalType\":\"contractITaskManager\",\"name\":\"_taskManager\",\"type\":\"address\"},{\"internalType\":\"contractIBlockRewardDistributor\",\"name\":\"_distributor\",\"type\":\"address\"},{\"internalType\":\"contractIBlockHeaderValidator\",\"name\":\"_headerValidator\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"meta\",\"type\":\"bytes4\"},{\"internalType\":\"bytes32\",\"name\":\"prevhash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"nbits\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"nonce\",\"type\":\"bytes8\"}],\"internalType\":\"structBlockHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"internalType\":\"structSequencer\",\"name\":\"coinbase\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment[]\",\"name\":\"assignments\",\"type\":\"tuple[]\"}],\"name\":\"mint\",\"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\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"name\":\"setBlockReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"}],\"name\":\"setTaskAllowance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"taskAllowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"taskManager\",\"outputs\":[{\"internalType\":\"contractITaskManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // MinterABI is the input ABI used to generate the binding from. @@ -235,37 +236,6 @@ func (_Minter *MinterCallerSession) BlockReward() (*big.Int, error) { return _Minter.Contract.BlockReward(&_Minter.CallOpts) } -// CurrentNBits is a free data retrieval call binding the contract method 0x626a0ccb. -// -// Solidity: function currentNBits() view returns(uint32) -func (_Minter *MinterCaller) CurrentNBits(opts *bind.CallOpts) (uint32, error) { - var out []interface{} - err := _Minter.contract.Call(opts, &out, "currentNBits") - - if err != nil { - return *new(uint32), err - } - - out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) - - return out0, err - -} - -// CurrentNBits is a free data retrieval call binding the contract method 0x626a0ccb. -// -// Solidity: function currentNBits() view returns(uint32) -func (_Minter *MinterSession) CurrentNBits() (uint32, error) { - return _Minter.Contract.CurrentNBits(&_Minter.CallOpts) -} - -// CurrentNBits is a free data retrieval call binding the contract method 0x626a0ccb. -// -// Solidity: function currentNBits() view returns(uint32) -func (_Minter *MinterCallerSession) CurrentNBits() (uint32, error) { - return _Minter.Contract.CurrentNBits(&_Minter.CallOpts) -} - // Dao is a free data retrieval call binding the contract method 0x4162169f. // // Solidity: function dao() view returns(address) @@ -328,35 +298,35 @@ func (_Minter *MinterCallerSession) Distributor() (common.Address, error) { return _Minter.Contract.Distributor(&_Minter.CallOpts) } -// NbitsToTarget is a free data retrieval call binding the contract method 0x7b6194c6. +// HeaderValidator is a free data retrieval call binding the contract method 0xa7cc4d43. // -// Solidity: function nbitsToTarget(uint32 nbits) pure returns(uint256) -func (_Minter *MinterCaller) NbitsToTarget(opts *bind.CallOpts, nbits uint32) (*big.Int, error) { +// Solidity: function headerValidator() view returns(address) +func (_Minter *MinterCaller) HeaderValidator(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _Minter.contract.Call(opts, &out, "nbitsToTarget", nbits) + err := _Minter.contract.Call(opts, &out, "headerValidator") if err != nil { - return *new(*big.Int), err + return *new(common.Address), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) return out0, err } -// NbitsToTarget is a free data retrieval call binding the contract method 0x7b6194c6. +// HeaderValidator is a free data retrieval call binding the contract method 0xa7cc4d43. // -// Solidity: function nbitsToTarget(uint32 nbits) pure returns(uint256) -func (_Minter *MinterSession) NbitsToTarget(nbits uint32) (*big.Int, error) { - return _Minter.Contract.NbitsToTarget(&_Minter.CallOpts, nbits) +// Solidity: function headerValidator() view returns(address) +func (_Minter *MinterSession) HeaderValidator() (common.Address, error) { + return _Minter.Contract.HeaderValidator(&_Minter.CallOpts) } -// NbitsToTarget is a free data retrieval call binding the contract method 0x7b6194c6. +// HeaderValidator is a free data retrieval call binding the contract method 0xa7cc4d43. // -// Solidity: function nbitsToTarget(uint32 nbits) pure returns(uint256) -func (_Minter *MinterCallerSession) NbitsToTarget(nbits uint32) (*big.Int, error) { - return _Minter.Contract.NbitsToTarget(&_Minter.CallOpts, nbits) +// Solidity: function headerValidator() view returns(address) +func (_Minter *MinterCallerSession) HeaderValidator() (common.Address, error) { + return _Minter.Contract.HeaderValidator(&_Minter.CallOpts) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -390,37 +360,6 @@ func (_Minter *MinterCallerSession) Owner() (common.Address, error) { return _Minter.Contract.Owner(&_Minter.CallOpts) } -// TargetDuration is a free data retrieval call binding the contract method 0xf0cdec63. -// -// Solidity: function targetDuration() view returns(uint256) -func (_Minter *MinterCaller) TargetDuration(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Minter.contract.Call(opts, &out, "targetDuration") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// TargetDuration is a free data retrieval call binding the contract method 0xf0cdec63. -// -// Solidity: function targetDuration() view returns(uint256) -func (_Minter *MinterSession) TargetDuration() (*big.Int, error) { - return _Minter.Contract.TargetDuration(&_Minter.CallOpts) -} - -// TargetDuration is a free data retrieval call binding the contract method 0xf0cdec63. -// -// Solidity: function targetDuration() view returns(uint256) -func (_Minter *MinterCallerSession) TargetDuration() (*big.Int, error) { - return _Minter.Contract.TargetDuration(&_Minter.CallOpts) -} - // TaskAllowance is a free data retrieval call binding the contract method 0xb6c11e51. // // Solidity: function taskAllowance() view returns(uint256) @@ -483,77 +422,46 @@ func (_Minter *MinterCallerSession) TaskManager() (common.Address, error) { return _Minter.Contract.TaskManager(&_Minter.CallOpts) } -// UseAdhocNBits is a free data retrieval call binding the contract method 0xb415aa51. -// -// Solidity: function useAdhocNBits() view returns(bool) -func (_Minter *MinterCaller) UseAdhocNBits(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Minter.contract.Call(opts, &out, "useAdhocNBits") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// UseAdhocNBits is a free data retrieval call binding the contract method 0xb415aa51. -// -// Solidity: function useAdhocNBits() view returns(bool) -func (_Minter *MinterSession) UseAdhocNBits() (bool, error) { - return _Minter.Contract.UseAdhocNBits(&_Minter.CallOpts) -} - -// UseAdhocNBits is a free data retrieval call binding the contract method 0xb415aa51. -// -// Solidity: function useAdhocNBits() view returns(bool) -func (_Minter *MinterCallerSession) UseAdhocNBits() (bool, error) { - return _Minter.Contract.UseAdhocNBits(&_Minter.CallOpts) -} - // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // -// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _scrypt) returns() -func (_Minter *MinterTransactor) Initialize(opts *bind.TransactOpts, _dao common.Address, _taskManager common.Address, _distributor common.Address, _scrypt common.Address) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "initialize", _dao, _taskManager, _distributor, _scrypt) +// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _headerValidator) returns() +func (_Minter *MinterTransactor) Initialize(opts *bind.TransactOpts, _dao common.Address, _taskManager common.Address, _distributor common.Address, _headerValidator common.Address) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "initialize", _dao, _taskManager, _distributor, _headerValidator) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // -// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _scrypt) returns() -func (_Minter *MinterSession) Initialize(_dao common.Address, _taskManager common.Address, _distributor common.Address, _scrypt common.Address) (*types.Transaction, error) { - return _Minter.Contract.Initialize(&_Minter.TransactOpts, _dao, _taskManager, _distributor, _scrypt) +// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _headerValidator) returns() +func (_Minter *MinterSession) Initialize(_dao common.Address, _taskManager common.Address, _distributor common.Address, _headerValidator common.Address) (*types.Transaction, error) { + return _Minter.Contract.Initialize(&_Minter.TransactOpts, _dao, _taskManager, _distributor, _headerValidator) } // Initialize is a paid mutator transaction binding the contract method 0xf8c8765e. // -// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _scrypt) returns() -func (_Minter *MinterTransactorSession) Initialize(_dao common.Address, _taskManager common.Address, _distributor common.Address, _scrypt common.Address) (*types.Transaction, error) { - return _Minter.Contract.Initialize(&_Minter.TransactOpts, _dao, _taskManager, _distributor, _scrypt) +// Solidity: function initialize(address _dao, address _taskManager, address _distributor, address _headerValidator) returns() +func (_Minter *MinterTransactorSession) Initialize(_dao common.Address, _taskManager common.Address, _distributor common.Address, _headerValidator common.Address) (*types.Transaction, error) { + return _Minter.Contract.Initialize(&_Minter.TransactOpts, _dao, _taskManager, _distributor, _headerValidator) } -// Mint is a paid mutator transaction binding the contract method 0x50f6582a. +// Mint is a paid mutator transaction binding the contract method 0x26fa1c47. // -// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) blockinfo, (address,address,address) coinbase, (uint256,bytes32,bytes32,address)[] assignments) returns() -func (_Minter *MinterTransactor) Mint(opts *bind.TransactOpts, blockinfo BlockInfo, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "mint", blockinfo, coinbase, assignments) +// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) header, (address,address,address) coinbase, (uint256,bytes32,bytes32,bytes,address)[] assignments) returns() +func (_Minter *MinterTransactor) Mint(opts *bind.TransactOpts, header BlockHeader, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { + return _Minter.contract.Transact(opts, "mint", header, coinbase, assignments) } -// Mint is a paid mutator transaction binding the contract method 0x50f6582a. +// Mint is a paid mutator transaction binding the contract method 0x26fa1c47. // -// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) blockinfo, (address,address,address) coinbase, (uint256,bytes32,bytes32,address)[] assignments) returns() -func (_Minter *MinterSession) Mint(blockinfo BlockInfo, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { - return _Minter.Contract.Mint(&_Minter.TransactOpts, blockinfo, coinbase, assignments) +// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) header, (address,address,address) coinbase, (uint256,bytes32,bytes32,bytes,address)[] assignments) returns() +func (_Minter *MinterSession) Mint(header BlockHeader, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { + return _Minter.Contract.Mint(&_Minter.TransactOpts, header, coinbase, assignments) } -// Mint is a paid mutator transaction binding the contract method 0x50f6582a. +// Mint is a paid mutator transaction binding the contract method 0x26fa1c47. // -// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) blockinfo, (address,address,address) coinbase, (uint256,bytes32,bytes32,address)[] assignments) returns() -func (_Minter *MinterTransactorSession) Mint(blockinfo BlockInfo, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { - return _Minter.Contract.Mint(&_Minter.TransactOpts, blockinfo, coinbase, assignments) +// Solidity: function mint((bytes4,bytes32,bytes32,uint32,bytes8) header, (address,address,address) coinbase, (uint256,bytes32,bytes32,bytes,address)[] assignments) returns() +func (_Minter *MinterTransactorSession) Mint(header BlockHeader, coinbase Sequencer, assignments []TaskAssignment) (*types.Transaction, error) { + return _Minter.Contract.Mint(&_Minter.TransactOpts, header, coinbase, assignments) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -577,27 +485,6 @@ func (_Minter *MinterTransactorSession) RenounceOwnership() (*types.Transaction, return _Minter.Contract.RenounceOwnership(&_Minter.TransactOpts) } -// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. -// -// Solidity: function setAdhocNBits(uint32 nbits) returns() -func (_Minter *MinterTransactor) SetAdhocNBits(opts *bind.TransactOpts, nbits uint32) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "setAdhocNBits", nbits) -} - -// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. -// -// Solidity: function setAdhocNBits(uint32 nbits) returns() -func (_Minter *MinterSession) SetAdhocNBits(nbits uint32) (*types.Transaction, error) { - return _Minter.Contract.SetAdhocNBits(&_Minter.TransactOpts, nbits) -} - -// SetAdhocNBits is a paid mutator transaction binding the contract method 0xe115953c. -// -// Solidity: function setAdhocNBits(uint32 nbits) returns() -func (_Minter *MinterTransactorSession) SetAdhocNBits(nbits uint32) (*types.Transaction, error) { - return _Minter.Contract.SetAdhocNBits(&_Minter.TransactOpts, nbits) -} - // SetBlockReward is a paid mutator transaction binding the contract method 0x1a18e707. // // Solidity: function setBlockReward(uint256 reward) returns() @@ -619,27 +506,6 @@ func (_Minter *MinterTransactorSession) SetBlockReward(reward *big.Int) (*types. return _Minter.Contract.SetBlockReward(&_Minter.TransactOpts, reward) } -// SetTargetDuration is a paid mutator transaction binding the contract method 0xa00171ea. -// -// Solidity: function setTargetDuration(uint256 duration) returns() -func (_Minter *MinterTransactor) SetTargetDuration(opts *bind.TransactOpts, duration *big.Int) (*types.Transaction, error) { - return _Minter.contract.Transact(opts, "setTargetDuration", duration) -} - -// SetTargetDuration is a paid mutator transaction binding the contract method 0xa00171ea. -// -// Solidity: function setTargetDuration(uint256 duration) returns() -func (_Minter *MinterSession) SetTargetDuration(duration *big.Int) (*types.Transaction, error) { - return _Minter.Contract.SetTargetDuration(&_Minter.TransactOpts, duration) -} - -// SetTargetDuration is a paid mutator transaction binding the contract method 0xa00171ea. -// -// Solidity: function setTargetDuration(uint256 duration) returns() -func (_Minter *MinterTransactorSession) SetTargetDuration(duration *big.Int) (*types.Transaction, error) { - return _Minter.Contract.SetTargetDuration(&_Minter.TransactOpts, duration) -} - // SetTaskAllowance is a paid mutator transaction binding the contract method 0x92d894ec. // // Solidity: function setTaskAllowance(uint256 allowance) returns() @@ -682,9 +548,9 @@ func (_Minter *MinterTransactorSession) TransferOwnership(newOwner common.Addres return _Minter.Contract.TransferOwnership(&_Minter.TransactOpts, newOwner) } -// MinterBlockRewardfSetIterator is returned from FilterBlockRewardfSet and is used to iterate over the raw logs and unpacked data for BlockRewardfSet events raised by the Minter contract. -type MinterBlockRewardfSetIterator struct { - Event *MinterBlockRewardfSet // Event containing the contract specifics and raw log +// MinterBlockRewardSetIterator is returned from FilterBlockRewardSet and is used to iterate over the raw logs and unpacked data for BlockRewardSet events raised by the Minter contract. +type MinterBlockRewardSetIterator struct { + Event *MinterBlockRewardSet // 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 @@ -698,7 +564,7 @@ type MinterBlockRewardfSetIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *MinterBlockRewardfSetIterator) Next() bool { +func (it *MinterBlockRewardSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -707,7 +573,7 @@ func (it *MinterBlockRewardfSetIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(MinterBlockRewardfSet) + it.Event = new(MinterBlockRewardSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -722,7 +588,7 @@ func (it *MinterBlockRewardfSetIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(MinterBlockRewardfSet) + it.Event = new(MinterBlockRewardSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -738,41 +604,41 @@ func (it *MinterBlockRewardfSetIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *MinterBlockRewardfSetIterator) Error() error { +func (it *MinterBlockRewardSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *MinterBlockRewardfSetIterator) Close() error { +func (it *MinterBlockRewardSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// MinterBlockRewardfSet represents a BlockRewardfSet event raised by the Minter contract. -type MinterBlockRewardfSet struct { +// MinterBlockRewardSet represents a BlockRewardSet event raised by the Minter contract. +type MinterBlockRewardSet struct { Reward *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterBlockRewardfSet is a free log retrieval operation binding the contract event 0x92121bd60c0061b634208f9f1b60e75a6bd603348031e3df06d29d2cbef32a55. +// FilterBlockRewardSet is a free log retrieval operation binding the contract event 0xb54abaa50fadd2086c578558d4ecb1890a97696c927a0e7dbd9417704d8a2c55. // -// Solidity: event BlockRewardfSet(uint256 reward) -func (_Minter *MinterFilterer) FilterBlockRewardfSet(opts *bind.FilterOpts) (*MinterBlockRewardfSetIterator, error) { +// Solidity: event BlockRewardSet(uint256 reward) +func (_Minter *MinterFilterer) FilterBlockRewardSet(opts *bind.FilterOpts) (*MinterBlockRewardSetIterator, error) { - logs, sub, err := _Minter.contract.FilterLogs(opts, "BlockRewardfSet") + logs, sub, err := _Minter.contract.FilterLogs(opts, "BlockRewardSet") if err != nil { return nil, err } - return &MinterBlockRewardfSetIterator{contract: _Minter.contract, event: "BlockRewardfSet", logs: logs, sub: sub}, nil + return &MinterBlockRewardSetIterator{contract: _Minter.contract, event: "BlockRewardSet", logs: logs, sub: sub}, nil } -// WatchBlockRewardfSet is a free log subscription operation binding the contract event 0x92121bd60c0061b634208f9f1b60e75a6bd603348031e3df06d29d2cbef32a55. +// WatchBlockRewardSet is a free log subscription operation binding the contract event 0xb54abaa50fadd2086c578558d4ecb1890a97696c927a0e7dbd9417704d8a2c55. // -// Solidity: event BlockRewardfSet(uint256 reward) -func (_Minter *MinterFilterer) WatchBlockRewardfSet(opts *bind.WatchOpts, sink chan<- *MinterBlockRewardfSet) (event.Subscription, error) { +// Solidity: event BlockRewardSet(uint256 reward) +func (_Minter *MinterFilterer) WatchBlockRewardSet(opts *bind.WatchOpts, sink chan<- *MinterBlockRewardSet) (event.Subscription, error) { - logs, sub, err := _Minter.contract.WatchLogs(opts, "BlockRewardfSet") + logs, sub, err := _Minter.contract.WatchLogs(opts, "BlockRewardSet") if err != nil { return nil, err } @@ -782,8 +648,8 @@ func (_Minter *MinterFilterer) WatchBlockRewardfSet(opts *bind.WatchOpts, sink c select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(MinterBlockRewardfSet) - if err := _Minter.contract.UnpackLog(event, "BlockRewardfSet", log); err != nil { + event := new(MinterBlockRewardSet) + if err := _Minter.contract.UnpackLog(event, "BlockRewardSet", log); err != nil { return err } event.Raw = log @@ -804,12 +670,12 @@ func (_Minter *MinterFilterer) WatchBlockRewardfSet(opts *bind.WatchOpts, sink c }), nil } -// ParseBlockRewardfSet is a log parse operation binding the contract event 0x92121bd60c0061b634208f9f1b60e75a6bd603348031e3df06d29d2cbef32a55. +// ParseBlockRewardSet is a log parse operation binding the contract event 0xb54abaa50fadd2086c578558d4ecb1890a97696c927a0e7dbd9417704d8a2c55. // -// Solidity: event BlockRewardfSet(uint256 reward) -func (_Minter *MinterFilterer) ParseBlockRewardfSet(log types.Log) (*MinterBlockRewardfSet, error) { - event := new(MinterBlockRewardfSet) - if err := _Minter.contract.UnpackLog(event, "BlockRewardfSet", log); err != nil { +// Solidity: event BlockRewardSet(uint256 reward) +func (_Minter *MinterFilterer) ParseBlockRewardSet(log types.Log) (*MinterBlockRewardSet, error) { + event := new(MinterBlockRewardSet) + if err := _Minter.contract.UnpackLog(event, "BlockRewardSet", log); err != nil { return nil, err } event.Raw = log diff --git a/smartcontracts/go/prover/prover.abi b/smartcontracts/go/prover/prover.abi index 58899355..125863b5 100644 --- a/smartcontracts/go/prover/prover.abi +++ b/smartcontracts/go/prover/prover.abi @@ -5,48 +5,17 @@ { "indexed": true, "internalType": "address", - "name": "owner", + "name": "prover", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "approved", + "name": "beneficiary", "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" } ], - "name": "ApprovalForAll", + "name": "BeneficiarySet", "type": "event" }, { @@ -62,38 +31,6 @@ "name": "Initialized", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "MinterSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "OperatorSet", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -118,9 +55,9 @@ "inputs": [ { "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" + "internalType": "address", + "name": "prover", + "type": "address" } ], "name": "ProverPaused", @@ -131,9 +68,9 @@ "inputs": [ { "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" + "internalType": "address", + "name": "prover", + "type": "address" } ], "name": "ProverResumed", @@ -145,23 +82,17 @@ { "indexed": true, "internalType": "address", - "name": "from", + "name": "prover", "type": "address" }, { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" + "indexed": false, + "internalType": "uint16", + "name": "ratio", + "type": "uint16" } ], - "name": "Transfer", + "name": "RebateRatioSet", "type": "event" }, { @@ -169,9 +100,9 @@ "inputs": [ { "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" + "internalType": "address", + "name": "prover", + "type": "address" }, { "indexed": false, @@ -188,9 +119,9 @@ "inputs": [ { "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" + "internalType": "address", + "name": "prover", + "type": "address" }, { "indexed": false, @@ -204,11 +135,6 @@ }, { "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - }, { "internalType": "uint256", "name": "_type", @@ -224,34 +150,16 @@ "inputs": [ { "internalType": "address", - "name": "to", + "name": "_prover", "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" } ], - "name": "approve", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", + "name": "beneficiary", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -259,42 +167,19 @@ }, { "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - }, { "internalType": "address", - "name": "_operator", + "name": "_beneficiary", "type": "address" } ], - "name": "changeOperator", + "name": "changeBeneficiary", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "count", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - }, { "internalType": "uint256", "name": "_type", @@ -307,37 +192,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "getApproved", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], + "inputs": [], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", @@ -347,34 +202,10 @@ "inputs": [ { "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", + "name": "_prover", "type": "address" } ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], "name": "isPaused", "outputs": [ { @@ -389,9 +220,9 @@ { "inputs": [ { - "internalType": "uint256", - "name": "_id", - "type": "uint256" + "internalType": "address", + "name": "_prover", + "type": "address" }, { "internalType": "uint256", @@ -410,70 +241,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "id_", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "minter", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], - "name": "operator", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "owner", @@ -488,80 +255,38 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ownerOf", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "_operator", + "name": "_prover", "type": "address" } ], - "name": "ownerOfOperator", + "name": "rebateRatio", "outputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", + "internalType": "uint16", "name": "", - "type": "address" + "type": "uint16" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], - "name": "pause", + "inputs": [], + "name": "register", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], - "name": "prover", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "renounceOwnership", @@ -570,13 +295,7 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], + "inputs": [], "name": "resume", "outputs": [], "stateMutability": "nonpayable", @@ -585,155 +304,12 @@ { "inputs": [ { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_minter", - "type": "address" - } - ], - "name": "setMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "tokenURI", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" + "internalType": "uint16", + "name": "_ratio", + "type": "uint16" } ], - "name": "transferFrom", + "name": "setRebateRatio", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/smartcontracts/go/prover/prover.go b/smartcontracts/go/prover/prover.go index 16350705..316aa003 100644 --- a/smartcontracts/go/prover/prover.go +++ b/smartcontracts/go/prover/prover.go @@ -31,7 +31,7 @@ var ( // ProverMetaData contains all meta data concerning the Prover contract. var ProverMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"MinterSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorSet\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"ProverPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"ProverResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"VMTypeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"VMTypeDeleted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"addVMType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"changeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"delVMType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"isVMTypeSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"operator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_operator\",\"type\":\"address\"}],\"name\":\"ownerOfOperator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"prover\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_minter\",\"type\":\"address\"}],\"name\":\"setMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"BeneficiarySet\",\"type\":\"event\"},{\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"ProverPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"ProverResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"ratio\",\"type\":\"uint16\"}],\"name\":\"RebateRatioSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"VMTypeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"VMTypeDeleted\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"addVMType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_prover\",\"type\":\"address\"}],\"name\":\"beneficiary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"}],\"name\":\"changeBeneficiary\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"delVMType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_prover\",\"type\":\"address\"}],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_prover\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"isVMTypeSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_prover\",\"type\":\"address\"}],\"name\":\"rebateRatio\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_ratio\",\"type\":\"uint16\"}],\"name\":\"setRebateRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // ProverABI is the input ABI used to generate the binding from. @@ -180,74 +180,12 @@ func (_Prover *ProverTransactorRaw) Transact(opts *bind.TransactOpts, method str return _Prover.Contract.contract.Transact(opts, method, params...) } -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// Beneficiary is a free data retrieval call binding the contract method 0x81008568. // -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Prover *ProverCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { +// Solidity: function beneficiary(address _prover) view returns(address) +func (_Prover *ProverCaller) Beneficiary(opts *bind.CallOpts, _prover common.Address) (common.Address, error) { var out []interface{} - err := _Prover.contract.Call(opts, &out, "balanceOf", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Prover *ProverSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Prover.Contract.BalanceOf(&_Prover.CallOpts, owner) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address owner) view returns(uint256) -func (_Prover *ProverCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { - return _Prover.Contract.BalanceOf(&_Prover.CallOpts, owner) -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Prover *ProverCaller) Count(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "count") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Prover *ProverSession) Count() (*big.Int, error) { - return _Prover.Contract.Count(&_Prover.CallOpts) -} - -// Count is a free data retrieval call binding the contract method 0x06661abd. -// -// Solidity: function count() view returns(uint256) -func (_Prover *ProverCallerSession) Count() (*big.Int, error) { - return _Prover.Contract.Count(&_Prover.CallOpts) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Prover *ProverCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "getApproved", tokenId) + err := _Prover.contract.Call(opts, &out, "beneficiary", _prover) if err != nil { return *new(common.Address), err @@ -259,57 +197,26 @@ func (_Prover *ProverCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) } -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Prover *ProverSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Prover.Contract.GetApproved(&_Prover.CallOpts, tokenId) -} - -// GetApproved is a free data retrieval call binding the contract method 0x081812fc. -// -// Solidity: function getApproved(uint256 tokenId) view returns(address) -func (_Prover *ProverCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { - return _Prover.Contract.GetApproved(&_Prover.CallOpts, tokenId) -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. -// -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Prover *ProverCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "isApprovedForAll", owner, operator) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. +// Beneficiary is a free data retrieval call binding the contract method 0x81008568. // -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Prover *ProverSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Prover.Contract.IsApprovedForAll(&_Prover.CallOpts, owner, operator) +// Solidity: function beneficiary(address _prover) view returns(address) +func (_Prover *ProverSession) Beneficiary(_prover common.Address) (common.Address, error) { + return _Prover.Contract.Beneficiary(&_Prover.CallOpts, _prover) } -// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. +// Beneficiary is a free data retrieval call binding the contract method 0x81008568. // -// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) -func (_Prover *ProverCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { - return _Prover.Contract.IsApprovedForAll(&_Prover.CallOpts, owner, operator) +// Solidity: function beneficiary(address _prover) view returns(address) +func (_Prover *ProverCallerSession) Beneficiary(_prover common.Address) (common.Address, error) { + return _Prover.Contract.Beneficiary(&_Prover.CallOpts, _prover) } -// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// IsPaused is a free data retrieval call binding the contract method 0x5b14f183. // -// Solidity: function isPaused(uint256 _id) view returns(bool) -func (_Prover *ProverCaller) IsPaused(opts *bind.CallOpts, _id *big.Int) (bool, error) { +// Solidity: function isPaused(address _prover) view returns(bool) +func (_Prover *ProverCaller) IsPaused(opts *bind.CallOpts, _prover common.Address) (bool, error) { var out []interface{} - err := _Prover.contract.Call(opts, &out, "isPaused", _id) + err := _Prover.contract.Call(opts, &out, "isPaused", _prover) if err != nil { return *new(bool), err @@ -321,26 +228,26 @@ func (_Prover *ProverCaller) IsPaused(opts *bind.CallOpts, _id *big.Int) (bool, } -// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// IsPaused is a free data retrieval call binding the contract method 0x5b14f183. // -// Solidity: function isPaused(uint256 _id) view returns(bool) -func (_Prover *ProverSession) IsPaused(_id *big.Int) (bool, error) { - return _Prover.Contract.IsPaused(&_Prover.CallOpts, _id) +// Solidity: function isPaused(address _prover) view returns(bool) +func (_Prover *ProverSession) IsPaused(_prover common.Address) (bool, error) { + return _Prover.Contract.IsPaused(&_Prover.CallOpts, _prover) } -// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// IsPaused is a free data retrieval call binding the contract method 0x5b14f183. // -// Solidity: function isPaused(uint256 _id) view returns(bool) -func (_Prover *ProverCallerSession) IsPaused(_id *big.Int) (bool, error) { - return _Prover.Contract.IsPaused(&_Prover.CallOpts, _id) +// Solidity: function isPaused(address _prover) view returns(bool) +func (_Prover *ProverCallerSession) IsPaused(_prover common.Address) (bool, error) { + return _Prover.Contract.IsPaused(&_Prover.CallOpts, _prover) } -// IsVMTypeSupported is a free data retrieval call binding the contract method 0x6d968739. +// IsVMTypeSupported is a free data retrieval call binding the contract method 0x17490cbc. // -// Solidity: function isVMTypeSupported(uint256 _id, uint256 _type) view returns(bool) -func (_Prover *ProverCaller) IsVMTypeSupported(opts *bind.CallOpts, _id *big.Int, _type *big.Int) (bool, error) { +// Solidity: function isVMTypeSupported(address _prover, uint256 _type) view returns(bool) +func (_Prover *ProverCaller) IsVMTypeSupported(opts *bind.CallOpts, _prover common.Address, _type *big.Int) (bool, error) { var out []interface{} - err := _Prover.contract.Call(opts, &out, "isVMTypeSupported", _id, _type) + err := _Prover.contract.Call(opts, &out, "isVMTypeSupported", _prover, _type) if err != nil { return *new(bool), err @@ -352,111 +259,18 @@ func (_Prover *ProverCaller) IsVMTypeSupported(opts *bind.CallOpts, _id *big.Int } -// IsVMTypeSupported is a free data retrieval call binding the contract method 0x6d968739. -// -// Solidity: function isVMTypeSupported(uint256 _id, uint256 _type) view returns(bool) -func (_Prover *ProverSession) IsVMTypeSupported(_id *big.Int, _type *big.Int) (bool, error) { - return _Prover.Contract.IsVMTypeSupported(&_Prover.CallOpts, _id, _type) -} - -// IsVMTypeSupported is a free data retrieval call binding the contract method 0x6d968739. -// -// Solidity: function isVMTypeSupported(uint256 _id, uint256 _type) view returns(bool) -func (_Prover *ProverCallerSession) IsVMTypeSupported(_id *big.Int, _type *big.Int) (bool, error) { - return _Prover.Contract.IsVMTypeSupported(&_Prover.CallOpts, _id, _type) -} - -// Minter is a free data retrieval call binding the contract method 0x07546172. -// -// Solidity: function minter() view returns(address) -func (_Prover *ProverCaller) Minter(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "minter") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Minter is a free data retrieval call binding the contract method 0x07546172. -// -// Solidity: function minter() view returns(address) -func (_Prover *ProverSession) Minter() (common.Address, error) { - return _Prover.Contract.Minter(&_Prover.CallOpts) -} - -// Minter is a free data retrieval call binding the contract method 0x07546172. -// -// Solidity: function minter() view returns(address) -func (_Prover *ProverCallerSession) Minter() (common.Address, error) { - return _Prover.Contract.Minter(&_Prover.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Prover *ProverCaller) Name(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "name") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Prover *ProverSession) Name() (string, error) { - return _Prover.Contract.Name(&_Prover.CallOpts) -} - -// Name is a free data retrieval call binding the contract method 0x06fdde03. -// -// Solidity: function name() view returns(string) -func (_Prover *ProverCallerSession) Name() (string, error) { - return _Prover.Contract.Name(&_Prover.CallOpts) -} - -// Operator is a free data retrieval call binding the contract method 0xab3d047f. -// -// Solidity: function operator(uint256 _id) view returns(address) -func (_Prover *ProverCaller) Operator(opts *bind.CallOpts, _id *big.Int) (common.Address, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "operator", _id) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Operator is a free data retrieval call binding the contract method 0xab3d047f. +// IsVMTypeSupported is a free data retrieval call binding the contract method 0x17490cbc. // -// Solidity: function operator(uint256 _id) view returns(address) -func (_Prover *ProverSession) Operator(_id *big.Int) (common.Address, error) { - return _Prover.Contract.Operator(&_Prover.CallOpts, _id) +// Solidity: function isVMTypeSupported(address _prover, uint256 _type) view returns(bool) +func (_Prover *ProverSession) IsVMTypeSupported(_prover common.Address, _type *big.Int) (bool, error) { + return _Prover.Contract.IsVMTypeSupported(&_Prover.CallOpts, _prover, _type) } -// Operator is a free data retrieval call binding the contract method 0xab3d047f. +// IsVMTypeSupported is a free data retrieval call binding the contract method 0x17490cbc. // -// Solidity: function operator(uint256 _id) view returns(address) -func (_Prover *ProverCallerSession) Operator(_id *big.Int) (common.Address, error) { - return _Prover.Contract.Operator(&_Prover.CallOpts, _id) +// Solidity: function isVMTypeSupported(address _prover, uint256 _type) view returns(bool) +func (_Prover *ProverCallerSession) IsVMTypeSupported(_prover common.Address, _type *big.Int) (bool, error) { + return _Prover.Contract.IsVMTypeSupported(&_Prover.CallOpts, _prover, _type) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -490,961 +304,250 @@ func (_Prover *ProverCallerSession) Owner() (common.Address, error) { return _Prover.Contract.Owner(&_Prover.CallOpts) } -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. +// RebateRatio is a free data retrieval call binding the contract method 0xff763ceb. // -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Prover *ProverCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { +// Solidity: function rebateRatio(address _prover) view returns(uint16) +func (_Prover *ProverCaller) RebateRatio(opts *bind.CallOpts, _prover common.Address) (uint16, error) { var out []interface{} - err := _Prover.contract.Call(opts, &out, "ownerOf", tokenId) + err := _Prover.contract.Call(opts, &out, "rebateRatio", _prover) if err != nil { - return *new(common.Address), err + return *new(uint16), err } - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) return out0, err } -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Prover *ProverSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Prover.Contract.OwnerOf(&_Prover.CallOpts, tokenId) -} - -// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. -// -// Solidity: function ownerOf(uint256 tokenId) view returns(address) -func (_Prover *ProverCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { - return _Prover.Contract.OwnerOf(&_Prover.CallOpts, tokenId) -} - -// OwnerOfOperator is a free data retrieval call binding the contract method 0xaeb44406. -// -// Solidity: function ownerOfOperator(address _operator) view returns(uint256, address) -func (_Prover *ProverCaller) OwnerOfOperator(opts *bind.CallOpts, _operator common.Address) (*big.Int, common.Address, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "ownerOfOperator", _operator) - - if err != nil { - return *new(*big.Int), *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - out1 := *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - - return out0, out1, err - -} - -// OwnerOfOperator is a free data retrieval call binding the contract method 0xaeb44406. -// -// Solidity: function ownerOfOperator(address _operator) view returns(uint256, address) -func (_Prover *ProverSession) OwnerOfOperator(_operator common.Address) (*big.Int, common.Address, error) { - return _Prover.Contract.OwnerOfOperator(&_Prover.CallOpts, _operator) -} - -// OwnerOfOperator is a free data retrieval call binding the contract method 0xaeb44406. -// -// Solidity: function ownerOfOperator(address _operator) view returns(uint256, address) -func (_Prover *ProverCallerSession) OwnerOfOperator(_operator common.Address) (*big.Int, common.Address, error) { - return _Prover.Contract.OwnerOfOperator(&_Prover.CallOpts, _operator) -} - -// Prover is a free data retrieval call binding the contract method 0x2becbd3e. -// -// Solidity: function prover(uint256 _id) view returns(address) -func (_Prover *ProverCaller) Prover(opts *bind.CallOpts, _id *big.Int) (common.Address, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "prover", _id) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Prover is a free data retrieval call binding the contract method 0x2becbd3e. -// -// Solidity: function prover(uint256 _id) view returns(address) -func (_Prover *ProverSession) Prover(_id *big.Int) (common.Address, error) { - return _Prover.Contract.Prover(&_Prover.CallOpts, _id) -} - -// Prover is a free data retrieval call binding the contract method 0x2becbd3e. -// -// Solidity: function prover(uint256 _id) view returns(address) -func (_Prover *ProverCallerSession) Prover(_id *big.Int) (common.Address, error) { - return _Prover.Contract.Prover(&_Prover.CallOpts, _id) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Prover *ProverCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Prover *ProverSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Prover.Contract.SupportsInterface(&_Prover.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Prover *ProverCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Prover.Contract.SupportsInterface(&_Prover.CallOpts, interfaceId) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Prover *ProverCaller) Symbol(opts *bind.CallOpts) (string, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "symbol") - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Prover *ProverSession) Symbol() (string, error) { - return _Prover.Contract.Symbol(&_Prover.CallOpts) -} - -// Symbol is a free data retrieval call binding the contract method 0x95d89b41. -// -// Solidity: function symbol() view returns(string) -func (_Prover *ProverCallerSession) Symbol() (string, error) { - return _Prover.Contract.Symbol(&_Prover.CallOpts) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Prover *ProverCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { - var out []interface{} - err := _Prover.contract.Call(opts, &out, "tokenURI", tokenId) - - if err != nil { - return *new(string), err - } - - out0 := *abi.ConvertType(out[0], new(string)).(*string) - - return out0, err - -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Prover *ProverSession) TokenURI(tokenId *big.Int) (string, error) { - return _Prover.Contract.TokenURI(&_Prover.CallOpts, tokenId) -} - -// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. -// -// Solidity: function tokenURI(uint256 tokenId) view returns(string) -func (_Prover *ProverCallerSession) TokenURI(tokenId *big.Int) (string, error) { - return _Prover.Contract.TokenURI(&_Prover.CallOpts, tokenId) -} - -// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. -// -// Solidity: function addVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverTransactor) AddVMType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "addVMType", _id, _type) -} - -// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. -// -// Solidity: function addVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverSession) AddVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.Contract.AddVMType(&_Prover.TransactOpts, _id, _type) -} - -// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. -// -// Solidity: function addVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverTransactorSession) AddVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.Contract.AddVMType(&_Prover.TransactOpts, _id, _type) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Prover *ProverTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "approve", to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Prover *ProverSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Approve(&_Prover.TransactOpts, to, tokenId) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address to, uint256 tokenId) returns() -func (_Prover *ProverTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Approve(&_Prover.TransactOpts, to, tokenId) -} - -// ChangeOperator is a paid mutator transaction binding the contract method 0x7a3bc817. -// -// Solidity: function changeOperator(uint256 _id, address _operator) returns() -func (_Prover *ProverTransactor) ChangeOperator(opts *bind.TransactOpts, _id *big.Int, _operator common.Address) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "changeOperator", _id, _operator) -} - -// ChangeOperator is a paid mutator transaction binding the contract method 0x7a3bc817. -// -// Solidity: function changeOperator(uint256 _id, address _operator) returns() -func (_Prover *ProverSession) ChangeOperator(_id *big.Int, _operator common.Address) (*types.Transaction, error) { - return _Prover.Contract.ChangeOperator(&_Prover.TransactOpts, _id, _operator) -} - -// ChangeOperator is a paid mutator transaction binding the contract method 0x7a3bc817. -// -// Solidity: function changeOperator(uint256 _id, address _operator) returns() -func (_Prover *ProverTransactorSession) ChangeOperator(_id *big.Int, _operator common.Address) (*types.Transaction, error) { - return _Prover.Contract.ChangeOperator(&_Prover.TransactOpts, _id, _operator) -} - -// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. -// -// Solidity: function delVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverTransactor) DelVMType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "delVMType", _id, _type) -} - -// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. -// -// Solidity: function delVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverSession) DelVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.Contract.DelVMType(&_Prover.TransactOpts, _id, _type) -} - -// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. -// -// Solidity: function delVMType(uint256 _id, uint256 _type) returns() -func (_Prover *ProverTransactorSession) DelVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _Prover.Contract.DelVMType(&_Prover.TransactOpts, _id, _type) -} - -// Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. -// -// Solidity: function initialize(string _name, string _symbol) returns() -func (_Prover *ProverTransactor) Initialize(opts *bind.TransactOpts, _name string, _symbol string) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "initialize", _name, _symbol) -} - -// Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. -// -// Solidity: function initialize(string _name, string _symbol) returns() -func (_Prover *ProverSession) Initialize(_name string, _symbol string) (*types.Transaction, error) { - return _Prover.Contract.Initialize(&_Prover.TransactOpts, _name, _symbol) -} - -// Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. -// -// Solidity: function initialize(string _name, string _symbol) returns() -func (_Prover *ProverTransactorSession) Initialize(_name string, _symbol string) (*types.Transaction, error) { - return _Prover.Contract.Initialize(&_Prover.TransactOpts, _name, _symbol) -} - -// Mint is a paid mutator transaction binding the contract method 0x6a627842. -// -// Solidity: function mint(address _account) returns(uint256 id_) -func (_Prover *ProverTransactor) Mint(opts *bind.TransactOpts, _account common.Address) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "mint", _account) -} - -// Mint is a paid mutator transaction binding the contract method 0x6a627842. -// -// Solidity: function mint(address _account) returns(uint256 id_) -func (_Prover *ProverSession) Mint(_account common.Address) (*types.Transaction, error) { - return _Prover.Contract.Mint(&_Prover.TransactOpts, _account) -} - -// Mint is a paid mutator transaction binding the contract method 0x6a627842. -// -// Solidity: function mint(address _account) returns(uint256 id_) -func (_Prover *ProverTransactorSession) Mint(_account common.Address) (*types.Transaction, error) { - return _Prover.Contract.Mint(&_Prover.TransactOpts, _account) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 _id) returns() -func (_Prover *ProverTransactor) Pause(opts *bind.TransactOpts, _id *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "pause", _id) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 _id) returns() -func (_Prover *ProverSession) Pause(_id *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Pause(&_Prover.TransactOpts, _id) -} - -// Pause is a paid mutator transaction binding the contract method 0x136439dd. -// -// Solidity: function pause(uint256 _id) returns() -func (_Prover *ProverTransactorSession) Pause(_id *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Pause(&_Prover.TransactOpts, _id) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Prover *ProverTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Prover *ProverSession) RenounceOwnership() (*types.Transaction, error) { - return _Prover.Contract.RenounceOwnership(&_Prover.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Prover *ProverTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Prover.Contract.RenounceOwnership(&_Prover.TransactOpts) -} - -// Resume is a paid mutator transaction binding the contract method 0x414000b5. -// -// Solidity: function resume(uint256 _id) returns() -func (_Prover *ProverTransactor) Resume(opts *bind.TransactOpts, _id *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "resume", _id) -} - -// Resume is a paid mutator transaction binding the contract method 0x414000b5. -// -// Solidity: function resume(uint256 _id) returns() -func (_Prover *ProverSession) Resume(_id *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Resume(&_Prover.TransactOpts, _id) -} - -// Resume is a paid mutator transaction binding the contract method 0x414000b5. -// -// Solidity: function resume(uint256 _id) returns() -func (_Prover *ProverTransactorSession) Resume(_id *big.Int) (*types.Transaction, error) { - return _Prover.Contract.Resume(&_Prover.TransactOpts, _id) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "safeTransferFrom", from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.SafeTransferFrom(&_Prover.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.SafeTransferFrom(&_Prover.TransactOpts, from, to, tokenId) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() -func (_Prover *ProverTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "safeTransferFrom0", from, to, tokenId, data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() -func (_Prover *ProverSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { - return _Prover.Contract.SafeTransferFrom0(&_Prover.TransactOpts, from, to, tokenId, data) -} - -// SafeTransferFrom0 is a paid mutator transaction binding the contract method 0xb88d4fde. -// -// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) returns() -func (_Prover *ProverTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { - return _Prover.Contract.SafeTransferFrom0(&_Prover.TransactOpts, from, to, tokenId, data) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Prover *ProverTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "setApprovalForAll", operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Prover *ProverSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Prover.Contract.SetApprovalForAll(&_Prover.TransactOpts, operator, approved) -} - -// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. -// -// Solidity: function setApprovalForAll(address operator, bool approved) returns() -func (_Prover *ProverTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { - return _Prover.Contract.SetApprovalForAll(&_Prover.TransactOpts, operator, approved) -} - -// SetMinter is a paid mutator transaction binding the contract method 0xfca3b5aa. -// -// Solidity: function setMinter(address _minter) returns() -func (_Prover *ProverTransactor) SetMinter(opts *bind.TransactOpts, _minter common.Address) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "setMinter", _minter) -} - -// SetMinter is a paid mutator transaction binding the contract method 0xfca3b5aa. -// -// Solidity: function setMinter(address _minter) returns() -func (_Prover *ProverSession) SetMinter(_minter common.Address) (*types.Transaction, error) { - return _Prover.Contract.SetMinter(&_Prover.TransactOpts, _minter) -} - -// SetMinter is a paid mutator transaction binding the contract method 0xfca3b5aa. -// -// Solidity: function setMinter(address _minter) returns() -func (_Prover *ProverTransactorSession) SetMinter(_minter common.Address) (*types.Transaction, error) { - return _Prover.Contract.SetMinter(&_Prover.TransactOpts, _minter) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// RebateRatio is a free data retrieval call binding the contract method 0xff763ceb. // -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "transferFrom", from, to, tokenId) +// Solidity: function rebateRatio(address _prover) view returns(uint16) +func (_Prover *ProverSession) RebateRatio(_prover common.Address) (uint16, error) { + return _Prover.Contract.RebateRatio(&_Prover.CallOpts, _prover) } -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// RebateRatio is a free data retrieval call binding the contract method 0xff763ceb. // -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.TransferFrom(&_Prover.TransactOpts, from, to, tokenId) +// Solidity: function rebateRatio(address _prover) view returns(uint16) +func (_Prover *ProverCallerSession) RebateRatio(_prover common.Address) (uint16, error) { + return _Prover.Contract.RebateRatio(&_Prover.CallOpts, _prover) } -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// AddVMType is a paid mutator transaction binding the contract method 0x298cad7a. // -// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() -func (_Prover *ProverTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { - return _Prover.Contract.TransferFrom(&_Prover.TransactOpts, from, to, tokenId) +// Solidity: function addVMType(uint256 _type) returns() +func (_Prover *ProverTransactor) AddVMType(opts *bind.TransactOpts, _type *big.Int) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "addVMType", _type) } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// AddVMType is a paid mutator transaction binding the contract method 0x298cad7a. // -// Solidity: function transferOwnership(address newOwner) returns() -func (_Prover *ProverTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Prover.contract.Transact(opts, "transferOwnership", newOwner) +// Solidity: function addVMType(uint256 _type) returns() +func (_Prover *ProverSession) AddVMType(_type *big.Int) (*types.Transaction, error) { + return _Prover.Contract.AddVMType(&_Prover.TransactOpts, _type) } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// AddVMType is a paid mutator transaction binding the contract method 0x298cad7a. // -// Solidity: function transferOwnership(address newOwner) returns() -func (_Prover *ProverSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Prover.Contract.TransferOwnership(&_Prover.TransactOpts, newOwner) +// Solidity: function addVMType(uint256 _type) returns() +func (_Prover *ProverTransactorSession) AddVMType(_type *big.Int) (*types.Transaction, error) { + return _Prover.Contract.AddVMType(&_Prover.TransactOpts, _type) } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// ChangeBeneficiary is a paid mutator transaction binding the contract method 0xdc070657. // -// Solidity: function transferOwnership(address newOwner) returns() -func (_Prover *ProverTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Prover.Contract.TransferOwnership(&_Prover.TransactOpts, newOwner) -} - -// ProverApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Prover contract. -type ProverApprovalIterator struct { - Event *ProverApproval // 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 +// Solidity: function changeBeneficiary(address _beneficiary) returns() +func (_Prover *ProverTransactor) ChangeBeneficiary(opts *bind.TransactOpts, _beneficiary common.Address) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "changeBeneficiary", _beneficiary) } -// 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 *ProverApprovalIterator) 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(ProverApproval) - 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(ProverApproval) - 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 *ProverApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ProverApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// ProverApproval represents a Approval event raised by the Prover contract. -type ProverApproval struct { - Owner common.Address - Approved common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Prover *ProverFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*ProverApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Prover.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - if err != nil { - return nil, err - } - return &ProverApprovalIterator{contract: _Prover.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Prover *ProverFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ProverApproval, owner []common.Address, approved []common.Address, tokenId []*big.Int) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var approvedRule []interface{} - for _, approvedItem := range approved { - approvedRule = append(approvedRule, approvedItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) - } - - logs, sub, err := _Prover.contract.WatchLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) - 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(ProverApproval) - if err := _Prover.contract.UnpackLog(event, "Approval", 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 -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId) -func (_Prover *ProverFilterer) ParseApproval(log types.Log) (*ProverApproval, error) { - event := new(ProverApproval) - if err := _Prover.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ProverApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the Prover contract. -type ProverApprovalForAllIterator struct { - Event *ProverApprovalForAll // 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 *ProverApprovalForAllIterator) 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(ProverApprovalForAll) - 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(ProverApprovalForAll) - 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 *ProverApprovalForAllIterator) Error() error { - return it.fail +// ChangeBeneficiary is a paid mutator transaction binding the contract method 0xdc070657. +// +// Solidity: function changeBeneficiary(address _beneficiary) returns() +func (_Prover *ProverSession) ChangeBeneficiary(_beneficiary common.Address) (*types.Transaction, error) { + return _Prover.Contract.ChangeBeneficiary(&_Prover.TransactOpts, _beneficiary) } -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ProverApprovalForAllIterator) Close() error { - it.sub.Unsubscribe() - return nil +// ChangeBeneficiary is a paid mutator transaction binding the contract method 0xdc070657. +// +// Solidity: function changeBeneficiary(address _beneficiary) returns() +func (_Prover *ProverTransactorSession) ChangeBeneficiary(_beneficiary common.Address) (*types.Transaction, error) { + return _Prover.Contract.ChangeBeneficiary(&_Prover.TransactOpts, _beneficiary) } -// ProverApprovalForAll represents a ApprovalForAll event raised by the Prover contract. -type ProverApprovalForAll struct { - Owner common.Address - Operator common.Address - Approved bool - Raw types.Log // Blockchain specific contextual infos +// DelVMType is a paid mutator transaction binding the contract method 0x0df813dd. +// +// Solidity: function delVMType(uint256 _type) returns() +func (_Prover *ProverTransactor) DelVMType(opts *bind.TransactOpts, _type *big.Int) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "delVMType", _type) } -// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// DelVMType is a paid mutator transaction binding the contract method 0x0df813dd. // -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Prover *ProverFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*ProverApprovalForAllIterator, error) { +// Solidity: function delVMType(uint256 _type) returns() +func (_Prover *ProverSession) DelVMType(_type *big.Int) (*types.Transaction, error) { + return _Prover.Contract.DelVMType(&_Prover.TransactOpts, _type) +} - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } +// DelVMType is a paid mutator transaction binding the contract method 0x0df813dd. +// +// Solidity: function delVMType(uint256 _type) returns() +func (_Prover *ProverTransactorSession) DelVMType(_type *big.Int) (*types.Transaction, error) { + return _Prover.Contract.DelVMType(&_Prover.TransactOpts, _type) +} - logs, sub, err := _Prover.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - if err != nil { - return nil, err - } - return &ProverApprovalForAllIterator{contract: _Prover.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Prover *ProverTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "initialize") } -// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. // -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Prover *ProverFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *ProverApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { +// Solidity: function initialize() returns() +func (_Prover *ProverSession) Initialize() (*types.Transaction, error) { + return _Prover.Contract.Initialize(&_Prover.TransactOpts) +} - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_Prover *ProverTransactorSession) Initialize() (*types.Transaction, error) { + return _Prover.Contract.Initialize(&_Prover.TransactOpts) +} - logs, sub, err := _Prover.contract.WatchLogs(opts, "ApprovalForAll", ownerRule, operatorRule) - 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(ProverApprovalForAll) - if err := _Prover.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return err - } - event.Raw = log +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_Prover *ProverTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "pause") +} - 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 +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_Prover *ProverSession) Pause() (*types.Transaction, error) { + return _Prover.Contract.Pause(&_Prover.TransactOpts) } -// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. // -// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) -func (_Prover *ProverFilterer) ParseApprovalForAll(log types.Log) (*ProverApprovalForAll, error) { - event := new(ProverApprovalForAll) - if err := _Prover.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil +// Solidity: function pause() returns() +func (_Prover *ProverTransactorSession) Pause() (*types.Transaction, error) { + return _Prover.Contract.Pause(&_Prover.TransactOpts) } -// ProverInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Prover contract. -type ProverInitializedIterator struct { - Event *ProverInitialized // Event containing the contract specifics and raw log +// Register is a paid mutator transaction binding the contract method 0x1aa3a008. +// +// Solidity: function register() returns() +func (_Prover *ProverTransactor) Register(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "register") +} - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data +// Register is a paid mutator transaction binding the contract method 0x1aa3a008. +// +// Solidity: function register() returns() +func (_Prover *ProverSession) Register() (*types.Transaction, error) { + return _Prover.Contract.Register(&_Prover.TransactOpts) +} - 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 +// Register is a paid mutator transaction binding the contract method 0x1aa3a008. +// +// Solidity: function register() returns() +func (_Prover *ProverTransactorSession) Register() (*types.Transaction, error) { + return _Prover.Contract.Register(&_Prover.TransactOpts) } -// 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 *ProverInitializedIterator) 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(ProverInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Prover *ProverTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "renounceOwnership") +} - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(ProverInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Prover *ProverSession) RenounceOwnership() (*types.Transaction, error) { + return _Prover.Contract.RenounceOwnership(&_Prover.TransactOpts) +} - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Prover *ProverTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Prover.Contract.RenounceOwnership(&_Prover.TransactOpts) } -// Error returns any retrieval or parsing error occurred during filtering. -func (it *ProverInitializedIterator) Error() error { - return it.fail +// Resume is a paid mutator transaction binding the contract method 0x046f7da2. +// +// Solidity: function resume() returns() +func (_Prover *ProverTransactor) Resume(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "resume") } -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *ProverInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil +// Resume is a paid mutator transaction binding the contract method 0x046f7da2. +// +// Solidity: function resume() returns() +func (_Prover *ProverSession) Resume() (*types.Transaction, error) { + return _Prover.Contract.Resume(&_Prover.TransactOpts) } -// ProverInitialized represents a Initialized event raised by the Prover contract. -type ProverInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos +// Resume is a paid mutator transaction binding the contract method 0x046f7da2. +// +// Solidity: function resume() returns() +func (_Prover *ProverTransactorSession) Resume() (*types.Transaction, error) { + return _Prover.Contract.Resume(&_Prover.TransactOpts) } -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// SetRebateRatio is a paid mutator transaction binding the contract method 0x36d06a28. // -// Solidity: event Initialized(uint8 version) -func (_Prover *ProverFilterer) FilterInitialized(opts *bind.FilterOpts) (*ProverInitializedIterator, error) { +// Solidity: function setRebateRatio(uint16 _ratio) returns() +func (_Prover *ProverTransactor) SetRebateRatio(opts *bind.TransactOpts, _ratio uint16) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "setRebateRatio", _ratio) +} - logs, sub, err := _Prover.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &ProverInitializedIterator{contract: _Prover.contract, event: "Initialized", logs: logs, sub: sub}, nil +// SetRebateRatio is a paid mutator transaction binding the contract method 0x36d06a28. +// +// Solidity: function setRebateRatio(uint16 _ratio) returns() +func (_Prover *ProverSession) SetRebateRatio(_ratio uint16) (*types.Transaction, error) { + return _Prover.Contract.SetRebateRatio(&_Prover.TransactOpts, _ratio) } -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// SetRebateRatio is a paid mutator transaction binding the contract method 0x36d06a28. // -// Solidity: event Initialized(uint8 version) -func (_Prover *ProverFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ProverInitialized) (event.Subscription, error) { +// Solidity: function setRebateRatio(uint16 _ratio) returns() +func (_Prover *ProverTransactorSession) SetRebateRatio(_ratio uint16) (*types.Transaction, error) { + return _Prover.Contract.SetRebateRatio(&_Prover.TransactOpts, _ratio) +} - logs, sub, err := _Prover.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(ProverInitialized) - if err := _Prover.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Prover *ProverTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Prover.contract.Transact(opts, "transferOwnership", newOwner) +} - 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 +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Prover *ProverSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Prover.Contract.TransferOwnership(&_Prover.TransactOpts, newOwner) } -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // -// Solidity: event Initialized(uint8 version) -func (_Prover *ProverFilterer) ParseInitialized(log types.Log) (*ProverInitialized, error) { - event := new(ProverInitialized) - if err := _Prover.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil +// Solidity: function transferOwnership(address newOwner) returns() +func (_Prover *ProverTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Prover.Contract.TransferOwnership(&_Prover.TransactOpts, newOwner) } -// ProverMinterSetIterator is returned from FilterMinterSet and is used to iterate over the raw logs and unpacked data for MinterSet events raised by the Prover contract. -type ProverMinterSetIterator struct { - Event *ProverMinterSet // Event containing the contract specifics and raw log +// ProverBeneficiarySetIterator is returned from FilterBeneficiarySet and is used to iterate over the raw logs and unpacked data for BeneficiarySet events raised by the Prover contract. +type ProverBeneficiarySetIterator struct { + Event *ProverBeneficiarySet // 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 @@ -1458,7 +561,7 @@ type ProverMinterSetIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *ProverMinterSetIterator) Next() bool { +func (it *ProverBeneficiarySetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1467,7 +570,7 @@ func (it *ProverMinterSetIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ProverMinterSet) + it.Event = new(ProverBeneficiarySet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1482,7 +585,7 @@ func (it *ProverMinterSetIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ProverMinterSet) + it.Event = new(ProverBeneficiarySet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1498,41 +601,60 @@ func (it *ProverMinterSetIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ProverMinterSetIterator) Error() error { +func (it *ProverBeneficiarySetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ProverMinterSetIterator) Close() error { +func (it *ProverBeneficiarySetIterator) Close() error { it.sub.Unsubscribe() return nil } -// ProverMinterSet represents a MinterSet event raised by the Prover contract. -type ProverMinterSet struct { - Minter common.Address - Raw types.Log // Blockchain specific contextual infos +// ProverBeneficiarySet represents a BeneficiarySet event raised by the Prover contract. +type ProverBeneficiarySet struct { + Prover common.Address + Beneficiary common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterMinterSet is a free log retrieval operation binding the contract event 0x726b590ef91a8c76ad05bbe91a57ef84605276528f49cd47d787f558a4e755b6. +// FilterBeneficiarySet is a free log retrieval operation binding the contract event 0x2906d223dc4163733bb374af8641c7e9ae256e2bae53c90e0c9a2be2e611ae44. // -// Solidity: event MinterSet(address minter) -func (_Prover *ProverFilterer) FilterMinterSet(opts *bind.FilterOpts) (*ProverMinterSetIterator, error) { +// Solidity: event BeneficiarySet(address indexed prover, address indexed beneficiary) +func (_Prover *ProverFilterer) FilterBeneficiarySet(opts *bind.FilterOpts, prover []common.Address, beneficiary []common.Address) (*ProverBeneficiarySetIterator, error) { + + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } - logs, sub, err := _Prover.contract.FilterLogs(opts, "MinterSet") + logs, sub, err := _Prover.contract.FilterLogs(opts, "BeneficiarySet", proverRule, beneficiaryRule) if err != nil { return nil, err } - return &ProverMinterSetIterator{contract: _Prover.contract, event: "MinterSet", logs: logs, sub: sub}, nil + return &ProverBeneficiarySetIterator{contract: _Prover.contract, event: "BeneficiarySet", logs: logs, sub: sub}, nil } -// WatchMinterSet is a free log subscription operation binding the contract event 0x726b590ef91a8c76ad05bbe91a57ef84605276528f49cd47d787f558a4e755b6. +// WatchBeneficiarySet is a free log subscription operation binding the contract event 0x2906d223dc4163733bb374af8641c7e9ae256e2bae53c90e0c9a2be2e611ae44. // -// Solidity: event MinterSet(address minter) -func (_Prover *ProverFilterer) WatchMinterSet(opts *bind.WatchOpts, sink chan<- *ProverMinterSet) (event.Subscription, error) { +// Solidity: event BeneficiarySet(address indexed prover, address indexed beneficiary) +func (_Prover *ProverFilterer) WatchBeneficiarySet(opts *bind.WatchOpts, sink chan<- *ProverBeneficiarySet, prover []common.Address, beneficiary []common.Address) (event.Subscription, error) { + + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } + var beneficiaryRule []interface{} + for _, beneficiaryItem := range beneficiary { + beneficiaryRule = append(beneficiaryRule, beneficiaryItem) + } - logs, sub, err := _Prover.contract.WatchLogs(opts, "MinterSet") + logs, sub, err := _Prover.contract.WatchLogs(opts, "BeneficiarySet", proverRule, beneficiaryRule) if err != nil { return nil, err } @@ -1542,8 +664,8 @@ func (_Prover *ProverFilterer) WatchMinterSet(opts *bind.WatchOpts, sink chan<- select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ProverMinterSet) - if err := _Prover.contract.UnpackLog(event, "MinterSet", log); err != nil { + event := new(ProverBeneficiarySet) + if err := _Prover.contract.UnpackLog(event, "BeneficiarySet", log); err != nil { return err } event.Raw = log @@ -1564,21 +686,21 @@ func (_Prover *ProverFilterer) WatchMinterSet(opts *bind.WatchOpts, sink chan<- }), nil } -// ParseMinterSet is a log parse operation binding the contract event 0x726b590ef91a8c76ad05bbe91a57ef84605276528f49cd47d787f558a4e755b6. +// ParseBeneficiarySet is a log parse operation binding the contract event 0x2906d223dc4163733bb374af8641c7e9ae256e2bae53c90e0c9a2be2e611ae44. // -// Solidity: event MinterSet(address minter) -func (_Prover *ProverFilterer) ParseMinterSet(log types.Log) (*ProverMinterSet, error) { - event := new(ProverMinterSet) - if err := _Prover.contract.UnpackLog(event, "MinterSet", log); err != nil { +// Solidity: event BeneficiarySet(address indexed prover, address indexed beneficiary) +func (_Prover *ProverFilterer) ParseBeneficiarySet(log types.Log) (*ProverBeneficiarySet, error) { + event := new(ProverBeneficiarySet) + if err := _Prover.contract.UnpackLog(event, "BeneficiarySet", log); err != nil { return nil, err } event.Raw = log return event, nil } -// ProverOperatorSetIterator is returned from FilterOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorSet events raised by the Prover contract. -type ProverOperatorSetIterator struct { - Event *ProverOperatorSet // Event containing the contract specifics and raw log +// ProverInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Prover contract. +type ProverInitializedIterator struct { + Event *ProverInitialized // 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 @@ -1592,7 +714,7 @@ type ProverOperatorSetIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *ProverOperatorSetIterator) Next() bool { +func (it *ProverInitializedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1601,7 +723,7 @@ func (it *ProverOperatorSetIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ProverOperatorSet) + it.Event = new(ProverInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1616,7 +738,7 @@ func (it *ProverOperatorSetIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ProverOperatorSet) + it.Event = new(ProverInitialized) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1632,60 +754,41 @@ func (it *ProverOperatorSetIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ProverOperatorSetIterator) Error() error { +func (it *ProverInitializedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ProverOperatorSetIterator) Close() error { +func (it *ProverInitializedIterator) Close() error { it.sub.Unsubscribe() return nil } -// ProverOperatorSet represents a OperatorSet event raised by the Prover contract. -type ProverOperatorSet struct { - Id *big.Int - Operator common.Address - Raw types.Log // Blockchain specific contextual infos +// ProverInitialized represents a Initialized event raised by the Prover contract. +type ProverInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos } -// FilterOperatorSet is a free log retrieval operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_Prover *ProverFilterer) FilterOperatorSet(opts *bind.FilterOpts, id []*big.Int, operator []common.Address) (*ProverOperatorSetIterator, error) { - - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } +// Solidity: event Initialized(uint8 version) +func (_Prover *ProverFilterer) FilterInitialized(opts *bind.FilterOpts) (*ProverInitializedIterator, error) { - logs, sub, err := _Prover.contract.FilterLogs(opts, "OperatorSet", idRule, operatorRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "Initialized") if err != nil { return nil, err } - return &ProverOperatorSetIterator{contract: _Prover.contract, event: "OperatorSet", logs: logs, sub: sub}, nil + return &ProverInitializedIterator{contract: _Prover.contract, event: "Initialized", logs: logs, sub: sub}, nil } -// WatchOperatorSet is a free log subscription operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_Prover *ProverFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan<- *ProverOperatorSet, id []*big.Int, operator []common.Address) (event.Subscription, error) { - - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) - } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } +// Solidity: event Initialized(uint8 version) +func (_Prover *ProverFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ProverInitialized) (event.Subscription, error) { - logs, sub, err := _Prover.contract.WatchLogs(opts, "OperatorSet", idRule, operatorRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "Initialized") if err != nil { return nil, err } @@ -1695,8 +798,8 @@ func (_Prover *ProverFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan< select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ProverOperatorSet) - if err := _Prover.contract.UnpackLog(event, "OperatorSet", log); err != nil { + event := new(ProverInitialized) + if err := _Prover.contract.UnpackLog(event, "Initialized", log); err != nil { return err } event.Raw = log @@ -1717,12 +820,12 @@ func (_Prover *ProverFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan< }), nil } -// ParseOperatorSet is a log parse operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_Prover *ProverFilterer) ParseOperatorSet(log types.Log) (*ProverOperatorSet, error) { - event := new(ProverOperatorSet) - if err := _Prover.contract.UnpackLog(event, "OperatorSet", log); err != nil { +// Solidity: event Initialized(uint8 version) +func (_Prover *ProverFilterer) ParseInitialized(log types.Log) (*ProverInitialized, error) { + event := new(ProverInitialized) + if err := _Prover.contract.UnpackLog(event, "Initialized", log); err != nil { return nil, err } event.Raw = log @@ -1951,38 +1054,38 @@ func (it *ProverProverPausedIterator) Close() error { // ProverProverPaused represents a ProverPaused event raised by the Prover contract. type ProverProverPaused struct { - Id *big.Int - Raw types.Log // Blockchain specific contextual infos + Prover common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterProverPaused is a free log retrieval operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// FilterProverPaused is a free log retrieval operation binding the contract event 0xb60833f9b39cb3f4532bc36a284e3a48f4f2ff9c4a057a295568315811c3daff. // -// Solidity: event ProverPaused(uint256 indexed id) -func (_Prover *ProverFilterer) FilterProverPaused(opts *bind.FilterOpts, id []*big.Int) (*ProverProverPausedIterator, error) { +// Solidity: event ProverPaused(address indexed prover) +func (_Prover *ProverFilterer) FilterProverPaused(opts *bind.FilterOpts, prover []common.Address) (*ProverProverPausedIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.FilterLogs(opts, "ProverPaused", idRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "ProverPaused", proverRule) if err != nil { return nil, err } return &ProverProverPausedIterator{contract: _Prover.contract, event: "ProverPaused", logs: logs, sub: sub}, nil } -// WatchProverPaused is a free log subscription operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// WatchProverPaused is a free log subscription operation binding the contract event 0xb60833f9b39cb3f4532bc36a284e3a48f4f2ff9c4a057a295568315811c3daff. // -// Solidity: event ProverPaused(uint256 indexed id) -func (_Prover *ProverFilterer) WatchProverPaused(opts *bind.WatchOpts, sink chan<- *ProverProverPaused, id []*big.Int) (event.Subscription, error) { +// Solidity: event ProverPaused(address indexed prover) +func (_Prover *ProverFilterer) WatchProverPaused(opts *bind.WatchOpts, sink chan<- *ProverProverPaused, prover []common.Address) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.WatchLogs(opts, "ProverPaused", idRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "ProverPaused", proverRule) if err != nil { return nil, err } @@ -2014,9 +1117,9 @@ func (_Prover *ProverFilterer) WatchProverPaused(opts *bind.WatchOpts, sink chan }), nil } -// ParseProverPaused is a log parse operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// ParseProverPaused is a log parse operation binding the contract event 0xb60833f9b39cb3f4532bc36a284e3a48f4f2ff9c4a057a295568315811c3daff. // -// Solidity: event ProverPaused(uint256 indexed id) +// Solidity: event ProverPaused(address indexed prover) func (_Prover *ProverFilterer) ParseProverPaused(log types.Log) (*ProverProverPaused, error) { event := new(ProverProverPaused) if err := _Prover.contract.UnpackLog(event, "ProverPaused", log); err != nil { @@ -2095,38 +1198,38 @@ func (it *ProverProverResumedIterator) Close() error { // ProverProverResumed represents a ProverResumed event raised by the Prover contract. type ProverProverResumed struct { - Id *big.Int - Raw types.Log // Blockchain specific contextual infos + Prover common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterProverResumed is a free log retrieval operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// FilterProverResumed is a free log retrieval operation binding the contract event 0xfedc704ee832701f3256eda12d9b4abb087fbbdf584108e7aef66b6e07abdaab. // -// Solidity: event ProverResumed(uint256 indexed id) -func (_Prover *ProverFilterer) FilterProverResumed(opts *bind.FilterOpts, id []*big.Int) (*ProverProverResumedIterator, error) { +// Solidity: event ProverResumed(address indexed prover) +func (_Prover *ProverFilterer) FilterProverResumed(opts *bind.FilterOpts, prover []common.Address) (*ProverProverResumedIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.FilterLogs(opts, "ProverResumed", idRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "ProverResumed", proverRule) if err != nil { return nil, err } return &ProverProverResumedIterator{contract: _Prover.contract, event: "ProverResumed", logs: logs, sub: sub}, nil } -// WatchProverResumed is a free log subscription operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// WatchProverResumed is a free log subscription operation binding the contract event 0xfedc704ee832701f3256eda12d9b4abb087fbbdf584108e7aef66b6e07abdaab. // -// Solidity: event ProverResumed(uint256 indexed id) -func (_Prover *ProverFilterer) WatchProverResumed(opts *bind.WatchOpts, sink chan<- *ProverProverResumed, id []*big.Int) (event.Subscription, error) { +// Solidity: event ProverResumed(address indexed prover) +func (_Prover *ProverFilterer) WatchProverResumed(opts *bind.WatchOpts, sink chan<- *ProverProverResumed, prover []common.Address) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.WatchLogs(opts, "ProverResumed", idRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "ProverResumed", proverRule) if err != nil { return nil, err } @@ -2158,9 +1261,9 @@ func (_Prover *ProverFilterer) WatchProverResumed(opts *bind.WatchOpts, sink cha }), nil } -// ParseProverResumed is a log parse operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// ParseProverResumed is a log parse operation binding the contract event 0xfedc704ee832701f3256eda12d9b4abb087fbbdf584108e7aef66b6e07abdaab. // -// Solidity: event ProverResumed(uint256 indexed id) +// Solidity: event ProverResumed(address indexed prover) func (_Prover *ProverFilterer) ParseProverResumed(log types.Log) (*ProverProverResumed, error) { event := new(ProverProverResumed) if err := _Prover.contract.UnpackLog(event, "ProverResumed", log); err != nil { @@ -2170,9 +1273,9 @@ func (_Prover *ProverFilterer) ParseProverResumed(log types.Log) (*ProverProverR return event, nil } -// ProverTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Prover contract. -type ProverTransferIterator struct { - Event *ProverTransfer // Event containing the contract specifics and raw log +// ProverRebateRatioSetIterator is returned from FilterRebateRatioSet and is used to iterate over the raw logs and unpacked data for RebateRatioSet events raised by the Prover contract. +type ProverRebateRatioSetIterator struct { + Event *ProverRebateRatioSet // 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 @@ -2186,7 +1289,7 @@ type ProverTransferIterator struct { // Next advances the iterator to the subsequent event, returning whether there // are any more events found. In case of a retrieval or parsing error, false is // returned and Error() can be queried for the exact failure. -func (it *ProverTransferIterator) Next() bool { +func (it *ProverRebateRatioSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2195,7 +1298,7 @@ func (it *ProverTransferIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(ProverTransfer) + it.Event = new(ProverRebateRatioSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2210,7 +1313,7 @@ func (it *ProverTransferIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(ProverTransfer) + it.Event = new(ProverRebateRatioSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2226,69 +1329,52 @@ func (it *ProverTransferIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *ProverTransferIterator) Error() error { +func (it *ProverRebateRatioSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *ProverTransferIterator) Close() error { +func (it *ProverRebateRatioSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// ProverTransfer represents a Transfer event raised by the Prover contract. -type ProverTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos +// ProverRebateRatioSet represents a RebateRatioSet event raised by the Prover contract. +type ProverRebateRatioSet struct { + Prover common.Address + Ratio uint16 + Raw types.Log // Blockchain specific contextual infos } -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// FilterRebateRatioSet is a free log retrieval operation binding the contract event 0xa0f5fcdc71c05b9272e6317da907366e3ebb2ef84f089a53c325c3a9cb8d4cbd. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Prover *ProverFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*ProverTransferIterator, error) { +// Solidity: event RebateRatioSet(address indexed prover, uint16 ratio) +func (_Prover *ProverFilterer) FilterRebateRatioSet(opts *bind.FilterOpts, prover []common.Address) (*ProverRebateRatioSetIterator, error) { - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "RebateRatioSet", proverRule) if err != nil { return nil, err } - return &ProverTransferIterator{contract: _Prover.contract, event: "Transfer", logs: logs, sub: sub}, nil + return &ProverRebateRatioSetIterator{contract: _Prover.contract, event: "RebateRatioSet", logs: logs, sub: sub}, nil } -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// WatchRebateRatioSet is a free log subscription operation binding the contract event 0xa0f5fcdc71c05b9272e6317da907366e3ebb2ef84f089a53c325c3a9cb8d4cbd. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Prover *ProverFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ProverTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { +// Solidity: event RebateRatioSet(address indexed prover, uint16 ratio) +func (_Prover *ProverFilterer) WatchRebateRatioSet(opts *bind.WatchOpts, sink chan<- *ProverRebateRatioSet, prover []common.Address) (event.Subscription, error) { - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - var tokenIdRule []interface{} - for _, tokenIdItem := range tokenId { - tokenIdRule = append(tokenIdRule, tokenIdItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "RebateRatioSet", proverRule) if err != nil { return nil, err } @@ -2298,8 +1384,8 @@ func (_Prover *ProverFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- * select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(ProverTransfer) - if err := _Prover.contract.UnpackLog(event, "Transfer", log); err != nil { + event := new(ProverRebateRatioSet) + if err := _Prover.contract.UnpackLog(event, "RebateRatioSet", log); err != nil { return err } event.Raw = log @@ -2320,12 +1406,12 @@ func (_Prover *ProverFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- * }), nil } -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// ParseRebateRatioSet is a log parse operation binding the contract event 0xa0f5fcdc71c05b9272e6317da907366e3ebb2ef84f089a53c325c3a9cb8d4cbd. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_Prover *ProverFilterer) ParseTransfer(log types.Log) (*ProverTransfer, error) { - event := new(ProverTransfer) - if err := _Prover.contract.UnpackLog(event, "Transfer", log); err != nil { +// Solidity: event RebateRatioSet(address indexed prover, uint16 ratio) +func (_Prover *ProverFilterer) ParseRebateRatioSet(log types.Log) (*ProverRebateRatioSet, error) { + event := new(ProverRebateRatioSet) + if err := _Prover.contract.UnpackLog(event, "RebateRatioSet", log); err != nil { return nil, err } event.Raw = log @@ -2401,39 +1487,39 @@ func (it *ProverVMTypeAddedIterator) Close() error { // ProverVMTypeAdded represents a VMTypeAdded event raised by the Prover contract. type ProverVMTypeAdded struct { - Id *big.Int - Typ *big.Int - Raw types.Log // Blockchain specific contextual infos + Prover common.Address + Typ *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterVMTypeAdded is a free log retrieval operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. +// FilterVMTypeAdded is a free log retrieval operation binding the contract event 0x9584d49ad17d5b2fc346a4680a1be7b2a02bf95d734fd677d9df585e9d52a655. // -// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) -func (_Prover *ProverFilterer) FilterVMTypeAdded(opts *bind.FilterOpts, id []*big.Int) (*ProverVMTypeAddedIterator, error) { +// Solidity: event VMTypeAdded(address indexed prover, uint256 typ) +func (_Prover *ProverFilterer) FilterVMTypeAdded(opts *bind.FilterOpts, prover []common.Address) (*ProverVMTypeAddedIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.FilterLogs(opts, "VMTypeAdded", idRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "VMTypeAdded", proverRule) if err != nil { return nil, err } return &ProverVMTypeAddedIterator{contract: _Prover.contract, event: "VMTypeAdded", logs: logs, sub: sub}, nil } -// WatchVMTypeAdded is a free log subscription operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. +// WatchVMTypeAdded is a free log subscription operation binding the contract event 0x9584d49ad17d5b2fc346a4680a1be7b2a02bf95d734fd677d9df585e9d52a655. // -// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) -func (_Prover *ProverFilterer) WatchVMTypeAdded(opts *bind.WatchOpts, sink chan<- *ProverVMTypeAdded, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeAdded(address indexed prover, uint256 typ) +func (_Prover *ProverFilterer) WatchVMTypeAdded(opts *bind.WatchOpts, sink chan<- *ProverVMTypeAdded, prover []common.Address) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.WatchLogs(opts, "VMTypeAdded", idRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "VMTypeAdded", proverRule) if err != nil { return nil, err } @@ -2465,9 +1551,9 @@ func (_Prover *ProverFilterer) WatchVMTypeAdded(opts *bind.WatchOpts, sink chan< }), nil } -// ParseVMTypeAdded is a log parse operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. +// ParseVMTypeAdded is a log parse operation binding the contract event 0x9584d49ad17d5b2fc346a4680a1be7b2a02bf95d734fd677d9df585e9d52a655. // -// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) +// Solidity: event VMTypeAdded(address indexed prover, uint256 typ) func (_Prover *ProverFilterer) ParseVMTypeAdded(log types.Log) (*ProverVMTypeAdded, error) { event := new(ProverVMTypeAdded) if err := _Prover.contract.UnpackLog(event, "VMTypeAdded", log); err != nil { @@ -2546,39 +1632,39 @@ func (it *ProverVMTypeDeletedIterator) Close() error { // ProverVMTypeDeleted represents a VMTypeDeleted event raised by the Prover contract. type ProverVMTypeDeleted struct { - Id *big.Int - Typ *big.Int - Raw types.Log // Blockchain specific contextual infos + Prover common.Address + Typ *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterVMTypeDeleted is a free log retrieval operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. +// FilterVMTypeDeleted is a free log retrieval operation binding the contract event 0xf1b01f10c033f88aa1a9daf399bdec09f261109268766ce78194396f3ff77ce8. // -// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) -func (_Prover *ProverFilterer) FilterVMTypeDeleted(opts *bind.FilterOpts, id []*big.Int) (*ProverVMTypeDeletedIterator, error) { +// Solidity: event VMTypeDeleted(address indexed prover, uint256 typ) +func (_Prover *ProverFilterer) FilterVMTypeDeleted(opts *bind.FilterOpts, prover []common.Address) (*ProverVMTypeDeletedIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.FilterLogs(opts, "VMTypeDeleted", idRule) + logs, sub, err := _Prover.contract.FilterLogs(opts, "VMTypeDeleted", proverRule) if err != nil { return nil, err } return &ProverVMTypeDeletedIterator{contract: _Prover.contract, event: "VMTypeDeleted", logs: logs, sub: sub}, nil } -// WatchVMTypeDeleted is a free log subscription operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. +// WatchVMTypeDeleted is a free log subscription operation binding the contract event 0xf1b01f10c033f88aa1a9daf399bdec09f261109268766ce78194396f3ff77ce8. // -// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) -func (_Prover *ProverFilterer) WatchVMTypeDeleted(opts *bind.WatchOpts, sink chan<- *ProverVMTypeDeleted, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeDeleted(address indexed prover, uint256 typ) +func (_Prover *ProverFilterer) WatchVMTypeDeleted(opts *bind.WatchOpts, sink chan<- *ProverVMTypeDeleted, prover []common.Address) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _Prover.contract.WatchLogs(opts, "VMTypeDeleted", idRule) + logs, sub, err := _Prover.contract.WatchLogs(opts, "VMTypeDeleted", proverRule) if err != nil { return nil, err } @@ -2610,9 +1696,9 @@ func (_Prover *ProverFilterer) WatchVMTypeDeleted(opts *bind.WatchOpts, sink cha }), nil } -// ParseVMTypeDeleted is a log parse operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. +// ParseVMTypeDeleted is a log parse operation binding the contract event 0xf1b01f10c033f88aa1a9daf399bdec09f261109268766ce78194396f3ff77ce8. // -// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) +// Solidity: event VMTypeDeleted(address indexed prover, uint256 typ) func (_Prover *ProverFilterer) ParseVMTypeDeleted(log types.Log) (*ProverVMTypeDeleted, error) { event := new(ProverVMTypeDeleted) if err := _Prover.contract.UnpackLog(event, "VMTypeDeleted", log); err != nil { diff --git a/smartcontracts/go/taskmanager/task_manager.abi b/smartcontracts/go/taskmanager/task_manager.abi index c57b7425..4a69a951 100644 --- a/smartcontracts/go/taskmanager/task_manager.abi +++ b/smartcontracts/go/taskmanager/task_manager.abi @@ -145,6 +145,11 @@ "name": "hash", "type": "bytes32" }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, { "internalType": "address", "name": "prover", @@ -190,6 +195,11 @@ "name": "hash", "type": "bytes32" }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, { "internalType": "address", "name": "prover", @@ -218,6 +228,35 @@ }, { "inputs": [], + "name": "debits", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_debits", + "type": "address" + }, + { + "internalType": "address", + "name": "_projectReward", + "type": "address" + }, + { + "internalType": "address", + "name": "_proverStore", + "type": "address" + } + ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", @@ -255,6 +294,50 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "projectReward", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proverStore", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "projectId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "taskId", + "type": "bytes32" + } + ], + "name": "recall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -275,6 +358,11 @@ "name": "hash", "type": "bytes32" }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, { "internalType": "address", "name": "sequencer", diff --git a/smartcontracts/go/taskmanager/task_manager.go b/smartcontracts/go/taskmanager/task_manager.go index ad83316d..dc6d9148 100644 --- a/smartcontracts/go/taskmanager/task_manager.go +++ b/smartcontracts/go/taskmanager/task_manager.go @@ -34,12 +34,13 @@ type TaskAssignment struct { ProjectId *big.Int TaskId [32]byte Hash [32]byte + Signature []byte Prover common.Address } // TaskmanagerMetaData contains all meta data concerning the Taskmanager contract. var TaskmanagerMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorRemoved\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"TaskAssigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"TaskSettled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"addOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment[]\",\"name\":\"taskAssignments\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"assign\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment\",\"name\":\"assignment\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"assign\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"operators\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"records\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardForProver\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardForSequencer\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"settled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"removeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"settle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"OperatorRemoved\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"TaskAssigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"TaskSettled\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"addOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment[]\",\"name\":\"taskAssignments\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"assign\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"internalType\":\"structTaskAssignment\",\"name\":\"assignment\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"name\":\"assign\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"debits\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_debits\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_projectReward\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proverStore\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"operators\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"projectReward\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proverStore\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"}],\"name\":\"recall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"records\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rewardForProver\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardForSequencer\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"settled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"removeOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"projectId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"taskId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"settle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaskmanagerABI is the input ABI used to generate the binding from. @@ -188,6 +189,37 @@ func (_Taskmanager *TaskmanagerTransactorRaw) Transact(opts *bind.TransactOpts, return _Taskmanager.Contract.contract.Transact(opts, method, params...) } +// Debits is a free data retrieval call binding the contract method 0x6f0f11e5. +// +// Solidity: function debits() view returns(address) +func (_Taskmanager *TaskmanagerCaller) Debits(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Taskmanager.contract.Call(opts, &out, "debits") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Debits is a free data retrieval call binding the contract method 0x6f0f11e5. +// +// Solidity: function debits() view returns(address) +func (_Taskmanager *TaskmanagerSession) Debits() (common.Address, error) { + return _Taskmanager.Contract.Debits(&_Taskmanager.CallOpts) +} + +// Debits is a free data retrieval call binding the contract method 0x6f0f11e5. +// +// Solidity: function debits() view returns(address) +func (_Taskmanager *TaskmanagerCallerSession) Debits() (common.Address, error) { + return _Taskmanager.Contract.Debits(&_Taskmanager.CallOpts) +} + // Operators is a free data retrieval call binding the contract method 0x13e7c9d8. // // Solidity: function operators(address ) view returns(bool) @@ -250,11 +282,74 @@ func (_Taskmanager *TaskmanagerCallerSession) Owner() (common.Address, error) { return _Taskmanager.Contract.Owner(&_Taskmanager.CallOpts) } +// ProjectReward is a free data retrieval call binding the contract method 0xa6095890. +// +// Solidity: function projectReward() view returns(address) +func (_Taskmanager *TaskmanagerCaller) ProjectReward(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Taskmanager.contract.Call(opts, &out, "projectReward") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProjectReward is a free data retrieval call binding the contract method 0xa6095890. +// +// Solidity: function projectReward() view returns(address) +func (_Taskmanager *TaskmanagerSession) ProjectReward() (common.Address, error) { + return _Taskmanager.Contract.ProjectReward(&_Taskmanager.CallOpts) +} + +// ProjectReward is a free data retrieval call binding the contract method 0xa6095890. +// +// Solidity: function projectReward() view returns(address) +func (_Taskmanager *TaskmanagerCallerSession) ProjectReward() (common.Address, error) { + return _Taskmanager.Contract.ProjectReward(&_Taskmanager.CallOpts) +} + +// ProverStore is a free data retrieval call binding the contract method 0x79b851f6. +// +// Solidity: function proverStore() view returns(address) +func (_Taskmanager *TaskmanagerCaller) ProverStore(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Taskmanager.contract.Call(opts, &out, "proverStore") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ProverStore is a free data retrieval call binding the contract method 0x79b851f6. +// +// Solidity: function proverStore() view returns(address) +func (_Taskmanager *TaskmanagerSession) ProverStore() (common.Address, error) { + return _Taskmanager.Contract.ProverStore(&_Taskmanager.CallOpts) +} + +// ProverStore is a free data retrieval call binding the contract method 0x79b851f6. +// +// Solidity: function proverStore() view returns(address) +func (_Taskmanager *TaskmanagerCallerSession) ProverStore() (common.Address, error) { + return _Taskmanager.Contract.ProverStore(&_Taskmanager.CallOpts) +} + // Records is a free data retrieval call binding the contract method 0x63c7a7c8. // -// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) +// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address owner, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) func (_Taskmanager *TaskmanagerCaller) Records(opts *bind.CallOpts, arg0 *big.Int, arg1 [32]byte) (struct { Hash [32]byte + Owner common.Address Sequencer common.Address Prover common.Address RewardForProver *big.Int @@ -267,6 +362,7 @@ func (_Taskmanager *TaskmanagerCaller) Records(opts *bind.CallOpts, arg0 *big.In outstruct := new(struct { Hash [32]byte + Owner common.Address Sequencer common.Address Prover common.Address RewardForProver *big.Int @@ -279,12 +375,13 @@ func (_Taskmanager *TaskmanagerCaller) Records(opts *bind.CallOpts, arg0 *big.In } outstruct.Hash = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - outstruct.Sequencer = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.Prover = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) - outstruct.RewardForProver = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.RewardForSequencer = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - outstruct.Deadline = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - outstruct.Settled = *abi.ConvertType(out[6], new(bool)).(*bool) + outstruct.Owner = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + outstruct.Sequencer = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + outstruct.Prover = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.RewardForProver = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.RewardForSequencer = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.Deadline = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + outstruct.Settled = *abi.ConvertType(out[7], new(bool)).(*bool) return *outstruct, err @@ -292,9 +389,10 @@ func (_Taskmanager *TaskmanagerCaller) Records(opts *bind.CallOpts, arg0 *big.In // Records is a free data retrieval call binding the contract method 0x63c7a7c8. // -// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) +// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address owner, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) func (_Taskmanager *TaskmanagerSession) Records(arg0 *big.Int, arg1 [32]byte) (struct { Hash [32]byte + Owner common.Address Sequencer common.Address Prover common.Address RewardForProver *big.Int @@ -307,9 +405,10 @@ func (_Taskmanager *TaskmanagerSession) Records(arg0 *big.Int, arg1 [32]byte) (s // Records is a free data retrieval call binding the contract method 0x63c7a7c8. // -// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) +// Solidity: function records(uint256 , bytes32 ) view returns(bytes32 hash, address owner, address sequencer, address prover, uint256 rewardForProver, uint256 rewardForSequencer, uint256 deadline, bool settled) func (_Taskmanager *TaskmanagerCallerSession) Records(arg0 *big.Int, arg1 [32]byte) (struct { Hash [32]byte + Owner common.Address Sequencer common.Address Prover common.Address RewardForProver *big.Int @@ -341,67 +440,88 @@ func (_Taskmanager *TaskmanagerTransactorSession) AddOperator(operator common.Ad return _Taskmanager.Contract.AddOperator(&_Taskmanager.TransactOpts, operator) } -// Assign is a paid mutator transaction binding the contract method 0x1c6b5243. +// Assign is a paid mutator transaction binding the contract method 0x11ba23ab. // -// Solidity: function assign((uint256,bytes32,bytes32,address)[] taskAssignments, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address)[] taskAssignments, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerTransactor) Assign(opts *bind.TransactOpts, taskAssignments []TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.contract.Transact(opts, "assign", taskAssignments, sequencer, deadline) } -// Assign is a paid mutator transaction binding the contract method 0x1c6b5243. +// Assign is a paid mutator transaction binding the contract method 0x11ba23ab. // -// Solidity: function assign((uint256,bytes32,bytes32,address)[] taskAssignments, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address)[] taskAssignments, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerSession) Assign(taskAssignments []TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.Contract.Assign(&_Taskmanager.TransactOpts, taskAssignments, sequencer, deadline) } -// Assign is a paid mutator transaction binding the contract method 0x1c6b5243. +// Assign is a paid mutator transaction binding the contract method 0x11ba23ab. // -// Solidity: function assign((uint256,bytes32,bytes32,address)[] taskAssignments, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address)[] taskAssignments, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerTransactorSession) Assign(taskAssignments []TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.Contract.Assign(&_Taskmanager.TransactOpts, taskAssignments, sequencer, deadline) } -// Assign0 is a paid mutator transaction binding the contract method 0xc7c323f1. +// Assign0 is a paid mutator transaction binding the contract method 0x79365ddb. // -// Solidity: function assign((uint256,bytes32,bytes32,address) assignment, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address) assignment, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerTransactor) Assign0(opts *bind.TransactOpts, assignment TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.contract.Transact(opts, "assign0", assignment, sequencer, deadline) } -// Assign0 is a paid mutator transaction binding the contract method 0xc7c323f1. +// Assign0 is a paid mutator transaction binding the contract method 0x79365ddb. // -// Solidity: function assign((uint256,bytes32,bytes32,address) assignment, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address) assignment, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerSession) Assign0(assignment TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.Contract.Assign0(&_Taskmanager.TransactOpts, assignment, sequencer, deadline) } -// Assign0 is a paid mutator transaction binding the contract method 0xc7c323f1. +// Assign0 is a paid mutator transaction binding the contract method 0x79365ddb. // -// Solidity: function assign((uint256,bytes32,bytes32,address) assignment, address sequencer, uint256 deadline) returns() +// Solidity: function assign((uint256,bytes32,bytes32,bytes,address) assignment, address sequencer, uint256 deadline) returns() func (_Taskmanager *TaskmanagerTransactorSession) Assign0(assignment TaskAssignment, sequencer common.Address, deadline *big.Int) (*types.Transaction, error) { return _Taskmanager.Contract.Assign0(&_Taskmanager.TransactOpts, assignment, sequencer, deadline) } -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _debits, address _projectReward, address _proverStore) returns() +func (_Taskmanager *TaskmanagerTransactor) Initialize(opts *bind.TransactOpts, _debits common.Address, _projectReward common.Address, _proverStore common.Address) (*types.Transaction, error) { + return _Taskmanager.contract.Transact(opts, "initialize", _debits, _projectReward, _proverStore) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _debits, address _projectReward, address _proverStore) returns() +func (_Taskmanager *TaskmanagerSession) Initialize(_debits common.Address, _projectReward common.Address, _proverStore common.Address) (*types.Transaction, error) { + return _Taskmanager.Contract.Initialize(&_Taskmanager.TransactOpts, _debits, _projectReward, _proverStore) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc0c53b8b. +// +// Solidity: function initialize(address _debits, address _projectReward, address _proverStore) returns() +func (_Taskmanager *TaskmanagerTransactorSession) Initialize(_debits common.Address, _projectReward common.Address, _proverStore common.Address) (*types.Transaction, error) { + return _Taskmanager.Contract.Initialize(&_Taskmanager.TransactOpts, _debits, _projectReward, _proverStore) +} + +// Recall is a paid mutator transaction binding the contract method 0x585407e0. // -// Solidity: function initialize() returns() -func (_Taskmanager *TaskmanagerTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Taskmanager.contract.Transact(opts, "initialize") +// Solidity: function recall(uint256 projectId, bytes32 taskId) returns() +func (_Taskmanager *TaskmanagerTransactor) Recall(opts *bind.TransactOpts, projectId *big.Int, taskId [32]byte) (*types.Transaction, error) { + return _Taskmanager.contract.Transact(opts, "recall", projectId, taskId) } -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// Recall is a paid mutator transaction binding the contract method 0x585407e0. // -// Solidity: function initialize() returns() -func (_Taskmanager *TaskmanagerSession) Initialize() (*types.Transaction, error) { - return _Taskmanager.Contract.Initialize(&_Taskmanager.TransactOpts) +// Solidity: function recall(uint256 projectId, bytes32 taskId) returns() +func (_Taskmanager *TaskmanagerSession) Recall(projectId *big.Int, taskId [32]byte) (*types.Transaction, error) { + return _Taskmanager.Contract.Recall(&_Taskmanager.TransactOpts, projectId, taskId) } -// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// Recall is a paid mutator transaction binding the contract method 0x585407e0. // -// Solidity: function initialize() returns() -func (_Taskmanager *TaskmanagerTransactorSession) Initialize() (*types.Transaction, error) { - return _Taskmanager.Contract.Initialize(&_Taskmanager.TransactOpts) +// Solidity: function recall(uint256 projectId, bytes32 taskId) returns() +func (_Taskmanager *TaskmanagerTransactorSession) Recall(projectId *big.Int, taskId [32]byte) (*types.Transaction, error) { + return _Taskmanager.Contract.Recall(&_Taskmanager.TransactOpts, projectId, taskId) } // RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a. diff --git a/smartcontracts/scripts/deploy.ts b/smartcontracts/scripts/deploy.ts index 82d4f3d5..b489e1fc 100644 --- a/smartcontracts/scripts/deploy.ts +++ b/smartcontracts/scripts/deploy.ts @@ -189,6 +189,10 @@ async function main() { await tx.wait(); console.log(`W3bstreamBlockRewardDistributor set operator to ${minter.target}`); + tx = await debits.setOperator(minter.target); + await tx.wait(); + console.log(`W3bstreamDebits set operator to ${minter.target}`); + tx = await minter.setBlockReward(0); await tx.wait(); console.log(`W3bstreamBlockMinter set block reward to 0`); diff --git a/smartcontracts/scripts/upgrade.ts b/smartcontracts/scripts/upgrade.ts index 4e2b44f3..e052704c 100644 --- a/smartcontracts/scripts/upgrade.ts +++ b/smartcontracts/scripts/upgrade.ts @@ -28,6 +28,27 @@ async function main() { await upgrades.upgradeProxy(process.env.W3BSTREAM_VMTYPE, W3bstreamVMType, {}); console.log(`Upgrade W3bstreamVMType ${process.env.W3BSTREAM_VMTYPE} successfull!`); } + + if (process.env.W3BSTREAM_DEBITS) { + const W3bstreamDebits = await ethers.getContractFactory('W3bstreamDebits'); + await upgrades.forceImport(process.env.W3BSTREAM_DEBITS, W3bstreamDebits); + await upgrades.upgradeProxy(process.env.W3BSTREAM_DEBITS, W3bstreamDebits, {}); + console.log(`Upgrade W3bstreamDebits ${process.env.W3BSTREAM_DEBITS} successfull!`); + } + + if (process.env.W3BSTREAM_TASK_MANAGER) { + const W3bstreamTaskManager = await ethers.getContractFactory('W3bstreamTaskManager'); + await upgrades.forceImport(process.env.W3BSTREAM_TASK_MANAGER, W3bstreamTaskManager); + await upgrades.upgradeProxy(process.env.W3BSTREAM_TASK_MANAGER, W3bstreamTaskManager, {}); + console.log(`Upgrade W3bstreamTaskManager ${process.env.W3BSTREAM_TASK_MANAGER} successfull!`); + } + + if (process.env.W3BSTREAM_MINTER) { + const W3bstreamBlockMinter = await ethers.getContractFactory('W3bstreamBlockMinter'); + await upgrades.forceImport(process.env.W3BSTREAM_MINTER, W3bstreamBlockMinter); + await upgrades.upgradeProxy(process.env.W3BSTREAM_MINTER, W3bstreamBlockMinter, {}); + console.log(`Upgrade W3bstreamBlockMinter ${process.env.W3BSTREAM_MINTER} successfull!`); + } } main().catch(err => { diff --git a/task/assigner/assigner.go b/task/assigner/assigner.go index 9ecacf36..0da78016 100644 --- a/task/assigner/assigner.go +++ b/task/assigner/assigner.go @@ -3,6 +3,8 @@ package assigner import ( "context" "crypto/ecdsa" + "encoding/json" + "fmt" "log/slog" "math/big" "time" @@ -10,6 +12,7 @@ import ( "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/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" @@ -19,8 +22,11 @@ import ( "github.com/iotexproject/w3bstream/block" "github.com/iotexproject/w3bstream/cmd/sequencer/api" "github.com/iotexproject/w3bstream/smartcontracts/go/minter" + "github.com/iotexproject/w3bstream/task" ) +type RetrieveTask func(projectID uint64, taskID common.Hash) (*task.Task, error) + type DB interface { BlockHead() (uint64, common.Hash, error) NBits() (uint32, error) @@ -36,10 +42,16 @@ type assigner struct { account common.Address client *ethclient.Client db DB + retrieve RetrieveTask minterInstance *minter.Minter } func (r *assigner) assign(projectID uint64, taskID common.Hash) error { + t, err := r.retrieve(projectID, taskID) + if err != nil { + return err + } + fmt.Println(hexutil.Encode(t.Signature)) _, hash, err := r.db.BlockHead() if err != nil { return errors.Wrap(err, "failed to get block head") @@ -94,7 +106,7 @@ func (r *assigner) assign(projectID uint64, taskID common.Hash) error { }, Nonce: new(big.Int).SetUint64(nonce), }, - minter.BlockInfo{ + minter.BlockHeader{ Meta: h.Meta, Prevhash: h.PrevHash, MerkleRoot: h.MerkleRoot, @@ -112,11 +124,24 @@ func (r *assigner) assign(projectID uint64, taskID common.Hash) error { TaskId: taskID, Prover: prover, Hash: common.Hash{}, + Signature: t.Signature, }, }, ) if err != nil { - return errors.Wrap(err, "failed to send tx") + jsonErr := &struct { + Code int `json:"code"` + Message string `json:"message"` + Data interface{} `json:"data,omitempty"` + }{} + je, nerr := json.Marshal(err) + if nerr != nil { + return errors.Wrap(err, "failed to marshal send tx error") + } + if err := json.Unmarshal(je, jsonErr); err != nil { + return errors.Wrap(err, "failed to unmarshal send tx error") + } + return errors.Errorf("failed to send tx, error_code: %v, error_message: %v, error_data: %v", jsonErr.Code, jsonErr.Message, jsonErr.Data) } slog.Info("send tx to minter contract success", "hash", tx.Hash().String()) if err := r.db.AssignTask(projectID, taskID, prover); err != nil { @@ -146,7 +171,7 @@ func (r *assigner) run() { } } -func Run(db DB, prv *ecdsa.PrivateKey, chainEndpoint string, minterAddr common.Address) error { +func Run(db DB, prv *ecdsa.PrivateKey, chainEndpoint string, retrieve RetrieveTask, minterAddr common.Address) error { client, err := ethclient.Dial(chainEndpoint) if err != nil { return errors.Wrap(err, "failed to dial chain endpoint") @@ -166,6 +191,7 @@ func Run(db DB, prv *ecdsa.PrivateKey, chainEndpoint string, minterAddr common.A signer: types.NewLondonSigner(chainID), account: crypto.PubkeyToAddress(prv.PublicKey), client: client, + retrieve: retrieve, minterInstance: minterInstance, } go p.run() diff --git a/task/task.go b/task/task.go index 83708527..4cf641f7 100644 --- a/task/task.go +++ b/task/task.go @@ -30,6 +30,7 @@ func (t *Task) Sign(prv *ecdsa.PrivateKey) ([]byte, error) { if err != nil { return nil, errors.Wrap(err, "failed to sign") } + sig[64] += 27 return sig, nil }