From fcda414fa93c230d5a1dd57edfda315433af494f Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Wed, 24 Jul 2024 09:12:03 +0800 Subject: [PATCH 1/7] feat(ioctl): add data-source-pubKey param in ws project config cmd (#4337) --- ioctl/cmd/ws/wsprojectconfig.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ioctl/cmd/ws/wsprojectconfig.go b/ioctl/cmd/ws/wsprojectconfig.go index e3f2378b4d..6d958ab8cd 100644 --- a/ioctl/cmd/ws/wsprojectconfig.go +++ b/ioctl/cmd/ws/wsprojectconfig.go @@ -26,6 +26,10 @@ var ( if err != nil { return errors.Wrap(err, "failed to get flag data-source") } + dataSourcePubKey, err := cmd.Flags().GetString("data-source-pubKey") + if err != nil { + return errors.Wrap(err, "failed to get flag data-source-pubKey") + } defaultVersion, err := cmd.Flags().GetString("default-version") if err != nil { return errors.Wrap(err, "failed to get flag default-version") @@ -55,7 +59,7 @@ var ( return errors.Wrap(err, "failed to get flag output-file") } - out, err := generateProjectFile(dataSource, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile) + out, err := generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile) if err != nil { return output.PrintError(err) } @@ -70,6 +74,10 @@ var ( config.Chinese: "生成项目的配置文件", } + _flagDataSourcePublicKeyUsages = map[config.Language]string{ + config.English: "data source public key of the project", + config.Chinese: "该project的数据源的公钥", + } _flagDataSourceUsages = map[config.Language]string{ config.English: "data source of the project", config.Chinese: "该project的数据源", @@ -106,6 +114,7 @@ var ( func init() { wsProjectConfig.Flags().StringP("data-source", "s", "", config.TranslateInLang(_flagDataSourceUsages, config.UILanguage)) + wsProjectConfig.Flags().StringP("data-source-pubKey", "k", "", config.TranslateInLang(_flagDataSourcePublicKeyUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("default-version", "d", "0.1", config.TranslateInLang(_flagDefaultVersionUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("version", "v", "", config.TranslateInLang(_flagVersionUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("vm-type", "t", "", config.TranslateInLang(_flagVMTypeUsages, config.UILanguage)) @@ -128,7 +137,7 @@ type projectConfig struct { Code string `json:"code"` } -func generateProjectFile(dataSource, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile string) (string, error) { +func generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile string) (string, error) { tye, err := stringToVMType(vmType) if err != nil { return "", err @@ -174,6 +183,9 @@ func generateProjectFile(dataSource, defaultVersion, version, vmType, codeFile, if dataSource != "" { confMap["datasourceURI"] = dataSource } + if dataSourcePubKey != "" { + confMap["datasourcePublicKey"] = dataSourcePubKey + } confMap["defaultVersion"] = defaultVersion confMap["versions"] = verMaps jsonConf, err := json.MarshalIndent(confMap, "", " ") From eaad18ffbd2782718013e706ffaf665d85263a3b Mon Sep 17 00:00:00 2001 From: Chen Chen <34592639+envestcc@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:46:32 +0800 Subject: [PATCH 2/7] [api] Fix nft bucket votes counting (#4346) --- .../protocol/staking/staking_statereader.go | 2 +- e2etest/e2etest.go | 40 ++++++++ e2etest/native_staking_test.go | 94 +++++++++++++++++++ 3 files changed, 135 insertions(+), 1 deletion(-) diff --git a/action/protocol/staking/staking_statereader.go b/action/protocol/staking/staking_statereader.go index 418c5e902c..4f5f86aacf 100644 --- a/action/protocol/staking/staking_statereader.go +++ b/action/protocol/staking/staking_statereader.go @@ -359,7 +359,7 @@ func (c *compositeStakingStateReader) addContractStakingVotes(ctx context.Contex if !ok { return errors.Errorf("invalid total weighted votes %s", candidate.TotalWeightedVotes) } - addr, err := address.FromString(candidate.OwnerAddress) + addr, err := address.FromString(candidate.GetId()) if err != nil { return err } diff --git a/e2etest/e2etest.go b/e2etest/e2etest.go index 7bbc8df4dd..db6fc68f68 100644 --- a/e2etest/e2etest.go +++ b/e2etest/e2etest.go @@ -3,6 +3,7 @@ package e2etest import ( "context" "fmt" + "slices" "testing" "time" @@ -158,6 +159,45 @@ func (e *e2etest) getCandidateByName(name string) (*iotextypes.CandidateV2, erro return candidate, nil } +func (e *e2etest) getBucket(index uint64, contractAddr string) (*iotextypes.VoteBucket, error) { + methodName, err := proto.Marshal(&iotexapi.ReadStakingDataMethod{ + Method: iotexapi.ReadStakingDataMethod_COMPOSITE_BUCKETS_BY_INDEXES, + }) + if err != nil { + return nil, err + } + arg, err := proto.Marshal(&iotexapi.ReadStakingDataRequest{ + Request: &iotexapi.ReadStakingDataRequest_BucketsByIndexes{ + BucketsByIndexes: &iotexapi.ReadStakingDataRequest_VoteBucketsByIndexes{ + Index: []uint64{index}, + }, + }, + }) + if err != nil { + return nil, err + } + resp, err := e.api.ReadState(context.Background(), &iotexapi.ReadStateRequest{ + ProtocolID: []byte("staking"), + MethodName: methodName, + Arguments: [][]byte{arg}, + }) + if err != nil { + return nil, err + } + bucketList := &iotextypes.VoteBucketList{} + if err = proto.Unmarshal(resp.GetData(), bucketList); err != nil { + return nil, err + } + idx := slices.IndexFunc(bucketList.Buckets, func(e *iotextypes.VoteBucket) bool { + return e.Index == index && e.ContractAddress == contractAddr + }) + if idx < 0 { + return nil, nil + } + return bucketList.Buckets[idx], nil + +} + func addOneTx(ctx context.Context, ap actpool.ActPool, bc blockchain.Blockchain, tx *actionWithTime) (*action.SealedEnvelope, *action.Receipt, error) { if err := ap.Add(ctx, tx.act); err != nil { return tx.act, nil, err diff --git a/e2etest/native_staking_test.go b/e2etest/native_staking_test.go index 350e4044de..a095be789d 100644 --- a/e2etest/native_staking_test.go +++ b/e2etest/native_staking_test.go @@ -1239,6 +1239,100 @@ func TestCandidateTransferOwnership(t *testing.T) { }, }) }) + t.Run("votesCounting", func(t *testing.T) { + contractAddr := "io16gnlvx6zk3tev9g6vaupngkpcrwe8hdsknxerw" + cfg := initCfg(require) + cfg.Genesis.UpernavikBlockHeight = 1 + cfg.Genesis.EndorsementWithdrawWaitingBlocks = 5 + cfg.DardanellesUpgrade.BlockInterval = time.Second * 8640 + cfg.Genesis.SystemStakingContractV2Address = contractAddr + cfg.Genesis.SystemStakingContractV2Height = 0 + test := newE2ETest(t, cfg) + defer test.teardown() + + var ( + oldOwnerID = 1 + stakerID = 2 + contractCreator = 3 + newOwnerID = 4 + beneficiaryID = 5 + chainID = test.cfg.Chain.ID + stakeTime = time.Now() + minAmount = unit.ConvertIotxToRau(1000) + stakeAmount = unit.ConvertIotxToRau(10000) + blocksPerDay = 24 * time.Hour / cfg.DardanellesUpgrade.BlockInterval + stakeDurationBlocks = big.NewInt(int64(blocksPerDay)) + candidate *iotextypes.CandidateV2 + ) + bytecode, err := hex.DecodeString(stakingContractV2Bytecode) + require.NoError(err) + mustCallData := func(m string, args ...any) []byte { + data, err := abiCall(staking.StakingContractABI, m, args...) + require.NoError(err) + return data + } + test.run([]*testcase{ + { + name: "prepare", + preActs: []*actionWithTime{ + {mustNoErr(action.SignedCandidateRegister(test.nonceMgr.pop(identityset.Address(oldOwnerID).String()), "cand1", identityset.Address(1).String(), identityset.Address(1).String(), identityset.Address(oldOwnerID).String(), registerAmount.String(), 1, true, nil, gasLimit, gasPrice, identityset.PrivateKey(oldOwnerID), action.WithChainID(chainID))), time.Now()}, + }, + act: &actionWithTime{mustNoErr(action.SignedExecution("", identityset.PrivateKey(contractCreator), test.nonceMgr.pop(identityset.Address(contractCreator).String()), big.NewInt(0), gasLimit, gasPrice, append(bytecode, mustCallData("", minAmount)...), action.WithChainID(chainID))), time.Now()}, + expect: []actionExpect{successExpect, &executionExpect{contractAddr}}, + }, + { + name: "stakeBuckets", + preActs: []*actionWithTime{ + {mustNoErr(action.SignedExecution(contractAddr, identityset.PrivateKey(contractCreator), test.nonceMgr.pop(identityset.Address(contractCreator).String()), big.NewInt(0), gasLimit, gasPrice, mustCallData("setBeneficiary(address)", common.BytesToAddress(identityset.Address(beneficiaryID).Bytes())), action.WithChainID(chainID))), stakeTime}, + {mustNoErr(action.SignedCreateStake(test.nonceMgr.pop(identityset.Address(stakerID).String()), "cand1", stakeAmount.String(), 91, true, nil, gasLimit, gasPrice, identityset.PrivateKey(stakerID), action.WithChainID(test.cfg.Chain.ID))), stakeTime}, + }, + act: &actionWithTime{mustNoErr(action.SignedExecution(contractAddr, identityset.PrivateKey(stakerID), test.nonceMgr.pop(identityset.Address(stakerID).String()), stakeAmount, gasLimit, gasPrice, mustCallData("stake(uint256,address)", stakeDurationBlocks, common.BytesToAddress(identityset.Address(oldOwnerID).Bytes())), action.WithChainID(chainID))), stakeTime}, + expect: []actionExpect{successExpect, &functionExpect{func(test *e2etest, act *action.SealedEnvelope, receipt *action.Receipt, err error) { + cand, err := test.getCandidateByName("cand1") + require.NoError(err) + candidate = cand + selfStake, err := test.getBucket(cand.SelfStakeBucketIdx, "") + require.NoError(err) + require.NotNil(selfStake) + nb, err := test.getBucket(1, "") + require.NoError(err) + require.NotNil(nb) + nft, err := test.getBucket(1, contractAddr) + require.NoError(err) + require.NotNil(nft) + amtSS, ok := big.NewInt(0).SetString(selfStake.StakedAmount, 10) + require.True(ok) + amtNB, ok := big.NewInt(0).SetString(nb.StakedAmount, 10) + require.True(ok) + amtNFT, ok := big.NewInt(0).SetString(nft.StakedAmount, 10) + require.True(ok) + voteSS := staking.CalculateVoteWeight(test.cfg.Genesis.VoteWeightCalConsts, &staking.VoteBucket{StakedAmount: amtSS, StakedDuration: time.Duration(selfStake.StakedDuration*24) * time.Hour, AutoStake: selfStake.AutoStake}, true) + voteNB := staking.CalculateVoteWeight(test.cfg.Genesis.VoteWeightCalConsts, &staking.VoteBucket{StakedAmount: amtNB, StakedDuration: time.Duration(nb.StakedDuration*24) * time.Hour, AutoStake: nb.AutoStake}, false) + voteNFT := staking.CalculateVoteWeight(test.cfg.Genesis.VoteWeightCalConsts, &staking.VoteBucket{StakedAmount: amtNFT, StakedDuration: time.Duration(nft.StakedDuration*24) * time.Hour, AutoStake: nft.AutoStake}, false) + require.Equal(voteSS.Add(voteSS, voteNB.Add(voteNB, voteNFT)).String(), cand.TotalWeightedVotes) + }}}, + }, + { + name: "transferOwnership", + act: &actionWithTime{mustNoErr(action.SignedCandidateTransferOwnership(test.nonceMgr.pop(identityset.Address(oldOwnerID).String()), identityset.Address(newOwnerID).String(), nil, gasLimit, gasPrice, identityset.PrivateKey(oldOwnerID), action.WithChainID(chainID))), time.Now()}, + expect: []actionExpect{successExpect, &functionExpect{func(test *e2etest, act *action.SealedEnvelope, receipt *action.Receipt, err error) { + cand, err := test.getCandidateByName(candidate.Name) + require.NoError(err) + selfStakeBucket, err := test.getBucket(candidate.SelfStakeBucketIdx, "") + require.NoError(err) + require.NotNil(selfStakeBucket) + amtSS, ok := big.NewInt(0).SetString(selfStakeBucket.StakedAmount, 10) + require.True(ok) + selfStakeVotes := staking.CalculateVoteWeight(test.cfg.Genesis.VoteWeightCalConsts, &staking.VoteBucket{StakedAmount: amtSS, StakedDuration: time.Duration(selfStakeBucket.StakedDuration*24) * time.Hour, AutoStake: selfStakeBucket.AutoStake}, true) + nonSelfStakeVotes := staking.CalculateVoteWeight(test.cfg.Genesis.VoteWeightCalConsts, &staking.VoteBucket{StakedAmount: amtSS, StakedDuration: time.Duration(selfStakeBucket.StakedDuration*24) * time.Hour, AutoStake: selfStakeBucket.AutoStake}, false) + deltaVotes := big.NewInt(0).Sub(selfStakeVotes, nonSelfStakeVotes) + votes, ok := big.NewInt(0).SetString(cand.TotalWeightedVotes, 10) + require.True(ok) + require.Equal(votes.Sub(votes, deltaVotes).String(), candidate.TotalWeightedVotes) + }}}, + }, + }) + }) } func initCfg(r *require.Assertions) config.Config { From 39dd1cc113622836160aa3f41284809061909992 Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Mon, 29 Jul 2024 10:53:08 +0800 Subject: [PATCH 3/7] feat(ioctl): add ws prover vmtype cmd (#4342) --- ioctl/cmd/ws/contracts/Makefile | 2 +- .../ws/contracts/abis/W3bstreamVMType.json | 589 +++++ ioctl/cmd/ws/contracts/gen.go | 1 + ioctl/cmd/ws/contracts/w3bstreamvmtype.go | 1981 +++++++++++++++++ ioctl/cmd/ws/ws.go | 9 + ioctl/cmd/ws/wsvmtype.go | 68 + ioctl/cmd/ws/wsvmtypequery.go | 70 + ioctl/cmd/ws/wsvmtyperegister.go | 52 + ioctl/cmd/ws/wsvmtypestate.go | 96 + ioctl/config/config.go | 6 + ioctl/config/configsetget.go | 11 +- ioctl/newcmd/config/config.go | 14 +- ioctl/newcmd/config/config_test.go | 14 +- 13 files changed, 2907 insertions(+), 6 deletions(-) create mode 100644 ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json create mode 100644 ioctl/cmd/ws/contracts/w3bstreamvmtype.go create mode 100644 ioctl/cmd/ws/wsvmtype.go create mode 100644 ioctl/cmd/ws/wsvmtypequery.go create mode 100644 ioctl/cmd/ws/wsvmtyperegister.go create mode 100644 ioctl/cmd/ws/wsvmtypestate.go diff --git a/ioctl/cmd/ws/contracts/Makefile b/ioctl/cmd/ws/contracts/Makefile index 9fe43b14e3..6fc372f81a 100644 --- a/ioctl/cmd/ws/contracts/Makefile +++ b/ioctl/cmd/ws/contracts/Makefile @@ -19,7 +19,7 @@ fetch: generate_abi: @echo "#### generate abis from latest contracts..." @cd sprout/smartcontracts && yarn install > /dev/null 2>&1 - @mkdir -p abis && cd sprout/smartcontracts/contracts && for file in 'FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamProver' 'ProjectDevice' 'W3bstreamRouter'; \ + @mkdir -p abis && cd sprout/smartcontracts/contracts && for file in 'FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamProver' 'ProjectDevice' 'W3bstreamRouter' 'W3bstreamVMType'; \ do \ solc --include-path ../node_modules/ --base-path . --optimize --abi --overwrite --pretty-json -o . $$file.sol > /dev/null 2>&1 ; \ if [ -e $$file.abi ]; then \ diff --git a/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json b/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json new file mode 100644 index 0000000000..accda65a9b --- /dev/null +++ b/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json @@ -0,0 +1,589 @@ +[ + { + "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": 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": "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" + } + ], + "name": "TypePaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": + [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TypeResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": + [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "name": "TypeSet", + "type": "event" + }, + { + "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": [], + "name": "count", + "outputs": + [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + } + ], + "name": "mint", + "outputs": + [ + { + "internalType": "uint256", + "name": "id_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": + [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "uint256", + "name": "_id", + "type": "uint256" + } + ], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "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": "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" + }, + { + "inputs": + [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + } + ], + "name": "vmType", + "outputs": + [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/ioctl/cmd/ws/contracts/gen.go b/ioctl/cmd/ws/contracts/gen.go index 2d7e1aadbd..98bc0ec35b 100644 --- a/ioctl/cmd/ws/contracts/gen.go +++ b/ioctl/cmd/ws/contracts/gen.go @@ -6,3 +6,4 @@ package contracts //go:generate abigen --abi abis/FleetManagement.json --pkg contracts --type FleetManagement -out ./fleetmanagement.go //go:generate abigen --abi abis/ProjectDevice.json --pkg contracts --type ProjectDevice -out ./projectdevice.go //go:generate abigen --abi abis/W3bstreamRouter.json --pkg contracts --type W3bstreamRouter -out ./w3bstreamrouter.go +//go:generate abigen --abi abis/W3bstreamVMType.json --pkg contracts --type W3bstreamVMType -out ./w3bstreamvmtype.go diff --git a/ioctl/cmd/ws/contracts/w3bstreamvmtype.go b/ioctl/cmd/ws/contracts/w3bstreamvmtype.go new file mode 100644 index 0000000000..d4bb05a965 --- /dev/null +++ b/ioctl/cmd/ws/contracts/w3bstreamvmtype.go @@ -0,0 +1,1981 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contracts + +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 +) + +// W3bstreamVMTypeMetaData contains all meta data concerning the W3bstreamVMType contract. +var W3bstreamVMTypeMetaData = &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\":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\":\"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\"}],\"name\":\"TypePaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"TypeResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"TypeSet\",\"type\":\"event\"},{\"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\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"vmType\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// W3bstreamVMTypeABI is the input ABI used to generate the binding from. +// Deprecated: Use W3bstreamVMTypeMetaData.ABI instead. +var W3bstreamVMTypeABI = W3bstreamVMTypeMetaData.ABI + +// W3bstreamVMType is an auto generated Go binding around an Ethereum contract. +type W3bstreamVMType struct { + W3bstreamVMTypeCaller // Read-only binding to the contract + W3bstreamVMTypeTransactor // Write-only binding to the contract + W3bstreamVMTypeFilterer // Log filterer for contract events +} + +// W3bstreamVMTypeCaller is an auto generated read-only Go binding around an Ethereum contract. +type W3bstreamVMTypeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// W3bstreamVMTypeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type W3bstreamVMTypeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// W3bstreamVMTypeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type W3bstreamVMTypeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// W3bstreamVMTypeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type W3bstreamVMTypeSession struct { + Contract *W3bstreamVMType // 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 +} + +// W3bstreamVMTypeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type W3bstreamVMTypeCallerSession struct { + Contract *W3bstreamVMTypeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// W3bstreamVMTypeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type W3bstreamVMTypeTransactorSession struct { + Contract *W3bstreamVMTypeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// W3bstreamVMTypeRaw is an auto generated low-level Go binding around an Ethereum contract. +type W3bstreamVMTypeRaw struct { + Contract *W3bstreamVMType // Generic contract binding to access the raw methods on +} + +// W3bstreamVMTypeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type W3bstreamVMTypeCallerRaw struct { + Contract *W3bstreamVMTypeCaller // Generic read-only contract binding to access the raw methods on +} + +// W3bstreamVMTypeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type W3bstreamVMTypeTransactorRaw struct { + Contract *W3bstreamVMTypeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewW3bstreamVMType creates a new instance of W3bstreamVMType, bound to a specific deployed contract. +func NewW3bstreamVMType(address common.Address, backend bind.ContractBackend) (*W3bstreamVMType, error) { + contract, err := bindW3bstreamVMType(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &W3bstreamVMType{W3bstreamVMTypeCaller: W3bstreamVMTypeCaller{contract: contract}, W3bstreamVMTypeTransactor: W3bstreamVMTypeTransactor{contract: contract}, W3bstreamVMTypeFilterer: W3bstreamVMTypeFilterer{contract: contract}}, nil +} + +// NewW3bstreamVMTypeCaller creates a new read-only instance of W3bstreamVMType, bound to a specific deployed contract. +func NewW3bstreamVMTypeCaller(address common.Address, caller bind.ContractCaller) (*W3bstreamVMTypeCaller, error) { + contract, err := bindW3bstreamVMType(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeCaller{contract: contract}, nil +} + +// NewW3bstreamVMTypeTransactor creates a new write-only instance of W3bstreamVMType, bound to a specific deployed contract. +func NewW3bstreamVMTypeTransactor(address common.Address, transactor bind.ContractTransactor) (*W3bstreamVMTypeTransactor, error) { + contract, err := bindW3bstreamVMType(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeTransactor{contract: contract}, nil +} + +// NewW3bstreamVMTypeFilterer creates a new log filterer instance of W3bstreamVMType, bound to a specific deployed contract. +func NewW3bstreamVMTypeFilterer(address common.Address, filterer bind.ContractFilterer) (*W3bstreamVMTypeFilterer, error) { + contract, err := bindW3bstreamVMType(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeFilterer{contract: contract}, nil +} + +// bindW3bstreamVMType binds a generic wrapper to an already deployed contract. +func bindW3bstreamVMType(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := W3bstreamVMTypeMetaData.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 (_W3bstreamVMType *W3bstreamVMTypeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _W3bstreamVMType.Contract.W3bstreamVMTypeCaller.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 (_W3bstreamVMType *W3bstreamVMTypeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.W3bstreamVMTypeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_W3bstreamVMType *W3bstreamVMTypeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.W3bstreamVMTypeTransactor.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 (_W3bstreamVMType *W3bstreamVMTypeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_W3bstreamVMType *W3bstreamVMTypeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.contract.Transact(opts, method, params...) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _W3bstreamVMType.Contract.BalanceOf(&_W3bstreamVMType.CallOpts, owner) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address owner) view returns(uint256) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) BalanceOf(owner common.Address) (*big.Int, error) { + return _W3bstreamVMType.Contract.BalanceOf(&_W3bstreamVMType.CallOpts, owner) +} + +// Count is a free data retrieval call binding the contract method 0x06661abd. +// +// Solidity: function count() view returns(uint256) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) Count(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Count() (*big.Int, error) { + return _W3bstreamVMType.Contract.Count(&_W3bstreamVMType.CallOpts) +} + +// Count is a free data retrieval call binding the contract method 0x06661abd. +// +// Solidity: function count() view returns(uint256) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) Count() (*big.Int, error) { + return _W3bstreamVMType.Contract.Count(&_W3bstreamVMType.CallOpts) +} + +// GetApproved is a free data retrieval call binding the contract method 0x081812fc. +// +// Solidity: function getApproved(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) GetApproved(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { + var out []interface{} + err := _W3bstreamVMType.contract.Call(opts, &out, "getApproved", tokenId) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetApproved is a free data retrieval call binding the contract method 0x081812fc. +// +// Solidity: function getApproved(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeSession) GetApproved(tokenId *big.Int) (common.Address, error) { + return _W3bstreamVMType.Contract.GetApproved(&_W3bstreamVMType.CallOpts, tokenId) +} + +// GetApproved is a free data retrieval call binding the contract method 0x081812fc. +// +// Solidity: function getApproved(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) GetApproved(tokenId *big.Int) (common.Address, error) { + return _W3bstreamVMType.Contract.GetApproved(&_W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeCaller) IsApprovedForAll(opts *bind.CallOpts, owner common.Address, operator common.Address) (bool, error) { + var out []interface{} + err := _W3bstreamVMType.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. +// +// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { + return _W3bstreamVMType.Contract.IsApprovedForAll(&_W3bstreamVMType.CallOpts, owner, operator) +} + +// IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. +// +// Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) IsApprovedForAll(owner common.Address, operator common.Address) (bool, error) { + return _W3bstreamVMType.Contract.IsApprovedForAll(&_W3bstreamVMType.CallOpts, owner, operator) +} + +// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// +// Solidity: function isPaused(uint256 _id) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) IsPaused(opts *bind.CallOpts, _id *big.Int) (bool, error) { + var out []interface{} + err := _W3bstreamVMType.contract.Call(opts, &out, "isPaused", _id) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// +// Solidity: function isPaused(uint256 _id) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeSession) IsPaused(_id *big.Int) (bool, error) { + return _W3bstreamVMType.Contract.IsPaused(&_W3bstreamVMType.CallOpts, _id) +} + +// IsPaused is a free data retrieval call binding the contract method 0xbdf2a43c. +// +// Solidity: function isPaused(uint256 _id) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) IsPaused(_id *big.Int) (bool, error) { + return _W3bstreamVMType.Contract.IsPaused(&_W3bstreamVMType.CallOpts, _id) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Name() (string, error) { + return _W3bstreamVMType.Contract.Name(&_W3bstreamVMType.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) Name() (string, error) { + return _W3bstreamVMType.Contract.Name(&_W3bstreamVMType.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Owner() (common.Address, error) { + return _W3bstreamVMType.Contract.Owner(&_W3bstreamVMType.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) Owner() (common.Address, error) { + return _W3bstreamVMType.Contract.Owner(&_W3bstreamVMType.CallOpts) +} + +// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. +// +// Solidity: function ownerOf(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) OwnerOf(opts *bind.CallOpts, tokenId *big.Int) (common.Address, error) { + var out []interface{} + err := _W3bstreamVMType.contract.Call(opts, &out, "ownerOf", tokenId) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. +// +// Solidity: function ownerOf(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeSession) OwnerOf(tokenId *big.Int) (common.Address, error) { + return _W3bstreamVMType.Contract.OwnerOf(&_W3bstreamVMType.CallOpts, tokenId) +} + +// OwnerOf is a free data retrieval call binding the contract method 0x6352211e. +// +// Solidity: function ownerOf(uint256 tokenId) view returns(address) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) OwnerOf(tokenId *big.Int) (common.Address, error) { + return _W3bstreamVMType.Contract.OwnerOf(&_W3bstreamVMType.CallOpts, tokenId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _W3bstreamVMType.Contract.SupportsInterface(&_W3bstreamVMType.CallOpts, interfaceId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _W3bstreamVMType.Contract.SupportsInterface(&_W3bstreamVMType.CallOpts, interfaceId) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Symbol() (string, error) { + return _W3bstreamVMType.Contract.Symbol(&_W3bstreamVMType.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) Symbol() (string, error) { + return _W3bstreamVMType.Contract.Symbol(&_W3bstreamVMType.CallOpts) +} + +// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. +// +// Solidity: function tokenURI(uint256 tokenId) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) TokenURI(opts *bind.CallOpts, tokenId *big.Int) (string, error) { + var out []interface{} + err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) TokenURI(tokenId *big.Int) (string, error) { + return _W3bstreamVMType.Contract.TokenURI(&_W3bstreamVMType.CallOpts, tokenId) +} + +// TokenURI is a free data retrieval call binding the contract method 0xc87b56dd. +// +// Solidity: function tokenURI(uint256 tokenId) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) TokenURI(tokenId *big.Int) (string, error) { + return _W3bstreamVMType.Contract.TokenURI(&_W3bstreamVMType.CallOpts, tokenId) +} + +// VmType is a free data retrieval call binding the contract method 0x60442876. +// +// Solidity: function vmType(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) VmType(opts *bind.CallOpts, _id *big.Int) (string, error) { + var out []interface{} + err := _W3bstreamVMType.contract.Call(opts, &out, "vmType", _id) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// VmType is a free data retrieval call binding the contract method 0x60442876. +// +// Solidity: function vmType(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeSession) VmType(_id *big.Int) (string, error) { + return _W3bstreamVMType.Contract.VmType(&_W3bstreamVMType.CallOpts, _id) +} + +// VmType is a free data retrieval call binding the contract method 0x60442876. +// +// Solidity: function vmType(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) VmType(_id *big.Int) (string, error) { + return _W3bstreamVMType.Contract.VmType(&_W3bstreamVMType.CallOpts, _id) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) Approve(opts *bind.TransactOpts, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Approve(&_W3bstreamVMType.TransactOpts, to, tokenId) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) Approve(to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Approve(&_W3bstreamVMType.TransactOpts, to, tokenId) +} + +// Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. +// +// Solidity: function initialize(string _name, string _symbol) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) Initialize(opts *bind.TransactOpts, _name string, _symbol string) (*types.Transaction, error) { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) Initialize(_name string, _symbol string) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Initialize(&_W3bstreamVMType.TransactOpts, _name, _symbol) +} + +// Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. +// +// Solidity: function initialize(string _name, string _symbol) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) Initialize(_name string, _symbol string) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Initialize(&_W3bstreamVMType.TransactOpts, _name, _symbol) +} + +// Mint is a paid mutator transaction binding the contract method 0xd85d3d27. +// +// Solidity: function mint(string _name) returns(uint256 id_) +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) Mint(opts *bind.TransactOpts, _name string) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "mint", _name) +} + +// Mint is a paid mutator transaction binding the contract method 0xd85d3d27. +// +// Solidity: function mint(string _name) returns(uint256 id_) +func (_W3bstreamVMType *W3bstreamVMTypeSession) Mint(_name string) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Mint(&_W3bstreamVMType.TransactOpts, _name) +} + +// Mint is a paid mutator transaction binding the contract method 0xd85d3d27. +// +// Solidity: function mint(string _name) returns(uint256 id_) +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) Mint(_name string) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Mint(&_W3bstreamVMType.TransactOpts, _name) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) Pause(opts *bind.TransactOpts, _id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "pause", _id) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeSession) Pause(_id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Pause(&_W3bstreamVMType.TransactOpts, _id) +} + +// Pause is a paid mutator transaction binding the contract method 0x136439dd. +// +// Solidity: function pause(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) Pause(_id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Pause(&_W3bstreamVMType.TransactOpts, _id) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_W3bstreamVMType *W3bstreamVMTypeSession) RenounceOwnership() (*types.Transaction, error) { + return _W3bstreamVMType.Contract.RenounceOwnership(&_W3bstreamVMType.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _W3bstreamVMType.Contract.RenounceOwnership(&_W3bstreamVMType.TransactOpts) +} + +// Resume is a paid mutator transaction binding the contract method 0x414000b5. +// +// Solidity: function resume(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) Resume(opts *bind.TransactOpts, _id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "resume", _id) +} + +// Resume is a paid mutator transaction binding the contract method 0x414000b5. +// +// Solidity: function resume(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeSession) Resume(_id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Resume(&_W3bstreamVMType.TransactOpts, _id) +} + +// Resume is a paid mutator transaction binding the contract method 0x414000b5. +// +// Solidity: function resume(uint256 _id) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) Resume(_id *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.Resume(&_W3bstreamVMType.TransactOpts, _id) +} + +// SafeTransferFrom is a paid mutator transaction binding the contract method 0x42842e0e. +// +// Solidity: function safeTransferFrom(address from, address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) SafeTransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SafeTransferFrom(&_W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) SafeTransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SafeTransferFrom(&_W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeTransactor) SafeTransferFrom0(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SafeTransferFrom0(&_W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) SafeTransferFrom0(from common.Address, to common.Address, tokenId *big.Int, data []byte) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SafeTransferFrom0(&_W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeTransactor) SetApprovalForAll(opts *bind.TransactOpts, operator common.Address, approved bool) (*types.Transaction, error) { + return _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SetApprovalForAll(&_W3bstreamVMType.TransactOpts, operator, approved) +} + +// SetApprovalForAll is a paid mutator transaction binding the contract method 0xa22cb465. +// +// Solidity: function setApprovalForAll(address operator, bool approved) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) SetApprovalForAll(operator common.Address, approved bool) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.SetApprovalForAll(&_W3bstreamVMType.TransactOpts, operator, approved) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "transferFrom", from, to, tokenId) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.TransferFrom(&_W3bstreamVMType.TransactOpts, from, to, tokenId) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 tokenId) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) TransferFrom(from common.Address, to common.Address, tokenId *big.Int) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.TransferFrom(&_W3bstreamVMType.TransactOpts, from, to, tokenId) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _W3bstreamVMType.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_W3bstreamVMType *W3bstreamVMTypeSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.TransferOwnership(&_W3bstreamVMType.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_W3bstreamVMType *W3bstreamVMTypeTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _W3bstreamVMType.Contract.TransferOwnership(&_W3bstreamVMType.TransactOpts, newOwner) +} + +// W3bstreamVMTypeApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeApprovalIterator struct { + Event *W3bstreamVMTypeApproval // 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 *W3bstreamVMTypeApprovalIterator) 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(W3bstreamVMTypeApproval) + 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(W3bstreamVMTypeApproval) + 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 *W3bstreamVMTypeApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeApproval represents a Approval event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeApproval 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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, approved []common.Address, tokenId []*big.Int) (*W3bstreamVMTypeApprovalIterator, 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 := _W3bstreamVMType.contract.FilterLogs(opts, "Approval", ownerRule, approvedRule, tokenIdRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeApprovalIterator{contract: _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeApproval, 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 := _W3bstreamVMType.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(W3bstreamVMTypeApproval) + if err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseApproval(log types.Log) (*W3bstreamVMTypeApproval, error) { + event := new(W3bstreamVMTypeApproval) + if err := _W3bstreamVMType.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeApprovalForAllIterator is returned from FilterApprovalForAll and is used to iterate over the raw logs and unpacked data for ApprovalForAll events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeApprovalForAllIterator struct { + Event *W3bstreamVMTypeApprovalForAll // 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 *W3bstreamVMTypeApprovalForAllIterator) 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(W3bstreamVMTypeApprovalForAll) + 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(W3bstreamVMTypeApprovalForAll) + 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 *W3bstreamVMTypeApprovalForAllIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeApprovalForAllIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeApprovalForAll represents a ApprovalForAll event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeApprovalForAll struct { + Owner common.Address + Operator common.Address + Approved bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApprovalForAll is a free log retrieval operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// +// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterApprovalForAll(opts *bind.FilterOpts, owner []common.Address, operator []common.Address) (*W3bstreamVMTypeApprovalForAllIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "ApprovalForAll", ownerRule, operatorRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeApprovalForAllIterator{contract: _W3bstreamVMType.contract, event: "ApprovalForAll", logs: logs, sub: sub}, nil +} + +// WatchApprovalForAll is a free log subscription operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// +// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchApprovalForAll(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeApprovalForAll, owner []common.Address, operator []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } + + logs, sub, err := _W3bstreamVMType.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(W3bstreamVMTypeApprovalForAll) + if err := _W3bstreamVMType.contract.UnpackLog(event, "ApprovalForAll", 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 +} + +// ParseApprovalForAll is a log parse operation binding the contract event 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31. +// +// Solidity: event ApprovalForAll(address indexed owner, address indexed operator, bool approved) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseApprovalForAll(log types.Log) (*W3bstreamVMTypeApprovalForAll, error) { + event := new(W3bstreamVMTypeApprovalForAll) + if err := _W3bstreamVMType.contract.UnpackLog(event, "ApprovalForAll", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeInitializedIterator struct { + Event *W3bstreamVMTypeInitialized // 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 *W3bstreamVMTypeInitializedIterator) 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(W3bstreamVMTypeInitialized) + 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(W3bstreamVMTypeInitialized) + 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 *W3bstreamVMTypeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeInitialized represents a Initialized event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterInitialized(opts *bind.FilterOpts) (*W3bstreamVMTypeInitializedIterator, error) { + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &W3bstreamVMTypeInitializedIterator{contract: _W3bstreamVMType.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeInitialized) (event.Subscription, error) { + + logs, sub, err := _W3bstreamVMType.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(W3bstreamVMTypeInitialized) + if err := _W3bstreamVMType.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseInitialized(log types.Log) (*W3bstreamVMTypeInitialized, error) { + event := new(W3bstreamVMTypeInitialized) + if err := _W3bstreamVMType.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeOwnershipTransferredIterator struct { + Event *W3bstreamVMTypeOwnershipTransferred // 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 *W3bstreamVMTypeOwnershipTransferredIterator) 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(W3bstreamVMTypeOwnershipTransferred) + 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(W3bstreamVMTypeOwnershipTransferred) + 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 *W3bstreamVMTypeOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeOwnershipTransferred represents a OwnershipTransferred event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeOwnershipTransferred 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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*W3bstreamVMTypeOwnershipTransferredIterator, 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 := _W3bstreamVMType.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeOwnershipTransferredIterator{contract: _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeOwnershipTransferred, 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 := _W3bstreamVMType.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(W3bstreamVMTypeOwnershipTransferred) + if err := _W3bstreamVMType.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 (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseOwnershipTransferred(log types.Log) (*W3bstreamVMTypeOwnershipTransferred, error) { + event := new(W3bstreamVMTypeOwnershipTransferred) + if err := _W3bstreamVMType.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTransferIterator struct { + Event *W3bstreamVMTypeTransfer // 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 *W3bstreamVMTypeTransferIterator) 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(W3bstreamVMTypeTransfer) + 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(W3bstreamVMTypeTransfer) + 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 *W3bstreamVMTypeTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeTransfer represents a Transfer event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTransfer struct { + From common.Address + To common.Address + TokenId *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*W3bstreamVMTypeTransferIterator, 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) + } + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeTransferIterator{contract: _W3bstreamVMType.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (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) + } + + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "Transfer", fromRule, toRule, 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(W3bstreamVMTypeTransfer) + if err := _W3bstreamVMType.contract.UnpackLog(event, "Transfer", 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 +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTransfer(log types.Log) (*W3bstreamVMTypeTransfer, error) { + event := new(W3bstreamVMTypeTransfer) + if err := _W3bstreamVMType.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeTypePausedIterator is returned from FilterTypePaused and is used to iterate over the raw logs and unpacked data for TypePaused events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypePausedIterator struct { + Event *W3bstreamVMTypeTypePaused // 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 *W3bstreamVMTypeTypePausedIterator) 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(W3bstreamVMTypeTypePaused) + 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(W3bstreamVMTypeTypePaused) + 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 *W3bstreamVMTypeTypePausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeTypePausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeTypePaused represents a TypePaused event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypePaused struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTypePaused is a free log retrieval operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// +// Solidity: event TypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypePaused(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypePausedIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypePaused", idRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeTypePausedIterator{contract: _W3bstreamVMType.contract, event: "TypePaused", logs: logs, sub: sub}, nil +} + +// WatchTypePaused is a free log subscription operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// +// Solidity: event TypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypePaused(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypePaused, id []*big.Int) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypePaused", idRule) + 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(W3bstreamVMTypeTypePaused) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypePaused", 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 +} + +// ParseTypePaused is a log parse operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// +// Solidity: event TypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypePaused(log types.Log) (*W3bstreamVMTypeTypePaused, error) { + event := new(W3bstreamVMTypeTypePaused) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypePaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeTypeResumedIterator is returned from FilterTypeResumed and is used to iterate over the raw logs and unpacked data for TypeResumed events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypeResumedIterator struct { + Event *W3bstreamVMTypeTypeResumed // 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 *W3bstreamVMTypeTypeResumedIterator) 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(W3bstreamVMTypeTypeResumed) + 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(W3bstreamVMTypeTypeResumed) + 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 *W3bstreamVMTypeTypeResumedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeTypeResumedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeTypeResumed represents a TypeResumed event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypeResumed struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTypeResumed is a free log retrieval operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// +// Solidity: event TypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypeResumed(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypeResumedIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypeResumed", idRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeTypeResumedIterator{contract: _W3bstreamVMType.contract, event: "TypeResumed", logs: logs, sub: sub}, nil +} + +// WatchTypeResumed is a free log subscription operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// +// Solidity: event TypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeResumed(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypeResumed, id []*big.Int) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypeResumed", idRule) + 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(W3bstreamVMTypeTypeResumed) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeResumed", 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 +} + +// ParseTypeResumed is a log parse operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// +// Solidity: event TypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypeResumed(log types.Log) (*W3bstreamVMTypeTypeResumed, error) { + event := new(W3bstreamVMTypeTypeResumed) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeResumed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamVMTypeTypeSetIterator is returned from FilterTypeSet and is used to iterate over the raw logs and unpacked data for TypeSet events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypeSetIterator struct { + Event *W3bstreamVMTypeTypeSet // 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 *W3bstreamVMTypeTypeSetIterator) 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(W3bstreamVMTypeTypeSet) + 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(W3bstreamVMTypeTypeSet) + 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 *W3bstreamVMTypeTypeSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamVMTypeTypeSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamVMTypeTypeSet represents a TypeSet event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeTypeSet struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTypeSet is a free log retrieval operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// +// Solidity: event TypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypeSet(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypeSetIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypeSet", idRule) + if err != nil { + return nil, err + } + return &W3bstreamVMTypeTypeSetIterator{contract: _W3bstreamVMType.contract, event: "TypeSet", logs: logs, sub: sub}, nil +} + +// WatchTypeSet is a free log subscription operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// +// Solidity: event TypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeSet(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypeSet, id []*big.Int) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypeSet", idRule) + 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(W3bstreamVMTypeTypeSet) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeSet", 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 +} + +// ParseTypeSet is a log parse operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// +// Solidity: event TypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypeSet(log types.Log) (*W3bstreamVMTypeTypeSet, error) { + event := new(W3bstreamVMTypeTypeSet) + if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/ioctl/cmd/ws/ws.go b/ioctl/cmd/ws/ws.go index a582cff852..f2773980ca 100644 --- a/ioctl/cmd/ws/ws.go +++ b/ioctl/cmd/ws/ws.go @@ -79,6 +79,11 @@ var ( config.English: "set w3bstream router contract address for once", config.Chinese: "一次设置w3bstream router合约地址", } + + _flagVmTypeContractAddressUsages = map[config.Language]string{ + config.English: "set w3bstream vmType contract address for once", + config.Chinese: "一次设置w3bstream vmType合约地址", + } ) var ( @@ -127,4 +132,8 @@ func init() { &config.ReadConfig.WsRouterContract, "router-contract", config.ReadConfig.WsRouterContract, config.TranslateInLang(_flagRouterContractAddressUsages, config.UILanguage), ) + WsCmd.PersistentFlags().StringVar( + &config.ReadConfig.WsVmTypeContract, "vmType-contract", + config.ReadConfig.WsVmTypeContract, config.TranslateInLang(_flagVmTypeContractAddressUsages, config.UILanguage), + ) } diff --git a/ioctl/cmd/ws/wsvmtype.go b/ioctl/cmd/ws/wsvmtype.go new file mode 100644 index 0000000000..f39b96797c --- /dev/null +++ b/ioctl/cmd/ws/wsvmtype.go @@ -0,0 +1,68 @@ +package ws + +import ( + "bytes" + _ "embed" // used to embed contract abi + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/spf13/cobra" + + "github.com/iotexproject/iotex-core/ioctl/config" + "github.com/iotexproject/iotex-core/ioctl/flag" +) + +var wsVmTypeCmd = &cobra.Command{ + Use: "vmtype", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "w3bstream zkp vm type management", + config.Chinese: "w3bstream 零知识证明虚拟机类型管理", + }, config.UILanguage), +} + +var ( + vmTypeID = flag.NewUint64VarP("id", "", 0, config.TranslateInLang(_flagVmTypeIDUsages, config.UILanguage)) + vmTypeName = flag.NewStringVarP("vm-type", "", "", config.TranslateInLang(_flagVmTypeNameUsages, config.UILanguage)) +) + +var ( + _flagVmTypeIDUsages = map[config.Language]string{ + config.English: "vmType id", + config.Chinese: "vmType(虚拟机类型) ID", + } + _flagVmTypeNameUsages = map[config.Language]string{ + config.English: "vm type", + config.Chinese: "vmType(虚拟机类型) 名", + } +) + +var ( + //go:embed contracts/abis/W3bstreamVMType.json + vmTypeJSON []byte + vmTypeAddress string + vmTypeABI abi.ABI +) + +const ( + funcVmTypeMint = "mint" + funcQueryVmType = "vmType" + funcQueryVmTypeIsPaused = "isPaused" + funcVmTypePause = "pause" + funcVmTypeResume = "resume" +) + +const ( + eventOnVmTypePaused = "TypePaused" + eventOnVmTypeResumed = "TypeResumed" + eventOnVmTypeSet = "TypeSet" +) + +func init() { + var err error + vmTypeABI, err = abi.JSON(bytes.NewReader(vmTypeJSON)) + if err != nil { + panic(err) + } + vmTypeAddress = config.ReadConfig.WsVmTypeContract + + WsCmd.AddCommand(wsVmTypeCmd) +} diff --git a/ioctl/cmd/ws/wsvmtypequery.go b/ioctl/cmd/ws/wsvmtypequery.go new file mode 100644 index 0000000000..a8f80b676c --- /dev/null +++ b/ioctl/cmd/ws/wsvmtypequery.go @@ -0,0 +1,70 @@ +package ws + +import ( + "math/big" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + + "github.com/iotexproject/iotex-core/ioctl/config" + "github.com/iotexproject/iotex-core/ioctl/output" +) + +var wsVmTypeQueryCmd = &cobra.Command{ + Use: "query", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "query vmType", + config.Chinese: "查询虚拟机类型信息", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + out, err := queryVmType(big.NewInt(int64(vmTypeID.Value().(uint64)))) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(output.JSONString(out)) + return nil + }, +} + +func init() { + vmTypeID.RegisterCommand(wsVmTypeQueryCmd) + vmTypeID.MarkFlagRequired(wsVmTypeQueryCmd) + + wsVmTypeCmd.AddCommand(wsVmTypeQueryCmd) +} + +func queryVmType(vmTypeID *big.Int) (any, error) { + caller, err := NewContractCaller(vmTypeABI, vmTypeAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to new contract caller") + } + result := NewContractResult(&vmTypeABI, funcQueryVmType, new(string)) + if err = caller.Read(funcQueryVmType, []any{vmTypeID}, result); err != nil { + return nil, errors.Wrapf(err, "failed to read contract: %s", funcQueryVmType) + } + + vmTypeName, err := result.Result() + if err != nil { + return nil, err + } + + result = NewContractResult(&vmTypeABI, funcQueryVmTypeIsPaused, new(bool)) + if err = caller.Read(funcQueryVmTypeIsPaused, []any{vmTypeID}, result); err != nil { + return nil, errors.Wrapf(err, "failed to read contract: %s", funcQueryVmTypeIsPaused) + } + isPaused, err := result.Result() + if err != nil { + return nil, err + } + + return &struct { + VmTypeID uint64 `json:"vmTypeID"` + VmType string `json:"vmType"` + IsPaused bool `json:"isPaused"` + }{ + VmTypeID: vmTypeID.Uint64(), + VmType: *vmTypeName.(*string), + IsPaused: *isPaused.(*bool), + }, nil + +} diff --git a/ioctl/cmd/ws/wsvmtyperegister.go b/ioctl/cmd/ws/wsvmtyperegister.go new file mode 100644 index 0000000000..841a8c90e1 --- /dev/null +++ b/ioctl/cmd/ws/wsvmtyperegister.go @@ -0,0 +1,52 @@ +package ws + +import ( + "github.com/pkg/errors" + "github.com/spf13/cobra" + + "github.com/iotexproject/iotex-core/ioctl/cmd/ws/contracts" + "github.com/iotexproject/iotex-core/ioctl/config" + "github.com/iotexproject/iotex-core/ioctl/output" +) + +var wsVmTypeRegisterCmd = &cobra.Command{ + Use: "register", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "register vmType", + config.Chinese: "注册虚拟机类型", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + out, err := registerVmType(vmTypeName.Value().(string)) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(output.JSONString(out)) + return nil + }, +} + +func init() { + vmTypeName.RegisterCommand(wsVmTypeRegisterCmd) + vmTypeName.MarkFlagRequired(wsVmTypeRegisterCmd) + + wsVmTypeCmd.AddCommand(wsVmTypeRegisterCmd) +} + +func registerVmType(name string) (any, error) { + caller, err := NewContractCaller(vmTypeABI, vmTypeAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to create contract caller") + } + + value := new(contracts.W3bstreamVMTypeTypeSet) + result := NewContractResult(&vmTypeABI, eventOnVmTypeSet, value) + if _, err = caller.CallAndRetrieveResult(funcVmTypeMint, []any{name}, result); err != nil { + return nil, errors.Wrap(err, "failed to call contract") + } + + if _, err = result.Result(); err != nil { + return nil, err + } + + return queryVmType(value.Id) +} diff --git a/ioctl/cmd/ws/wsvmtypestate.go b/ioctl/cmd/ws/wsvmtypestate.go new file mode 100644 index 0000000000..81cb0fe708 --- /dev/null +++ b/ioctl/cmd/ws/wsvmtypestate.go @@ -0,0 +1,96 @@ +package ws + +import ( + "fmt" + "math/big" + + "github.com/pkg/errors" + "github.com/spf13/cobra" + + "github.com/iotexproject/iotex-core/ioctl/config" + "github.com/iotexproject/iotex-core/ioctl/output" +) + +var wsVmTypePauseCmd = &cobra.Command{ + Use: "pause", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "pause vmType", + config.Chinese: "停止虚拟机类型", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + id := big.NewInt(int64(vmTypeID.Value().(uint64))) + out, err := pauseVmType(id) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(fmt.Sprintf("vmType %d paused", id)) + output.PrintResult(output.JSONString(out)) + return nil + }, +} + +var wsVmTypeResumeCmd = &cobra.Command{ + Use: "resume", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "resume vmType", + config.Chinese: "启动虚拟机类型", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + id := big.NewInt(int64(vmTypeID.Value().(uint64))) + out, err := resumeVmType(id) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(fmt.Sprintf("vmType %d resumed", id)) + output.PrintResult(output.JSONString(out)) + return nil + }, +} + +func init() { + vmTypeID.RegisterCommand(wsVmTypePauseCmd) + vmTypeID.MarkFlagRequired(wsVmTypePauseCmd) + + vmTypeID.RegisterCommand(wsVmTypeResumeCmd) + vmTypeID.MarkFlagRequired(wsVmTypeResumeCmd) + + wsVmTypeCmd.AddCommand(wsVmTypePauseCmd) + wsVmTypeCmd.AddCommand(wsVmTypeResumeCmd) +} + +func pauseVmType(vmTypeID *big.Int) (any, error) { + caller, err := NewContractCaller(vmTypeABI, vmTypeAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to new contract caller") + } + + result := NewContractResult(&vmTypeABI, eventOnVmTypePaused, nil) + _, err = caller.CallAndRetrieveResult(funcVmTypePause, []any{vmTypeID}, result) + if err != nil { + return nil, errors.Wrap(err, "failed to call contract") + } + _, err = result.Result() + if err != nil { + return nil, err + } + return queryVmType(vmTypeID) +} + +func resumeVmType(vmTypeID *big.Int) (any, error) { + caller, err := NewContractCaller(vmTypeABI, vmTypeAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to new contract caller") + } + + result := NewContractResult(&vmTypeABI, eventOnVmTypeResumed, nil) + _, err = caller.CallAndRetrieveResult(funcVmTypeResume, []any{vmTypeID}, result) + if err != nil { + return nil, errors.Wrap(err, "failed to call contract") + } + _, err = result.Result() + if err != nil { + return nil, err + } + + return queryVmType(vmTypeID) +} diff --git a/ioctl/config/config.go b/ioctl/config/config.go index 7d4936450d..f1695be6c3 100644 --- a/ioctl/config/config.go +++ b/ioctl/config/config.go @@ -85,6 +85,8 @@ type Config struct { WsProjectDevicesContract string `json:"wsProjectDevicesContract" yaml:"wsProjectDevicesContract"` // WsRouterContract w3bstream Router contract address WsRouterContract string `json:"wsRouterContract" yaml:"wsRouterContract"` + // WsVmTypeContract w3bstream VMType contract address + WsVmTypeContract string `json:"wsVmTypeContract" yaml:"wsVmTypeContract"` } var ( @@ -174,6 +176,10 @@ func init() { ReadConfig.WsRouterContract = _defaultWsRouterContract completeness = false } + if ReadConfig.WsVmTypeContract == "" { + ReadConfig.WsVmTypeContract = _defaultWsVmTypeContract + completeness = false + } if !completeness { err := writeConfig() if err != nil { diff --git a/ioctl/config/configsetget.go b/ioctl/config/configsetget.go index 033f6b3b2e..dd2652e25a 100644 --- a/ioctl/config/configsetget.go +++ b/ioctl/config/configsetget.go @@ -46,12 +46,14 @@ const ( _defaultWsProjectDevicesContract = "0x3d6b6c7bDB72e8BF73780f433342759d8b329Ca5" // _defaultWsRouterContract default router contract address _defaultWsRouterContract = "0x90A27ab74E790Cef6e258aabee1B361a9c993e8b" + // _defaultWsVmTypeContract default vmType contract address + _defaultWsVmTypeContract = "0x90A27ab74E790Cef6e258aabee1B361a9c993e8b" ) var ( _supportedLanguage = []string{"English", "中文"} - _validArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract"} - _validGetArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "analyserEndpoint", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "all"} + _validArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "wsVmTypeContract"} + _validGetArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "analyserEndpoint", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "wsVmTypeContract", "all"} _validExpl = []string{"iotexscan", "iotxplorer"} _endpointCompile = regexp.MustCompile("^" + _endpointPattern + "$") ) @@ -185,6 +187,8 @@ func Get(arg string) error { fmt.Println(ReadConfig.WsProjectDevicesContract) case "wsRouterContract": fmt.Println(ReadConfig.WsRouterContract) + case "wsVmTypeContract": + fmt.Println(ReadConfig.WsVmTypeContract) case "all": fmt.Println(ReadConfig.String()) } @@ -331,6 +335,8 @@ func set(args []string) error { ReadConfig.WsProjectDevicesContract = args[1] case "wsRouterContract": ReadConfig.WsRouterContract = args[1] + case "wsVmTypeContract": + ReadConfig.WsVmTypeContract = args[1] } err := writeConfig() if err != nil { @@ -358,6 +364,7 @@ func reset() error { ReadConfig.WsProverStoreContract = _defaultWsProverStoreContract ReadConfig.WsProjectDevicesContract = _defaultWsProjectDevicesContract ReadConfig.WsRouterContract = _defaultWsRouterContract + ReadConfig.WsVmTypeContract = _defaultWsVmTypeContract err := writeConfig() if err != nil { diff --git a/ioctl/newcmd/config/config.go b/ioctl/newcmd/config/config.go index 979c030011..1e9fd5b84c 100644 --- a/ioctl/newcmd/config/config.go +++ b/ioctl/newcmd/config/config.go @@ -52,12 +52,14 @@ const ( _defaultWsProjectDevicesContract = "0x3d6b6c7bDB72e8BF73780f433342759d8b329Ca5" // _defaultWsRouterContract default router contract address _defaultWsRouterContract = "0x90A27ab74E790Cef6e258aabee1B361a9c993e8b" + // _defaultWsVmTypeContract default vmType contract address + _defaultWsVmTypeContract = "0x90A27ab74E790Cef6e258aabee1B361a9c993e8b" ) var ( _supportedLanguage = []string{"English", "中文"} - _validArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract"} - _validGetArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "analyserEndpoint", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "all"} + _validArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "wsVmTypeContract"} + _validGetArgs = []string{"endpoint", "wallet", "explorer", "defaultacc", "language", "nsv2height", "wsEndpoint", "ipfsEndpoint", "ipfsGateway", "analyserEndpoint", "wsProjectRegisterContract", "wsProjectStoreContract", "wsFleetManagementContract", "wsProverStoreContract", "wsProjectDevicesContract", "wsRouterContract", "wsVmTypeContract", "all"} _validExpl = []string{"iotexscan", "iotxplorer"} _endpointCompile = regexp.MustCompile("^" + _endpointPattern + "$") _configDir = os.Getenv("HOME") + "/.config/ioctl/default" @@ -161,6 +163,9 @@ func InitConfig() (config.Config, string, error) { if info.readConfig.WsRouterContract == "" { info.readConfig.WsRouterContract = _defaultWsRouterContract } + if info.readConfig.WsVmTypeContract == "" { + info.readConfig.WsVmTypeContract = _defaultWsVmTypeContract + } if !completeness { if err = info.writeConfig(); err != nil { return info.readConfig, info.defaultConfigFile, err @@ -199,6 +204,7 @@ func (c *info) reset() error { c.readConfig.WsProverStoreContract = _defaultWsProverStoreContract c.readConfig.WsProjectDevicesContract = _defaultWsProjectDevicesContract c.readConfig.WsRouterContract = _defaultWsRouterContract + c.readConfig.WsVmTypeContract = _defaultWsVmTypeContract err := c.writeConfig() if err != nil { @@ -275,6 +281,8 @@ func (c *info) set(args []string, insecure bool, client ioctl.Client) (string, e c.readConfig.WsProjectDevicesContract = args[1] case "wsRouterContract": c.readConfig.WsRouterContract = args[1] + case "wsVmTypeContract": + c.readConfig.WsVmTypeContract = args[1] default: return "", config.ErrConfigNotMatch } @@ -328,6 +336,8 @@ func (c *info) get(arg string) (string, error) { return c.readConfig.WsProjectDevicesContract, nil case "wsRouterContract": return c.readConfig.WsRouterContract, nil + case "wsVmTypeContract": + return c.readConfig.WsVmTypeContract, nil case "all": return jsonString(c.readConfig) default: diff --git a/ioctl/newcmd/config/config_test.go b/ioctl/newcmd/config/config_test.go index 3bd04cc493..a4c046808a 100644 --- a/ioctl/newcmd/config/config_test.go +++ b/ioctl/newcmd/config/config_test.go @@ -66,6 +66,7 @@ func TestConfigGet(t *testing.T) { WsProverStoreContract: "testWsProverStoreContract", WsProjectDevicesContract: "testWsProjectDevicesContract", WsRouterContract: "testWsRouterContract", + WsVmTypeContract: "testWsVmTypeContract", }, testPath) tcs := []struct { @@ -132,10 +133,14 @@ func TestConfigGet(t *testing.T) { "wsRouterContract", "testWsRouterContract", }, + { + "wsVmTypeContract", + "testWsVmTypeContract", + }, { "all", // " \"endpoint\": \"\",\n \"secureConnect\": true,\n \"aliases\": {},\n \"defaultAccount\": {\n \"addressOrAlias\": \"test\"\n },\n \"explorer\": \"iotexscan\",\n \"language\": \"English\",\n \"nsv2height\": 0,\n \"analyserEndpoint\": \"testAnalyser\",\n \"wsEndpoint\": \"testWsEndpoint\",\n \"ipfsEndpoint\": \"testIPFSEndpoint\",\n \"ipfsGateway\": \"testIPFSGateway\",\n \"wsProjectRegisterContract\": \"testWsProjectRegisterContract\",\n \"wsProjectStoreContract\": \"testWsProjectStoreContract\",\n \"wsFleetManagementContract\": \"testWsFleetManagementContract\",\n \"wsProverStoreContract\": \"testWsProverStoreContract\"\n}", - " \"endpoint\": \"\",\n \"secureConnect\": true,\n \"aliases\": {},\n \"defaultAccount\": {\n \"addressOrAlias\": \"test\"\n },\n \"explorer\": \"iotexscan\",\n \"language\": \"English\",\n \"nsv2height\": 0,\n \"analyserEndpoint\": \"testAnalyser\",\n \"wsEndpoint\": \"testWsEndpoint\",\n \"ipfsEndpoint\": \"testIPFSEndpoint\",\n \"ipfsGateway\": \"testIPFSGateway\",\n \"wsProjectRegisterContract\": \"testWsProjectRegisterContract\",\n \"wsProjectStoreContract\": \"testWsProjectStoreContract\",\n \"wsFleetManagementContract\": \"testWsFleetManagementContract\",\n \"wsProverStoreContract\": \"testWsProverStoreContract\",\n \"wsProjectDevicesContract\": \"testWsProjectDevicesContract\",\n \"wsRouterContract\": \"testWsRouterContract\"\n}", + " \"endpoint\": \"\",\n \"secureConnect\": true,\n \"aliases\": {},\n \"defaultAccount\": {\n \"addressOrAlias\": \"test\"\n },\n \"explorer\": \"iotexscan\",\n \"language\": \"English\",\n \"nsv2height\": 0,\n \"analyserEndpoint\": \"testAnalyser\",\n \"wsEndpoint\": \"testWsEndpoint\",\n \"ipfsEndpoint\": \"testIPFSEndpoint\",\n \"ipfsGateway\": \"testIPFSGateway\",\n \"wsProjectRegisterContract\": \"testWsProjectRegisterContract\",\n \"wsProjectStoreContract\": \"testWsProjectStoreContract\",\n \"wsFleetManagementContract\": \"testWsFleetManagementContract\",\n \"wsProverStoreContract\": \"testWsProverStoreContract\",\n \"wsProjectDevicesContract\": \"testWsProjectDevicesContract\",\n \"wsRouterContract\": \"testWsRouterContract\",\n \"wsVmTypeContract\": \"testWsVmTypeContract\"\n}", }, } @@ -171,6 +176,7 @@ func TestConfigReset(t *testing.T) { WsProverStoreContract: "testWsProverStoreContract", WsProjectDevicesContract: "testWsProjectDevicesContract", WsRouterContract: "testWsRouterContract", + WsVmTypeContract: "testWsVmTypeContract", }, cfgFile) // write the config to the temp dir and then reset @@ -194,6 +200,7 @@ func TestConfigReset(t *testing.T) { require.Equal("testWsProverStoreContract", cfg.WsProverStoreContract) require.Equal("testWsProjectDevicesContract", cfg.WsProjectDevicesContract) require.Equal("testWsRouterContract", cfg.WsRouterContract) + require.Equal("testWsVmTypeContract", cfg.WsVmTypeContract) require.NoError(info.reset()) require.NoError(info.loadConfig()) @@ -214,6 +221,7 @@ func TestConfigReset(t *testing.T) { require.Equal(_defaultWsProverStoreContract, resetCfg.WsProverStoreContract) require.Equal(_defaultWsProjectDevicesContract, resetCfg.WsProjectDevicesContract) require.Equal(_defaultWsRouterContract, resetCfg.WsRouterContract) + require.Equal(_defaultWsVmTypeContract, resetCfg.WsVmTypeContract) require.Equal("iotexscan", resetCfg.Explorer) require.Equal(*new(config.Context), resetCfg.DefaultAccount) } @@ -316,6 +324,10 @@ func TestConfigSet(t *testing.T) { []string{"wsRouterContract", "testWsRouterContract"}, "testWsRouterContract", }, + { + []string{"wsVmTypeContract", "testWsVmTypeContract"}, + "testWsVmTypeContract", + }, } for _, tc := range tcs { From 635b74547c2ea8da8d92419e6d09ad9b2cf5980a Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Mon, 29 Jul 2024 11:31:58 +0800 Subject: [PATCH 4/7] [ioctl] update ws prover update cmd (#4343) * feat(ioctl): add ws prover vmtype cmd * feat(ioctl): update ws prover update cmd --- .../ws/contracts/abis/W3bstreamProver.json | 126 ++++--- ioctl/cmd/ws/contracts/w3bstreamprover.go | 324 +++++++++++++----- ioctl/cmd/ws/wsprover.go | 8 +- ioctl/cmd/ws/wsproverquery.go | 54 ++- ioctl/cmd/ws/wsproverupdate.go | 88 +++-- 5 files changed, 441 insertions(+), 159 deletions(-) diff --git a/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json b/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json index e1e3f4e3d8..94a7b1335e 100644 --- a/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json +++ b/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json @@ -96,7 +96,27 @@ "type": "uint256" } ], - "name": "NodeTypeUpdated", + "name": "NodeTypeAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": + [ + { + "indexed": true, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "typ", + "type": "uint256" + } + ], + "name": "NodeTypeDeleted", "type": "event" }, { @@ -193,6 +213,25 @@ "name": "Transfer", "type": "event" }, + { + "inputs": + [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + } + ], + "name": "addNodeType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ @@ -266,6 +305,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": + [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + } + ], + "name": "delNodeType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ @@ -287,6 +345,32 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": + [ + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + } + ], + "name": "hasNodeType", + "outputs": + [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ @@ -402,27 +486,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": - [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - } - ], - "name": "nodeType", - "outputs": - [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ @@ -740,24 +803,5 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": - [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_type", - "type": "uint256" - } - ], - "name": "updateNodeType", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" } ] \ No newline at end of file diff --git a/ioctl/cmd/ws/contracts/w3bstreamprover.go b/ioctl/cmd/ws/contracts/w3bstreamprover.go index 12ec262de0..70727588f9 100644 --- a/ioctl/cmd/ws/contracts/w3bstreamprover.go +++ b/ioctl/cmd/ws/contracts/w3bstreamprover.go @@ -31,7 +31,7 @@ var ( // W3bstreamProverMetaData contains all meta data concerning the W3bstreamProver contract. var W3bstreamProverMetaData = &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\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"NodeTypeUpdated\",\"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\"},{\"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\":\"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\":\"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\":\"nodeType\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"updateNodeType\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + 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\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"NodeTypeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"NodeTypeDeleted\",\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"addNodeType\",\"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\":\"delNodeType\",\"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\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"hasNodeType\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\"}]", } // W3bstreamProverABI is the input ABI used to generate the binding from. @@ -273,6 +273,37 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) GetApproved(tokenId *big.I return _W3bstreamProver.Contract.GetApproved(&_W3bstreamProver.CallOpts, tokenId) } +// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. +// +// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) +func (_W3bstreamProver *W3bstreamProverCaller) HasNodeType(opts *bind.CallOpts, _id *big.Int, _type *big.Int) (bool, error) { + var out []interface{} + err := _W3bstreamProver.contract.Call(opts, &out, "hasNodeType", _id, _type) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. +// +// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) +func (_W3bstreamProver *W3bstreamProverSession) HasNodeType(_id *big.Int, _type *big.Int) (bool, error) { + return _W3bstreamProver.Contract.HasNodeType(&_W3bstreamProver.CallOpts, _id, _type) +} + +// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. +// +// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) +func (_W3bstreamProver *W3bstreamProverCallerSession) HasNodeType(_id *big.Int, _type *big.Int) (bool, error) { + return _W3bstreamProver.Contract.HasNodeType(&_W3bstreamProver.CallOpts, _id, _type) +} + // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) @@ -397,37 +428,6 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) Name() (string, error) { return _W3bstreamProver.Contract.Name(&_W3bstreamProver.CallOpts) } -// NodeType is a free data retrieval call binding the contract method 0x1c794b84. -// -// Solidity: function nodeType(uint256 _id) view returns(uint256) -func (_W3bstreamProver *W3bstreamProverCaller) NodeType(opts *bind.CallOpts, _id *big.Int) (*big.Int, error) { - var out []interface{} - err := _W3bstreamProver.contract.Call(opts, &out, "nodeType", _id) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// NodeType is a free data retrieval call binding the contract method 0x1c794b84. -// -// Solidity: function nodeType(uint256 _id) view returns(uint256) -func (_W3bstreamProver *W3bstreamProverSession) NodeType(_id *big.Int) (*big.Int, error) { - return _W3bstreamProver.Contract.NodeType(&_W3bstreamProver.CallOpts, _id) -} - -// NodeType is a free data retrieval call binding the contract method 0x1c794b84. -// -// Solidity: function nodeType(uint256 _id) view returns(uint256) -func (_W3bstreamProver *W3bstreamProverCallerSession) NodeType(_id *big.Int) (*big.Int, error) { - return _W3bstreamProver.Contract.NodeType(&_W3bstreamProver.CallOpts, _id) -} - // Operator is a free data retrieval call binding the contract method 0xab3d047f. // // Solidity: function operator(uint256 _id) view returns(address) @@ -677,6 +677,27 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) TokenURI(tokenId *big.Int) return _W3bstreamProver.Contract.TokenURI(&_W3bstreamProver.CallOpts, tokenId) } +// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// +// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactor) AddNodeType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.contract.Transact(opts, "addNodeType", _id, _type) +} + +// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// +// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverSession) AddNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.AddNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +} + +// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// +// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactorSession) AddNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.AddNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +} + // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address to, uint256 tokenId) returns() @@ -719,6 +740,27 @@ func (_W3bstreamProver *W3bstreamProverTransactorSession) ChangeOperator(_id *bi return _W3bstreamProver.Contract.ChangeOperator(&_W3bstreamProver.TransactOpts, _id, _operator) } +// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// +// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactor) DelNodeType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.contract.Transact(opts, "delNodeType", _id, _type) +} + +// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// +// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverSession) DelNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.DelNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +} + +// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// +// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactorSession) DelNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.DelNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +} + // Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. // // Solidity: function initialize(string _name, string _symbol) returns() @@ -950,27 +992,6 @@ func (_W3bstreamProver *W3bstreamProverTransactorSession) TransferOwnership(newO return _W3bstreamProver.Contract.TransferOwnership(&_W3bstreamProver.TransactOpts, newOwner) } -// UpdateNodeType is a paid mutator transaction binding the contract method 0x6a07973f. -// -// Solidity: function updateNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactor) UpdateNodeType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.contract.Transact(opts, "updateNodeType", _id, _type) -} - -// UpdateNodeType is a paid mutator transaction binding the contract method 0x6a07973f. -// -// Solidity: function updateNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverSession) UpdateNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.UpdateNodeType(&_W3bstreamProver.TransactOpts, _id, _type) -} - -// UpdateNodeType is a paid mutator transaction binding the contract method 0x6a07973f. -// -// Solidity: function updateNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactorSession) UpdateNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.UpdateNodeType(&_W3bstreamProver.TransactOpts, _id, _type) -} - // W3bstreamProverApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the W3bstreamProver contract. type W3bstreamProverApprovalIterator struct { Event *W3bstreamProverApproval // Event containing the contract specifics and raw log @@ -1555,9 +1576,154 @@ func (_W3bstreamProver *W3bstreamProverFilterer) ParseMinterSet(log types.Log) ( return event, nil } -// W3bstreamProverNodeTypeUpdatedIterator is returned from FilterNodeTypeUpdated and is used to iterate over the raw logs and unpacked data for NodeTypeUpdated events raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeUpdatedIterator struct { - Event *W3bstreamProverNodeTypeUpdated // Event containing the contract specifics and raw log +// W3bstreamProverNodeTypeAddedIterator is returned from FilterNodeTypeAdded and is used to iterate over the raw logs and unpacked data for NodeTypeAdded events raised by the W3bstreamProver contract. +type W3bstreamProverNodeTypeAddedIterator struct { + Event *W3bstreamProverNodeTypeAdded // 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 *W3bstreamProverNodeTypeAddedIterator) 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(W3bstreamProverNodeTypeAdded) + 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(W3bstreamProverNodeTypeAdded) + 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 *W3bstreamProverNodeTypeAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *W3bstreamProverNodeTypeAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// W3bstreamProverNodeTypeAdded represents a NodeTypeAdded event raised by the W3bstreamProver contract. +type W3bstreamProverNodeTypeAdded struct { + Id *big.Int + Typ *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNodeTypeAdded is a free log retrieval operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// +// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterNodeTypeAdded(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverNodeTypeAddedIterator, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "NodeTypeAdded", idRule) + if err != nil { + return nil, err + } + return &W3bstreamProverNodeTypeAddedIterator{contract: _W3bstreamProver.contract, event: "NodeTypeAdded", logs: logs, sub: sub}, nil +} + +// WatchNodeTypeAdded is a free log subscription operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// +// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeAdded(opts *bind.WatchOpts, sink chan<- *W3bstreamProverNodeTypeAdded, id []*big.Int) (event.Subscription, error) { + + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) + } + + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "NodeTypeAdded", idRule) + 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(W3bstreamProverNodeTypeAdded) + if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeAdded", 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 +} + +// ParseNodeTypeAdded is a log parse operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// +// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseNodeTypeAdded(log types.Log) (*W3bstreamProverNodeTypeAdded, error) { + event := new(W3bstreamProverNodeTypeAdded) + if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// W3bstreamProverNodeTypeDeletedIterator is returned from FilterNodeTypeDeleted and is used to iterate over the raw logs and unpacked data for NodeTypeDeleted events raised by the W3bstreamProver contract. +type W3bstreamProverNodeTypeDeletedIterator struct { + Event *W3bstreamProverNodeTypeDeleted // 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 @@ -1571,7 +1737,7 @@ type W3bstreamProverNodeTypeUpdatedIterator 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 *W3bstreamProverNodeTypeUpdatedIterator) Next() bool { +func (it *W3bstreamProverNodeTypeDeletedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1580,7 +1746,7 @@ func (it *W3bstreamProverNodeTypeUpdatedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeUpdated) + it.Event = new(W3bstreamProverNodeTypeDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1595,7 +1761,7 @@ func (it *W3bstreamProverNodeTypeUpdatedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeUpdated) + it.Event = new(W3bstreamProverNodeTypeDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1611,52 +1777,52 @@ func (it *W3bstreamProverNodeTypeUpdatedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverNodeTypeUpdatedIterator) Error() error { +func (it *W3bstreamProverNodeTypeDeletedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverNodeTypeUpdatedIterator) Close() error { +func (it *W3bstreamProverNodeTypeDeletedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverNodeTypeUpdated represents a NodeTypeUpdated event raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeUpdated struct { +// W3bstreamProverNodeTypeDeleted represents a NodeTypeDeleted event raised by the W3bstreamProver contract. +type W3bstreamProverNodeTypeDeleted struct { Id *big.Int Typ *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterNodeTypeUpdated is a free log retrieval operation binding the contract event 0x09e65b7abf1ac020ee57d85addfaffc3466fbaa144c58cf8d736f09de55820ab. +// FilterNodeTypeDeleted is a free log retrieval operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. // -// Solidity: event NodeTypeUpdated(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterNodeTypeUpdated(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverNodeTypeUpdatedIterator, error) { +// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterNodeTypeDeleted(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverNodeTypeDeletedIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "NodeTypeUpdated", idRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "NodeTypeDeleted", idRule) if err != nil { return nil, err } - return &W3bstreamProverNodeTypeUpdatedIterator{contract: _W3bstreamProver.contract, event: "NodeTypeUpdated", logs: logs, sub: sub}, nil + return &W3bstreamProverNodeTypeDeletedIterator{contract: _W3bstreamProver.contract, event: "NodeTypeDeleted", logs: logs, sub: sub}, nil } -// WatchNodeTypeUpdated is a free log subscription operation binding the contract event 0x09e65b7abf1ac020ee57d85addfaffc3466fbaa144c58cf8d736f09de55820ab. +// WatchNodeTypeDeleted is a free log subscription operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. // -// Solidity: event NodeTypeUpdated(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeUpdated(opts *bind.WatchOpts, sink chan<- *W3bstreamProverNodeTypeUpdated, id []*big.Int) (event.Subscription, error) { +// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeDeleted(opts *bind.WatchOpts, sink chan<- *W3bstreamProverNodeTypeDeleted, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "NodeTypeUpdated", idRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "NodeTypeDeleted", idRule) if err != nil { return nil, err } @@ -1666,8 +1832,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeUpdated(opts *bind select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverNodeTypeUpdated) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeUpdated", log); err != nil { + event := new(W3bstreamProverNodeTypeDeleted) + if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeDeleted", log); err != nil { return err } event.Raw = log @@ -1688,12 +1854,12 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeUpdated(opts *bind }), nil } -// ParseNodeTypeUpdated is a log parse operation binding the contract event 0x09e65b7abf1ac020ee57d85addfaffc3466fbaa144c58cf8d736f09de55820ab. +// ParseNodeTypeDeleted is a log parse operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. // -// Solidity: event NodeTypeUpdated(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseNodeTypeUpdated(log types.Log) (*W3bstreamProverNodeTypeUpdated, error) { - event := new(W3bstreamProverNodeTypeUpdated) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeUpdated", log); err != nil { +// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseNodeTypeDeleted(log types.Log) (*W3bstreamProverNodeTypeDeleted, error) { + event := new(W3bstreamProverNodeTypeDeleted) + if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeDeleted", log); err != nil { return nil, err } event.Raw = log diff --git a/ioctl/cmd/ws/wsprover.go b/ioctl/cmd/ws/wsprover.go index fc1f40afe6..6be8a16de8 100644 --- a/ioctl/cmd/ws/wsprover.go +++ b/ioctl/cmd/ws/wsprover.go @@ -54,8 +54,9 @@ var ( const ( funcProverRegister = "register" - funcUpdateProver = "updateNodeType" - funcQueryProverNodeType = "nodeType" + funcAddProverType = "addNodeType" + funcDelProverType = "delNodeType" + funcQueryProverNodeType = "hasNodeType" funcQueryProverIsPaused = "isPaused" funcQueryProverOperator = "operator" funcQueryProverOwner = "prover" @@ -66,7 +67,8 @@ const ( const ( eventOnProverRegistered = "Transfer" - eventOnProverUpdated = "NodeTypeUpdated" + eventOnProverTypeAdded = "NodeTypeAdded" + eventOnProverTypeDeleted = "NodeTypeDeleted" eventOnProverPaused = "ProverPaused" eventOnProverResumed = "ProverResumed" eventOnProverOwnerChanged = "OperatorSet" diff --git a/ioctl/cmd/ws/wsproverquery.go b/ioctl/cmd/ws/wsproverquery.go index c4019194c4..2526b1900e 100644 --- a/ioctl/cmd/ws/wsproverquery.go +++ b/ioctl/cmd/ws/wsproverquery.go @@ -1,6 +1,7 @@ package ws import ( + "fmt" "math/big" "github.com/ethereum/go-ethereum/common" @@ -29,11 +30,33 @@ var wsProverQueryCmd = &cobra.Command{ }, } +var wsProverQueryTypeCmd = &cobra.Command{ + Use: "querytype", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "query prover node type", + config.Chinese: "查询prover节点类型信息", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + out, err := queryProverType(big.NewInt(int64(proverID.Value().(uint64))), big.NewInt(int64(proverNodeType.Value().(uint64)))) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(output.JSONString(out)) + return nil + }, +} + func init() { proverID.RegisterCommand(wsProverQueryCmd) proverID.MarkFlagRequired(wsProverQueryCmd) + proverID.RegisterCommand(wsProverQueryTypeCmd) + proverID.MarkFlagRequired(wsProverQueryTypeCmd) + proverNodeType.RegisterCommand(wsProverQueryTypeCmd) + proverNodeType.MarkFlagRequired(wsProverQueryTypeCmd) + wsProverCmd.AddCommand(wsProverQueryCmd) + wsProverCmd.AddCommand(wsProverQueryTypeCmd) } func queryProver(proverID *big.Int) (any, error) { @@ -41,17 +64,8 @@ func queryProver(proverID *big.Int) (any, error) { if err != nil { return nil, errors.Wrap(err, "failed to new contract caller") } - result := NewContractResult(&proverStoreABI, funcQueryProverNodeType, new(big.Int)) - if err = caller.Read(funcQueryProverNodeType, []any{proverID}, result); err != nil { - return nil, errors.Wrapf(err, "failed to read contract: %s", funcQueryProverNodeType) - } - nodeType, err := result.Result() - if err != nil { - return nil, err - } - - result = NewContractResult(&proverStoreABI, funcQueryProverIsPaused, new(bool)) + result := NewContractResult(&proverStoreABI, funcQueryProverIsPaused, new(bool)) if err = caller.Read(funcQueryProverIsPaused, []any{proverID}, result); err != nil { return nil, errors.Wrapf(err, "failed to read contract: %s", funcQueryProverIsPaused) } @@ -91,15 +105,31 @@ func queryProver(proverID *big.Int) (any, error) { return &struct { ProverID uint64 `json:"proverID"` Prover string `json:"owner"` - NodeType uint64 `json:"nodeType"` IsPaused bool `json:"isPaused"` Operator string `json:"operator"` }{ ProverID: proverID.Uint64(), Prover: ownerAddr, - NodeType: nodeType.(*big.Int).Uint64(), IsPaused: *isPaused.(*bool), Operator: operatorAddr, }, nil } + +func queryProverType(proverID, nodeType *big.Int) (string, error) { + caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) + if err != nil { + return "", errors.Wrap(err, "failed to new contract caller") + } + result := NewContractResult(&proverStoreABI, funcQueryProverNodeType, new(bool)) + if err = caller.Read(funcQueryProverNodeType, []any{proverID, nodeType}, result); err != nil { + return "", errors.Wrapf(err, "failed to read contract: %s", funcQueryProverNodeType) + } + + hasNodeType, err := result.Result() + if err != nil { + return "", err + } + + return fmt.Sprintf("the state of proverID and nodeType is %t", *hasNodeType.(*bool)), nil +} diff --git a/ioctl/cmd/ws/wsproverupdate.go b/ioctl/cmd/ws/wsproverupdate.go index 1de499039a..cc56e901ea 100644 --- a/ioctl/cmd/ws/wsproverupdate.go +++ b/ioctl/cmd/ws/wsproverupdate.go @@ -1,6 +1,7 @@ package ws import ( + "fmt" "math/big" "github.com/pkg/errors" @@ -11,14 +12,33 @@ import ( "github.com/iotexproject/iotex-core/ioctl/output" ) -var wsProverUpdateCmd = &cobra.Command{ - Use: "update", +var wsProverAddNodeTypeCmd = &cobra.Command{ + Use: "addtype", Short: config.TranslateInLang(map[config.Language]string{ - config.English: "update prover", - config.Chinese: "更新prover节点类型", + config.English: "add prover node type", + config.Chinese: "添加prover节点类型", }, config.UILanguage), RunE: func(cmd *cobra.Command, args []string) error { - out, err := updateProver( + out, err := addProverType( + big.NewInt(int64(proverID.Value().(uint64))), + big.NewInt(int64(proverNodeType.Value().(uint64))), + ) + if err != nil { + return output.PrintError(err) + } + output.PrintResult(output.JSONString(out)) + return nil + }, +} + +var wsProverDelNodeTypeCmd = &cobra.Command{ + Use: "deltype", + Short: config.TranslateInLang(map[config.Language]string{ + config.English: "delete prover node type", + config.Chinese: "删除prover节点类型", + }, config.UILanguage), + RunE: func(cmd *cobra.Command, args []string) error { + out, err := delProverType( big.NewInt(int64(proverID.Value().(uint64))), big.NewInt(int64(proverNodeType.Value().(uint64))), ) @@ -31,36 +51,56 @@ var wsProverUpdateCmd = &cobra.Command{ } func init() { - proverID.RegisterCommand(wsProverUpdateCmd) - proverID.MarkFlagRequired(wsProverUpdateCmd) + proverID.RegisterCommand(wsProverAddNodeTypeCmd) + proverID.MarkFlagRequired(wsProverAddNodeTypeCmd) - proverNodeType.RegisterCommand(wsProverUpdateCmd) - proverNodeType.MarkFlagRequired(wsProverUpdateCmd) + proverNodeType.RegisterCommand(wsProverAddNodeTypeCmd) + proverNodeType.MarkFlagRequired(wsProverAddNodeTypeCmd) + + proverID.RegisterCommand(wsProverDelNodeTypeCmd) + proverID.MarkFlagRequired(wsProverDelNodeTypeCmd) + + proverNodeType.RegisterCommand(wsProverDelNodeTypeCmd) + proverNodeType.MarkFlagRequired(wsProverDelNodeTypeCmd) + + wsProverCmd.AddCommand(wsProverAddNodeTypeCmd) + wsProverCmd.AddCommand(wsProverDelNodeTypeCmd) +} + +func addProverType(proverID, nodeType *big.Int) (string, error) { + caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) + if err != nil { + return "", errors.Wrap(err, "failed to create contract caller") + } + + value := new(contracts.W3bstreamProverNodeTypeAdded) + result := NewContractResult(&proverStoreABI, eventOnProverTypeAdded, value) + if _, err = caller.CallAndRetrieveResult(funcAddProverType, []any{proverID, nodeType}, result); err != nil { + return "", errors.Wrap(err, "failed to call contract") + } + + if _, err = result.Result(); err != nil { + return "", err + } - wsProverCmd.AddCommand(wsProverUpdateCmd) + return fmt.Sprintf("the type of proverID %s and nodeType %s has added successfully.", value.Id.String(), value.Typ.String()), nil } -func updateProver(proverID, nodeType *big.Int) (any, error) { +func delProverType(proverID, nodeType *big.Int) (string, error) { caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) if err != nil { - return nil, errors.Wrap(err, "failed to create contract caller") + return "", errors.Wrap(err, "failed to create contract caller") } - value := new(contracts.W3bstreamProverNodeTypeUpdated) - result := NewContractResult(&proverStoreABI, eventOnProverUpdated, value) - if _, err = caller.CallAndRetrieveResult(funcUpdateProver, []any{proverID, nodeType}, result); err != nil { - return nil, errors.Wrap(err, "failed to call contract") + value := new(contracts.W3bstreamProverNodeTypeDeleted) + result := NewContractResult(&proverStoreABI, eventOnProverTypeDeleted, value) + if _, err = caller.CallAndRetrieveResult(funcDelProverType, []any{proverID, nodeType}, result); err != nil { + return "", errors.Wrap(err, "failed to call contract") } if _, err = result.Result(); err != nil { - return nil, err + return "", err } - return &struct { - ProverID *big.Int `json:"proverID"` - NodeType *big.Int `json:"nodeType"` - }{ - ProverID: value.Id, - NodeType: value.Typ, - }, nil + return fmt.Sprintf("the type of proverID %s and nodeType %s has deleted successfully.", value.Id.String(), value.Typ.String()), nil } From b927c59072b58408cbe40213ae017bc93e792f7d Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Mon, 29 Jul 2024 12:41:33 +0800 Subject: [PATCH 5/7] [ioctl] rename nodetype to vmtype (#4344) * feat(ioctl): add ws prover vmtype cmd * feat(ioctl): update ws prover update cmd * feat(ioctl): rename nodetype to vmtype --- .../ws/contracts/abis/W3bstreamProver.json | 136 ++-- .../ws/contracts/abis/W3bstreamVMType.json | 8 +- ioctl/cmd/ws/contracts/w3bstreamprover.go | 624 +++++++++--------- ioctl/cmd/ws/contracts/w3bstreamvmtype.go | 182 ++--- ioctl/cmd/ws/wsprover.go | 26 +- ioctl/cmd/ws/wsproverquery.go | 34 +- ioctl/cmd/ws/wsproverupdate.go | 64 +- ioctl/cmd/ws/wsvmtype.go | 8 +- ioctl/cmd/ws/wsvmtyperegister.go | 2 +- 9 files changed, 542 insertions(+), 542 deletions(-) diff --git a/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json b/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json index 94a7b1335e..b69d40ca5f 100644 --- a/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json +++ b/ioctl/cmd/ws/contracts/abis/W3bstreamProver.json @@ -79,46 +79,6 @@ "name": "MinterSet", "type": "event" }, - { - "anonymous": false, - "inputs": - [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "typ", - "type": "uint256" - } - ], - "name": "NodeTypeAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": - [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "typ", - "type": "uint256" - } - ], - "name": "NodeTypeDeleted", - "type": "event" - }, { "anonymous": false, "inputs": @@ -213,6 +173,46 @@ "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": [ @@ -227,7 +227,7 @@ "type": "uint256" } ], - "name": "addNodeType", + "name": "addVMType", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -319,7 +319,7 @@ "type": "uint256" } ], - "name": "delNodeType", + "name": "delVMType", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -345,32 +345,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": - [ - { - "internalType": "uint256", - "name": "_id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_type", - "type": "uint256" - } - ], - "name": "hasNodeType", - "outputs": - [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ @@ -437,6 +411,32 @@ "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": [ diff --git a/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json b/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json index accda65a9b..3dae0704b5 100644 --- a/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json +++ b/ioctl/cmd/ws/contracts/abis/W3bstreamVMType.json @@ -122,7 +122,7 @@ "type": "uint256" } ], - "name": "TypePaused", + "name": "VMTypePaused", "type": "event" }, { @@ -136,7 +136,7 @@ "type": "uint256" } ], - "name": "TypeResumed", + "name": "VMTypeResumed", "type": "event" }, { @@ -150,7 +150,7 @@ "type": "uint256" } ], - "name": "TypeSet", + "name": "VMTypeSet", "type": "event" }, { @@ -574,7 +574,7 @@ "type": "uint256" } ], - "name": "vmType", + "name": "vmTypeName", "outputs": [ { diff --git a/ioctl/cmd/ws/contracts/w3bstreamprover.go b/ioctl/cmd/ws/contracts/w3bstreamprover.go index 70727588f9..746916e5e6 100644 --- a/ioctl/cmd/ws/contracts/w3bstreamprover.go +++ b/ioctl/cmd/ws/contracts/w3bstreamprover.go @@ -31,7 +31,7 @@ var ( // W3bstreamProverMetaData contains all meta data concerning the W3bstreamProver contract. var W3bstreamProverMetaData = &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\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"NodeTypeAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"typ\",\"type\":\"uint256\"}],\"name\":\"NodeTypeDeleted\",\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"addNodeType\",\"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\":\"delNodeType\",\"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\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"}],\"name\":\"hasNodeType\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":\"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\"}]", } // W3bstreamProverABI is the input ABI used to generate the binding from. @@ -273,37 +273,6 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) GetApproved(tokenId *big.I return _W3bstreamProver.Contract.GetApproved(&_W3bstreamProver.CallOpts, tokenId) } -// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. -// -// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) -func (_W3bstreamProver *W3bstreamProverCaller) HasNodeType(opts *bind.CallOpts, _id *big.Int, _type *big.Int) (bool, error) { - var out []interface{} - err := _W3bstreamProver.contract.Call(opts, &out, "hasNodeType", _id, _type) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. -// -// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) -func (_W3bstreamProver *W3bstreamProverSession) HasNodeType(_id *big.Int, _type *big.Int) (bool, error) { - return _W3bstreamProver.Contract.HasNodeType(&_W3bstreamProver.CallOpts, _id, _type) -} - -// HasNodeType is a free data retrieval call binding the contract method 0x5b60c637. -// -// Solidity: function hasNodeType(uint256 _id, uint256 _type) view returns(bool) -func (_W3bstreamProver *W3bstreamProverCallerSession) HasNodeType(_id *big.Int, _type *big.Int) (bool, error) { - return _W3bstreamProver.Contract.HasNodeType(&_W3bstreamProver.CallOpts, _id, _type) -} - // IsApprovedForAll is a free data retrieval call binding the contract method 0xe985e9c5. // // Solidity: function isApprovedForAll(address owner, address operator) view returns(bool) @@ -366,6 +335,37 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) IsPaused(_id *big.Int) (bo return _W3bstreamProver.Contract.IsPaused(&_W3bstreamProver.CallOpts, _id) } +// IsVMTypeSupported is a free data retrieval call binding the contract method 0x6d968739. +// +// Solidity: function isVMTypeSupported(uint256 _id, uint256 _type) view returns(bool) +func (_W3bstreamProver *W3bstreamProverCaller) IsVMTypeSupported(opts *bind.CallOpts, _id *big.Int, _type *big.Int) (bool, error) { + var out []interface{} + err := _W3bstreamProver.contract.Call(opts, &out, "isVMTypeSupported", _id, _type) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsVMTypeSupported is a free data retrieval call binding the contract method 0x6d968739. +// +// Solidity: function isVMTypeSupported(uint256 _id, uint256 _type) view returns(bool) +func (_W3bstreamProver *W3bstreamProverSession) IsVMTypeSupported(_id *big.Int, _type *big.Int) (bool, error) { + return _W3bstreamProver.Contract.IsVMTypeSupported(&_W3bstreamProver.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 (_W3bstreamProver *W3bstreamProverCallerSession) IsVMTypeSupported(_id *big.Int, _type *big.Int) (bool, error) { + return _W3bstreamProver.Contract.IsVMTypeSupported(&_W3bstreamProver.CallOpts, _id, _type) +} + // Minter is a free data retrieval call binding the contract method 0x07546172. // // Solidity: function minter() view returns(address) @@ -677,25 +677,25 @@ func (_W3bstreamProver *W3bstreamProverCallerSession) TokenURI(tokenId *big.Int) return _W3bstreamProver.Contract.TokenURI(&_W3bstreamProver.CallOpts, tokenId) } -// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. // -// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactor) AddNodeType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.contract.Transact(opts, "addNodeType", _id, _type) +// Solidity: function addVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactor) AddVMType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.contract.Transact(opts, "addVMType", _id, _type) } -// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. // -// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverSession) AddNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.AddNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +// Solidity: function addVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverSession) AddVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.AddVMType(&_W3bstreamProver.TransactOpts, _id, _type) } -// AddNodeType is a paid mutator transaction binding the contract method 0xe2b6f485. +// AddVMType is a paid mutator transaction binding the contract method 0x5ba87ef4. // -// Solidity: function addNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactorSession) AddNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.AddNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +// Solidity: function addVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactorSession) AddVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.AddVMType(&_W3bstreamProver.TransactOpts, _id, _type) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. @@ -740,25 +740,25 @@ func (_W3bstreamProver *W3bstreamProverTransactorSession) ChangeOperator(_id *bi return _W3bstreamProver.Contract.ChangeOperator(&_W3bstreamProver.TransactOpts, _id, _operator) } -// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. // -// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactor) DelNodeType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.contract.Transact(opts, "delNodeType", _id, _type) +// Solidity: function delVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactor) DelVMType(opts *bind.TransactOpts, _id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.contract.Transact(opts, "delVMType", _id, _type) } -// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. // -// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverSession) DelNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.DelNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +// Solidity: function delVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverSession) DelVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.DelVMType(&_W3bstreamProver.TransactOpts, _id, _type) } -// DelNodeType is a paid mutator transaction binding the contract method 0x6dcab315. +// DelVMType is a paid mutator transaction binding the contract method 0x572529b7. // -// Solidity: function delNodeType(uint256 _id, uint256 _type) returns() -func (_W3bstreamProver *W3bstreamProverTransactorSession) DelNodeType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { - return _W3bstreamProver.Contract.DelNodeType(&_W3bstreamProver.TransactOpts, _id, _type) +// Solidity: function delVMType(uint256 _id, uint256 _type) returns() +func (_W3bstreamProver *W3bstreamProverTransactorSession) DelVMType(_id *big.Int, _type *big.Int) (*types.Transaction, error) { + return _W3bstreamProver.Contract.DelVMType(&_W3bstreamProver.TransactOpts, _id, _type) } // Initialize is a paid mutator transaction binding the contract method 0x4cd88b76. @@ -1576,9 +1576,9 @@ func (_W3bstreamProver *W3bstreamProverFilterer) ParseMinterSet(log types.Log) ( return event, nil } -// W3bstreamProverNodeTypeAddedIterator is returned from FilterNodeTypeAdded and is used to iterate over the raw logs and unpacked data for NodeTypeAdded events raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeAddedIterator struct { - Event *W3bstreamProverNodeTypeAdded // Event containing the contract specifics and raw log +// W3bstreamProverOperatorSetIterator is returned from FilterOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorSet events raised by the W3bstreamProver contract. +type W3bstreamProverOperatorSetIterator struct { + Event *W3bstreamProverOperatorSet // 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 +1592,7 @@ type W3bstreamProverNodeTypeAddedIterator 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 *W3bstreamProverNodeTypeAddedIterator) Next() bool { +func (it *W3bstreamProverOperatorSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1601,7 +1601,7 @@ func (it *W3bstreamProverNodeTypeAddedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeAdded) + it.Event = new(W3bstreamProverOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1616,7 +1616,7 @@ func (it *W3bstreamProverNodeTypeAddedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeAdded) + it.Event = new(W3bstreamProverOperatorSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1632,52 +1632,60 @@ func (it *W3bstreamProverNodeTypeAddedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverNodeTypeAddedIterator) Error() error { +func (it *W3bstreamProverOperatorSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverNodeTypeAddedIterator) Close() error { +func (it *W3bstreamProverOperatorSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverNodeTypeAdded represents a NodeTypeAdded event raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeAdded struct { - Id *big.Int - Typ *big.Int - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverOperatorSet represents a OperatorSet event raised by the W3bstreamProver contract. +type W3bstreamProverOperatorSet struct { + Id *big.Int + Operator common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterNodeTypeAdded is a free log retrieval operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// FilterOperatorSet is a free log retrieval operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. // -// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterNodeTypeAdded(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverNodeTypeAddedIterator, error) { +// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterOperatorSet(opts *bind.FilterOpts, id []*big.Int, operator []common.Address) (*W3bstreamProverOperatorSetIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } + var operatorRule []interface{} + for _, operatorItem := range operator { + operatorRule = append(operatorRule, operatorItem) + } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "NodeTypeAdded", idRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "OperatorSet", idRule, operatorRule) if err != nil { return nil, err } - return &W3bstreamProverNodeTypeAddedIterator{contract: _W3bstreamProver.contract, event: "NodeTypeAdded", logs: logs, sub: sub}, nil + return &W3bstreamProverOperatorSetIterator{contract: _W3bstreamProver.contract, event: "OperatorSet", logs: logs, sub: sub}, nil } -// WatchNodeTypeAdded is a free log subscription operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// WatchOperatorSet is a free log subscription operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. // -// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeAdded(opts *bind.WatchOpts, sink chan<- *W3bstreamProverNodeTypeAdded, id []*big.Int) (event.Subscription, error) { +// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan<- *W3bstreamProverOperatorSet, 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) + } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "NodeTypeAdded", idRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "OperatorSet", idRule, operatorRule) if err != nil { return nil, err } @@ -1687,8 +1695,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeAdded(opts *bind.W select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverNodeTypeAdded) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeAdded", log); err != nil { + event := new(W3bstreamProverOperatorSet) + if err := _W3bstreamProver.contract.UnpackLog(event, "OperatorSet", log); err != nil { return err } event.Raw = log @@ -1709,21 +1717,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeAdded(opts *bind.W }), nil } -// ParseNodeTypeAdded is a log parse operation binding the contract event 0x7a8d6c13ab852956e13c00c7ca802bab711f762666d33ba105921650b0243f20. +// ParseOperatorSet is a log parse operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. // -// Solidity: event NodeTypeAdded(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseNodeTypeAdded(log types.Log) (*W3bstreamProverNodeTypeAdded, error) { - event := new(W3bstreamProverNodeTypeAdded) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeAdded", log); err != nil { +// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseOperatorSet(log types.Log) (*W3bstreamProverOperatorSet, error) { + event := new(W3bstreamProverOperatorSet) + if err := _W3bstreamProver.contract.UnpackLog(event, "OperatorSet", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverNodeTypeDeletedIterator is returned from FilterNodeTypeDeleted and is used to iterate over the raw logs and unpacked data for NodeTypeDeleted events raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeDeletedIterator struct { - Event *W3bstreamProverNodeTypeDeleted // Event containing the contract specifics and raw log +// W3bstreamProverOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the W3bstreamProver contract. +type W3bstreamProverOwnershipTransferredIterator struct { + Event *W3bstreamProverOwnershipTransferred // 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 @@ -1737,7 +1745,7 @@ type W3bstreamProverNodeTypeDeletedIterator 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 *W3bstreamProverNodeTypeDeletedIterator) Next() bool { +func (it *W3bstreamProverOwnershipTransferredIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1746,7 +1754,7 @@ func (it *W3bstreamProverNodeTypeDeletedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeDeleted) + it.Event = new(W3bstreamProverOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1761,7 +1769,7 @@ func (it *W3bstreamProverNodeTypeDeletedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverNodeTypeDeleted) + it.Event = new(W3bstreamProverOwnershipTransferred) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1777,52 +1785,60 @@ func (it *W3bstreamProverNodeTypeDeletedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverNodeTypeDeletedIterator) Error() error { +func (it *W3bstreamProverOwnershipTransferredIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverNodeTypeDeletedIterator) Close() error { +func (it *W3bstreamProverOwnershipTransferredIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverNodeTypeDeleted represents a NodeTypeDeleted event raised by the W3bstreamProver contract. -type W3bstreamProverNodeTypeDeleted struct { - Id *big.Int - Typ *big.Int - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverOwnershipTransferred represents a OwnershipTransferred event raised by the W3bstreamProver contract. +type W3bstreamProverOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterNodeTypeDeleted is a free log retrieval operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterNodeTypeDeleted(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverNodeTypeDeletedIterator, error) { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*W3bstreamProverOwnershipTransferredIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + 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 := _W3bstreamProver.contract.FilterLogs(opts, "NodeTypeDeleted", idRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } - return &W3bstreamProverNodeTypeDeletedIterator{contract: _W3bstreamProver.contract, event: "NodeTypeDeleted", logs: logs, sub: sub}, nil + return &W3bstreamProverOwnershipTransferredIterator{contract: _W3bstreamProver.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil } -// WatchNodeTypeDeleted is a free log subscription operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeDeleted(opts *bind.WatchOpts, sink chan<- *W3bstreamProverNodeTypeDeleted, id []*big.Int) (event.Subscription, error) { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *W3bstreamProverOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + 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 := _W3bstreamProver.contract.WatchLogs(opts, "NodeTypeDeleted", idRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) if err != nil { return nil, err } @@ -1832,8 +1848,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeDeleted(opts *bind select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverNodeTypeDeleted) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeDeleted", log); err != nil { + event := new(W3bstreamProverOwnershipTransferred) + if err := _W3bstreamProver.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return err } event.Raw = log @@ -1854,21 +1870,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchNodeTypeDeleted(opts *bind }), nil } -// ParseNodeTypeDeleted is a log parse operation binding the contract event 0xef1aba63aee4e221bc1b165e1617efd3034ad5c99837d048c05850fd10b138d2. +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. // -// Solidity: event NodeTypeDeleted(uint256 indexed id, uint256 typ) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseNodeTypeDeleted(log types.Log) (*W3bstreamProverNodeTypeDeleted, error) { - event := new(W3bstreamProverNodeTypeDeleted) - if err := _W3bstreamProver.contract.UnpackLog(event, "NodeTypeDeleted", log); err != nil { +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseOwnershipTransferred(log types.Log) (*W3bstreamProverOwnershipTransferred, error) { + event := new(W3bstreamProverOwnershipTransferred) + if err := _W3bstreamProver.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverOperatorSetIterator is returned from FilterOperatorSet and is used to iterate over the raw logs and unpacked data for OperatorSet events raised by the W3bstreamProver contract. -type W3bstreamProverOperatorSetIterator struct { - Event *W3bstreamProverOperatorSet // Event containing the contract specifics and raw log +// W3bstreamProverProverPausedIterator is returned from FilterProverPaused and is used to iterate over the raw logs and unpacked data for ProverPaused events raised by the W3bstreamProver contract. +type W3bstreamProverProverPausedIterator struct { + Event *W3bstreamProverProverPaused // 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 @@ -1882,7 +1898,7 @@ type W3bstreamProverOperatorSetIterator 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 *W3bstreamProverOperatorSetIterator) Next() bool { +func (it *W3bstreamProverProverPausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1891,7 +1907,7 @@ func (it *W3bstreamProverOperatorSetIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverOperatorSet) + it.Event = new(W3bstreamProverProverPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1906,7 +1922,7 @@ func (it *W3bstreamProverOperatorSetIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverOperatorSet) + it.Event = new(W3bstreamProverProverPaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1922,60 +1938,51 @@ func (it *W3bstreamProverOperatorSetIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverOperatorSetIterator) Error() error { +func (it *W3bstreamProverProverPausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverOperatorSetIterator) Close() error { +func (it *W3bstreamProverProverPausedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverOperatorSet represents a OperatorSet event raised by the W3bstreamProver contract. -type W3bstreamProverOperatorSet struct { - Id *big.Int - Operator common.Address - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverProverPaused represents a ProverPaused event raised by the W3bstreamProver contract. +type W3bstreamProverProverPaused struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterOperatorSet is a free log retrieval operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// FilterProverPaused is a free log retrieval operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterOperatorSet(opts *bind.FilterOpts, id []*big.Int, operator []common.Address) (*W3bstreamProverOperatorSetIterator, error) { +// Solidity: event ProverPaused(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterProverPaused(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverProverPausedIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - var operatorRule []interface{} - for _, operatorItem := range operator { - operatorRule = append(operatorRule, operatorItem) - } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "OperatorSet", idRule, operatorRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "ProverPaused", idRule) if err != nil { return nil, err } - return &W3bstreamProverOperatorSetIterator{contract: _W3bstreamProver.contract, event: "OperatorSet", logs: logs, sub: sub}, nil + return &W3bstreamProverProverPausedIterator{contract: _W3bstreamProver.contract, event: "ProverPaused", logs: logs, sub: sub}, nil } -// WatchOperatorSet is a free log subscription operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// WatchProverPaused is a free log subscription operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchOperatorSet(opts *bind.WatchOpts, sink chan<- *W3bstreamProverOperatorSet, id []*big.Int, operator []common.Address) (event.Subscription, error) { +// Solidity: event ProverPaused(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverPaused(opts *bind.WatchOpts, sink chan<- *W3bstreamProverProverPaused, id []*big.Int) (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) - } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "OperatorSet", idRule, operatorRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "ProverPaused", idRule) if err != nil { return nil, err } @@ -1985,8 +1992,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchOperatorSet(opts *bind.Wat select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverOperatorSet) - if err := _W3bstreamProver.contract.UnpackLog(event, "OperatorSet", log); err != nil { + event := new(W3bstreamProverProverPaused) + if err := _W3bstreamProver.contract.UnpackLog(event, "ProverPaused", log); err != nil { return err } event.Raw = log @@ -2007,21 +2014,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchOperatorSet(opts *bind.Wat }), nil } -// ParseOperatorSet is a log parse operation binding the contract event 0x712369dba77e7931b9ec3bd57319108256b9f79ea5b5255122e3c06117421593. +// ParseProverPaused is a log parse operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. // -// Solidity: event OperatorSet(uint256 indexed id, address indexed operator) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseOperatorSet(log types.Log) (*W3bstreamProverOperatorSet, error) { - event := new(W3bstreamProverOperatorSet) - if err := _W3bstreamProver.contract.UnpackLog(event, "OperatorSet", log); err != nil { +// Solidity: event ProverPaused(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseProverPaused(log types.Log) (*W3bstreamProverProverPaused, error) { + event := new(W3bstreamProverProverPaused) + if err := _W3bstreamProver.contract.UnpackLog(event, "ProverPaused", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the W3bstreamProver contract. -type W3bstreamProverOwnershipTransferredIterator struct { - Event *W3bstreamProverOwnershipTransferred // Event containing the contract specifics and raw log +// W3bstreamProverProverResumedIterator is returned from FilterProverResumed and is used to iterate over the raw logs and unpacked data for ProverResumed events raised by the W3bstreamProver contract. +type W3bstreamProverProverResumedIterator struct { + Event *W3bstreamProverProverResumed // 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 @@ -2035,7 +2042,7 @@ type W3bstreamProverOwnershipTransferredIterator 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 *W3bstreamProverOwnershipTransferredIterator) Next() bool { +func (it *W3bstreamProverProverResumedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2044,7 +2051,7 @@ func (it *W3bstreamProverOwnershipTransferredIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverOwnershipTransferred) + it.Event = new(W3bstreamProverProverResumed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2059,7 +2066,7 @@ func (it *W3bstreamProverOwnershipTransferredIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverOwnershipTransferred) + it.Event = new(W3bstreamProverProverResumed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2075,60 +2082,51 @@ func (it *W3bstreamProverOwnershipTransferredIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverOwnershipTransferredIterator) Error() error { +func (it *W3bstreamProverProverResumedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverOwnershipTransferredIterator) Close() error { +func (it *W3bstreamProverProverResumedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverOwnershipTransferred represents a OwnershipTransferred event raised by the W3bstreamProver contract. -type W3bstreamProverOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverProverResumed represents a ProverResumed event raised by the W3bstreamProver contract. +type W3bstreamProverProverResumed struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// FilterProverResumed is a free log retrieval operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*W3bstreamProverOwnershipTransferredIterator, error) { +// Solidity: event ProverResumed(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterProverResumed(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverProverResumedIterator, error) { - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "ProverResumed", idRule) if err != nil { return nil, err } - return &W3bstreamProverOwnershipTransferredIterator{contract: _W3bstreamProver.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil + return &W3bstreamProverProverResumedIterator{contract: _W3bstreamProver.contract, event: "ProverResumed", logs: logs, sub: sub}, nil } -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// WatchProverResumed is a free log subscription operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *W3bstreamProverOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { +// Solidity: event ProverResumed(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverResumed(opts *bind.WatchOpts, sink chan<- *W3bstreamProverProverResumed, id []*big.Int) (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) + var idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "ProverResumed", idRule) if err != nil { return nil, err } @@ -2138,8 +2136,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchOwnershipTransferred(opts select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverOwnershipTransferred) - if err := _W3bstreamProver.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + event := new(W3bstreamProverProverResumed) + if err := _W3bstreamProver.contract.UnpackLog(event, "ProverResumed", log); err != nil { return err } event.Raw = log @@ -2160,21 +2158,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchOwnershipTransferred(opts }), nil } -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// ParseProverResumed is a log parse operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. // -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseOwnershipTransferred(log types.Log) (*W3bstreamProverOwnershipTransferred, error) { - event := new(W3bstreamProverOwnershipTransferred) - if err := _W3bstreamProver.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { +// Solidity: event ProverResumed(uint256 indexed id) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseProverResumed(log types.Log) (*W3bstreamProverProverResumed, error) { + event := new(W3bstreamProverProverResumed) + if err := _W3bstreamProver.contract.UnpackLog(event, "ProverResumed", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverProverPausedIterator is returned from FilterProverPaused and is used to iterate over the raw logs and unpacked data for ProverPaused events raised by the W3bstreamProver contract. -type W3bstreamProverProverPausedIterator struct { - Event *W3bstreamProverProverPaused // Event containing the contract specifics and raw log +// W3bstreamProverTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the W3bstreamProver contract. +type W3bstreamProverTransferIterator struct { + Event *W3bstreamProverTransfer // 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 @@ -2188,7 +2186,7 @@ type W3bstreamProverProverPausedIterator 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 *W3bstreamProverProverPausedIterator) Next() bool { +func (it *W3bstreamProverTransferIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2197,7 +2195,7 @@ func (it *W3bstreamProverProverPausedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverProverPaused) + it.Event = new(W3bstreamProverTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2212,7 +2210,7 @@ func (it *W3bstreamProverProverPausedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverProverPaused) + it.Event = new(W3bstreamProverTransfer) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2228,51 +2226,69 @@ func (it *W3bstreamProverProverPausedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverProverPausedIterator) Error() error { +func (it *W3bstreamProverTransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverProverPausedIterator) Close() error { +func (it *W3bstreamProverTransferIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverProverPaused represents a ProverPaused event raised by the W3bstreamProver contract. -type W3bstreamProverProverPaused struct { - Id *big.Int - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverTransfer represents a Transfer event raised by the W3bstreamProver contract. +type W3bstreamProverTransfer struct { + From common.Address + To common.Address + TokenId *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterProverPaused is a free log retrieval operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // -// Solidity: event ProverPaused(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterProverPaused(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverProverPausedIterator, error) { +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*W3bstreamProverTransferIterator, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + 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) } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "ProverPaused", idRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } - return &W3bstreamProverProverPausedIterator{contract: _W3bstreamProver.contract, event: "ProverPaused", logs: logs, sub: sub}, nil + return &W3bstreamProverTransferIterator{contract: _W3bstreamProver.contract, event: "Transfer", logs: logs, sub: sub}, nil } -// WatchProverPaused is a free log subscription operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // -// Solidity: event ProverPaused(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverPaused(opts *bind.WatchOpts, sink chan<- *W3bstreamProverProverPaused, id []*big.Int) (event.Subscription, error) { +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *W3bstreamProverTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { - var idRule []interface{} - for _, idItem := range id { - idRule = append(idRule, idItem) + 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) } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "ProverPaused", idRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) if err != nil { return nil, err } @@ -2282,8 +2298,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverPaused(opts *bind.Wa select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverProverPaused) - if err := _W3bstreamProver.contract.UnpackLog(event, "ProverPaused", log); err != nil { + event := new(W3bstreamProverTransfer) + if err := _W3bstreamProver.contract.UnpackLog(event, "Transfer", log); err != nil { return err } event.Raw = log @@ -2304,21 +2320,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverPaused(opts *bind.Wa }), nil } -// ParseProverPaused is a log parse operation binding the contract event 0x09c10a851184c6f4c4f912c821413d9b27d48061ecf90d270551f40a23131a88. +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. // -// Solidity: event ProverPaused(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseProverPaused(log types.Log) (*W3bstreamProverProverPaused, error) { - event := new(W3bstreamProverProverPaused) - if err := _W3bstreamProver.contract.UnpackLog(event, "ProverPaused", log); err != nil { +// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseTransfer(log types.Log) (*W3bstreamProverTransfer, error) { + event := new(W3bstreamProverTransfer) + if err := _W3bstreamProver.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverProverResumedIterator is returned from FilterProverResumed and is used to iterate over the raw logs and unpacked data for ProverResumed events raised by the W3bstreamProver contract. -type W3bstreamProverProverResumedIterator struct { - Event *W3bstreamProverProverResumed // Event containing the contract specifics and raw log +// W3bstreamProverVMTypeAddedIterator is returned from FilterVMTypeAdded and is used to iterate over the raw logs and unpacked data for VMTypeAdded events raised by the W3bstreamProver contract. +type W3bstreamProverVMTypeAddedIterator struct { + Event *W3bstreamProverVMTypeAdded // 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 @@ -2332,7 +2348,7 @@ type W3bstreamProverProverResumedIterator 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 *W3bstreamProverProverResumedIterator) Next() bool { +func (it *W3bstreamProverVMTypeAddedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2341,7 +2357,7 @@ func (it *W3bstreamProverProverResumedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverProverResumed) + it.Event = new(W3bstreamProverVMTypeAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2356,7 +2372,7 @@ func (it *W3bstreamProverProverResumedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverProverResumed) + it.Event = new(W3bstreamProverVMTypeAdded) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2372,51 +2388,52 @@ func (it *W3bstreamProverProverResumedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverProverResumedIterator) Error() error { +func (it *W3bstreamProverVMTypeAddedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverProverResumedIterator) Close() error { +func (it *W3bstreamProverVMTypeAddedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverProverResumed represents a ProverResumed event raised by the W3bstreamProver contract. -type W3bstreamProverProverResumed struct { +// W3bstreamProverVMTypeAdded represents a VMTypeAdded event raised by the W3bstreamProver contract. +type W3bstreamProverVMTypeAdded struct { Id *big.Int + Typ *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterProverResumed is a free log retrieval operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// FilterVMTypeAdded is a free log retrieval operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. // -// Solidity: event ProverResumed(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterProverResumed(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverProverResumedIterator, error) { +// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterVMTypeAdded(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverVMTypeAddedIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "ProverResumed", idRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "VMTypeAdded", idRule) if err != nil { return nil, err } - return &W3bstreamProverProverResumedIterator{contract: _W3bstreamProver.contract, event: "ProverResumed", logs: logs, sub: sub}, nil + return &W3bstreamProverVMTypeAddedIterator{contract: _W3bstreamProver.contract, event: "VMTypeAdded", logs: logs, sub: sub}, nil } -// WatchProverResumed is a free log subscription operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// WatchVMTypeAdded is a free log subscription operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. // -// Solidity: event ProverResumed(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverResumed(opts *bind.WatchOpts, sink chan<- *W3bstreamProverProverResumed, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchVMTypeAdded(opts *bind.WatchOpts, sink chan<- *W3bstreamProverVMTypeAdded, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "ProverResumed", idRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "VMTypeAdded", idRule) if err != nil { return nil, err } @@ -2426,8 +2443,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverResumed(opts *bind.W select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverProverResumed) - if err := _W3bstreamProver.contract.UnpackLog(event, "ProverResumed", log); err != nil { + event := new(W3bstreamProverVMTypeAdded) + if err := _W3bstreamProver.contract.UnpackLog(event, "VMTypeAdded", log); err != nil { return err } event.Raw = log @@ -2448,21 +2465,21 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchProverResumed(opts *bind.W }), nil } -// ParseProverResumed is a log parse operation binding the contract event 0xd5c12038aca4e36d3193c55c06f70eee8f829f1165a9e383c70b00d28e3bfdb9. +// ParseVMTypeAdded is a log parse operation binding the contract event 0x31d3cf7e64f8a54ff46174ebf94989d43bf8db12f6b2668940bc5653fea13ab4. // -// Solidity: event ProverResumed(uint256 indexed id) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseProverResumed(log types.Log) (*W3bstreamProverProverResumed, error) { - event := new(W3bstreamProverProverResumed) - if err := _W3bstreamProver.contract.UnpackLog(event, "ProverResumed", log); err != nil { +// Solidity: event VMTypeAdded(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseVMTypeAdded(log types.Log) (*W3bstreamProverVMTypeAdded, error) { + event := new(W3bstreamProverVMTypeAdded) + if err := _W3bstreamProver.contract.UnpackLog(event, "VMTypeAdded", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamProverTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the W3bstreamProver contract. -type W3bstreamProverTransferIterator struct { - Event *W3bstreamProverTransfer // Event containing the contract specifics and raw log +// W3bstreamProverVMTypeDeletedIterator is returned from FilterVMTypeDeleted and is used to iterate over the raw logs and unpacked data for VMTypeDeleted events raised by the W3bstreamProver contract. +type W3bstreamProverVMTypeDeletedIterator struct { + Event *W3bstreamProverVMTypeDeleted // 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 @@ -2476,7 +2493,7 @@ type W3bstreamProverTransferIterator 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 *W3bstreamProverTransferIterator) Next() bool { +func (it *W3bstreamProverVMTypeDeletedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -2485,7 +2502,7 @@ func (it *W3bstreamProverTransferIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamProverTransfer) + it.Event = new(W3bstreamProverVMTypeDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2500,7 +2517,7 @@ func (it *W3bstreamProverTransferIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamProverTransfer) + it.Event = new(W3bstreamProverVMTypeDeleted) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -2516,69 +2533,52 @@ func (it *W3bstreamProverTransferIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamProverTransferIterator) Error() error { +func (it *W3bstreamProverVMTypeDeletedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamProverTransferIterator) Close() error { +func (it *W3bstreamProverVMTypeDeletedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamProverTransfer represents a Transfer event raised by the W3bstreamProver contract. -type W3bstreamProverTransfer struct { - From common.Address - To common.Address - TokenId *big.Int - Raw types.Log // Blockchain specific contextual infos +// W3bstreamProverVMTypeDeleted represents a VMTypeDeleted event raised by the W3bstreamProver contract. +type W3bstreamProverVMTypeDeleted struct { + Id *big.Int + Typ *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// FilterVMTypeDeleted is a free log retrieval operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_W3bstreamProver *W3bstreamProverFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address, tokenId []*big.Int) (*W3bstreamProverTransferIterator, error) { +// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) FilterVMTypeDeleted(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamProverVMTypeDeletedIterator, 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 idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) + logs, sub, err := _W3bstreamProver.contract.FilterLogs(opts, "VMTypeDeleted", idRule) if err != nil { return nil, err } - return &W3bstreamProverTransferIterator{contract: _W3bstreamProver.contract, event: "Transfer", logs: logs, sub: sub}, nil + return &W3bstreamProverVMTypeDeletedIterator{contract: _W3bstreamProver.contract, event: "VMTypeDeleted", logs: logs, sub: sub}, nil } -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// WatchVMTypeDeleted is a free log subscription operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_W3bstreamProver *W3bstreamProverFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *W3bstreamProverTransfer, from []common.Address, to []common.Address, tokenId []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) WatchVMTypeDeleted(opts *bind.WatchOpts, sink chan<- *W3bstreamProverVMTypeDeleted, id []*big.Int) (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 idRule []interface{} + for _, idItem := range id { + idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "Transfer", fromRule, toRule, tokenIdRule) + logs, sub, err := _W3bstreamProver.contract.WatchLogs(opts, "VMTypeDeleted", idRule) if err != nil { return nil, err } @@ -2588,8 +2588,8 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchTransfer(opts *bind.WatchO select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamProverTransfer) - if err := _W3bstreamProver.contract.UnpackLog(event, "Transfer", log); err != nil { + event := new(W3bstreamProverVMTypeDeleted) + if err := _W3bstreamProver.contract.UnpackLog(event, "VMTypeDeleted", log); err != nil { return err } event.Raw = log @@ -2610,12 +2610,12 @@ func (_W3bstreamProver *W3bstreamProverFilterer) WatchTransfer(opts *bind.WatchO }), nil } -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// ParseVMTypeDeleted is a log parse operation binding the contract event 0xa52940e84e8bab7c0aef4e1446a2893c726b08d30eba0a03d1ba969f0852cf46. // -// Solidity: event Transfer(address indexed from, address indexed to, uint256 indexed tokenId) -func (_W3bstreamProver *W3bstreamProverFilterer) ParseTransfer(log types.Log) (*W3bstreamProverTransfer, error) { - event := new(W3bstreamProverTransfer) - if err := _W3bstreamProver.contract.UnpackLog(event, "Transfer", log); err != nil { +// Solidity: event VMTypeDeleted(uint256 indexed id, uint256 typ) +func (_W3bstreamProver *W3bstreamProverFilterer) ParseVMTypeDeleted(log types.Log) (*W3bstreamProverVMTypeDeleted, error) { + event := new(W3bstreamProverVMTypeDeleted) + if err := _W3bstreamProver.contract.UnpackLog(event, "VMTypeDeleted", log); err != nil { return nil, err } event.Raw = log diff --git a/ioctl/cmd/ws/contracts/w3bstreamvmtype.go b/ioctl/cmd/ws/contracts/w3bstreamvmtype.go index d4bb05a965..8b5e56212e 100644 --- a/ioctl/cmd/ws/contracts/w3bstreamvmtype.go +++ b/ioctl/cmd/ws/contracts/w3bstreamvmtype.go @@ -31,7 +31,7 @@ var ( // W3bstreamVMTypeMetaData contains all meta data concerning the W3bstreamVMType contract. var W3bstreamVMTypeMetaData = &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\":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\":\"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\"}],\"name\":\"TypePaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"TypeResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"TypeSet\",\"type\":\"event\"},{\"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\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"vmType\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + 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\":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\":\"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\"}],\"name\":\"VMTypePaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"VMTypeResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"VMTypeSet\",\"type\":\"event\"},{\"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\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"vmTypeName\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // W3bstreamVMTypeABI is the input ABI used to generate the binding from. @@ -521,12 +521,12 @@ func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) TokenURI(tokenId *big.Int) return _W3bstreamVMType.Contract.TokenURI(&_W3bstreamVMType.CallOpts, tokenId) } -// VmType is a free data retrieval call binding the contract method 0x60442876. +// VmTypeName is a free data retrieval call binding the contract method 0xfad40382. // -// Solidity: function vmType(uint256 _id) view returns(string) -func (_W3bstreamVMType *W3bstreamVMTypeCaller) VmType(opts *bind.CallOpts, _id *big.Int) (string, error) { +// Solidity: function vmTypeName(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCaller) VmTypeName(opts *bind.CallOpts, _id *big.Int) (string, error) { var out []interface{} - err := _W3bstreamVMType.contract.Call(opts, &out, "vmType", _id) + err := _W3bstreamVMType.contract.Call(opts, &out, "vmTypeName", _id) if err != nil { return *new(string), err @@ -538,18 +538,18 @@ func (_W3bstreamVMType *W3bstreamVMTypeCaller) VmType(opts *bind.CallOpts, _id * } -// VmType is a free data retrieval call binding the contract method 0x60442876. +// VmTypeName is a free data retrieval call binding the contract method 0xfad40382. // -// Solidity: function vmType(uint256 _id) view returns(string) -func (_W3bstreamVMType *W3bstreamVMTypeSession) VmType(_id *big.Int) (string, error) { - return _W3bstreamVMType.Contract.VmType(&_W3bstreamVMType.CallOpts, _id) +// Solidity: function vmTypeName(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeSession) VmTypeName(_id *big.Int) (string, error) { + return _W3bstreamVMType.Contract.VmTypeName(&_W3bstreamVMType.CallOpts, _id) } -// VmType is a free data retrieval call binding the contract method 0x60442876. +// VmTypeName is a free data retrieval call binding the contract method 0xfad40382. // -// Solidity: function vmType(uint256 _id) view returns(string) -func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) VmType(_id *big.Int) (string, error) { - return _W3bstreamVMType.Contract.VmType(&_W3bstreamVMType.CallOpts, _id) +// Solidity: function vmTypeName(uint256 _id) view returns(string) +func (_W3bstreamVMType *W3bstreamVMTypeCallerSession) VmTypeName(_id *big.Int) (string, error) { + return _W3bstreamVMType.Contract.VmTypeName(&_W3bstreamVMType.CallOpts, _id) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. @@ -1548,9 +1548,9 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTransfer(log types.Log) (* return event, nil } -// W3bstreamVMTypeTypePausedIterator is returned from FilterTypePaused and is used to iterate over the raw logs and unpacked data for TypePaused events raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypePausedIterator struct { - Event *W3bstreamVMTypeTypePaused // Event containing the contract specifics and raw log +// W3bstreamVMTypeVMTypePausedIterator is returned from FilterVMTypePaused and is used to iterate over the raw logs and unpacked data for VMTypePaused events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypePausedIterator struct { + Event *W3bstreamVMTypeVMTypePaused // 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 @@ -1564,7 +1564,7 @@ type W3bstreamVMTypeTypePausedIterator 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 *W3bstreamVMTypeTypePausedIterator) Next() bool { +func (it *W3bstreamVMTypeVMTypePausedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1573,7 +1573,7 @@ func (it *W3bstreamVMTypeTypePausedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypePaused) + it.Event = new(W3bstreamVMTypeVMTypePaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1588,7 +1588,7 @@ func (it *W3bstreamVMTypeTypePausedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypePaused) + it.Event = new(W3bstreamVMTypeVMTypePaused) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1604,51 +1604,51 @@ func (it *W3bstreamVMTypeTypePausedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamVMTypeTypePausedIterator) Error() error { +func (it *W3bstreamVMTypeVMTypePausedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamVMTypeTypePausedIterator) Close() error { +func (it *W3bstreamVMTypeVMTypePausedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamVMTypeTypePaused represents a TypePaused event raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypePaused struct { +// W3bstreamVMTypeVMTypePaused represents a VMTypePaused event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypePaused struct { Id *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTypePaused is a free log retrieval operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// FilterVMTypePaused is a free log retrieval operation binding the contract event 0xd6800ce5ea4bba066159abb6480df7f6484cb48dcf57194f7fbb119182f0be93. // -// Solidity: event TypePaused(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypePaused(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypePausedIterator, error) { +// Solidity: event VMTypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterVMTypePaused(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeVMTypePausedIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypePaused", idRule) + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "VMTypePaused", idRule) if err != nil { return nil, err } - return &W3bstreamVMTypeTypePausedIterator{contract: _W3bstreamVMType.contract, event: "TypePaused", logs: logs, sub: sub}, nil + return &W3bstreamVMTypeVMTypePausedIterator{contract: _W3bstreamVMType.contract, event: "VMTypePaused", logs: logs, sub: sub}, nil } -// WatchTypePaused is a free log subscription operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// WatchVMTypePaused is a free log subscription operation binding the contract event 0xd6800ce5ea4bba066159abb6480df7f6484cb48dcf57194f7fbb119182f0be93. // -// Solidity: event TypePaused(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypePaused(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypePaused, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchVMTypePaused(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeVMTypePaused, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypePaused", idRule) + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "VMTypePaused", idRule) if err != nil { return nil, err } @@ -1658,8 +1658,8 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypePaused(opts *bind.Watc select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamVMTypeTypePaused) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypePaused", log); err != nil { + event := new(W3bstreamVMTypeVMTypePaused) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypePaused", log); err != nil { return err } event.Raw = log @@ -1680,21 +1680,21 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypePaused(opts *bind.Watc }), nil } -// ParseTypePaused is a log parse operation binding the contract event 0xee198ea20d6196174f619499b7f8b02b7551e600f8bc9ba03174ed8c9e3057aa. +// ParseVMTypePaused is a log parse operation binding the contract event 0xd6800ce5ea4bba066159abb6480df7f6484cb48dcf57194f7fbb119182f0be93. // -// Solidity: event TypePaused(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypePaused(log types.Log) (*W3bstreamVMTypeTypePaused, error) { - event := new(W3bstreamVMTypeTypePaused) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypePaused", log); err != nil { +// Solidity: event VMTypePaused(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseVMTypePaused(log types.Log) (*W3bstreamVMTypeVMTypePaused, error) { + event := new(W3bstreamVMTypeVMTypePaused) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypePaused", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamVMTypeTypeResumedIterator is returned from FilterTypeResumed and is used to iterate over the raw logs and unpacked data for TypeResumed events raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypeResumedIterator struct { - Event *W3bstreamVMTypeTypeResumed // Event containing the contract specifics and raw log +// W3bstreamVMTypeVMTypeResumedIterator is returned from FilterVMTypeResumed and is used to iterate over the raw logs and unpacked data for VMTypeResumed events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypeResumedIterator struct { + Event *W3bstreamVMTypeVMTypeResumed // 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 @@ -1708,7 +1708,7 @@ type W3bstreamVMTypeTypeResumedIterator 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 *W3bstreamVMTypeTypeResumedIterator) Next() bool { +func (it *W3bstreamVMTypeVMTypeResumedIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1717,7 +1717,7 @@ func (it *W3bstreamVMTypeTypeResumedIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypeResumed) + it.Event = new(W3bstreamVMTypeVMTypeResumed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1732,7 +1732,7 @@ func (it *W3bstreamVMTypeTypeResumedIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypeResumed) + it.Event = new(W3bstreamVMTypeVMTypeResumed) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1748,51 +1748,51 @@ func (it *W3bstreamVMTypeTypeResumedIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamVMTypeTypeResumedIterator) Error() error { +func (it *W3bstreamVMTypeVMTypeResumedIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamVMTypeTypeResumedIterator) Close() error { +func (it *W3bstreamVMTypeVMTypeResumedIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamVMTypeTypeResumed represents a TypeResumed event raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypeResumed struct { +// W3bstreamVMTypeVMTypeResumed represents a VMTypeResumed event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypeResumed struct { Id *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTypeResumed is a free log retrieval operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// FilterVMTypeResumed is a free log retrieval operation binding the contract event 0x7b2cfd5a3cf01b5a7a47661508884b5c0bb936c465a58bd9f685e991178c7673. // -// Solidity: event TypeResumed(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypeResumed(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypeResumedIterator, error) { +// Solidity: event VMTypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterVMTypeResumed(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeVMTypeResumedIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypeResumed", idRule) + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "VMTypeResumed", idRule) if err != nil { return nil, err } - return &W3bstreamVMTypeTypeResumedIterator{contract: _W3bstreamVMType.contract, event: "TypeResumed", logs: logs, sub: sub}, nil + return &W3bstreamVMTypeVMTypeResumedIterator{contract: _W3bstreamVMType.contract, event: "VMTypeResumed", logs: logs, sub: sub}, nil } -// WatchTypeResumed is a free log subscription operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// WatchVMTypeResumed is a free log subscription operation binding the contract event 0x7b2cfd5a3cf01b5a7a47661508884b5c0bb936c465a58bd9f685e991178c7673. // -// Solidity: event TypeResumed(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeResumed(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypeResumed, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchVMTypeResumed(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeVMTypeResumed, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypeResumed", idRule) + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "VMTypeResumed", idRule) if err != nil { return nil, err } @@ -1802,8 +1802,8 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeResumed(opts *bind.Wat select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamVMTypeTypeResumed) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeResumed", log); err != nil { + event := new(W3bstreamVMTypeVMTypeResumed) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypeResumed", log); err != nil { return err } event.Raw = log @@ -1824,21 +1824,21 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeResumed(opts *bind.Wat }), nil } -// ParseTypeResumed is a log parse operation binding the contract event 0x2c56df928800f92157b7aa555243152a0cc8a98dd90080fdff8de7e516b7baa9. +// ParseVMTypeResumed is a log parse operation binding the contract event 0x7b2cfd5a3cf01b5a7a47661508884b5c0bb936c465a58bd9f685e991178c7673. // -// Solidity: event TypeResumed(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypeResumed(log types.Log) (*W3bstreamVMTypeTypeResumed, error) { - event := new(W3bstreamVMTypeTypeResumed) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeResumed", log); err != nil { +// Solidity: event VMTypeResumed(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseVMTypeResumed(log types.Log) (*W3bstreamVMTypeVMTypeResumed, error) { + event := new(W3bstreamVMTypeVMTypeResumed) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypeResumed", log); err != nil { return nil, err } event.Raw = log return event, nil } -// W3bstreamVMTypeTypeSetIterator is returned from FilterTypeSet and is used to iterate over the raw logs and unpacked data for TypeSet events raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypeSetIterator struct { - Event *W3bstreamVMTypeTypeSet // Event containing the contract specifics and raw log +// W3bstreamVMTypeVMTypeSetIterator is returned from FilterVMTypeSet and is used to iterate over the raw logs and unpacked data for VMTypeSet events raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypeSetIterator struct { + Event *W3bstreamVMTypeVMTypeSet // 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 @@ -1852,7 +1852,7 @@ type W3bstreamVMTypeTypeSetIterator 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 *W3bstreamVMTypeTypeSetIterator) Next() bool { +func (it *W3bstreamVMTypeVMTypeSetIterator) Next() bool { // If the iterator failed, stop iterating if it.fail != nil { return false @@ -1861,7 +1861,7 @@ func (it *W3bstreamVMTypeTypeSetIterator) Next() bool { if it.done { select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypeSet) + it.Event = new(W3bstreamVMTypeVMTypeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1876,7 +1876,7 @@ func (it *W3bstreamVMTypeTypeSetIterator) Next() bool { // Iterator still in progress, wait for either a data or an error event select { case log := <-it.logs: - it.Event = new(W3bstreamVMTypeTypeSet) + it.Event = new(W3bstreamVMTypeVMTypeSet) if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { it.fail = err return false @@ -1892,51 +1892,51 @@ func (it *W3bstreamVMTypeTypeSetIterator) Next() bool { } // Error returns any retrieval or parsing error occurred during filtering. -func (it *W3bstreamVMTypeTypeSetIterator) Error() error { +func (it *W3bstreamVMTypeVMTypeSetIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. -func (it *W3bstreamVMTypeTypeSetIterator) Close() error { +func (it *W3bstreamVMTypeVMTypeSetIterator) Close() error { it.sub.Unsubscribe() return nil } -// W3bstreamVMTypeTypeSet represents a TypeSet event raised by the W3bstreamVMType contract. -type W3bstreamVMTypeTypeSet struct { +// W3bstreamVMTypeVMTypeSet represents a VMTypeSet event raised by the W3bstreamVMType contract. +type W3bstreamVMTypeVMTypeSet struct { Id *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTypeSet is a free log retrieval operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// FilterVMTypeSet is a free log retrieval operation binding the contract event 0xbe89461c9f17800f078edad9f41b00b5ce425af848dfe6d4c53a95c0905ce96a. // -// Solidity: event TypeSet(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterTypeSet(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeTypeSetIterator, error) { +// Solidity: event VMTypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) FilterVMTypeSet(opts *bind.FilterOpts, id []*big.Int) (*W3bstreamVMTypeVMTypeSetIterator, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "TypeSet", idRule) + logs, sub, err := _W3bstreamVMType.contract.FilterLogs(opts, "VMTypeSet", idRule) if err != nil { return nil, err } - return &W3bstreamVMTypeTypeSetIterator{contract: _W3bstreamVMType.contract, event: "TypeSet", logs: logs, sub: sub}, nil + return &W3bstreamVMTypeVMTypeSetIterator{contract: _W3bstreamVMType.contract, event: "VMTypeSet", logs: logs, sub: sub}, nil } -// WatchTypeSet is a free log subscription operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// WatchVMTypeSet is a free log subscription operation binding the contract event 0xbe89461c9f17800f078edad9f41b00b5ce425af848dfe6d4c53a95c0905ce96a. // -// Solidity: event TypeSet(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeSet(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeTypeSet, id []*big.Int) (event.Subscription, error) { +// Solidity: event VMTypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchVMTypeSet(opts *bind.WatchOpts, sink chan<- *W3bstreamVMTypeVMTypeSet, id []*big.Int) (event.Subscription, error) { var idRule []interface{} for _, idItem := range id { idRule = append(idRule, idItem) } - logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "TypeSet", idRule) + logs, sub, err := _W3bstreamVMType.contract.WatchLogs(opts, "VMTypeSet", idRule) if err != nil { return nil, err } @@ -1946,8 +1946,8 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeSet(opts *bind.WatchOp select { case log := <-logs: // New log arrived, parse the event and forward to the user - event := new(W3bstreamVMTypeTypeSet) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeSet", log); err != nil { + event := new(W3bstreamVMTypeVMTypeSet) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypeSet", log); err != nil { return err } event.Raw = log @@ -1968,12 +1968,12 @@ func (_W3bstreamVMType *W3bstreamVMTypeFilterer) WatchTypeSet(opts *bind.WatchOp }), nil } -// ParseTypeSet is a log parse operation binding the contract event 0xa20a6e4a5b8817f7ebf57f7b871045c10619a6b3a46f3ec91b2cf69b32ed029f. +// ParseVMTypeSet is a log parse operation binding the contract event 0xbe89461c9f17800f078edad9f41b00b5ce425af848dfe6d4c53a95c0905ce96a. // -// Solidity: event TypeSet(uint256 indexed id) -func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseTypeSet(log types.Log) (*W3bstreamVMTypeTypeSet, error) { - event := new(W3bstreamVMTypeTypeSet) - if err := _W3bstreamVMType.contract.UnpackLog(event, "TypeSet", log); err != nil { +// Solidity: event VMTypeSet(uint256 indexed id) +func (_W3bstreamVMType *W3bstreamVMTypeFilterer) ParseVMTypeSet(log types.Log) (*W3bstreamVMTypeVMTypeSet, error) { + event := new(W3bstreamVMTypeVMTypeSet) + if err := _W3bstreamVMType.contract.UnpackLog(event, "VMTypeSet", log); err != nil { return nil, err } event.Raw = log diff --git a/ioctl/cmd/ws/wsprover.go b/ioctl/cmd/ws/wsprover.go index 6be8a16de8..85c4a61d8a 100644 --- a/ioctl/cmd/ws/wsprover.go +++ b/ioctl/cmd/ws/wsprover.go @@ -21,7 +21,7 @@ var wsProverCmd = &cobra.Command{ var ( proverID = flag.NewUint64VarP("id", "", 0, config.TranslateInLang(_flagProverIDUsages, config.UILanguage)) - proverNodeType = flag.NewUint64VarP("node-type", "", 0, config.TranslateInLang(_flagProverNodeTypeUsages, config.UILanguage)) + proverVmType = flag.NewUint64VarP("vm-type", "", 0, config.TranslateInLang(_flagProverVmTypeUsages, config.UILanguage)) proverOperator = flag.NewStringVarP("operator", "", "", config.TranslateInLang(_flagProverOperatorUsages, config.UILanguage)) ) @@ -30,9 +30,9 @@ var ( config.English: "prover id", config.Chinese: "prover(计算节点) ID", } - _flagProverNodeTypeUsages = map[config.Language]string{ - config.English: "prover node type", - config.Chinese: "prover(计算节点) 节点类型", + _flagProverVmTypeUsages = map[config.Language]string{ + config.English: "prover vm type", + config.Chinese: "prover(计算节点) 节点虚拟机类型", } _flagProverOperatorUsages = map[config.Language]string{ config.English: "prover node operator", @@ -54,9 +54,9 @@ var ( const ( funcProverRegister = "register" - funcAddProverType = "addNodeType" - funcDelProverType = "delNodeType" - funcQueryProverNodeType = "hasNodeType" + funcAddProverVmType = "addVMType" + funcDelProverVmType = "delVMType" + funcQueryProverVmType = "isVMTypeSupported" funcQueryProverIsPaused = "isPaused" funcQueryProverOperator = "operator" funcQueryProverOwner = "prover" @@ -66,12 +66,12 @@ const ( ) const ( - eventOnProverRegistered = "Transfer" - eventOnProverTypeAdded = "NodeTypeAdded" - eventOnProverTypeDeleted = "NodeTypeDeleted" - eventOnProverPaused = "ProverPaused" - eventOnProverResumed = "ProverResumed" - eventOnProverOwnerChanged = "OperatorSet" + eventOnProverRegistered = "Transfer" + eventOnProverVmTypeAdded = "VMTypeAdded" + eventOnProverVmTypeDeleted = "VMTypeDeleted" + eventOnProverPaused = "ProverPaused" + eventOnProverResumed = "ProverResumed" + eventOnProverOwnerChanged = "OperatorSet" ) func init() { diff --git a/ioctl/cmd/ws/wsproverquery.go b/ioctl/cmd/ws/wsproverquery.go index 2526b1900e..a083e0c1f6 100644 --- a/ioctl/cmd/ws/wsproverquery.go +++ b/ioctl/cmd/ws/wsproverquery.go @@ -5,7 +5,6 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" "github.com/spf13/cobra" @@ -30,14 +29,14 @@ var wsProverQueryCmd = &cobra.Command{ }, } -var wsProverQueryTypeCmd = &cobra.Command{ - Use: "querytype", +var wsProverQueryVmTypeCmd = &cobra.Command{ + Use: "queryvmtype", Short: config.TranslateInLang(map[config.Language]string{ - config.English: "query prover node type", - config.Chinese: "查询prover节点类型信息", + config.English: "query prover vm type", + config.Chinese: "查询prover节点虚拟机类型信息", }, config.UILanguage), RunE: func(cmd *cobra.Command, args []string) error { - out, err := queryProverType(big.NewInt(int64(proverID.Value().(uint64))), big.NewInt(int64(proverNodeType.Value().(uint64)))) + out, err := queryProverVmType(big.NewInt(int64(proverID.Value().(uint64))), big.NewInt(int64(proverVmType.Value().(uint64)))) if err != nil { return output.PrintError(err) } @@ -50,13 +49,13 @@ func init() { proverID.RegisterCommand(wsProverQueryCmd) proverID.MarkFlagRequired(wsProverQueryCmd) - proverID.RegisterCommand(wsProverQueryTypeCmd) - proverID.MarkFlagRequired(wsProverQueryTypeCmd) - proverNodeType.RegisterCommand(wsProverQueryTypeCmd) - proverNodeType.MarkFlagRequired(wsProverQueryTypeCmd) + proverID.RegisterCommand(wsProverQueryVmTypeCmd) + proverID.MarkFlagRequired(wsProverQueryVmTypeCmd) + proverVmType.RegisterCommand(wsProverQueryVmTypeCmd) + proverVmType.MarkFlagRequired(wsProverQueryVmTypeCmd) wsProverCmd.AddCommand(wsProverQueryCmd) - wsProverCmd.AddCommand(wsProverQueryTypeCmd) + wsProverCmd.AddCommand(wsProverQueryVmTypeCmd) } func queryProver(proverID *big.Int) (any, error) { @@ -116,20 +115,21 @@ func queryProver(proverID *big.Int) (any, error) { } -func queryProverType(proverID, nodeType *big.Int) (string, error) { + +func queryProverVmType(proverID, vmType *big.Int) (string, error) { caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) if err != nil { return "", errors.Wrap(err, "failed to new contract caller") } - result := NewContractResult(&proverStoreABI, funcQueryProverNodeType, new(bool)) - if err = caller.Read(funcQueryProverNodeType, []any{proverID, nodeType}, result); err != nil { - return "", errors.Wrapf(err, "failed to read contract: %s", funcQueryProverNodeType) + result := NewContractResult(&proverStoreABI, funcQueryProverVmType, new(bool)) + if err = caller.Read(funcQueryProverVmType, []any{proverID, vmType}, result); err != nil { + return "", errors.Wrapf(err, "failed to read contract: %s", funcQueryProverVmType) } - hasNodeType, err := result.Result() + hasVmType, err := result.Result() if err != nil { return "", err } - return fmt.Sprintf("the state of proverID and nodeType is %t", *hasNodeType.(*bool)), nil + return fmt.Sprintf("the state of proverID and vmType is %t", *hasVmType.(*bool)), nil } diff --git a/ioctl/cmd/ws/wsproverupdate.go b/ioctl/cmd/ws/wsproverupdate.go index cc56e901ea..35300dfdfa 100644 --- a/ioctl/cmd/ws/wsproverupdate.go +++ b/ioctl/cmd/ws/wsproverupdate.go @@ -12,16 +12,16 @@ import ( "github.com/iotexproject/iotex-core/ioctl/output" ) -var wsProverAddNodeTypeCmd = &cobra.Command{ - Use: "addtype", +var wsProverAddVmTypeCmd = &cobra.Command{ + Use: "addvmtype", Short: config.TranslateInLang(map[config.Language]string{ - config.English: "add prover node type", - config.Chinese: "添加prover节点类型", + config.English: "add prover vm type", + config.Chinese: "添加prover节点虚拟机类型", }, config.UILanguage), RunE: func(cmd *cobra.Command, args []string) error { - out, err := addProverType( + out, err := addProverVmType( big.NewInt(int64(proverID.Value().(uint64))), - big.NewInt(int64(proverNodeType.Value().(uint64))), + big.NewInt(int64(proverVmType.Value().(uint64))), ) if err != nil { return output.PrintError(err) @@ -31,16 +31,16 @@ var wsProverAddNodeTypeCmd = &cobra.Command{ }, } -var wsProverDelNodeTypeCmd = &cobra.Command{ - Use: "deltype", +var wsProverDelVmTypeCmd = &cobra.Command{ + Use: "delvmtype", Short: config.TranslateInLang(map[config.Language]string{ - config.English: "delete prover node type", - config.Chinese: "删除prover节点类型", + config.English: "delete prover vm type", + config.Chinese: "删除prover节点虚拟机类型", }, config.UILanguage), RunE: func(cmd *cobra.Command, args []string) error { - out, err := delProverType( + out, err := delProverVmType( big.NewInt(int64(proverID.Value().(uint64))), - big.NewInt(int64(proverNodeType.Value().(uint64))), + big.NewInt(int64(proverVmType.Value().(uint64))), ) if err != nil { return output.PrintError(err) @@ -51,31 +51,31 @@ var wsProverDelNodeTypeCmd = &cobra.Command{ } func init() { - proverID.RegisterCommand(wsProverAddNodeTypeCmd) - proverID.MarkFlagRequired(wsProverAddNodeTypeCmd) + proverID.RegisterCommand(wsProverAddVmTypeCmd) + proverID.MarkFlagRequired(wsProverAddVmTypeCmd) - proverNodeType.RegisterCommand(wsProverAddNodeTypeCmd) - proverNodeType.MarkFlagRequired(wsProverAddNodeTypeCmd) + proverVmType.RegisterCommand(wsProverAddVmTypeCmd) + proverVmType.MarkFlagRequired(wsProverAddVmTypeCmd) - proverID.RegisterCommand(wsProverDelNodeTypeCmd) - proverID.MarkFlagRequired(wsProverDelNodeTypeCmd) + proverID.RegisterCommand(wsProverDelVmTypeCmd) + proverID.MarkFlagRequired(wsProverDelVmTypeCmd) - proverNodeType.RegisterCommand(wsProverDelNodeTypeCmd) - proverNodeType.MarkFlagRequired(wsProverDelNodeTypeCmd) + proverVmType.RegisterCommand(wsProverDelVmTypeCmd) + proverVmType.MarkFlagRequired(wsProverDelVmTypeCmd) - wsProverCmd.AddCommand(wsProverAddNodeTypeCmd) - wsProverCmd.AddCommand(wsProverDelNodeTypeCmd) + wsProverCmd.AddCommand(wsProverAddVmTypeCmd) + wsProverCmd.AddCommand(wsProverDelVmTypeCmd) } -func addProverType(proverID, nodeType *big.Int) (string, error) { +func addProverVmType(proverID, vmType *big.Int) (string, error) { caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) if err != nil { return "", errors.Wrap(err, "failed to create contract caller") } - value := new(contracts.W3bstreamProverNodeTypeAdded) - result := NewContractResult(&proverStoreABI, eventOnProverTypeAdded, value) - if _, err = caller.CallAndRetrieveResult(funcAddProverType, []any{proverID, nodeType}, result); err != nil { + value := new(contracts.W3bstreamProverVMTypeAdded) + result := NewContractResult(&proverStoreABI, eventOnProverVmTypeAdded, value) + if _, err = caller.CallAndRetrieveResult(funcAddProverVmType, []any{proverID, vmType}, result); err != nil { return "", errors.Wrap(err, "failed to call contract") } @@ -83,18 +83,18 @@ func addProverType(proverID, nodeType *big.Int) (string, error) { return "", err } - return fmt.Sprintf("the type of proverID %s and nodeType %s has added successfully.", value.Id.String(), value.Typ.String()), nil + return fmt.Sprintf("the type of proverID %s and vmType %s has added successfully.", value.Id.String(), value.Typ.String()), nil } -func delProverType(proverID, nodeType *big.Int) (string, error) { +func delProverVmType(proverID, vmType *big.Int) (string, error) { caller, err := NewContractCaller(proverStoreABI, proverStoreAddress) if err != nil { return "", errors.Wrap(err, "failed to create contract caller") } - value := new(contracts.W3bstreamProverNodeTypeDeleted) - result := NewContractResult(&proverStoreABI, eventOnProverTypeDeleted, value) - if _, err = caller.CallAndRetrieveResult(funcDelProverType, []any{proverID, nodeType}, result); err != nil { + value := new(contracts.W3bstreamProverVMTypeDeleted) + result := NewContractResult(&proverStoreABI, eventOnProverVmTypeDeleted, value) + if _, err = caller.CallAndRetrieveResult(funcDelProverVmType, []any{proverID, vmType}, result); err != nil { return "", errors.Wrap(err, "failed to call contract") } @@ -102,5 +102,5 @@ func delProverType(proverID, nodeType *big.Int) (string, error) { return "", err } - return fmt.Sprintf("the type of proverID %s and nodeType %s has deleted successfully.", value.Id.String(), value.Typ.String()), nil + return fmt.Sprintf("the type of proverID %s and vmType %s has deleted successfully.", value.Id.String(), value.Typ.String()), nil } diff --git a/ioctl/cmd/ws/wsvmtype.go b/ioctl/cmd/ws/wsvmtype.go index f39b96797c..3c129bd43c 100644 --- a/ioctl/cmd/ws/wsvmtype.go +++ b/ioctl/cmd/ws/wsvmtype.go @@ -44,16 +44,16 @@ var ( const ( funcVmTypeMint = "mint" - funcQueryVmType = "vmType" + funcQueryVmType = "vmTypeName" funcQueryVmTypeIsPaused = "isPaused" funcVmTypePause = "pause" funcVmTypeResume = "resume" ) const ( - eventOnVmTypePaused = "TypePaused" - eventOnVmTypeResumed = "TypeResumed" - eventOnVmTypeSet = "TypeSet" + eventOnVmTypePaused = "VMTypePaused" + eventOnVmTypeResumed = "VMTypeResumed" + eventOnVmTypeSet = "VMTypeSet" ) func init() { diff --git a/ioctl/cmd/ws/wsvmtyperegister.go b/ioctl/cmd/ws/wsvmtyperegister.go index 841a8c90e1..7514102a06 100644 --- a/ioctl/cmd/ws/wsvmtyperegister.go +++ b/ioctl/cmd/ws/wsvmtyperegister.go @@ -38,7 +38,7 @@ func registerVmType(name string) (any, error) { return nil, errors.Wrap(err, "failed to create contract caller") } - value := new(contracts.W3bstreamVMTypeTypeSet) + value := new(contracts.W3bstreamVMTypeVMTypeSet) result := NewContractResult(&vmTypeABI, eventOnVmTypeSet, value) if _, err = caller.CallAndRetrieveResult(funcVmTypeMint, []any{name}, result); err != nil { return nil, errors.Wrap(err, "failed to call contract") From 0d60973b0616063f2d314e0c2e4bcd13c3f68a22 Mon Sep 17 00:00:00 2001 From: dustinxie Date: Mon, 29 Jul 2024 18:29:24 -0700 Subject: [PATCH 6/7] [ioctl] add ID into candidate display (#4348) --- ioctl/cmd/bc/bcdelegate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ioctl/cmd/bc/bcdelegate.go b/ioctl/cmd/bc/bcdelegate.go index 5ba6822388..aad19ebb07 100644 --- a/ioctl/cmd/bc/bcdelegate.go +++ b/ioctl/cmd/bc/bcdelegate.go @@ -62,6 +62,7 @@ func (m *delegateMessage) delegateString() string { lines []string ) lines = append(lines, "{") + lines = append(lines, fmt.Sprintf(" id: %s", d.Id)) lines = append(lines, fmt.Sprintf(" name: %s", d.Name)) lines = append(lines, fmt.Sprintf(" ownerAddress: %s", d.OwnerAddress)) lines = append(lines, fmt.Sprintf(" operatorAddress: %s", d.OperatorAddress)) From df622ccdf1e9edef92e2905efcf533186ba849b7 Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Tue, 30 Jul 2024 13:28:52 +0800 Subject: [PATCH 7/7] feat(ioctl): change vmType from string to uint64 (#4349) --- ioctl/cmd/ws/wsprojectconfig.go | 47 ++++++--------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/ioctl/cmd/ws/wsprojectconfig.go b/ioctl/cmd/ws/wsprojectconfig.go index 6d958ab8cd..0044f2b89d 100644 --- a/ioctl/cmd/ws/wsprojectconfig.go +++ b/ioctl/cmd/ws/wsprojectconfig.go @@ -38,7 +38,7 @@ var ( if err != nil { return errors.Wrap(err, "failed to get flag version") } - vmType, err := cmd.Flags().GetString("vm-type") + vmType, err := cmd.Flags().GetUint64("vm-type") if err != nil { return errors.Wrap(err, "failed to get flag vm-type") } @@ -59,7 +59,7 @@ var ( return errors.Wrap(err, "failed to get flag output-file") } - out, err := generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile) + out, err := generateProjectFile(vmType, dataSource, dataSourcePubKey, defaultVersion, version, codeFile, confFile, expParam, outputFile) if err != nil { return output.PrintError(err) } @@ -117,7 +117,7 @@ func init() { wsProjectConfig.Flags().StringP("data-source-pubKey", "k", "", config.TranslateInLang(_flagDataSourcePublicKeyUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("default-version", "d", "0.1", config.TranslateInLang(_flagDefaultVersionUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("version", "v", "", config.TranslateInLang(_flagVersionUsages, config.UILanguage)) - wsProjectConfig.Flags().StringP("vm-type", "t", "", config.TranslateInLang(_flagVMTypeUsages, config.UILanguage)) + wsProjectConfig.Flags().Uint64P("vm-type", "t", 0, config.TranslateInLang(_flagVMTypeUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("code-file", "i", "", config.TranslateInLang(_flagCodeFileUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("conf-file", "c", "", config.TranslateInLang(_flagConfFileUsages, config.UILanguage)) wsProjectConfig.Flags().StringP("expand-param", "e", "", config.TranslateInLang(_flagExpandParamUsages, config.UILanguage)) @@ -131,18 +131,13 @@ func init() { type projectConfig struct { Version string `json:"version"` - VMType string `json:"vmType"` + VMType uint64 `json:"vmType"` Output interface{} `json:"output"` CodeExpParam string `json:"codeExpParam,omitempty"` Code string `json:"code"` } -func generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, vmType, codeFile, confFile, expParam, outputFile string) (string, error) { - tye, err := stringToVMType(vmType) - if err != nil { - return "", err - } - +func generateProjectFile(vmType uint64, dataSource, dataSourcePubKey, defaultVersion, version, codeFile, confFile, expParam, outputFile string) (string, error) { hexString, err := convertCodeToZlibHex(codeFile) if err != nil { return "", err @@ -158,7 +153,7 @@ func generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, if expParam != "" { verMap.CodeExpParam = expParam } - verMap.VMType = string(tye) + verMap.VMType = vmType verMap.Code = hexString if version == "" { version = "0.1" @@ -194,7 +189,7 @@ func generateProjectFile(dataSource, dataSourcePubKey, defaultVersion, version, } if confFile == "" { - confFile = fmt.Sprintf("./%s-config.json", vmType) + confFile = fmt.Sprintf("./%d-config.json", vmType) } err = os.WriteFile(confFile, jsonConf, fs.FileMode(0666)) if err != nil { @@ -220,30 +215,4 @@ func convertCodeToZlibHex(codeFile string) (string, error) { hexString := hex.EncodeToString(b.Bytes()) return hexString, err -} - -// zkp vm type -type vmType string - -const ( - risc0 vmType = "risc0" // risc0 vm - halo2 vmType = "halo2" // halo2 vm - zkWasm vmType = "zkwasm" // zkwasm vm - wasm vmType = "wasm" // wasm vm -) - -// TODO move this to sprout -func stringToVMType(vmType string) (vmType, error) { - switch vmType { - case string(risc0): - return risc0, nil - case string(halo2): - return halo2, nil - case string(zkWasm): - return zkWasm, nil - case string(wasm): - return wasm, nil - default: - return "", errors.New(fmt.Sprintf("not support %s type, just support %s, %s, %s, and %s", vmType, risc0, halo2, zkWasm, wasm)) - } -} +} \ No newline at end of file