From 8cfed0df3f0b192a0c68645a0a1a815a55a228c6 Mon Sep 17 00:00:00 2001 From: jed-wemade <127728629+jed-wemade@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:37:46 +0900 Subject: [PATCH 1/3] Add release ci (#102) * Create release.yml * fix: typo * fix: remove sha * fix: specify ubuntu version in ci files * fix: setup packages in ci files to match dependency * fix: integrate file name rule to keep consistency between ci files * fix: use gwemix version instead of ref name --- .github/workflows/artifacts.yml | 25 ++++++++++---- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 527a85885a3e..8e53af77cb69 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 @@ -18,19 +18,30 @@ jobs: with: go-version: '1.19' + - name: Setup packages + run: | + sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev + sudo apt remove -y bzip2 libbz2-dev zlib1g-dev + - name: Build Go-WEMIX tarball run: USE_ROCKSDB=YES make gwemix.tar.gz - - name: Stat Go-WEMIX tarball + - name: Set version run: | - ls -l build/gwemix.tar.gz - tar tf build/gwemix.tar.gz + GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')" + echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV" + echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV" + echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV" + echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV" + + - name: Display ELF info + run: readelf -dV build/bin/gwemix - name: Move results to artifact - run: mv build/gwemix.tar.gz gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz + run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz - name: Upload Go-WEMIX uses: actions/upload-artifact@v4 with: - name: artifact-${{ github.ref_name }}-${{ github.sha }} - path: gwemix-${{ github.ref_name }}-${{ github.sha }}-linux-amd64-rocksdb.tar.gz + name: artifact-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }} + path: gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..957166478d25 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: "Release a tag as draft" + +on: + push: + tags: + - w* + +jobs: + + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.19' + + - name: Setup packages + run: | + sudo apt install -y libjemalloc-dev liblz4-dev libsnappy-dev libzstd-dev libudev-dev + sudo apt remove -y bzip2 libbz2-dev zlib1g-dev + + - name: Build Go-WEMIX tarball (rocksdb) + run: USE_ROCKSDB=YES make gwemix.tar.gz + + - name: Set version + run: | + GWEMIX_VERSION_META="v$(build/bin/gwemix version | awk '/^Version/{ print $2 }')" + echo "GWEMIX_VERSION_META=$GWEMIX_VERSION_META" >> "$GITHUB_ENV" + echo "GWEMIX_VERSION=$(echo $GWEMIX_VERSION_META | cut -d'-' -f1)" >> "$GITHUB_ENV" + echo "GWEMIX_META=$(echo $GWEMIX_VERSION_META | cut -d'-' -f2-)" >> "$GITHUB_ENV" + echo "GWEMIX_COMMITHASH=$(echo ${{ github.sha }} | cut -c1-8)" >> "$GITHUB_ENV" + + - name: Display ELF info (rocksdb) + run: readelf -dV build/bin/gwemix + + - name: Move results to artifact (rocksdb) + run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz + + - name: Build Go-WEMIX tarball (leveldb) + run: USE_ROCKSDB=NO make gwemix.tar.gz + + - name: Display ELF info (leveldb) + run: readelf -dV build/bin/gwemix + + - name: Move results to artifact (leveldb) + run: mv build/gwemix.tar.gz gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz + + - name: GH Release + uses: softprops/action-gh-release@v2.0.5 + with: + name: WEMIX3.0 Mainnet and Testnet Build (${{ env.GWEMIX_VERSION }}) + draft: true + files: | + gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-rocksdb.tar.gz + gwemix-${{ env.GWEMIX_VERSION_META }}-${{ env.GWEMIX_COMMITHASH }}-linux-amd64-leveldb.tar.gz From 06515671a63074d982ff90cd7a35deb3de5ffa1f Mon Sep 17 00:00:00 2001 From: egonspace Date: Mon, 24 Jun 2024 11:55:46 +0900 Subject: [PATCH 2/3] feat: update snapshot pending state --- ethclient/gethclient/gethclient_test.go | 2 +- internal/ethapi/api.go | 4 ++-- miner/worker.go | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ethclient/gethclient/gethclient_test.go b/ethclient/gethclient/gethclient_test.go index 718dc14bbcb6..bbae8973b422 100644 --- a/ethclient/gethclient/gethclient_test.go +++ b/ethclient/gethclient/gethclient_test.go @@ -147,7 +147,7 @@ func testAccessList(t *testing.T, client *rpc.Client) { From: testAddr, To: &common.Address{}, Gas: 21000, - GasPrice: big.NewInt(765625000), + GasPrice: big.NewInt(875000000), Value: big.NewInt(1), } al, gas, vmErr, err := ec.CreateAccessList(context.Background(), msg) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 08d85442cc50..ceab2e801706 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1338,7 +1338,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr // EstimateGas returns an estimate of the amount of gas needed to execute the // given transaction against the current pending block. func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error) { - bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber) if blockNrOrHash != nil { bNrOrHash = *blockNrOrHash } @@ -1622,7 +1622,7 @@ type accessListResult struct { // CreateAccessList creates a EIP-2930 type AccessList for the given transaction. // Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state. func (s *PublicBlockChainAPI) CreateAccessList(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (*accessListResult, error) { - bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber) if blockNrOrHash != nil { bNrOrHash = *blockNrOrHash } diff --git a/miner/worker.go b/miner/worker.go index c30d38ed10ed..364bf034970f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -119,6 +119,7 @@ func (env *environment) copy() *environment { coinbase: env.coinbase, header: types.CopyHeader(env.header), receipts: copyReceipts(env.receipts), + till: env.till, } if env.gasPool != nil { gasPool := *env.gasPool @@ -535,7 +536,7 @@ func (w *worker) newWorkLoopEx(recommit time.Duration) { // commitSimple just starts a new commitNewWork commitSimple := func() { - if atomic.CompareAndSwapInt32(&busyMining, 0, 1) { + if wemixminer.AmPartner() && atomic.CompareAndSwapInt32(&busyMining, 0, 1) { w.newWorkCh <- &newWorkReq{interrupt: nil, noempty: false, timestamp: time.Now().Unix()} atomic.StoreInt32(&w.newTxs, 0) atomic.StoreInt32(&busyMining, 0) @@ -1268,8 +1269,6 @@ func (w *worker) commitTransactionsEx(env *environment, interrupt *int32, tstart } - time.Sleep(time.Until(*env.till)) - log.Debug("Block", "number", env.header.Number.Int64(), "elapsed", common.PrettyDuration(time.Since(tstart)), "txs", len(committedTxs)) return false @@ -1769,6 +1768,13 @@ func (w *worker) commitEx(env *environment, interval func(), update bool, start } logs = append(logs, receipt.Logs...) } + + if update { + w.updateSnapshot(env) + update = false + } + time.Sleep(time.Until(*env.till)) + if !wemixminer.IsPoW() { if err = wemixminer.ReleaseMiningToken(sealedBlock.Number(), sealedBlock.Hash(), sealedBlock.ParentHash()); err != nil { return err From 71325e9d1e97c773bc658fb89735dc9dac8b57df Mon Sep 17 00:00:00 2001 From: felix-shin-wt <65204854+felix-shin-wt@users.noreply.github.com> Date: Thu, 4 Jul 2024 07:59:39 +0900 Subject: [PATCH 3/3] Migrate governance-contracts (#89) * migrate : governance-contract * panic: core.GenerateChain * fix: test panic * fix : FakeMode, escape futureBlock * fix : panic bad block * refact : mv wemix_backends -> wemix package * refact : remove common/bn * refact : GovContracts * fix : remove unused * fix : rename confusing variable * fix : unhandled error * fix : code style * refact: migrate openzeppelin contract:v4.6.0, contracts-upgrade:v4.7.0 * feat : update governancedeploy use wemix/bind * fix : remove unused * fix : default init envstorage values * fix : gwemix.sh * fix : compare fixed bytes * fix : compare fixed bytes * fix : typo * fix : Flag type * feat : update genesisConfig * fix : remove unused code * fix : deploy log * feat : wemix simulated OptionFn * feat : install solc * fix : typo * fix : typo * fix : error verifyBlockSig * fix : remove unused file * fix : gwemix.sh * fix: go.mod * refact : using bind structs * docs : gwemix.sh comment * refact : submodule openzeppelin * feat : using NCPExit * wip : dev-ci * fix : unuse generic * fix : TestWemixBackends$ * feat : using generic, remove lint_test go@1.17 * fix: go:generate * fix : clean code * fix : remove comment * fix : clean code * feat : (governance abigen) compare data before writing to the file * refact : using compiledTy * feat : include sigs wemix/bind contracts * refacet : move compiled, remove simulated-backend * fix : clean code * fix : clean code * fix : detailed tick processing * feat : [init-gov] add option password * fix : gwemix.sh init-gov params * fix : [init-gov] add option password * refact : use const * fix : use constant * fix : loadGenesisConfig * fix : check bootnodeExists --------- Co-authored-by: egonspace --- .github/workflows/dev-ci.yml | 7 +- .github/workflows/gwemix-ci.yml | 5 +- .github/workflows/master-ci.yml | 5 +- .gitmodules | 6 + Makefile | 79 +- accounts/abi/bind/backends/simulated.go | 15 + cmd/geth/governancedeploy.go | 352 +- cmd/geth/governancedeploy_test.go | 133 + cmd/geth/main.go | 5 +- cmd/geth/wemixcmd.go | 168 +- consensus/ethash/consensus.go | 2 +- go.mod | 10 +- go.sum | 11 +- wemix/admin.go | 620 +- wemix/bind/backends/options.go | 50 + wemix/bind/backends/wemix_simulated.go | 260 + wemix/bind/backends/wemix_simulated_test.go | 175 + wemix/bind/const.go | 28 + wemix/bind/gen_ballotStorage_abi.go | 4325 +++++++++++++ wemix/bind/gen_envStorage_abi.go | 5443 +++++++++++++++++ wemix/bind/gen_gov_abi.go | 5304 ++++++++++++++++ wemix/bind/gen_ncpExit_abi.go | 2439 ++++++++ wemix/bind/gen_registry_abi.go | 981 +++ wemix/bind/gen_staking_abi.go | 4177 +++++++++++++ wemix/bind/structs.go | 474 ++ wemix/contracts/WemixGovernance.js | 644 -- wemix/governance-contract/compiler.go | 160 + wemix/governance-contract/contracts/Gov.sol | 13 + .../contracts/GovChecker.sol | 92 + .../governance-contract/contracts/GovImp.sol | 1383 +++++ .../governance-contract/contracts/NCPExit.sol | 13 + .../contracts/NCPExitImp.sol | 115 + .../contracts/Registry.sol | 82 + .../governance-contract/contracts/Staking.sol | 13 + .../contracts/StakingImp.sol | 385 ++ .../contracts/TestnetGovImp.sol | 1031 ++++ wemix/governance-contract/contracts/abigen.go | 51 + .../contracts/abstract/AEnvStorage.sol | 134 + .../contracts/abstract/AGov.sol | 91 + .../contracts/abstract/BallotEnums.sol | 28 + .../contracts/abstract/EnvConstants.sol | 56 + .../contracts/abstract/TestnetAGov.sol | 91 + .../contracts/interface/IBallotStorage.sol | 44 + .../contracts/interface/IEnvStorage.sol | 36 + .../contracts/interface/IGov.sol | 19 + .../contracts/interface/IGovStaking.sol | 6 + .../contracts/interface/INCPExit.sol | 43 + .../contracts/interface/INCPStaking.sol | 18 + .../contracts/interface/IRegistry.sol | 6 + .../contracts/interface/IStaking.sol | 22 + .../contracts/interface/ITestnetGov.sol | 18 + .../contracts/openzeppelin/contracts | 1 + .../openzeppelin/contracts-upgradeable | 1 + .../contracts/storage/BallotStorage.sol | 13 + .../contracts/storage/BallotStorageImp.sol | 570 ++ .../contracts/storage/EnvStorage.sol | 13 + .../contracts/storage/EnvStorageImp.sol | 495 ++ .../contracts/storage/EternalStorage.sol | 147 + wemix/governance-contract/remappings.txt | 2 + wemix/governance-contract/test/const.go | 110 + wemix/governance-contract/test/contracts.go | 304 + .../governance-contract/test/gov_bind_test.go | 114 + wemix/governance-contract/test/gov_test.go | 3137 ++++++++++ wemix/governance-contract/test/utils.go | 236 + wemix/metclient/util.go | 37 +- wemix/miner_limit.go | 95 +- wemix/rewards_test.go | 6 +- wemix/scripts/deploy-governance.js | 400 -- wemix/scripts/gwemix.sh | 28 +- wemix/scripts/solc.sh | 188 - wemix/sync.go | 5 +- 71 files changed, 33426 insertions(+), 2144 deletions(-) create mode 100644 cmd/geth/governancedeploy_test.go create mode 100644 wemix/bind/backends/options.go create mode 100644 wemix/bind/backends/wemix_simulated.go create mode 100644 wemix/bind/backends/wemix_simulated_test.go create mode 100644 wemix/bind/const.go create mode 100644 wemix/bind/gen_ballotStorage_abi.go create mode 100644 wemix/bind/gen_envStorage_abi.go create mode 100644 wemix/bind/gen_gov_abi.go create mode 100644 wemix/bind/gen_ncpExit_abi.go create mode 100644 wemix/bind/gen_registry_abi.go create mode 100644 wemix/bind/gen_staking_abi.go create mode 100644 wemix/bind/structs.go delete mode 100644 wemix/contracts/WemixGovernance.js create mode 100644 wemix/governance-contract/compiler.go create mode 100644 wemix/governance-contract/contracts/Gov.sol create mode 100644 wemix/governance-contract/contracts/GovChecker.sol create mode 100644 wemix/governance-contract/contracts/GovImp.sol create mode 100644 wemix/governance-contract/contracts/NCPExit.sol create mode 100644 wemix/governance-contract/contracts/NCPExitImp.sol create mode 100644 wemix/governance-contract/contracts/Registry.sol create mode 100644 wemix/governance-contract/contracts/Staking.sol create mode 100644 wemix/governance-contract/contracts/StakingImp.sol create mode 100644 wemix/governance-contract/contracts/TestnetGovImp.sol create mode 100644 wemix/governance-contract/contracts/abigen.go create mode 100644 wemix/governance-contract/contracts/abstract/AEnvStorage.sol create mode 100644 wemix/governance-contract/contracts/abstract/AGov.sol create mode 100644 wemix/governance-contract/contracts/abstract/BallotEnums.sol create mode 100644 wemix/governance-contract/contracts/abstract/EnvConstants.sol create mode 100644 wemix/governance-contract/contracts/abstract/TestnetAGov.sol create mode 100644 wemix/governance-contract/contracts/interface/IBallotStorage.sol create mode 100644 wemix/governance-contract/contracts/interface/IEnvStorage.sol create mode 100644 wemix/governance-contract/contracts/interface/IGov.sol create mode 100644 wemix/governance-contract/contracts/interface/IGovStaking.sol create mode 100644 wemix/governance-contract/contracts/interface/INCPExit.sol create mode 100644 wemix/governance-contract/contracts/interface/INCPStaking.sol create mode 100644 wemix/governance-contract/contracts/interface/IRegistry.sol create mode 100644 wemix/governance-contract/contracts/interface/IStaking.sol create mode 100644 wemix/governance-contract/contracts/interface/ITestnetGov.sol create mode 160000 wemix/governance-contract/contracts/openzeppelin/contracts create mode 160000 wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable create mode 100644 wemix/governance-contract/contracts/storage/BallotStorage.sol create mode 100644 wemix/governance-contract/contracts/storage/BallotStorageImp.sol create mode 100644 wemix/governance-contract/contracts/storage/EnvStorage.sol create mode 100644 wemix/governance-contract/contracts/storage/EnvStorageImp.sol create mode 100644 wemix/governance-contract/contracts/storage/EternalStorage.sol create mode 100644 wemix/governance-contract/remappings.txt create mode 100644 wemix/governance-contract/test/const.go create mode 100644 wemix/governance-contract/test/contracts.go create mode 100644 wemix/governance-contract/test/gov_bind_test.go create mode 100644 wemix/governance-contract/test/gov_test.go create mode 100644 wemix/governance-contract/test/utils.go delete mode 100644 wemix/scripts/deploy-governance.js delete mode 100755 wemix/scripts/solc.sh diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index df9f049e80aa..2a1b1088641a 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: [1.17, 1.18, 1.19] + version: [1.18, 1.19] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -38,7 +38,7 @@ jobs: uses: actions/setup-go@v3 with: go-version: ${{ matrix.version }} - + - name: Check Lint run: make lint @@ -49,6 +49,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Wemix Submodules + run: git submodule update --init wemix/ + - name: Set up Go uses: actions/setup-go@v3 with: diff --git a/.github/workflows/gwemix-ci.yml b/.github/workflows/gwemix-ci.yml index f141532d2241..da7fcc178378 100644 --- a/.github/workflows/gwemix-ci.yml +++ b/.github/workflows/gwemix-ci.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: [1.17, 1.18, 1.19] + version: [1.18, 1.19] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -49,6 +49,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Wemix Submodules + run: git submodule update --init wemix/ + - name: Set up Go uses: actions/setup-go@v3 with: diff --git a/.github/workflows/master-ci.yml b/.github/workflows/master-ci.yml index 46736e268895..b9b67f2da7eb 100644 --- a/.github/workflows/master-ci.yml +++ b/.github/workflows/master-ci.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - version: [1.17, 1.18, 1.19] + version: [1.18, 1.19] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -49,6 +49,9 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Wemix Submodules + run: git submodule update --init wemix/ + - name: Set up Go uses: actions/setup-go@v3 with: diff --git a/.gitmodules b/.gitmodules index 57093244b9c7..4dcaf5dbad01 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,3 +12,9 @@ [submodule "etcd"] path = etcd url = https://github.com/metadium/etcd +[submodule "wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable"] + path = wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable + url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable +[submodule "wemix/governance-contract/contracts/openzeppelin/contracts"] + path = wemix/governance-contract/contracts/openzeppelin/contracts + url = https://github.com/OpenZeppelin/openzeppelin-contracts diff --git a/Makefile b/Makefile index f7b7366f29a1..5f2b8a1575b7 100644 --- a/Makefile +++ b/Makefile @@ -31,16 +31,14 @@ endif gwemix.tar.gz: gwemix logrot @[ -d build/conf ] || mkdir -p build/conf - @cp -p wemix/scripts/gwemix.sh wemix/scripts/solc.sh build/bin/ + @cp -p wemix/scripts/gwemix.sh build/bin/ @cp -p wemix/scripts/config.json.example \ wemix/scripts/genesis-template.json \ - wemix/contracts/WemixGovernance.js \ - wemix/scripts/deploy-governance.js \ build/conf/ @(cd build; tar cfz gwemix.tar.gz bin conf) @echo "Done building build/gwemix.tar.gz" -gwemix: rocksdb wemix/governance_abi.go +gwemix: rocksdb ifeq ($(USE_ROCKSDB), NO) $(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/gwemix else @@ -68,7 +66,7 @@ else $(GORUN) build/ci.go install $(ROCKSDB_TAG) ./cmd/dbbench endif -all: wemix/governance_abi.go +all: $(GORUN) build/ci.go install android: @@ -89,12 +87,12 @@ test: all test-short: all $(GORUN) build/ci.go test -short -lint: wemix/governance_abi.go ## Run linters. +lint: ## Run linters. $(GORUN) build/ci.go lint clean: env GO111MODULE=on go clean -cache - rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf wemix/admin_abi.go wemix/governance_abi.go + rm -fr build/_workspace/pkg/ $(GOBIN)/* build/conf @ROCKSDB_DIR=$(ROCKSDB_DIR); \ if [ -e $${ROCKSDB_DIR}/Makefile ]; then \ cd $${ROCKSDB_DIR}; \ @@ -132,70 +130,3 @@ rocksdb: @[ ! -e rocksdb/.git ] && git submodule update --init rocksdb; \ cd $(ROCKSDB_DIR) && PORTABLE=1 make -j8 static_lib; endif - -AWK_CODE=' \ -BEGIN { print "package wemix"; bin = 0; name = ""; abi = ""; } \ -/^{/ { bin = 1; abi = ""; name = ""; } \ -/^}/ { bin = 0; abi = abi "}"; print "var " name "Abi = `" abi "`"; } \ -{ \ - if (bin == 1) { \ - abi = abi $$0; \ - if ($$1 == "\"contractName\":") { \ - name = $$2; \ - gsub(",|\"", "", name); \ - } \ - } \ -}' - -wemix/admin_abi.go: wemix/contracts/WemixAdmin-template.sol build/bin/solc - @PATH=${PATH}:build/bin wemix/scripts/solc.sh -f abi $< /tmp/junk.$$$$; \ - cat /tmp/junk.$$$$ | awk $(AWK_CODE) > $@; \ - rm -f /tmp/junk.$$$$; - -AWK_CODE_2=' \ -BEGIN { print "package wemix\n"; } \ -/^var Registry_contract/ { \ - sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \ - n = "Registry"; \ - print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \ -} \ -/^var StakingImp_contract/ { \ - sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \ - n = "Staking"; \ - print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \ -} \ -/^var EnvStorageImp_contract/ { \ - sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \ - n = "EnvStorageImp"; \ - print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \ -} \ -/^var GovImp_contract/ { \ - sub("^var[^(]*\\(","",$$0); sub("\\);$$","",$$0); \ - n = "Gov"; \ - print "var " n "Abi = `{ \"contractName\": \"" n "\", \"abi\": " $$0 "}`"; \ -}' - -wemix/governance_abi.go: wemix/contracts/WemixGovernance.js - @cat $< | awk $(AWK_CODE_2) > $@ - -ifneq ($(shell uname), Linux) - -build/bin/solc: - @test 1 - -else - -SOLC_URL=https://github.com/ethereum/solidity/releases/download/v0.4.24/solc-static-linux -build/bin/solc: - @[ -d build/bin ] || mkdir -p build/bin; \ - if [ ! -x build/bin/solc ]; then \ - if which curl > /dev/null 2>&1; then \ - curl -Ls -o build/bin/solc $(SOLC_URL); \ - chmod +x build/bin/solc; \ - elif which wget > /dev/null 2>&1; then \ - wget -nv -o build/bin/solc $(SOLC_URL); \ - chmod +x build/bin/solc; \ - fi \ - fi - -endif diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index e26341d9df5d..a73eb311eadd 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -37,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" @@ -72,6 +73,20 @@ type SimulatedBackend struct { config *params.ChainConfig } +func NewSimulatedBackendWithEthereum(e *eth.Ethereum) *SimulatedBackend { + database := e.ChainDb() + blockchain := e.BlockChain() + + backend := &SimulatedBackend{ + database: database, + blockchain: blockchain, + config: blockchain.Config(), + events: filters.NewEventSystem(&filterBackend{database, blockchain}, false), + } + backend.rollback(blockchain.CurrentBlock()) + return backend +} + // NewSimulatedBackendWithDatabase creates a new binding backend based on the given database // and uses a simulated blockchain for testing purposes. // A simulated backend always uses chainID 1337. diff --git a/cmd/geth/governancedeploy.go b/cmd/geth/governancedeploy.go index 4f2eb965e9a6..4e488b6e18c8 100644 --- a/cmd/geth/governancedeploy.go +++ b/cmd/geth/governancedeploy.go @@ -3,24 +3,28 @@ package main import ( - "bytes" "context" - "encoding/hex" + "errors" "fmt" "math/big" "os" - "reflect" - "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + gov "github.com/ethereum/go-ethereum/wemix/bind" "github.com/ethereum/go-ethereum/wemix/metclient" "gopkg.in/urfave/cli.v1" ) -func getInitialGovernanceMembersAndNodes(configJsFile string) (nodes []byte, stakes []byte, rewardPoolAccount, maintenanceAccount *common.Address, err error) { +func getInitialGovernanceInitDatas(configJsFile string) ( + domains map[string]common.Address, + env gov.InitEnvStorage, + members gov.InitMembers, + err error, +) { var fin *os.File if fin, err = os.Open(configJsFile); err != nil { return @@ -33,312 +37,124 @@ func getInitialGovernanceMembersAndNodes(configJsFile string) (nodes []byte, sta return } - l := len(cfg.Members) - var b1, b2 bytes.Buffer - for i := 0; i < l; i++ { - m := cfg.Members[i] - var ( - sid string - id []byte - ) - if len(m.Id) == 128 { - sid = m.Id - } else if len(m.Id) == 130 { - sid = m.Id[2:] - } else { - return nil, nil, nil, nil, fmt.Errorf("Invalid enode id %s", m.Id) - } - if id, err = hex.DecodeString(sid); err != nil { - return nil, nil, nil, nil, err - } - - addr := new(big.Int).SetBytes(m.Addr[:]) - b1.Write(metclient.PackNum(reflect.ValueOf(addr))) - b1.Write(metclient.PackNum(reflect.ValueOf(len(m.Name)))) - b1.Write([]byte(m.Name)) - b1.Write(metclient.PackNum(reflect.ValueOf(len(id)))) - b1.Write(id) - b1.Write(metclient.PackNum(reflect.ValueOf(len(m.Ip)))) - b1.Write([]byte(m.Ip)) - b1.Write(metclient.PackNum(reflect.ValueOf(m.Port))) - - b2.Write(metclient.PackNum(reflect.ValueOf(addr))) - b2.Write(metclient.PackNum(reflect.ValueOf(m.Stake))) - } - nodes = b1.Bytes() - stakes = b2.Bytes() - nilAddr := common.Address{} - if cfg.RewardPool != nilAddr { - rewardPoolAccount = &cfg.RewardPool + domains = make(map[string]common.Address) + zeroAddress := common.Address{} + if cfg.StakingReward != zeroAddress { + domains[gov.DOMAIN_StakingReward] = cfg.StakingReward } - if cfg.Maintenance != nilAddr { - maintenanceAccount = &cfg.Maintenance + if cfg.Ecosystem != zeroAddress { + domains[gov.DOMAIN_Ecosystem] = cfg.Ecosystem } - - return -} - -// governance-contract.js config.js -func deployGovernanceContracts(cliCtx *cli.Context) error { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - var err error - - // get command line arguments - url := cliCtx.String(urlFlag.Name) - gas := cliCtx.Int(gasFlag.Name) - gasPrice := cliCtx.Int(gasPriceFlag.Name) - - if gas <= 0 { - gas = 0xF000000 + if cfg.Maintenance != zeroAddress { + domains[gov.DOMAIN_Maintenance] = cfg.Maintenance } - if gasPrice <= 0 { - gasPrice = 80000000000 + if cfg.FeeCollector != zeroAddress { + domains[gov.DOMAIN_FeeCollector] = cfg.FeeCollector } - if len(url) == 0 || len(cliCtx.Args()) != 3 { - return fmt.Errorf("Invalid Arguments") - } + env = cfg.Env.ToInitData() - passwd := utils.GetPassPhraseWithList("", false, 0, utils.MakePasswordList(cliCtx)) - if len(passwd) == 0 { - return fmt.Errorf("Invalid Arguments") + members = make(gov.InitMembers, len(cfg.Members)) + for i, member := range cfg.Members { + members[i] = member.ToInitData() } - contractsFile, configJsFile, accountFile := cliCtx.Args()[0], cliCtx.Args()[1], cliCtx.Args()[2] + return +} - // account - var from *keystore.Key - from, err = metclient.LoadAccount(passwd, accountFile) - if err != nil { - return err - } +// governance-contract.js config.js +func deployGovernanceContracts(ctx *cli.Context) error { + log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) + // get command line arguments + args := ctx.Args() - // initial members and nodes data var ( - membersAndNodes, stakes []byte - rewardPoolAccount, maintenanceAccount *common.Address + errInvalidArguments error = errors.New("invalid Arguments") + configFile, accountFile string + lockAmount *big.Int ) - membersAndNodes, stakes, rewardPoolAccount, maintenanceAccount, err = getInitialGovernanceMembersAndNodes(configJsFile) - if err != nil { - return nil - } - - // cli connection - var cli *ethclient.Client - cli, err = ethclient.Dial(url) - if err != nil { - return err - } - - // contract variables - registry := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - envStorageImp := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - staking := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - ballotStorage := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - envStorage := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - govImp := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - gov := &metclient.RemoteContract{Cli: cli, From: from, Gas: gas} - - // load contract codes - var contracts map[string]*metclient.ContractData - if fin, e2 := os.Open(contractsFile); e2 != nil { - return e2 - } else { - defer fin.Close() - if contracts, err = metclient.LoadJsContract(fin); err != nil { - return nil + switch len(args) { + case 3: + configFile, accountFile = args[0], args[1] + lockAmount, ok := new(big.Int).SetString(args[2], 10) + if !ok || lockAmount.Sign() <= 0 { + return errInvalidArguments } + case 2: + configFile, accountFile = args[0], args[1] + lockAmount = gov.DefaultInitEnvStorage.STAKING_MIN + default: + return errInvalidArguments } - // check if contracts exist - contractNames := []string{"Registry", "EnvStorageImp", "Staking", "BallotStorage", "EnvStorage", "GovImp", "Gov"} - for _, name := range contractNames { - if _, ok := contracts[name]; !ok { - return fmt.Errorf("Cannot find %s contract", name) - } - } - registry.Abi = contracts["Registry"].Abi - envStorageImp.Abi = contracts["EnvStorageImp"].Abi - staking.Abi = contracts["Staking"].Abi - ballotStorage.Abi = contracts["BallotStorage"].Abi - envStorage.Abi = contracts["EnvStorage"].Abi - govImp.Abi = contracts["GovImp"].Abi - gov.Abi = contracts["Gov"].Abi - - txs := make([]common.Hash, 10) - - // 1. deploy Registry and EnvStorageImp contracts - ixTxs := 0 - fmt.Println("Deploying Registry...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["Registry"], nil, gas, gasPrice); err != nil { + client, err := ethclient.Dial(ctx.String(urlFlag.Name)) + if err != nil { return err } - ixTxs++ - fmt.Println("Deploying EnvStorageImp...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["EnvStorageImp"], nil, gas, gasPrice); err != nil { + chainID, err := client.ChainID(context.TODO()) + if err != nil { return err } - fmt.Print("Waiting for receipts...") - for i := ixTxs; i >= 0; i-- { - var receipt *types.Receipt - receipt, err = metclient.GetContractReceipt(ctx, cli, txs[i], 200, 300) - if err != nil { - return err - } - switch i { - case 0: - registry.To = &receipt.ContractAddress - case 1: - envStorageImp.To = &receipt.ContractAddress - } - } - fmt.Println("good.") - - // 2. deploy Staking, BallotStorage, EnvStorage, GovImp, Gov - ixTxs = 0 - fmt.Println("Deploying Staking...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["Staking"], - []interface{}{registry.To, stakes}, gas, gasPrice); err != nil { + var opts *bind.TransactOpts + if from, err := metclient.LoadAccount(utils.GetPassPhraseWithList("", false, 0, utils.MakePasswordList(ctx)), accountFile); err != nil { return err - } - ixTxs++ - fmt.Println("Deploying BalloStorage...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["BallotStorage"], - []interface{}{registry.To}, gas, gasPrice); err != nil { - return err - } - ixTxs++ - fmt.Println("Deploying EnvStorage...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["EnvStorage"], - []interface{}{registry.To, envStorageImp.To}, gas, gasPrice); err != nil { - return err - } - ixTxs++ - fmt.Println("Deploying GovImp...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["GovImp"], nil, gas, gasPrice); err != nil { + } else if opts, err = bind.NewKeyedTransactorWithChainID(from.PrivateKey, chainID); err != nil { return err - } - ixTxs++ - fmt.Println("Deploying Gov...") - if txs[ixTxs], err = metclient.Deploy(ctx, cli, from, contracts["Gov"], - nil, gas, gasPrice); err != nil { - return err - } - fmt.Println("Gov tx is", txs[ixTxs].Hex()) - - fmt.Printf("Waiting for receipts...") - for i := ixTxs; i >= 0; i-- { - var receipt *types.Receipt - receipt, err = metclient.GetContractReceipt(ctx, cli, txs[i], 200, 300) - if err != nil { - return err + } else { + if ctx.IsSet(gasFlag.Name) { + opts.GasLimit = ctx.Uint64(gasFlag.Name) } - switch i { - case 0: - staking.To = &receipt.ContractAddress - case 1: - ballotStorage.To = &receipt.ContractAddress - case 2: - envStorage.To = &receipt.ContractAddress - case 3: - govImp.To = &receipt.ContractAddress - case 4: - gov.To = &receipt.ContractAddress + if ctx.IsSet(gasPriceFlag.Name) { + opts.GasPrice = big.NewInt(ctx.Int64(gasPriceFlag.Name)) } } - fmt.Printf("good. Governance address %v.\n", gov.To.Hex()) - // 3. setup registry - fmt.Println("Setting registry...") - ixTxs = 0 - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("Staking"), staking.To}); err != nil { - return err - } - ixTxs++ - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("BallotStorage"), ballotStorage.To}); err != nil { - return err - } - ixTxs++ - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("EnvStorage"), envStorage.To}); err != nil { - return err - } - ixTxs++ - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("GovernanceContract"), gov.To}); err != nil { - return err - } - if rewardPoolAccount != nil { - ixTxs++ - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("RewardPool"), rewardPoolAccount}); err != nil { - return err - } - } - if maintenanceAccount != nil { - ixTxs++ - if txs[ixTxs], err = metclient.SendContract(ctx, registry, "setContractDomain", []interface{}{metclient.ToBytes32("Maintenance"), maintenanceAccount}); err != nil { - return err - } - } + return deployGovernance(client, opts, lockAmount, configFile) +} - // no need to wait for the receipts for the above +type Client interface { + bind.ContractBackend + bind.DeployBackend +} - // 4. deposit staking - not needed - fmt.Println("Depositing stakes...") +func deployGovernance(cli Client, ownerOpts *bind.TransactOpts, lockAmount *big.Int, configJsFile string) error { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ownerOpts.Context = ctx - // 5. Gov.initOnce() - fmt.Printf("Initializing governance members and nodes...") - if txs[0], err = metclient.SendContract(ctx, gov, "initOnce", []interface{}{registry.To, govImp.To, membersAndNodes}); err != nil { + // initial members and nodes data + domains, env, members, err := getInitialGovernanceInitDatas(configJsFile) + if err != nil { return err } - - if receipt, err2 := metclient.GetReceipt(ctx, cli, txs[0], 200, 300); err2 != nil { - return err2 - } else if receipt.Status != 1 { - fmt.Printf("Transaction %v failed with status %d.\n", - txs[0].Hex(), receipt.Status) - return fmt.Errorf("Transaction failed with status %d.", receipt.Status) + if lockAmount.Cmp(env.STAKING_MIN) < 0 || lockAmount.Cmp(env.STAKING_MAX) > 0 { + return fmt.Errorf("invalid lock amount, input:%v, min:%v, max:%v", lockAmount, env.STAKING_MIN, env.STAKING_MAX) } - fmt.Println("good.") - // 6. initialize environment storage data: - // blocksPer, ballotDurationMin, ballotDurationMax, stakingMin, stakingMax, - // gasPrice - defaultBlocksPer := big.NewInt(100) - defaultBallotDurationMin := big.NewInt(86400) - defaultBallotDurationMax := big.NewInt(604800) - defaultStakingMin, _ := big.NewInt(0).SetString("4980000000000000000000000", 0) - defaultStakingMax, _ := big.NewInt(0).SetString("39840000000000000000000000", 0) - defaultGasPrice := big.NewInt(80000000000) - defaultMaxIdleBlockInterval := big.NewInt(5) - envDefaults := []interface{}{ - defaultBlocksPer, - defaultBallotDurationMin, - defaultBallotDurationMax, - defaultStakingMin, - defaultStakingMax, - defaultGasPrice, - defaultMaxIdleBlockInterval, + // deploy & set domains + contracts, err := gov.DeployGovContracts(ownerOpts, cli, domains) + if err != nil { + return err } - fmt.Printf("Initializing environment storage.\n") - envStorageImp.To = envStorage.To - if txs[0], err = metclient.SendContract(ctx, envStorageImp, "initialize", envDefaults); err != nil { + // init contracts + err = gov.ExecuteInitialize(contracts, ownerOpts, cli, lockAmount, env, members) + if err != nil { return err } - // 7. print the addresses + // print the addresses + address := contracts.Address() fmt.Printf(`{ "REGISTRY_ADDRESS": "%s", "STAKING_ADDRESS": "%s", "ENV_STORAGE_ADDRESS": "%s", "BALLOT_STORAGE_ADDRESS": "%s", - "GOV_ADDRESS": "%s", - "GOV_IMP_ADDRESS": "%s" + "GOV_ADDRESS": "%s" } `, - registry.To.Hex(), staking.To.Hex(), envStorage.To.Hex(), - ballotStorage.To.Hex(), gov.To.Hex(), govImp.To.Hex()) + address.Registry, address.Staking, address.EnvStorage, address.BallotStorage, address.Gov) return nil } diff --git a/cmd/geth/governancedeploy_test.go b/cmd/geth/governancedeploy_test.go new file mode 100644 index 000000000000..347d3a673603 --- /dev/null +++ b/cmd/geth/governancedeploy_test.go @@ -0,0 +1,133 @@ +// governancedeploy.js + +package main + +import ( + "context" + "encoding/json" + "math" + "math/big" + "os" + "path/filepath" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + gov "github.com/ethereum/go-ethereum/wemix/bind" + "github.com/stretchr/testify/require" +) + +func TestDeployGoverananceContracts(t *testing.T) { + owner, err := crypto.GenerateKey() + require.NoError(t, err) + + opts, err := bind.NewKeyedTransactorWithChainID(owner, params.AllEthashProtocolChanges.ChainID) + require.NoError(t, err) + + backend := backends.NewSimulatedBackend( + core.GenesisAlloc{ + opts.From: {Balance: new(big.Int).Mul(big.NewInt(math.MaxInt64), big.NewInt(params.Ether))}, + }, + params.MaxGasLimit, + ) + + fin := make(chan struct{}) + defer close(fin) + + go func() { + ticker := time.NewTicker(0.1e9) + defer ticker.Stop() + + nonce, err := backend.NonceAt(context.Background(), opts.From, nil) + require.NoError(t, err) + + for { + select { + case <-ticker.C: + pending, err := backend.PendingNonceAt(context.Background(), opts.From) + require.NoError(t, err) + if nonce != pending { + nonce = pending + backend.Commit() + } + case <-fin: + return + } + } + }() + + configJSFile := filepath.Join(t.TempDir(), "config.json") + require.NoError(t, os.WriteFile(configJSFile, []byte(configStr), 0775)) + + domains, env, members, err := getInitialGovernanceInitDatas(configJSFile) + require.NoError(t, err) + for name, addr := range domains { + t.Log(name, addr) + } + bytes, _ := json.MarshalIndent(env, "", " ") + t.Log(string(bytes)) + for i, member := range members { + t.Log(i, member) + } + + require.NoError(t, deployGovernance(backend, opts, gov.DefaultInitEnvStorage.STAKING_MIN, configJSFile)) +} + +// config.json.example +const configStr string = ` +{ + "extraData": "The beginning of Wemix3.0 testnet on July 1st, 2022", + "staker": "0xf00d9928ed1dada205aec56ab85e0e2ab5670ad5", + "ecosystem": "0x1be19928ed1dada205aec56ab85e0e2ab5670ad5", + "maintenance": "0x900d9928ed1dada205aec56ab85e0e2ab5670ad5", + "feecollector": "0x900d9928ed1dada205aec56ab85e0e2ab5670ad5", + "env": { + "ballotDurationMin": 86400, + "ballotDurationMax": 604800, + "stakingMin": 1500000000000000000000000, + "stakingMax": 1500000000000000000000000, + "MaxIdleBlockInterval": 5, + "blockCreationTime": 1000, + "blockRewardAmount": 1000000000000000000, + "maxPriorityFeePerGas": 100000000000, + "rewardDistributionMethod": [ 4000, 1000, 2500, 2500 ], + "maxBaseFee": 50000000000000, + "blockGasLimit": 105000000, + "baseFeeMaxChangeRate": 55, + "gasTargetPercentage": 30 + }, + "members": [ + { + "addr": "0x1be19928ed1dada205aec56ab85e0e2ab5670ad5", + "stake": 2000000000000000000000000000, + "name": "fak1", + "id": "0xfa5f92fc954e4e45ac5773d5472bf8ab0b888979a5e65d49bac65e1b4345e82a745e255d1018d7a6de7ae8fd3a04b0e8eca4359f0fd35c2d0c45d29f7ffa0290", + "ip": "172.18.0.1", + "port": 8589, + "bootnode": true + }, + { + "addr": "0xb4388353fd0f3b3a017e09f2b857052ff219e663", + "stake": 2000000000000000000000000000, + "name": "fak2", + "id": "0xea5f92fc954e4e45ac5773d5472bf8ab0b888979a5e65d49bac65e1b4345e82a745e255d1018d7a6de7ae8fd3a04b0e8eca4359f0fd35c2d0c45d29f7ffa0290", + "ip": "172.18.0.2", + "port": 8589 + } + ], + "accounts": [ + { + "addr": "0x1be19928ed1dada205aec56ab85e0e2ab5670ad5", + "balance": 200000000000000000000000 + }, + { + "addr": "0xb4388353fd0f3b3a017e09f2b857052ff219e663", + "balance": 200000000000000000000000 + } + ] +} +` diff --git a/cmd/geth/main.go b/cmd/geth/main.go index cdbff4d8ff1a..0a28da665eb0 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -412,10 +412,7 @@ func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isCon stack.AccountManager().Subscribe(events) // Create a client to interact with local geth node. - rpcClient, err := stack.Attach() - if err != nil { - utils.Fatalf("Failed to attach to self: %v", err) - } + rpcClient, _ := stack.Attach() ethClient := ethclient.NewClient(rpcClient) go func() { diff --git a/cmd/geth/wemixcmd.go b/cmd/geth/wemixcmd.go index d301dd9c6a9e..f497b39e04ae 100644 --- a/cmd/geth/wemixcmd.go +++ b/cmd/geth/wemixcmd.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/p2p/enode" + gov "github.com/ethereum/go-ethereum/wemix/bind" "github.com/ethereum/go-ethereum/wemix/metclient" "golang.org/x/sys/unix" "gopkg.in/urfave/cli.v1" @@ -159,7 +160,7 @@ Download a genesis file from a peer to initialize.`, gasPriceFlag, }, Description: ` - geth wemix deploy-governance [--password value] [--url ] [--gas ] [--gasprice ] + geth wemix deploy-governance [--password value] [--url ] [--gas ] [--gasprice ] Deploy governance contracts. To give password in command line, use "--password <(echo )". @@ -184,11 +185,11 @@ To give password in command line, use "--password <(echo )". Name: "out", Usage: "out file", } - gasFlag = cli.IntFlag{ + gasFlag = cli.Uint64Flag{ Name: "gas", Usage: "gas amount", } - gasPriceFlag = cli.IntFlag{ + gasPriceFlag = cli.Int64Flag{ Name: "gasprice", Usage: "gas price", } @@ -267,25 +268,17 @@ func nodeKey2Id(ctx *cli.Context) error { } type genesisConfig struct { - ExtraData string `json:"extraData"` - RewardPool common.Address `json:"pool"` - Maintenance common.Address `json:"maintenance"` - Accounts []*struct { + ExtraData string `json:"extraData"` + StakingReward common.Address `json:"staker"` + Ecosystem common.Address `json:"ecosystem"` + Maintenance common.Address `json:"maintenance"` + FeeCollector common.Address `json:"feecollector"` + Env *genesisEnvConfig `json:"env"` + Members []*genesisMemberConfig `json:"members"` + Accounts []*struct { Addr common.Address `json:"addr"` Balance *big.Int `json:"balance"` } `json:"accounts"` - Members []*struct { - Addr common.Address `json:"addr"` - Staker common.Address `json:"staker"` - Voter common.Address `json:"voter"` - Reward common.Address `json:"reward"` - Stake *big.Int `json:"stake"` - Name string `json:"name"` - Id string `json:"id"` - Ip string `json:"ip"` - Port int `json:"port"` - Bootnode bool `json:"bootnode"` - } `json:"members"` } func loadGenesisConfig(r io.Reader) (*genesisConfig, error) { @@ -297,31 +290,122 @@ func loadGenesisConfig(r io.Reader) (*genesisConfig, error) { } if len(config.Accounts) == 0 || len(config.Members) == 0 { - return nil, fmt.Errorf("At least one account and node are required.") + return nil, fmt.Errorf("at least one account and node are required") } bootnodeExists := false for _, m := range config.Members { - // to conforming form to avoid checksum error - if !(len(m.Id) == 128 || len(m.Id) == 130) { - return nil, fmt.Errorf("Not a node id: %s\n", m.Id) - } - if len(m.Id) == 128 { + if !strings.HasPrefix(m.Id, "0x") { m.Id = "0x" + m.Id } + if bytes, err := hexutil.Decode(m.Id); err != nil { + return nil, fmt.Errorf("invalid node id: %s, error: %s", m.Id, err) + } else if len(bytes) != 64 { + return nil, fmt.Errorf("invalid node id: %s, error: size error", m.Id) + } if m.Bootnode { bootnodeExists = true - break } } - if !bootnodeExists { - return nil, fmt.Errorf("No bootnode found") + return nil, errors.New("no bootnode found") } return &config, nil } +type genesisEnvConfig struct { + BlocksPer *big.Int `json:"blocksPer"` + BallotDurationMin *big.Int `json:"ballotDurationMin"` + BallotDurationMax *big.Int `json:"ballotDurationMax"` + StakingMin *big.Int `json:"stakingMin"` + StakingMax *big.Int `json:"stakingMax"` + MaxIdleBlockInterval *big.Int `json:"MaxIdleBlockInterval"` + BlockCreationTime *big.Int `json:"blockCreationTime"` + BlockRewardAmount *big.Int `json:"blockRewardAmount"` + MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"` + RewardDistributionMethod [4]*big.Int `json:"rewardDistributionMethod"` // [BLOCK_PRODUCER, STAKING_REWARD, ECOSYSTEM, MAINTENANCE] + MaxBaseFee *big.Int `json:"maxBaseFee"` + BlockGasLimit *big.Int `json:"blockGasLimit"` + BaseFeeMaxChangeRate *big.Int `json:"baseFeeMaxChangeRate"` + GasTargetPercentage *big.Int `json:"gasTargetPercentage"` +} + +func (cfg *genesisEnvConfig) ToInitData() gov.InitEnvStorage { + defaultValue := gov.DefaultInitEnvStorage + withDefault := func(v, d *big.Int) *big.Int { + // '0' is no init + if v == nil || v.Sign() < 0 { + return d + } + return v + } + + return gov.InitEnvStorage{ + BLOCKS_PER: withDefault(cfg.BlocksPer, defaultValue.BLOCKS_PER), + BALLOT_DURATION_MIN: withDefault(cfg.BallotDurationMin, defaultValue.BALLOT_DURATION_MIN), + BALLOT_DURATION_MAX: withDefault(cfg.BallotDurationMax, defaultValue.BALLOT_DURATION_MAX), + STAKING_MIN: withDefault(cfg.StakingMin, defaultValue.STAKING_MIN), + STAKING_MAX: withDefault(cfg.StakingMax, defaultValue.STAKING_MAX), + MAX_IDLE_BLOCK_INTERVAL: withDefault(cfg.MaxIdleBlockInterval, defaultValue.MAX_IDLE_BLOCK_INTERVAL), + BLOCK_CREATION_TIME: withDefault(cfg.BlockCreationTime, defaultValue.BLOCK_CREATION_TIME), + BLOCK_REWARD_AMOUNT: withDefault(cfg.BlockRewardAmount, defaultValue.BLOCK_REWARD_AMOUNT), + MAX_PRIORITY_FEE_PER_GAS: withDefault(cfg.MaxPriorityFeePerGas, defaultValue.MAX_PRIORITY_FEE_PER_GAS), + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER: withDefault(cfg.RewardDistributionMethod[0], defaultValue.BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER), + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD: withDefault(cfg.RewardDistributionMethod[1], defaultValue.BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD), + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM: withDefault(cfg.RewardDistributionMethod[2], defaultValue.BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM), + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE: withDefault(cfg.RewardDistributionMethod[3], defaultValue.BLOCK_REWARD_DISTRIBUTION_MAINTENANCE), + MAX_BASE_FEE: withDefault(cfg.MaxBaseFee, defaultValue.MAX_BASE_FEE), + BLOCK_GASLIMIT: withDefault(cfg.BlockGasLimit, defaultValue.BLOCK_GASLIMIT), + BASE_FEE_MAX_CHANGE_RATE: withDefault(cfg.BaseFeeMaxChangeRate, defaultValue.BASE_FEE_MAX_CHANGE_RATE), + GAS_TARGET_PERCENTAGE: withDefault(cfg.GasTargetPercentage, defaultValue.GAS_TARGET_PERCENTAGE), + } +} + +type genesisMemberConfig struct { + Addr common.Address `json:"addr"` + Staker common.Address `json:"staker"` + Voter common.Address `json:"voter"` + Reward common.Address `json:"reward"` + Stake *big.Int `json:"stake"` + Name string `json:"name"` + Id string `json:"id"` + Ip string `json:"ip"` + Port int `json:"port"` + Bootnode bool `json:"bootnode"` +} + +func (cfg *genesisMemberConfig) ToInitData() gov.InitMember { + var ( + zeroAddress = common.Address{} + + staker, voter, reward common.Address = cfg.Staker, cfg.Voter, cfg.Reward + ) + + if addr := cfg.Addr; addr != zeroAddress { + if staker == zeroAddress { + staker = addr + } + if voter == zeroAddress { + voter = addr + } + if reward == zeroAddress { + reward = addr + } + } + + return gov.InitMember{ + Staker: staker, + Voter: voter, + Reward: reward, + Name: cfg.Name, + Enode: cfg.Id, + Ip: cfg.Ip, + Port: cfg.Port, + Deposit: cfg.Stake, + } +} + func genGenesis(ctx *cli.Context) error { var err error @@ -338,7 +422,7 @@ func genGenesis(ctx *cli.Context) error { if fn := ctx.String(dataFileFlag.Name); fn != "" { r, err = os.Open(fn) if err != nil { - utils.Fatalf("%v", err) + return err } } @@ -351,29 +435,26 @@ func genGenesis(ctx *cli.Context) error { if fn := ctx.String(outFlag.Name); fn != "" { w, err = os.OpenFile(fn, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { - utils.Fatalf("%v", err) + return err } } - if len(config.Members) <= 0 { - utils.Fatalf("At least one member and node are required.") - } - - bootacct, bootnode, emptyAddr := "", "", common.Address{} + bootacct, bootnode, zeroAddress := "", "", common.Address{} for _, i := range config.Members { if i.Bootnode { - if !bytes.Equal(i.Addr[:], emptyAddr[:]) { + bootnode = i.Id + if i.Addr != zeroAddress { bootacct = i.Addr.Hex() - } else if !bytes.Equal(i.Staker[:], emptyAddr[:]) { + } else if i.Staker != zeroAddress { bootacct = i.Staker.Hex() } - bootnode = i.Id break } } genesis["coinbase"] = bootacct genesis["extraData"] = hexutil.Encode([]byte(fmt.Sprintf("%s\n%s", config.ExtraData, bootnode))) + alloc := map[string]map[string]string{} for _, m := range config.Accounts { alloc[m.Addr.Hex()] = map[string]string{ @@ -502,11 +583,11 @@ func deployContract(ctx *cli.Context) error { passwd := ctx.String(utils.PasswordFileFlag.Name) url := ctx.String(urlFlag.Name) - gas := ctx.Int(gasFlag.Name) - gasPrice := ctx.Int(gasPriceFlag.Name) + gas := ctx.Uint64(gasFlag.Name) + gasPrice := ctx.Int64(gasPriceFlag.Name) if len(url) == 0 || len(ctx.Args()) != 3 { - return fmt.Errorf("Invalid Arguments") + return fmt.Errorf("invalid arguments") } accountFile, contractName, contractFile := ctx.Args()[0], ctx.Args()[1], ctx.Args()[2] @@ -533,8 +614,7 @@ func deployContract(ctx *cli.Context) error { } var hash common.Hash - hash, err = metclient.Deploy(ctxx, cli, acct, contractData, nil, gas, - gasPrice) + hash, err = metclient.Deploy(ctxx, cli, acct, contractData, nil, int(gas), int(gasPrice)) if err != nil { return err } @@ -642,7 +722,7 @@ func logrota(ctx *cli.Context) error { logOpts := strings.Split(logflag, ",") logFile := "" if len(logOpts) == 0 { - return errors.New("No log file name") + return errors.New("no log file name") } if len(logOpts) >= 1 { logFile = strings.TrimSpace(logOpts[0]) diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 535d5b6c344e..5a0efda8bfff 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -268,7 +268,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa } // Verify the header's timestamp if !uncle { - if header.Time > uint64(unixNow+allowedFutureBlockTimeSeconds) { + if ethash.config.PowMode < ModeFake && header.Time > uint64(unixNow+allowedFutureBlockTimeSeconds) { return consensus.ErrFutureBlock } } diff --git a/go.mod b/go.mod index 0e3cb402128d..22434ac9941b 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,7 @@ require ( golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 + golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 golang.org/x/text v0.3.7 golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 @@ -76,9 +76,14 @@ require ( gopkg.in/urfave/cli.v1 v1.20.0 ) +require github.com/pkg/errors v0.9.1 + +require github.com/fabelx/go-solc-select v0.2.0 + require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 // indirect + github.com/Masterminds/semver v1.5.0 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 // indirect @@ -111,13 +116,12 @@ require ( github.com/modern-go/reflect2 v1.0.1 // indirect github.com/naoina/go-stringutil v0.1.0 // indirect github.com/opentracing/opentracing-go v1.1.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect - github.com/sirupsen/logrus v1.7.0 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect diff --git a/go.sum b/go.sum index ab7702166ce9..da04c5325921 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -166,6 +168,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fabelx/go-solc-select v0.2.0 h1:T1ST4U1EHzgRMyjVhyb0+ppGFqO3IqeuNFx0kjtl0RE= +github.com/fabelx/go-solc-select v0.2.0/go.mod h1:Ayuhu79bQpLAfFrJbPNKZaz0dD7n1nJk3ShZgpt5U6g= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c h1:CndMRAH4JIwxbW8KYq6Q+cGWcGHz0FjGR3QqcInWcW0= @@ -530,8 +534,9 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -794,8 +799,8 @@ golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/wemix/admin.go b/wemix/admin.go index e26618d61749..c5c6f7d6ce61 100644 --- a/wemix/admin.go +++ b/wemix/admin.go @@ -7,7 +7,6 @@ import ( "context" "encoding/hex" "encoding/json" - "errors" "fmt" "math/big" "path" @@ -20,7 +19,7 @@ import ( "go.etcd.io/etcd/server/v3/embed" "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/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -33,8 +32,10 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" wemixapi "github.com/ethereum/go-ethereum/wemix/api" + gov "github.com/ethereum/go-ethereum/wemix/bind" "github.com/ethereum/go-ethereum/wemix/metclient" wemixminer "github.com/ethereum/go-ethereum/wemix/miner" + "github.com/pkg/errors" ) type wemixNode struct { @@ -61,10 +62,7 @@ type wemixAdmin struct { bootNodeId string // allowed to generate block without admin contract bootAccount common.Address nodeInfo *p2p.NodeInfo - registry *metclient.RemoteContract - gov *metclient.RemoteContract - staking *metclient.RemoteContract - envStorage *metclient.RemoteContract + contracts *gov.GovContracts Updates chan bool rpcCli *rpc.Client cli *ethclient.Client @@ -174,7 +172,7 @@ func toIdv4(id string) (string, error) { return idv4.ID().String(), nil } } else { - return "", fmt.Errorf("Invalid V5 Identifier") + return "", fmt.Errorf("invalid V5 Identifier") } } @@ -191,14 +189,13 @@ func (ma *wemixAdmin) getGenesisInfo() (string, common.Address, error) { if err != nil { return "", common.Address{}, err } - var nodeId string if len(block.Extra) < 64 { - return "", common.Address{}, fmt.Errorf("Invalid bootnode id in the genesis block") + return "", common.Address{}, fmt.Errorf("invalid bootnode id in the genesis block") } else if len(block.Extra) == 64 { nodeId = hex.EncodeToString(block.Extra) } else if len(block.Extra) <= 128 { - return "", common.Address{}, fmt.Errorf("Invalid bootnode id in the genesis block") + return "", common.Address{}, fmt.Errorf("invalid bootnode id in the genesis block") } else { nodeId = string(block.Extra[len(block.Extra)-128:]) } @@ -206,140 +203,14 @@ func (ma *wemixAdmin) getGenesisInfo() (string, common.Address, error) { return nodeId, block.Coinbase, nil } -func (ma *wemixAdmin) getRegistryAddress(ctx context.Context, cli *ethclient.Client, registryAbi abi.ABI, height *big.Int) (*common.Address, error) { - contract := &metclient.RemoteContract{ - Cli: cli, - Abi: registryAbi, - } - for i := uint64(0); i < 10; i++ { - addr := crypto.CreateAddress(ma.bootAccount, i) - contract.To = &addr - - var v *big.Int - err := metclient.CallContract(ctx, contract, "magic", nil, &v, height) - if err == nil && v.Cmp(magic) == 0 { - return &addr, nil - } - } - return nil, wemixminer.ErrNotInitialized -} - -// it should be the first transaction of the coinbase of the genesis block -func (ma *wemixAdmin) getAdminAddresses() (registry, gov, staking, envStorage *common.Address, err error) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - registry, gov, staking, envStorage = nil, nil, nil, nil - contract := &metclient.RemoteContract{ - Cli: ma.cli, - Abi: ma.registry.Abi, - } - if ma.registry != nil && ma.registry.To != nil { - registry = ma.registry.To - } else { - registry, err = ma.getRegistryAddress(ctx, ma.cli, ma.registry.Abi, nil) - if err != nil { - err = ethereum.NotFound - return - } - } - contract.To = registry - - n1 := metclient.ToBytes32("GovernanceContract") - n2 := metclient.ToBytes32("Staking") - n3 := metclient.ToBytes32("EnvStorage") - var a1, a2, a3 common.Address - input := []interface{}{n1} - if err = metclient.CallContract(ctx, contract, "getContractAddress", input, &a1, nil); err != nil { - return - } - input = []interface{}{n2} - if err = metclient.CallContract(ctx, contract, "getContractAddress", input, &a2, nil); err != nil { - return - } - input = []interface{}{n3} - if err = metclient.CallContract(ctx, contract, "getContractAddress", input, &a3, nil); err != nil { - return - } - - log.Debug("Wemix Contract Address", - hex.EncodeToString(n1[:]), a1.Hex(), - hex.EncodeToString(n2[:]), a2.Hex(), - hex.EncodeToString(n3[:]), a3.Hex()) - - gov, staking, envStorage = &a1, &a2, &a3 - return -} - -func (ma *wemixAdmin) getInt(ctx context.Context, contract *metclient.RemoteContract, block *big.Int, name string) (int64, error) { - var v *big.Int - err := metclient.CallContract(ctx, contract, name, nil, &v, block) - if err != nil { - return 0, err - } else { - return v.Int64(), nil - } -} - -// TODO: error handling -func (ma *wemixAdmin) getRegGovEnvContracts(ctx context.Context, height *big.Int) (reg, gov, env, staking *metclient.RemoteContract, err error) { - if ma.registry == nil { - err = wemixminer.ErrNotInitialized - return - } - reg = &metclient.RemoteContract{ - Cli: ma.cli, - Abi: ma.registry.Abi, - } - env = &metclient.RemoteContract{ - Cli: ma.cli, - Abi: ma.envStorage.Abi, - } - gov = &metclient.RemoteContract{ - Cli: ma.cli, - Abi: ma.gov.Abi, - } - staking = &metclient.RemoteContract{ - Cli: ma.cli, - Abi: ma.staking.Abi, - } - if ma.registry.To != nil { - reg.To = ma.registry.To - } else { - var addr *common.Address - if addr, err = ma.getRegistryAddress(ctx, ma.cli, reg.Abi, height); err != nil { - err = wemixminer.ErrNotInitialized - return - } - reg.To = addr - } - - var addr common.Address - input := []interface{}{metclient.ToBytes32("GovernanceContract")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - err = wemixminer.ErrNotInitialized - return - } - gov.To = &common.Address{} - gov.To.SetBytes(addr.Bytes()) - - input = []interface{}{metclient.ToBytes32("EnvStorage")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - err = wemixminer.ErrNotInitialized - return - } - env.To = &common.Address{} - env.To.SetBytes(addr.Bytes()) - - input = []interface{}{metclient.ToBytes32("Staking")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - err = wemixminer.ErrNotInitialized - return +func (ma *wemixAdmin) getRegGovEnvContracts(ctx context.Context, height *big.Int) (*gov.GovContracts, error) { + if ctx == nil { + var cancel func() + ctx, cancel = context.WithCancel(context.Background()) + defer cancel() } - staking.To = &common.Address{} - staking.To.SetBytes(addr.Bytes()) - - return + opts := &bind.CallOpts{Context: ctx, BlockNumber: height} + return gov.GetGovContractsByOwner(opts, ma.cli, ma.bootAccount) } // returns []*wemixNode from map[string]*wemixNode @@ -415,40 +286,35 @@ func (ma *wemixAdmin) getMinerNodes(height int64, locked bool) (*wemixNode, *wem // get nodes from the Governance contract func (ma *wemixAdmin) getWemixNodes(ctx context.Context, block *big.Int) ([]*wemixNode, error) { - var ( - nodes []*wemixNode - addr common.Address - name, enode, ip []byte - port *big.Int - count int64 - input, output []interface{} - err error - ) - - count, err = ma.getInt(ctx, ma.gov, block, "getNodeLength") + callOpts := &bind.CallOpts{Context: ctx, BlockNumber: block} + nodes := make([]*wemixNode, 0) + nodeLength, err := ma.contracts.GovImp.GetNodeLength(callOpts) + if err != nil { + return nil, err + } + count := nodeLength.Int64() for i := int64(1); i <= count; i++ { - input = []interface{}{big.NewInt(i)} - output = []interface{}{&name, &enode, &ip, &port} - if err = metclient.CallContract(ctx, ma.gov, "getNode", input, &output, block); err != nil { + node, err := ma.contracts.GovImp.GetNode(callOpts, big.NewInt(i)) + if err != nil { return nil, err } - - if err = metclient.CallContract(ctx, ma.gov, "getMember", input, &addr, block); err != nil { + member, err := ma.contracts.GovImp.GetMember(callOpts, big.NewInt(i)) + if err != nil { return nil, err } - sid := hex.EncodeToString(enode) + sid := hex.EncodeToString(node.Enode) if len(sid) != 128 { return nil, ErrInvalidEnode } idv4, _ := toIdv4(sid) nodes = append(nodes, &wemixNode{ - Name: string(name), + Name: string(node.Name), Enode: sid, - Ip: string(ip), + Ip: string(node.Ip), Id: idv4, - Port: int(port.Int64()), - Addr: addr, + Port: int(node.Port.Int64()), + Addr: member, }) } sort.Slice(nodes, func(i, j int) bool { @@ -459,149 +325,78 @@ func (ma *wemixAdmin) getWemixNodes(ctx context.Context, block *big.Int) ([]*wem func (ma *wemixAdmin) getRewardParams(ctx context.Context, height *big.Int) (*rewardParameters, error) { rp := &rewardParameters{} - reg, gov, env, staking, err := ma.getRegGovEnvContracts(ctx, height) + contracts, err := ma.getRegGovEnvContracts(ctx, height) if err != nil { return nil, err } + opts := &bind.CallOpts{Context: ctx, BlockNumber: height} - if err = metclient.CallContract(ctx, env, "getBlockRewardAmount", nil, &rp.rewardAmount, height); err != nil { + rp.rewardAmount, err = contracts.EnvStorageImp.GetBlockRewardAmount(opts) + if err != nil { return nil, err } - rp.distributionMethod = make([]*big.Int, 4) - if err = metclient.CallContract(ctx, env, "getBlockRewardDistributionMethod", nil, &rp.distributionMethod, height); err != nil { + distributionMethod1, distributionMethod2, distributionMethod3, distributionMethod4, err := contracts.EnvStorageImp.GetBlockRewardDistributionMethod(opts) + if err != nil { return nil, err } + rp.distributionMethod = []*big.Int{distributionMethod1, distributionMethod2, distributionMethod3, distributionMethod4} - var addr common.Address - input := []interface{}{metclient.ToBytes32("StakingReward")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - return nil, err + staker, err := contracts.Registry.GetContractAddress(opts, metclient.ToBytes32(gov.DOMAIN_Staking)) + if err != nil { + return nil, errors.Wrap(err, gov.DOMAIN_Staking) } - rp.staker = &common.Address{} - rp.staker.SetBytes(addr.Bytes()) + rp.staker = &staker - input = []interface{}{metclient.ToBytes32("Ecosystem")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - return nil, err + ecoSystem, err := contracts.Registry.GetContractAddress(opts, metclient.ToBytes32(gov.DOMAIN_Ecosystem)) + if err != nil { + return nil, errors.Wrap(err, gov.DOMAIN_Ecosystem) } - rp.ecoSystem = &common.Address{} - rp.ecoSystem.SetBytes(addr.Bytes()) + rp.ecoSystem = &ecoSystem - input = []interface{}{metclient.ToBytes32("Maintenance")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - return nil, err + maintenance, err := contracts.Registry.GetContractAddress(opts, metclient.ToBytes32(gov.DOMAIN_Maintenance)) + if err != nil { + return nil, errors.Wrap(err, gov.DOMAIN_Maintenance) } - rp.maintenance = &common.Address{} - rp.maintenance.SetBytes(addr.Bytes()) + rp.maintenance = &maintenance - input = []interface{}{metclient.ToBytes32("FeeCollector")} - if err = metclient.CallContract(ctx, reg, "getContractAddress", input, &addr, height); err != nil { - // ignore error + feeCollector, err := contracts.Registry.GetContractAddress(opts, metclient.ToBytes32(gov.DOMAIN_FeeCollector)) + if err != nil { rp.feeCollector = nil } else { - rp.feeCollector = &common.Address{} - rp.feeCollector.SetBytes(addr.Bytes()) + rp.feeCollector = &feeCollector } - rp.blocksPer, err = ma.getInt(ctx, env, height, "getBlocksPer") + blocksPer, err := contracts.EnvStorageImp.GetBlocksPer(opts) if err != nil { return nil, err } + rp.blocksPer = blocksPer.Int64() - if count, err := ma.getInt(ctx, gov, height, "getMemberLength"); err != nil { + if countBig, err := contracts.GovImp.GetMemberLength(opts); err != nil { return nil, err } else { + count := countBig.Int64() for i := int64(1); i <= count; i++ { - var rewardAddress common.Address - var stake *big.Int - - input = []interface{}{big.NewInt(i)} - if err = metclient.CallContract(ctx, gov, "getMember", input, &addr, height); err != nil { + index := big.NewInt(i) + if member, err := contracts.GovImp.GetMember(opts, index); err != nil { return nil, err - } - input = []interface{}{big.NewInt(i)} - if err = metclient.CallContract(ctx, gov, "getReward", input, &rewardAddress, height); err != nil { + } else if reward, err := contracts.GovImp.GetReward(opts, index); err != nil { return nil, err - } - input = []interface{}{addr} - if err = metclient.CallContract(ctx, staking, "lockedBalanceOf", input, &stake, height); err != nil { + } else if stake, err := contracts.StakingImp.LockedBalanceOf(opts, member); err != nil { return nil, err + } else { + rp.members = append(rp.members, &wemixMember{ + Staker: member, + Reward: reward, + Stake: stake, + }) } - rp.members = append(rp.members, &wemixMember{ - Staker: addr, - Reward: rewardAddress, - Stake: stake, - }) } } - return rp, nil } -func (ma *wemixAdmin) getRewardAccounts(ctx context.Context, block *big.Int) (rewardPoolAccount, maintenanceAccount *common.Address, members []*wemixMember, err error) { - var ( - addr common.Address - count int64 - stake *big.Int - input []interface{} - ) - - if ma.registry == nil || ma.registry.To == nil { - err = wemixminer.ErrNotInitialized - return - } - - input = []interface{}{metclient.ToBytes32("RewardPool")} - err = metclient.CallContract(ctx, ma.registry, "getContractAddress", input, &addr, block) - if err == nil { - rewardPoolAccount = &common.Address{} - rewardPoolAccount.SetBytes(addr.Bytes()) - } - - input = []interface{}{metclient.ToBytes32("Maintenance")} - err = metclient.CallContract(ctx, ma.registry, "getContractAddress", input, &addr, block) - if err == nil { - maintenanceAccount = &common.Address{} - maintenanceAccount.SetBytes(addr.Bytes()) - } - - count, err = ma.getInt(ctx, ma.gov, block, "getMemberLength") - if err != nil { - return - } - - for i := int64(1); i <= count; i++ { - var rewardAddress common.Address - - input = []interface{}{big.NewInt(i)} - err = metclient.CallContract(ctx, ma.gov, "getMember", input, - &addr, block) - if err != nil { - return - } - err = metclient.CallContract(ctx, ma.gov, "getReward", input, - &rewardAddress, block) - if err != nil { - return - } - input = []interface{}{addr} - err = metclient.CallContract(ctx, ma.staking, "lockedBalanceOf", input, - &stake, block) - if err != nil { - return - } - - members = append(members, &wemixMember{ - Staker: addr, - Reward: rewardAddress, - Stake: stake, - }) - } - - return -} - // temporary internal structure to collect data from governance contracts type govdata struct { blockNum, modifiedBlock int64 @@ -612,73 +407,79 @@ type govdata struct { nodes, addedNodes, updatedNodes, deletedNodes []*wemixNode } -func (ma *wemixAdmin) getGovData(refresh bool) (data *govdata, err error) { - data = &govdata{} +func (ma *wemixAdmin) getGovData(refresh bool) (*govdata, error) { + data := new(govdata) ctx, cancel := context.WithCancel(context.Background()) defer cancel() block, err := ma.cli.HeaderByNumber(ctx, nil) if err != nil { - return + return data, err } data.blockNum = block.Number.Int64() if !refresh && data.blockNum <= ma.lastBlock { - return + return data, err } - data.modifiedBlock, err = ma.getInt(ctx, ma.gov, block.Number, - "modifiedBlock") - if err != nil { - return + opts := &bind.CallOpts{Context: ctx, BlockNumber: block.Number} + if modifiedBlock, err := ma.contracts.GovImp.ModifiedBlock(opts); err != nil { + return data, err + } else { + data.modifiedBlock = modifiedBlock.Int64() } + if !refresh && ma.modifiedBlock == data.modifiedBlock { - return + return data, nil } - data.blockInterval, err = ma.getInt(ctx, ma.envStorage, block.Number, "getBlockCreationTime") - if err != nil { - // TODO: ignore this error for now + if blockInterval, err := ma.contracts.EnvStorageImp.GetBlockCreationTime(opts); err != nil { data.blockInterval = ma.blockInterval - //return + } else { + data.blockInterval = blockInterval.Int64() } - data.blocksPer, err = ma.getInt(ctx, ma.envStorage, block.Number, "getBlocksPer") - if err != nil { - // TODO: ignore this error for now + + if blocksPer, err := ma.contracts.EnvStorageImp.GetBlocksPer(opts); err != nil { data.blocksPer = ma.blocksPer - //return + } else { + data.blocksPer = blocksPer.Int64() } - data.maxIdleBlockInterval, err = ma.getInt(ctx, ma.envStorage, block.Number, "getMaxIdleBlockInterval") - if err != nil { - // TODO: ignore this error for now + + if maxIdleBlockInterval, err := ma.contracts.EnvStorageImp.GetMaxIdleBlockInterval(opts); err != nil { data.maxIdleBlockInterval = int64(params.MaxIdleBlockInterval) - //return + } else { + data.maxIdleBlockInterval = maxIdleBlockInterval.Int64() } - err = metclient.CallContract(ctx, ma.envStorage, "getBlockRewardAmount", nil, &data.blockReward, block.Number) - if err != nil { - return + + if blockReward, err := ma.contracts.EnvStorageImp.GetBlockRewardAmount(opts); err != nil { + return data, err + } else { + data.blockReward = blockReward } - err = metclient.CallContract(ctx, ma.envStorage, "getMaxPriorityFeePerGas", nil, &data.maxPriorityFeePerGas, block.Number) - if err != nil { - return + + if maxPriorityFeePerGas, err := ma.contracts.EnvStorageImp.GetMaxPriorityFeePerGas(opts); err != nil { + return data, err + } else { + data.maxPriorityFeePerGas = maxPriorityFeePerGas } - gasLimitAndBaseFee := make([]*big.Int, 3) - err = metclient.CallContract(ctx, ma.envStorage, "getGasLimitAndBaseFee", nil, &gasLimitAndBaseFee, block.Number) - if err != nil { - return + + if gasLimit, baseFeeMaxChangeRate, gasTargetPercentage, err := ma.contracts.EnvStorageImp.GetGasLimitAndBaseFee(opts); err != nil { + return data, err + } else { + data.gasLimit = gasLimit + data.baseFeeMaxChangeRate = baseFeeMaxChangeRate.Int64() + data.gasTargetPercentage = gasTargetPercentage.Int64() } - data.gasLimit = gasLimitAndBaseFee[0] - data.baseFeeMaxChangeRate = gasLimitAndBaseFee[1].Int64() - data.gasTargetPercentage = gasLimitAndBaseFee[2].Int64() - err = metclient.CallContract(ctx, ma.envStorage, "getMaxBaseFee", nil, &data.maxBaseFee, block.Number) - if err != nil { - return + if maxBaseFee, err := ma.contracts.EnvStorageImp.GetMaxBaseFee(opts); err != nil { + return data, err + } else { + data.maxBaseFee = maxBaseFee } data.nodes, err = ma.getWemixNodes(ctx, block.Number) if err != nil { - return + return data, err } oldNodes := ma.getNodes() @@ -720,8 +521,7 @@ func (ma *wemixAdmin) getGovData(refresh bool) (data *govdata, err error) { data.addedNodes = append(data.addedNodes, data.nodes[j]) } } - - return + return data, nil } func StartAdmin(stack *node.Node, datadir string) { @@ -736,35 +536,10 @@ func StartAdmin(stack *node.Node, datadir string) { utils.Fatalf("Failed to attach to self: %v", err) } - registryContract, err := metclient.LoadJsonContract(strings.NewReader(RegistryAbi)) - if err != nil { - utils.Fatalf("Loading ABI failed: %v", err) - } - govContract, err := metclient.LoadJsonContract(strings.NewReader(GovAbi)) - if err != nil { - utils.Fatalf("Loading ABI failed: %v", err) - } - stakingContract, err := metclient.LoadJsonContract(strings.NewReader(StakingAbi)) - if err != nil { - utils.Fatalf("Loading ABI failed: %v", err) - } - envStorageImpContract, err := metclient.LoadJsonContract(strings.NewReader(EnvStorageImpAbi)) - if err != nil { - utils.Fatalf("Loading ABI failed: %v", err) - } - cli := ethclient.NewClient(rpcCli) admin = &wemixAdmin{ - stack: stack, - lock: &sync.Mutex{}, - registry: &metclient.RemoteContract{ - Cli: cli, Abi: registryContract.Abi}, - gov: &metclient.RemoteContract{ - Cli: cli, Abi: govContract.Abi}, - staking: &metclient.RemoteContract{ - Cli: cli, Abi: stakingContract.Abi}, - envStorage: &metclient.RemoteContract{ - Cli: cli, Abi: envStorageImpContract.Abi}, + stack: stack, + lock: &sync.Mutex{}, Updates: make(chan bool, 10), rpcCli: rpcCli, cli: cli, @@ -810,22 +585,16 @@ func (ma *wemixAdmin) addPeer(node *wemixNode) error { } func (ma *wemixAdmin) update() { - if ma.registry == nil || ma.registry.To == nil { + if ma.contracts == nil || ma.contracts.Registry == nil { return } refresh := false - registry, gov, staking, envStorage, err := ma.getAdminAddresses() + contracts, err := ma.getRegGovEnvContracts(nil, nil) if err != nil { return - } else if !bytes.Equal(registry[:], ma.registry.To[:]) || - !bytes.Equal(gov[:], ma.gov.To[:]) || - !bytes.Equal(staking[:], ma.staking.To[:]) || - !bytes.Equal(envStorage[:], ma.envStorage.To[:]) { - ma.registry.To = registry - ma.gov.To = gov - ma.staking.To = staking - ma.envStorage.To = envStorage + } else if !ma.contracts.Equal(contracts) { + ma.contracts = contracts refresh = true } @@ -895,7 +664,7 @@ func (ma *wemixAdmin) update() { "maxPriorityFeePerGas", data.maxPriorityFeePerGas) } - if ma.self != nil && !bytes.Equal(ma.self.Addr[:], nilAddress[:]) { + if ma.self != nil && ma.self.Addr != nilAddress { err = ma.rpcCli.CallContext(ctx, &v, "miner_setEtherbase", &ma.self.Addr) if err != nil || !*v { log.Info("set the coinbase", "error", err) @@ -966,16 +735,13 @@ func (ma *wemixAdmin) run() { ma.nodeInfo = nodeInfo } } - if ma.registry.To == nil { - registry, gov, staking, envStorage, err := ma.getAdminAddresses() + if ma.contracts == nil { + contracts, err := ma.getRegGovEnvContracts(nil, nil) if err == nil { - ma.registry.To = registry - ma.gov.To = gov - ma.staking.To = staking - ma.envStorage.To = envStorage + ma.contracts = contracts } } - if ma.registry.To != nil && ma.nodeInfo != nil { + if ma.contracts != nil && ma.nodeInfo != nil { ma.update() if ma.amPartner() && ma.self != nil && !ma.etcdIsRunning() { EtcdStart() @@ -1015,11 +781,11 @@ type reward struct { } // handles rewards in testnet block 94 -func handleBlock94Rewards(height *big.Int, rp *rewardParameters, fees *big.Int) []reward { +func handleBlock94Rewards(height *big.Int, rp *rewardParameters, _ /*fees*/ *big.Int) []reward { if height.Int64() != 94 || len(rp.members) != 0 || - !bytes.Equal(rp.staker[:], testnetBlock94Rewards[0].Addr[:]) || - !bytes.Equal(rp.ecoSystem[:], testnetBlock94Rewards[1].Addr[:]) || - !bytes.Equal(rp.maintenance[:], testnetBlock94Rewards[2].Addr[:]) { + *rp.staker != testnetBlock94Rewards[0].Addr || + *rp.ecoSystem != testnetBlock94Rewards[1].Addr || + *rp.maintenance != testnetBlock94Rewards[2].Addr { return nil } return testnetBlock94Rewards @@ -1181,67 +947,61 @@ func calculateRewards(config *params.ChainConfig, num, fees *big.Int, addBalance return calculateRewardsWithParams(config, rp, num, fees, addBalance) } -func getCoinbase(height *big.Int) (coinbase common.Address, err error) { +func getCoinbase(height *big.Int) (common.Address, error) { if admin == nil { - err = wemixminer.ErrNotInitialized - return + return common.Address{}, wemixminer.ErrNotInitialized } + prvKey := admin.stack.Server().PrivateKey if admin.self != nil { ctx, cancel := context.WithCancel(context.Background()) defer cancel() num := new(big.Int).Sub(height, common.Big1) - _, gov, _, _, err2 := admin.getRegGovEnvContracts(ctx, num) - if err2 != nil { - err = err2 - return + contracts, err := admin.getRegGovEnvContracts(ctx, num) + if err != nil { + return common.Address{}, err } - nodeId := crypto.FromECDSAPub(&prvKey.PublicKey)[1:] - if addr, err2 := enodeExists(ctx, height, gov, nodeId); err2 != nil { - err = err2 - return - } else { - coinbase = addr - } + return enodeExists(ctx, height, contracts.GovImp, nodeId) } else if admin.nodeInfo != nil && admin.nodeInfo.ID == admin.bootNodeId { - coinbase = admin.bootAccount + return admin.bootAccount, nil + } else { + return common.Address{}, ethereum.NotFound } - return } -func signBlock(height *big.Int, hash common.Hash) (coinbase common.Address, sig []byte, err error) { +func signBlock(height *big.Int, hash common.Hash) (common.Address, []byte, error) { if admin == nil { - err = wemixminer.ErrNotInitialized - return + return common.Address{}, nil, wemixminer.ErrNotInitialized } - data := append(height.Bytes(), hash.Bytes()...) - data = crypto.Keccak256(data) prvKey := admin.stack.Server().PrivateKey - sig, err = crypto.Sign(data, prvKey) - if admin.self != nil { + sig, err := crypto.Sign(crypto.Keccak256(append(height.Bytes(), hash.Bytes()...)), prvKey) + if err != nil { + return common.Address{}, nil, err + } + + if admin.nodeInfo != nil && admin.nodeInfo.ID == admin.bootNodeId { + return admin.bootAccount, sig, nil + } else if admin.self != nil { ctx, cancel := context.WithCancel(context.Background()) defer cancel() num := new(big.Int).Sub(height, common.Big1) - _, gov, _, _, err2 := admin.getRegGovEnvContracts(ctx, num) - if err2 != nil { - err = err2 - return + contracts, err := admin.getRegGovEnvContracts(ctx, num) + if err != nil { + return common.Address{}, nil, err } nodeId := crypto.FromECDSAPub(&prvKey.PublicKey)[1:] - if addr, err2 := enodeExists(ctx, height, gov, nodeId); err2 != nil { - err = err2 - return + if addr, err := enodeExists(ctx, height, contracts.GovImp, nodeId); err != nil { + return common.Address{}, nil, err } else { - coinbase = addr + return addr, sig, nil } - } else if admin.nodeInfo != nil && admin.nodeInfo.ID == admin.bootNodeId { - coinbase = admin.bootAccount + } else { + return common.Address{}, sig, wemixminer.ErrNotInitialized } - return } func verifyBlockSig(height *big.Int, coinbase common.Address, nodeId []byte, hash common.Hash, sig []byte, checkMinerLimit bool) bool { @@ -1250,12 +1010,13 @@ func verifyBlockSig(height *big.Int, coinbase common.Address, nodeId []byte, has // get nodeid from the coinbase num := new(big.Int).Sub(height, common.Big1) - _, gov, _, _, err := admin.getRegGovEnvContracts(ctx, num) + contracts, err := admin.getRegGovEnvContracts(ctx, num) if err != nil { - return err == wemixminer.ErrNotInitialized - } else if count, err := admin.getInt(ctx, gov, num, "getMemberLength"); err != nil || count == 0 { - return err == wemixminer.ErrNotInitialized || count == 0 + return err == wemixminer.ErrNotInitialized || errors.Is(err, ethereum.NotFound) + } else if count, err := contracts.GovImp.GetMemberLength(&bind.CallOpts{Context: ctx, BlockNumber: num}); err != nil || count.Sign() == 0 { + return err == wemixminer.ErrNotInitialized || count.Sign() == 0 } + gov := contracts.GovImp // if minerNodeId is given, i.e. present in block header, use it, // otherwise, derive it from the codebase var data []byte @@ -1383,28 +1144,17 @@ func (ma *wemixAdmin) pendingEmpty() bool { return status.Pending == 0 } -func getMaxPriorityFeePerGas() *big.Int { - defaultFee := big.NewInt(100 * params.GWei) - if admin == nil || admin.envStorage == nil || admin.envStorage.To == nil { - return defaultFee - } - var fee *big.Int - if err := metclient.CallContract(context.Background(), admin.envStorage, "getMaxPriorityFeePerGas", nil, &fee, nil); err != nil { - return defaultFee - } - return fee -} - func suggestGasPrice() *big.Int { defaultFee := big.NewInt(100 * params.GWei) - if admin == nil || admin.envStorage == nil || admin.envStorage.To == nil { + if admin == nil || admin.contracts == nil || admin.contracts.EnvStorageImp == nil { return defaultFee } - var fee *big.Int - if err := metclient.CallContract(context.Background(), admin.envStorage, "getMaxPriorityFeePerGas", nil, &fee, nil); err != nil { + fee, err := admin.contracts.EnvStorageImp.GetMaxPriorityFeePerGas(nil) + if err != nil { return defaultFee + } else { + return fee } - return fee } func getBlockBuildParameters(height *big.Int) (blockInterval int64, maxBaseFee, gasLimit *big.Int, baseFeeMaxChangeRate, gasTargetPercentage int64, err error) { @@ -1437,31 +1187,39 @@ func getBlockBuildParameters(height *big.Int) (blockInterval int64, maxBaseFee, ctx, cancel := context.WithCancel(context.Background()) defer cancel() - var env, gov *metclient.RemoteContract - if _, gov, env, _, err = admin.getRegGovEnvContracts(ctx, height); err != nil { + var ( + env *gov.EnvStorageImp + gov *gov.GovImp + ) + if contracts, err2 := admin.getRegGovEnvContracts(ctx, height); err2 != nil { err = wemixminer.ErrNotInitialized return - } else if count, err2 := admin.getInt(ctx, gov, height, "getMemberLength"); err2 != nil || count == 0 { + } else { + env, gov = contracts.EnvStorageImp, contracts.GovImp + } + + opts := &bind.CallOpts{Context: ctx, BlockNumber: height} + if count, err2 := gov.GetMemberLength(opts); err2 != nil || count.Sign() == 0 { err = wemixminer.ErrNotInitialized return } - var v *big.Int - if err = metclient.CallContract(ctx, env, "getBlockCreationTime", nil, &v, height); err != nil { + if v, err2 := env.GetBlockCreationTime(opts); err2 != nil { err = wemixminer.ErrNotInitialized return + } else { + blockInterval = v.Int64() } - blockInterval = v.Int64() - gasLimitAndBaseFee := make([]*big.Int, 3) - if err = metclient.CallContract(ctx, env, "getGasLimitAndBaseFee", nil, &gasLimitAndBaseFee, height); err != nil { + if GasLimit, BaseFeeMaxChangeRate, GasTargetPercentage, err2 := env.GetGasLimitAndBaseFee(opts); err2 != nil { err = wemixminer.ErrNotInitialized return + } else { + gasLimit = GasLimit + baseFeeMaxChangeRate = BaseFeeMaxChangeRate.Int64() + gasTargetPercentage = GasTargetPercentage.Int64() } - gasLimit = gasLimitAndBaseFee[0] - baseFeeMaxChangeRate = gasLimitAndBaseFee[1].Int64() - gasTargetPercentage = gasLimitAndBaseFee[2].Int64() - if err = metclient.CallContract(ctx, env, "getMaxBaseFee", nil, &maxBaseFee, height); err != nil { + if maxBaseFee, err = env.GetMaxBaseFee(opts); err != nil { err = wemixminer.ErrNotInitialized return } @@ -1522,11 +1280,12 @@ func Info() interface{} { return nodes[i].Name < nodes[j].Name }) + ca := admin.contracts.Address() info := &map[string]interface{}{ "consensus": params.ConsensusMethod, - "registry": admin.registry.To, - "governance": admin.gov.To, - "staking": admin.staking.To, + "registry": ca.Registry, + "governance": ca.Gov, + "staking": ca.Staking, "modifiedblock": admin.modifiedBlock, "blocksPer": admin.blocksPer, "blockInterval": admin.blockInterval, @@ -1732,7 +1491,7 @@ func (ma *wemixAdmin) getTxPoolStatus() (pending, queued uint, err error) { p, b1 := data["pending"] q, b2 := data["queued"] if !b1 || !b2 { - err = fmt.Errorf("Invalid Data") + err = fmt.Errorf("invalid Data") } else { pending = uint(p) queued = uint(q) @@ -1803,6 +1562,7 @@ func init() { wemixminer.AcquireMiningTokenFunc = acquireMiningToken wemixminer.ReleaseMiningTokenFunc = releaseMiningToken wemixminer.HasMiningTokenFunc = hasMiningToken + wemixapi.Info = Info wemixapi.GetMiners = getMiners wemixapi.GetMinerStatus = getMinerStatus diff --git a/wemix/bind/backends/options.go b/wemix/bind/backends/options.go new file mode 100644 index 000000000000..db7d814baba9 --- /dev/null +++ b/wemix/bind/backends/options.go @@ -0,0 +1,50 @@ +package backends + +import ( + "math/big" + "os" + + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + gov "github.com/ethereum/go-ethereum/wemix/bind" +) + +type OptionFn func(nodeConf *node.Config, ethConf *ethconfig.Config, envConfig *gov.InitEnvStorage) + +func SetLogLevel(level int) OptionFn { + return func(nodeConf *node.Config, ethConf *ethconfig.Config, envConfig *gov.InitEnvStorage) { + log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(level), log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) + } +} + +// WithBlockGasLimit configures the simulated backend to target a specific gas limit +// when producing blocks. +func WithBlockGasLimit(gaslimit uint64) OptionFn { + return func(nodeConf *node.Config, ethConf *ethconfig.Config, envConfig *gov.InitEnvStorage) { + ethConf.Genesis.GasLimit = gaslimit + ethConf.Miner.GasCeil = gaslimit + } +} + +// WithCallGasLimit configures the simulated backend to cap eth_calls to a specific +// gas limit when running client operations. +func WithCallGasLimit(gaslimit uint64) OptionFn { + return func(nodeConf *node.Config, ethConf *ethconfig.Config, envConfig *gov.InitEnvStorage) { + ethConf.RPCGasCap = gaslimit + } +} + +// WithMinerMinTip configures the simulated backend to require a specific minimum +// gas tip for a transaction to be included. +// +// 0 is not possible as a live Geth node would reject that due to DoS protection, +// so the simulated backend will replicate that behavior for consistency. +func WithMinerMinTip(tip *big.Int) OptionFn { + if tip == nil || tip.Sign() <= 0 { + panic("invalid miner minimum tip") + } + return func(nodeConf *node.Config, ethConf *ethconfig.Config, envConfig *gov.InitEnvStorage) { + ethConf.Miner.GasPrice = tip + } +} diff --git a/wemix/bind/backends/wemix_simulated.go b/wemix/bind/backends/wemix_simulated.go new file mode 100644 index 000000000000..098cbf7e2276 --- /dev/null +++ b/wemix/bind/backends/wemix_simulated.go @@ -0,0 +1,260 @@ +package backends + +import ( + "context" + "crypto/ecdsa" + "errors" + "math/big" + "path/filepath" + "strings" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/ethconfig" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/wemix" + gov "github.com/ethereum/go-ethereum/wemix/bind" +) + +type SimClient interface { + ethereum.ChainReader + ethereum.ChainStateReader + ethereum.ContractCaller + ethereum.GasEstimator + ethereum.GasPricer + ethereum.LogFilterer + ethereum.PendingStateReader + ethereum.PendingContractCaller + ethereum.TransactionReader + ethereum.TransactionSender + SuggestGasTipCap(ctx context.Context) (*big.Int, error) // GasPricer1559 + Commit() +} + +var ChainID = params.AllEthashProtocolChanges.ChainID + +type wemixSimulatedBackend struct { + stack *node.Node + eth *eth.Ethereum + backend *backends.SimulatedBackend +} + +func NewWemixSimulatedBackend(pk *ecdsa.PrivateKey, datadir string, alloc core.GenesisAlloc, options ...OptionFn) (SimClient, error) { + params.ConsensusMethod = params.ConsensusPoA + + nodeConfig := node.DefaultConfig + nodeConfig.DataDir = datadir + nodeConfig.KeyStoreDir = filepath.Join(datadir, "keystore") + nodeConfig.P2P = p2p.Config{ + PrivateKey: pk, + NoDiscovery: true, + } + + ethConfig := ethconfig.Defaults + ethConfig.Genesis = &core.Genesis{ + Config: params.AllEthashProtocolChanges, + GasLimit: ethconfig.Defaults.Miner.GasCeil, + Alloc: alloc, + Coinbase: crypto.PubkeyToAddress(pk.PublicKey), + } + ethConfig.SyncMode = downloader.FullSync + ethConfig.TxPool.NoLocals = true + ethConfig.Ethash = ethash.Config{PowMode: ethash.ModeFake, Log: log.Root()} + ethConfig.NoPruning = true + envConfig := gov.DefaultInitEnvStorage + + for _, option := range options { + option(&nodeConfig, ðConfig, &envConfig) + } + + stack, err := node.New(&nodeConfig) + if err != nil { + return nil, err + } + + enode := strings.Split(strings.TrimLeft(stack.Server().NodeInfo().Enode, "enode://"), "@")[0] + ethConfig.Genesis.ExtraData = append(ethConfig.Genesis.ExtraData, []byte("0x"+enode)...) + ethConfig.NetworkId = ethConfig.Genesis.Config.ChainID.Uint64() + + backend, err := eth.New(stack, ðConfig) + if err != nil { + return nil, err + } + ethConfig.Genesis.MustCommit(backend.ChainDb()) + + if err := stack.Start(); err != nil { + return nil, err + } + + wemix.StartAdmin(stack, nodeConfig.DataDir) + + ks := keystore.NewPlaintextKeyStore(nodeConfig.KeyStoreDir) + account, err := ks.ImportECDSA(pk, "") + if err != nil { + return nil, err + } + if err := ks.Unlock(account, ""); err != nil { + return nil, err + } + + backend.AccountManager().AddBackend(ks) + backend.TxPool().SetGasPrice(ethConfig.Miner.GasPrice) + if err := backend.StartMining(1); err != nil { + return nil, err + } + now := time.Now() + for backend.APIBackend.CurrentBlock().NumberU64() == 0 { + if time.Since(now).Seconds() > 10 { + return nil, errors.New("mining error") + } + time.Sleep(0.2e9) + } + log.Warn("Wait Genesis Block Mined", "elapsed", time.Since(now).Seconds()) + + rpcClient, _ := stack.Attach() + ethClient := ethclient.NewClient(rpcClient) + + opts, err := bind.NewKeyedTransactorWithChainID(pk, ethConfig.Genesis.Config.ChainID) + if err != nil { + return nil, err + } + + contracts, err := gov.DeployGovContracts(opts, ethClient, map[string]common.Address{ + gov.DOMAIN_StakingReward: opts.From, + gov.DOMAIN_Ecosystem: opts.From, + gov.DOMAIN_Maintenance: opts.From, + gov.DOMAIN_FeeCollector: opts.From, + }) + if err != nil { + return nil, err + } + + nodeInfo := stack.Server().NodeInfo() + var members gov.InitMembers = []gov.InitMember{ + { + Staker: opts.From, + Voter: opts.From, + Reward: opts.From, + Name: nodeInfo.Name, + Enode: enode, + Ip: nodeInfo.IP, + Port: 8589, + Deposit: envConfig.STAKING_MIN, + }, + } + + if err := gov.ExecuteInitialize(contracts, opts, ethClient, envConfig.STAKING_MIN, envConfig, members); err != nil { + return nil, err + } + + return &wemixSimulatedBackend{ + stack: stack, + eth: backend, + backend: backends.NewSimulatedBackendWithEthereum(backend), + }, nil +} + +func (w *wemixSimulatedBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) { + return w.backend.BlockByHash(ctx, hash) +} +func (w *wemixSimulatedBackend) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) { + return w.backend.BlockByNumber(ctx, number) +} +func (w *wemixSimulatedBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { + return w.backend.HeaderByHash(ctx, hash) +} +func (w *wemixSimulatedBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { + return w.backend.HeaderByNumber(ctx, number) +} +func (w *wemixSimulatedBackend) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) { + return w.backend.TransactionCount(ctx, blockHash) +} +func (w *wemixSimulatedBackend) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) { + return w.backend.TransactionInBlock(ctx, blockHash, index) +} +func (w *wemixSimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) { + return w.backend.SubscribeNewHead(ctx, ch) +} +func (w *wemixSimulatedBackend) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) { + return w.backend.BalanceAt(ctx, account, blockNumber) +} +func (w *wemixSimulatedBackend) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) { + return w.backend.StorageAt(ctx, account, key, blockNumber) +} +func (w *wemixSimulatedBackend) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) { + return w.backend.CodeAt(ctx, account, blockNumber) +} +func (w *wemixSimulatedBackend) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) { + return w.backend.NonceAt(ctx, account, blockNumber) +} +func (w *wemixSimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + return w.backend.CallContract(ctx, call, blockNumber) +} +func (w *wemixSimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) { + return w.backend.EstimateGas(ctx, call) +} +func (w *wemixSimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) { + return w.backend.SuggestGasPrice(ctx) +} +func (w *wemixSimulatedBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { + return w.backend.SuggestGasTipCap(ctx) +} +func (w *wemixSimulatedBackend) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { + return w.backend.FilterLogs(ctx, q) +} +func (w *wemixSimulatedBackend) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { + return w.backend.SubscribeFilterLogs(ctx, q, ch) +} +func (w *wemixSimulatedBackend) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) { + return w.backend.PendingCodeAt(ctx, account) +} +func (w *wemixSimulatedBackend) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { + return w.backend.PendingNonceAt(ctx, account) +} +func (w *wemixSimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) { + return w.backend.PendingCallContract(ctx, call) +} +func (w *wemixSimulatedBackend) TransactionByHash(ctx context.Context, txHash common.Hash) (tx *types.Transaction, isPending bool, err error) { + return w.backend.TransactionByHash(ctx, txHash) +} +func (w *wemixSimulatedBackend) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { + receipt, err := w.backend.TransactionReceipt(ctx, txHash) + if err == ethereum.NotFound { + w.backend.Commit() + return w.TransactionReceipt(ctx, txHash) + } + return receipt, err +} +func (w *wemixSimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error { + return w.backend.SendTransaction(ctx, tx) +} +func (w *wemixSimulatedBackend) Commit() { + w.backend.Commit() +} + +func (w *wemixSimulatedBackend) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) { + // return w.backend.PendingBalanceAt(ctx, account) + return nil, errors.New("PendingBalanceAt") +} +func (w *wemixSimulatedBackend) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) { + // return w.backend.PendingStorageAt(ctx, account, key) + return nil, errors.New("PendingStorageAt") +} +func (w *wemixSimulatedBackend) PendingTransactionCount(ctx context.Context) (uint, error) { + // return w.backend.PendingTransactionCount(ctx) + return 0, errors.New("PendingTransactionCount") +} diff --git a/wemix/bind/backends/wemix_simulated_test.go b/wemix/bind/backends/wemix_simulated_test.go new file mode 100644 index 000000000000..f4a358666584 --- /dev/null +++ b/wemix/bind/backends/wemix_simulated_test.go @@ -0,0 +1,175 @@ +package backends_test + +import ( + "context" + "encoding/hex" + "math/big" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + gov "github.com/ethereum/go-ethereum/wemix/bind" + "github.com/ethereum/go-ethereum/wemix/bind/backends" + wemix_miner "github.com/ethereum/go-ethereum/wemix/miner" + "github.com/stretchr/testify/require" +) + +func TestWemixBackends(t *testing.T) { + key, err := crypto.GenerateKey() + require.NoError(t, err) + opts, err := bind.NewKeyedTransactorWithChainID(key, backends.ChainID) + require.NoError(t, err) + b, err := backends.NewWemixSimulatedBackend( + key, + t.TempDir(), + core.GenesisAlloc{ + opts.From: {Balance: new(big.Int).Mul(big.NewInt(256_000_000_000_000), big.NewInt(params.Ether))}, + }, + backends.SetLogLevel(2), + ) + if err != nil { + return + } + require.NotNil(t, b) + + defaultEnv := gov.DefaultInitEnvStorage + + require.True(t, defaultEnv.MAX_PRIORITY_FEE_PER_GAS.Cmp(wemix_miner.SuggestGasPrice()) == 0) + coinBase, err := wemix_miner.GetCoinbase(common.Big0) + require.NoError(t, err) + require.Equal(t, opts.From, coinBase) + + callOpts := new(bind.CallOpts) + contracts, err := gov.GetGovContractsByOwner(callOpts, b, opts.From) + require.NoError(t, err) + + got, err := contracts.EnvStorageImp.GetBallotDurationMax(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BALLOT_DURATION_MAX.Cmp(got) == 0, "mismatch BALLOT_DURATION_MAX, got: %v, want: %v", got, defaultEnv.BALLOT_DURATION_MAX) + + got, err = contracts.EnvStorageImp.GetBallotDurationMin(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BALLOT_DURATION_MIN.Cmp(got) == 0, "mismatch BALLOT_DURATION_MIN, got: %v, want: %v", got, defaultEnv.BALLOT_DURATION_MIN) + + got, err = contracts.EnvStorageImp.GetBlockCreationTime(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BLOCK_CREATION_TIME.Cmp(got) == 0, "mismatch BLOCK_CREATION_TIME, got: %v, want: %v", got, defaultEnv.BLOCK_CREATION_TIME) + + got, err = contracts.EnvStorageImp.GetBlockRewardAmount(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BLOCK_REWARD_AMOUNT.Cmp(got) == 0, "mismatch BLOCK_REWARD_AMOUNT, got: %v, want: %v", got, defaultEnv.BLOCK_REWARD_AMOUNT) + + blockRewardDistributionBlockProducer, + blockRewardDistributionStakingReward, blockRewardDistributionEcosystem, + blockRewardDistributionMaintenance, + err := contracts.EnvStorageImp.GetBlockRewardDistributionMethod(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER.Cmp(blockRewardDistributionBlockProducer) == 0, "mismatch BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER, got: %v, want: %v", blockRewardDistributionBlockProducer, defaultEnv.BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER) + require.Truef(t, defaultEnv.BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD.Cmp(blockRewardDistributionStakingReward) == 0, "mismatch BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD, got: %v, want: %v", blockRewardDistributionStakingReward, defaultEnv.BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD) + require.Truef(t, defaultEnv.BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM.Cmp(blockRewardDistributionEcosystem) == 0, "mismatch BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM, got: %v, want: %v", blockRewardDistributionEcosystem, defaultEnv.BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM) + require.Truef(t, defaultEnv.BLOCK_REWARD_DISTRIBUTION_MAINTENANCE.Cmp(blockRewardDistributionMaintenance) == 0, "mismatch BLOCK_REWARD_DISTRIBUTION_MAINTENANCE, got: %v, want: %v", blockRewardDistributionMaintenance, defaultEnv.BLOCK_REWARD_DISTRIBUTION_MAINTENANCE) + + got, err = contracts.EnvStorageImp.GetBlocksPer(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.BLOCKS_PER.Cmp(got) == 0, "mismatch BLOCKS_PER, got: %v, want: %v", got, defaultEnv.BLOCKS_PER) + + got, err = contracts.EnvStorageImp.GetMaxBaseFee(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.MAX_BASE_FEE.Cmp(got) == 0, "mismatch MAX_BASE_FEE, got: %v, want: %v", got, defaultEnv.MAX_BASE_FEE) + + got, err = contracts.EnvStorageImp.GetMaxIdleBlockInterval(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.MAX_IDLE_BLOCK_INTERVAL.Cmp(got) == 0, "mismatch MAX_IDLE_BLOCK_INTERVAL, got: %v, want: %v", got, defaultEnv.MAX_IDLE_BLOCK_INTERVAL) + + got, err = contracts.EnvStorageImp.GetMaxPriorityFeePerGas(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.MAX_PRIORITY_FEE_PER_GAS.Cmp(got) == 0, "mismatch MAX_PRIORITY_FEE_PER_GAS, got: %v, want: %v", got, defaultEnv.MAX_PRIORITY_FEE_PER_GAS) + + got, err = contracts.EnvStorageImp.GetStakingMax(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.STAKING_MAX.Cmp(got) == 0, "mismatch STAKING_MAX, got: %v, want: %v", got, defaultEnv.STAKING_MAX) + + got, err = contracts.EnvStorageImp.GetStakingMin(callOpts) + require.NoError(t, err) + require.Truef(t, defaultEnv.STAKING_MIN.Cmp(got) == 0, "mismatch STAKING_MIN, got: %v, want: %v", got, defaultEnv.STAKING_MIN) + + getNode, err := contracts.GovImp.GetNode(callOpts, common.Big1) + require.NoError(t, err) + t.Log( + "\n Name:", string(getNode.Name), + "\n Enode:", hex.EncodeToString(getNode.Enode), + "\n Ip:", string(getNode.Ip), + "\n Port:", getNode.Port, + ) + newVoterKey, err := crypto.GenerateKey() + require.NoError(t, err) + newVoter := crypto.PubkeyToAddress(newVoterKey.PublicKey) + + LOCK_AMOUNT, err := contracts.EnvStorageImp.GetStakingMax(callOpts) + require.NoError(t, err) + + tx, err := contracts.GovImp.AddProposalToChangeMember(opts, gov.GovImpMemberInfo{ + Staker: opts.From, + Voter: newVoter, + Reward: opts.From, + Name: getNode.Name, + Enode: getNode.Enode, + Ip: getNode.Ip, + Port: getNode.Port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + }, opts.From, common.Big0, common.Big0) + require.NoError(t, err) + + receipt, err := bind.WaitMined(context.Background(), b, tx) + require.NoError(t, err) + require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status) + + inVoting, err := contracts.GovImp.GetBallotInVoting(callOpts) + require.NoError(t, err) + require.True(t, inVoting.Sign() == 0) + + member, err := contracts.GovImp.GetMember(callOpts, common.Big1) + require.NoError(t, err) + require.Equal(t, opts.From, member) + + voter, err := contracts.GovImp.GetVoter(callOpts, common.Big1) + require.NoError(t, err) + require.Equal(t, newVoter, voter) + + newReward, err := contracts.GovImp.GetReward(callOpts, common.Big1) + require.NoError(t, err) + require.Equal(t, opts.From, newReward) + + newHead := make(chan *types.Header) + sub, err := b.SubscribeNewHead(context.Background(), newHead) + require.NoError(t, err) + defer sub.Unsubscribe() + + ticker := time.NewTicker(10e9) + var headNumber *big.Int = nil +loop: + for { + b.Commit() + select { + case head := <-newHead: + if headNumber == nil { + headNumber = head.Number + } else { + require.Equal(t, new(big.Int).Add(headNumber, common.Big1), head.Number) + headNumber = head.Number + } + case err := <-sub.Err(): + require.NoError(t, err) + case <-ticker.C: + break loop + } + } + t.Log("end") +} diff --git a/wemix/bind/const.go b/wemix/bind/const.go new file mode 100644 index 000000000000..8943327f2335 --- /dev/null +++ b/wemix/bind/const.go @@ -0,0 +1,28 @@ +package gov + +const ( + REGISTRY = "Registry" + GOV = "Gov" + GOV_IMP = "GovImp" + NCPEXIT = "NCPExit" + NCPEXIT_IMP = "NCPExitImp" + STAKING = "Staking" + STAKING_IMP = "StakingImp" + BALLOTSTORAGE = "BallotStorage" + BALLOTSTORAGE_IMP = "BallotStorageImp" + ENVSTORAGE = "EnvStorage" + ENVSTORAGE_IMP = "EnvStorageImp" +) + +const ( + DOMAIN_Gov = "GovernanceContract" + DOMAIN_NCPExit = "NCPExit" + DOMAIN_Staking = "Staking" + DOMAIN_BallotStorage = "BallotStorage" + DOMAIN_EnvStorage = "EnvStorage" + + DOMAIN_StakingReward = "StakingReward" + DOMAIN_Ecosystem = "Ecosystem" + DOMAIN_Maintenance = "Maintenance" + DOMAIN_FeeCollector = "FeeCollector" +) diff --git a/wemix/bind/gen_ballotStorage_abi.go b/wemix/bind/gen_ballotStorage_abi.go new file mode 100644 index 000000000000..e5200641f416 --- /dev/null +++ b/wemix/bind/gen_ballotStorage_abi.go @@ -0,0 +1,4325 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// BallotStorageMetaData contains all meta data concerning the BallotStorage contract. +var BallotStorageMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_imp\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "5c60da1b": "implementation()", + }, + Bin: "0x608060405234801561001057600080fd5b5060405161077238038061077283398101604081905261002f91610326565b604080516020810190915260008152819061006b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61034f565b60008051602061072b8339815191521461008757610087610374565b6100938282600061009b565b505050610405565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b61008b1760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610136838360405180606001604052806027815260200161074b602791396101fd565b9392505050565b610150816102db60201b6100b71760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061072b83398151915260001b6102ea60201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161028091906103b6565b600060405180830381855af49150503d80600081146102bb576040519150601f19603f3d011682016040523d82523d6000602084013e6102c0565b606091505b5090925090506102d18282866102ed565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102fc575081610136565b82511561030c5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103d2565b60006020828403121561033857600080fd5b81516001600160a01b038116811461013657600080fd5b60008282101561036f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156103a557818101518382015260200161038d565b838111156100ca5750506000910152565b600082516103c881846020870161038a565b9190910192915050565b60208152600082518060208401526103f181604085016020870161038a565b601f01601f19169190910160400192915050565b610317806104146000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102bb60279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b60606001600160a01b0384163b61018d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a8919061026b565b600060405180830381855af49150503d80600081146101e3576040519150601f19603f3d011682016040523d82523d6000602084013e6101e8565b606091505b50915091506101f8828286610202565b9695505050505050565b606083156102115750816100b0565b8251156102215782518084602001fd5b8160405162461bcd60e51b81526004016101849190610287565b60005b8381101561025657818101518382015260200161023e565b83811115610265576000848401525b50505050565b6000825161027d81846020870161023b565b9190910192915050565b60208152600082518060208401526102a681604085016020870161023b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220ee902ae1ebb19baf0a3fcf922eb15a905dba5a97ac0a363ad62a66403d3450e564736f6c634300080e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", +} + +// BallotStorageABI is the input ABI used to generate the binding from. +// Deprecated: Use BallotStorageMetaData.ABI instead. +var BallotStorageABI = BallotStorageMetaData.ABI + +// Deprecated: Use BallotStorageMetaData.Sigs instead. +// BallotStorageFuncSigs maps the 4-byte function signature to its string representation. +var BallotStorageFuncSigs = BallotStorageMetaData.Sigs + +// BallotStorageBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use BallotStorageMetaData.Bin instead. +var BallotStorageBin = BallotStorageMetaData.Bin + +// DeployBallotStorage deploys a new Ethereum contract, binding an instance of BallotStorage to it. +func DeployBallotStorage(auth *bind.TransactOpts, backend bind.ContractBackend, _imp common.Address) (common.Address, *types.Transaction, *BallotStorage, error) { + parsed, err := BallotStorageMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BallotStorageBin), backend, _imp) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BallotStorage{BallotStorageCaller: BallotStorageCaller{contract: contract}, BallotStorageTransactor: BallotStorageTransactor{contract: contract}, BallotStorageFilterer: BallotStorageFilterer{contract: contract}}, nil +} + +// BallotStorage is an auto generated Go binding around an Ethereum contract. +type BallotStorage struct { + BallotStorageCaller // Read-only binding to the contract + BallotStorageTransactor // Write-only binding to the contract + BallotStorageFilterer // Log filterer for contract events +} + +// BallotStorageCaller is an auto generated read-only Go binding around an Ethereum contract. +type BallotStorageCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BallotStorageTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BallotStorageFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BallotStorageSession struct { + Contract *BallotStorage // 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 +} + +// BallotStorageCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BallotStorageCallerSession struct { + Contract *BallotStorageCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BallotStorageTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BallotStorageTransactorSession struct { + Contract *BallotStorageTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BallotStorageRaw is an auto generated low-level Go binding around an Ethereum contract. +type BallotStorageRaw struct { + Contract *BallotStorage // Generic contract binding to access the raw methods on +} + +// BallotStorageCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BallotStorageCallerRaw struct { + Contract *BallotStorageCaller // Generic read-only contract binding to access the raw methods on +} + +// BallotStorageTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BallotStorageTransactorRaw struct { + Contract *BallotStorageTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBallotStorage creates a new instance of BallotStorage, bound to a specific deployed contract. +func NewBallotStorage(address common.Address, backend bind.ContractBackend) (*BallotStorage, error) { + contract, err := bindBallotStorage(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BallotStorage{BallotStorageCaller: BallotStorageCaller{contract: contract}, BallotStorageTransactor: BallotStorageTransactor{contract: contract}, BallotStorageFilterer: BallotStorageFilterer{contract: contract}}, nil +} + +// NewBallotStorageCaller creates a new read-only instance of BallotStorage, bound to a specific deployed contract. +func NewBallotStorageCaller(address common.Address, caller bind.ContractCaller) (*BallotStorageCaller, error) { + contract, err := bindBallotStorage(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BallotStorageCaller{contract: contract}, nil +} + +// NewBallotStorageTransactor creates a new write-only instance of BallotStorage, bound to a specific deployed contract. +func NewBallotStorageTransactor(address common.Address, transactor bind.ContractTransactor) (*BallotStorageTransactor, error) { + contract, err := bindBallotStorage(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BallotStorageTransactor{contract: contract}, nil +} + +// NewBallotStorageFilterer creates a new log filterer instance of BallotStorage, bound to a specific deployed contract. +func NewBallotStorageFilterer(address common.Address, filterer bind.ContractFilterer) (*BallotStorageFilterer, error) { + contract, err := bindBallotStorage(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BallotStorageFilterer{contract: contract}, nil +} + +// bindBallotStorage binds a generic wrapper to an already deployed contract. +func bindBallotStorage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(BallotStorageABI)) + 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 (_BallotStorage *BallotStorageRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BallotStorage.Contract.BallotStorageCaller.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 (_BallotStorage *BallotStorageRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorage.Contract.BallotStorageTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BallotStorage *BallotStorageRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BallotStorage.Contract.BallotStorageTransactor.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 (_BallotStorage *BallotStorageCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BallotStorage.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 (_BallotStorage *BallotStorageTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorage.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BallotStorage *BallotStorageTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BallotStorage.Contract.contract.Transact(opts, method, params...) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_BallotStorage *BallotStorageCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BallotStorage.contract.Call(opts, &out, "implementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_BallotStorage *BallotStorageSession) Implementation() (common.Address, error) { + return _BallotStorage.Contract.Implementation(&_BallotStorage.CallOpts) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_BallotStorage *BallotStorageCallerSession) Implementation() (common.Address, error) { + return _BallotStorage.Contract.Implementation(&_BallotStorage.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_BallotStorage *BallotStorageTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _BallotStorage.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_BallotStorage *BallotStorageSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _BallotStorage.Contract.Fallback(&_BallotStorage.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_BallotStorage *BallotStorageTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _BallotStorage.Contract.Fallback(&_BallotStorage.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BallotStorage *BallotStorageTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorage.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BallotStorage *BallotStorageSession) Receive() (*types.Transaction, error) { + return _BallotStorage.Contract.Receive(&_BallotStorage.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_BallotStorage *BallotStorageTransactorSession) Receive() (*types.Transaction, error) { + return _BallotStorage.Contract.Receive(&_BallotStorage.TransactOpts) +} + +// BallotStorageAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the BallotStorage contract. +type BallotStorageAdminChangedIterator struct { + Event *BallotStorageAdminChanged // 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 *BallotStorageAdminChangedIterator) 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(BallotStorageAdminChanged) + 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(BallotStorageAdminChanged) + 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 *BallotStorageAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageAdminChanged represents a AdminChanged event raised by the BallotStorage contract. +type BallotStorageAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorage *BallotStorageFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*BallotStorageAdminChangedIterator, error) { + + logs, sub, err := _BallotStorage.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &BallotStorageAdminChangedIterator{contract: _BallotStorage.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorage *BallotStorageFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *BallotStorageAdminChanged) (event.Subscription, error) { + + logs, sub, err := _BallotStorage.contract.WatchLogs(opts, "AdminChanged") + 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(BallotStorageAdminChanged) + if err := _BallotStorage.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorage *BallotStorageFilterer) ParseAdminChanged(log types.Log) (*BallotStorageAdminChanged, error) { + event := new(BallotStorageAdminChanged) + if err := _BallotStorage.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the BallotStorage contract. +type BallotStorageBeaconUpgradedIterator struct { + Event *BallotStorageBeaconUpgraded // 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 *BallotStorageBeaconUpgradedIterator) 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(BallotStorageBeaconUpgraded) + 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(BallotStorageBeaconUpgraded) + 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 *BallotStorageBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageBeaconUpgraded represents a BeaconUpgraded event raised by the BallotStorage contract. +type BallotStorageBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorage *BallotStorageFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*BallotStorageBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _BallotStorage.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &BallotStorageBeaconUpgradedIterator{contract: _BallotStorage.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorage *BallotStorageFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *BallotStorageBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _BallotStorage.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(BallotStorageBeaconUpgraded) + if err := _BallotStorage.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorage *BallotStorageFilterer) ParseBeaconUpgraded(log types.Log) (*BallotStorageBeaconUpgraded, error) { + event := new(BallotStorageBeaconUpgraded) + if err := _BallotStorage.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the BallotStorage contract. +type BallotStorageUpgradedIterator struct { + Event *BallotStorageUpgraded // 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 *BallotStorageUpgradedIterator) 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(BallotStorageUpgraded) + 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(BallotStorageUpgraded) + 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 *BallotStorageUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageUpgraded represents a Upgraded event raised by the BallotStorage contract. +type BallotStorageUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorage *BallotStorageFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*BallotStorageUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _BallotStorage.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &BallotStorageUpgradedIterator{contract: _BallotStorage.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorage *BallotStorageFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *BallotStorageUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _BallotStorage.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(BallotStorageUpgraded) + if err := _BallotStorage.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorage *BallotStorageFilterer) ParseUpgraded(log types.Log) (*BallotStorageUpgraded, error) { + event := new(BallotStorageUpgraded) + if err := _BallotStorage.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpMetaData contains all meta data concerning the BallotStorageImp contract. +var BallotStorageImpMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"}],\"name\":\"BallotCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotType\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"}],\"name\":\"BallotCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"}],\"name\":\"BallotFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"name\":\"BallotStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"updatedBy\",\"type\":\"address\"}],\"name\":\"BallotUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"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\":\"previous\",\"type\":\"address\"}],\"name\":\"SetPrevBallotStorage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetRegistry\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"voteid\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"decision\",\"type\":\"uint256\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ENV_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_POOL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"}],\"name\":\"cancelBallot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ballotType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newGovernanceAddress\",\"type\":\"address\"}],\"name\":\"createBallotForAddress\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_unlockAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_slashing\",\"type\":\"uint256\"}],\"name\":\"createBallotForExit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ballotType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_creator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_oldStakerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newStakerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newVoterAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newRewardAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_newNodeName\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_newNodeId\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_newNodeIp\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_newNodePort\",\"type\":\"uint256\"}],\"name\":\"createBallotForMember\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ballotType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_creator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_envVariableName\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_envVariableType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_envVariableValue\",\"type\":\"bytes\"}],\"name\":\"createBallotForVariable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_decision\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_power\",\"type\":\"uint256\"}],\"name\":\"createVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ballotState\",\"type\":\"uint256\"}],\"name\":\"finalizeBallot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"newGovernanceAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotBasic\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ballotType\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"totalVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"powerOfAccepts\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"powerOfRejects\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isFinalized\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBallotCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotForExit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"unlockAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slashing\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"oldStakerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newStakerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newVoterAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"newRewardAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"newNodeName\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"newNodeId\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"newNodeIp\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newNodePort\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotState\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"state\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isFinalized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotVariable\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"envVariableName\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"envVariableType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"envVariableValue\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getBallotVotingInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalVoters\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"powerOfAccepts\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"powerOfRejects\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxVotingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinVotingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPreviousBallotStorage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_voteId\",\"type\":\"uint256\"}],\"name\":\"getVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"voteId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"decision\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"time\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint56\",\"name\":\"_ballotId\",\"type\":\"uint56\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"hasAlreadyVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_registry\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isDisabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reg\",\"outputs\":[{\"internalType\":\"contractIRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"setPreviousBallotStorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"}],\"name\":\"startBallot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"}],\"name\":\"updateBallotDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_lockAmount\",\"type\":\"uint256\"}],\"name\":\"updateBallotMemberLockAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ballotId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_memo\",\"type\":\"bytes\"}],\"name\":\"updateBallotMemo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImp\",\"type\":\"address\"}],\"name\":\"upgradeBallotStorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Sigs: map[string]string{ + "9986e4b9": "BALLOT_STORAGE_NAME()", + "34125c84": "ECOSYSTEM_NAME()", + "7bf46530": "ENV_STORAGE_NAME()", + "6c78d2cf": "GOV_NAME()", + "4bd1ed76": "MAINTENANCE_NAME()", + "2f40992e": "REWARD_POOL_NAME()", + "1e0cba0d": "STAKING_NAME()", + "5a731cca": "STAKING_REWARD_NAME()", + "155ca224": "cancelBallot(uint256)", + "0a3a63fe": "createBallotForAddress(uint256,uint256,uint256,address,address)", + "22640859": "createBallotForExit(uint256,uint256,uint256)", + "daacbb95": "createBallotForMember(uint256,uint256,uint256,address,address,address,address,address,bytes,bytes,bytes,uint256)", + "4a57823e": "createBallotForVariable(uint256,uint256,uint256,address,bytes32,uint256,bytes)", + "96462b9c": "createVote(uint256,uint256,address,uint256,uint256)", + "a91e59ba": "finalizeBallot(uint256,uint256)", + "7efa9ae3": "getBallotAddress(uint256)", + "02b385fb": "getBallotBasic(uint256)", + "b4741495": "getBallotCount()", + "8c7be692": "getBallotForExit(uint256)", + "73df4e01": "getBallotMember(uint256)", + "09970688": "getBallotPeriod(uint256)", + "688ca5b2": "getBallotState(uint256)", + "1d940da2": "getBallotVariable(uint256)", + "56ba988e": "getBallotVotingInfo(uint256)", + "ce04b9d4": "getMaxVotingDuration()", + "1c150171": "getMinVotingDuration()", + "b23c676c": "getPreviousBallotStorage()", + "557ed1ba": "getTime()", + "5a55c1f0": "getVote(uint256)", + "f680e555": "hasAlreadyVoted(uint56,address)", + "c4d66de8": "initialize(address)", + "6c57f5a9": "isDisabled()", + "8da5cb5b": "owner()", + "52d1902d": "proxiableUUID()", + "738fdd1a": "reg()", + "715018a6": "renounceOwnership()", + "2a74f38c": "setPreviousBallotStorage(address)", + "a91ee0dc": "setRegistry(address)", + "c0b6f186": "startBallot(uint256,uint256,uint256)", + "f2fde38b": "transferOwnership(address)", + "656bc633": "updateBallotDuration(uint256,uint256)", + "72d0ec92": "updateBallotMemberLockAmount(uint256,uint256)", + "bce0dbc1": "updateBallotMemo(uint256,bytes)", + "f51a88e2": "upgradeBallotStorage(address)", + "3659cfe6": "upgradeTo(address)", + "4f1ef286": "upgradeToAndCall(address,bytes)", + }, + Bin: "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516144aa6200012060003960008181611147015281816111870152818161132d0152818161136d015261140001526144aa6000f3fe60806040526004361061027d5760003560e01c80636c78d2cf1161014f578063a91e59ba116100c1578063c4d66de81161007a578063c4d66de814610872578063ce04b9d414610892578063daacbb95146108a7578063f2fde38b146108c7578063f51a88e2146108e7578063f680e5551461090757600080fd5b8063a91e59ba146107bf578063a91ee0dc146107df578063b23c676c146107ff578063b47414951461081d578063bce0dbc114610832578063c0b6f1861461085257600080fd5b80637bf46530116101135780637bf46530146106b95780637efa9ae3146106da5780638c7be692146107135780638da5cb5b1461075d57806396462b9c1461077b5780639986e4b91461079b57600080fd5b80636c78d2cf146105ee578063715018a61461061757806372d0ec921461062c578063738fdd1a1461064c57806373df4e011461068457600080fd5b80633659cfe6116101f357806356ba988e116101ac57806356ba988e146104cd5780635a55c1f0146104ed5780635a731cca14610548578063656bc6331461056c578063688ca5b21461058c5780636c57f5a9146105c957600080fd5b80633659cfe6146104305780634a57823e146104505780634bd1ed76146104705780634f1ef2861461049257806352d1902d146104a5578063557ed1ba146104ba57600080fd5b80631d940da2116102455780631d940da2146103625780631e0cba0d1461039157806322640859146103af5780632a74f38c146103cf5780632f40992e146103ef57806334125c841461041057600080fd5b806302b385fb1461028257806309970688146102c25780630a3a63fe146102fd578063155ca2241461032b5780631c1501711461034d575b600080fd5b34801561028e57600080fd5b506102a261029d366004613acc565b610958565b6040516102b99b9a99989796959493929190613b3d565b60405180910390f35b3480156102ce57600080fd5b506102e26102dd366004613acc565b610b23565b604080519384526020840192909252908201526060016102b9565b34801561030957600080fd5b5061031d610318366004613bd1565b610c83565b6040519081526020016102b9565b34801561033757600080fd5b5061034b610346366004613acc565b610d9b565b005b34801561035957600080fd5b5061031d610efc565b34801561036e57600080fd5b5061038261037d366004613acc565b610f6c565b6040516102b993929190613c27565b34801561039d57600080fd5b5061031d665374616b696e6760c81b81565b3480156103bb57600080fd5b5061034b6103ca366004613c4f565b611024565b3480156103db57600080fd5b5061034b6103ea366004613c7b565b6110a3565b3480156103fb57600080fd5b5061031d6914995dd85c99141bdbdb60b21b81565b34801561041c57600080fd5b5061031d6845636f73797374656d60b81b81565b34801561043c57600080fd5b5061034b61044b366004613c7b565b61113d565b34801561045c57600080fd5b5061031d61046b366004613d3b565b61121c565b34801561047c57600080fd5b5061031d6a4d61696e74656e616e636560a81b81565b61034b6104a0366004613dbb565b611323565b3480156104b157600080fd5b5061031d6113f3565b3480156104c657600080fd5b504261031d565b3480156104d957600080fd5b506102e26104e8366004613acc565b6114a6565b3480156104f957600080fd5b5061050d610508366004613acc565b6115f7565b6040805196875260208701959095526001600160a01b03909316938501939093526060840152608083019190915260a082015260c0016102b9565b34801561055457600080fd5b5061031d6c14dd185ada5b99d4995dd85c99609a1b81565b34801561057857600080fd5b5061034b610587366004613e0b565b6116c5565b34801561059857600080fd5b506105ac6105a7366004613acc565b6118d8565b6040805193845260208401929092521515908201526060016102b9565b3480156105d557600080fd5b506105de611a2e565b60405190151581526020016102b9565b3480156105fa57600080fd5b5061031d7111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b34801561062357600080fd5b5061034b611a52565b34801561063857600080fd5b5061034b610647366004613e0b565b611a66565b34801561065857600080fd5b5060655461066c906001600160a01b031681565b6040516001600160a01b0390911681526020016102b9565b34801561069057600080fd5b506106a461069f366004613acc565b611c00565b6040516102b999989796959493929190613e2d565b3480156106c557600080fd5b5061031d69456e7653746f7261676560b01b81565b3480156106e657600080fd5b5061066c6106f5366004613acc565b6000908152606860205260409020600101546001600160a01b031690565b34801561071f57600080fd5b5061074861072e366004613acc565b6000908152606e6020526040902080546001909101549091565b604080519283526020830191909152016102b9565b34801561076957600080fd5b506033546001600160a01b031661066c565b34801561078757600080fd5b5061034b610796366004613eac565b611e0d565b3480156107a757600080fd5b5061031d6c42616c6c6f7453746f7261676560981b81565b3480156107cb57600080fd5b5061034b6107da366004613e0b565b6120f8565b3480156107eb57600080fd5b5061034b6107fa366004613c7b565b612276565b34801561080b57600080fd5b50606c546001600160a01b031661066c565b34801561082957600080fd5b50606d5461031d565b34801561083e57600080fd5b5061034b61084d366004613ef5565b61231e565b34801561085e57600080fd5b5061034b61086d366004613c4f565b612463565b34801561087e57600080fd5b5061034b61088d366004613c7b565b612643565b34801561089e57600080fd5b5061031d61275d565b3480156108b357600080fd5b5061034b6108c2366004613f26565b6127a4565b3480156108d357600080fd5b5061034b6108e2366004613c7b565b612ab4565b3480156108f357600080fd5b5061034b610902366004613c7b565b612b2a565b34801561091357600080fd5b506105de610922366004614040565b66ffffffffffffff82166000908152606b602090815260408083206001600160a01b038516845290915290205460ff1692915050565b60008060008060606000806000806000806000606660008e815260200190815260200160002060405180610180016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016005820180546109f190614085565b80601f0160208091040260200160405190810160405280929190818152602001828054610a1d90614085565b8015610a6a5780601f10610a3f57610100808354040283529160200191610a6a565b820191906000526020600020905b815481529060010190602001808311610a4d57829003601f168201915b5050505050815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16151515158152602001600b82015481525050905080602001519b5080604001519a5080606001519950806080015198508060a0015197508060c0015196508060e00151955080610100015194508061012001519350806101400151925080610160015191505091939597999b90929496989a50565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a0840191610b9490614085565b80601f0160208091040260200160405190810160405280929190818152602001828054610bc090614085565b8015610c0d5780601f10610be257610100808354040283529160200191610c0d565b820191906000526020600020905b815481529060010190602001808311610bf057829003601f168201915b5050505050815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16151515158152602001600b82015481525050905080602001519350806040015192508061016001519150509193909250565b600033610c8e612b4a565b6001600160a01b031614610cbd5760405162461bcd60e51b8152600401610cb4906140bf565b60405180910390fd5b610cc5612b6a565b6001600160a01b0316306001600160a01b031614610cf55760405162461bcd60e51b8152600401610cb4906140e6565b60048514610d155760405162461bcd60e51b8152600401610cb49061410b565b6001600160a01b038216610d3b5760405162461bcd60e51b8152600401610cb490614138565b610d4786868686612b85565b506040805180820182528681526001600160a01b0392831660208083019182526000898152606890915292909220905181559051600190910180546001600160a01b03191691909216179055509192915050565b8033610da5612b4a565b6001600160a01b03161480610dd357506000818152606660205260409020600401546001600160a01b031633145b610def5760405162461bcd60e51b8152600401610cb4906140bf565b610df7612b6a565b6001600160a01b0316306001600160a01b031614610e275760405162461bcd60e51b8152600401610cb4906140e6565b6000828152606660205260409020548214610e545760405162461bcd60e51b8152600401610cb490614163565b6000828152606660205260409020600a015460ff1615610e865760405162461bcd60e51b8152600401610cb49061418f565b600160008381526066602052604090206009015414610eb75760405162461bcd60e51b8152600401610cb4906141ba565b60008281526066602052604090206005600982015560405183907fd5e541d004c50564e5e05fcbc6be2916c68d817507693dc3774c69dde4ce13dc90600090a2505050565b6000610f06612e40565b6001600160a01b03166333be496e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6791906141e3565b905090565b600081815260696020526040902060018101546002820154600383018054929391926060929190610f9c90614085565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc890614085565b80156110155780601f10610fea57610100808354040283529160200191611015565b820191906000526020600020905b815481529060010190602001808311610ff857829003601f168201915b50505050509150509193909250565b3361102d612b4a565b6001600160a01b0316146110535760405162461bcd60e51b8152600401610cb4906140bf565b61105b612b6a565b6001600160a01b0316306001600160a01b03161461108b5760405162461bcd60e51b8152600401610cb4906140e6565b6000928352606e602052604090922090815560010155565b6110ab612e58565b6001600160a01b0381166110f35760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610cb4565b606c80546001600160a01b0319166001600160a01b0383169081179091556040517f3d809312b6e303291a93b307c7ddbd0960c094f5f0fb4e3ba0758775013edeb390600090a250565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111855760405162461bcd60e51b8152600401610cb4906141fc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111ce60008051602061442e833981519152546001600160a01b031690565b6001600160a01b0316146111f45760405162461bcd60e51b8152600401610cb490614248565b6111fd81612eb2565b6040805160008082526020820190925261121991839190612eba565b50565b600033611227612b4a565b6001600160a01b03161461124d5760405162461bcd60e51b8152600401610cb4906140bf565b611255612b6a565b6001600160a01b0316306001600160a01b0316146112855760405162461bcd60e51b8152600401610cb4906140e6565b61129087858461302a565b6112ac5760405162461bcd60e51b8152600401610cb490614138565b6112b888888888612b85565b6040805160808101825289815260208082018781528284018781526060840187815260008e81526069855295909520845181559151600183015551600282015592518051929384939092611313926003850192910190613a33565b50999a9950505050505050505050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361136b5760405162461bcd60e51b8152600401610cb4906141fc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166113b460008051602061442e833981519152546001600160a01b031690565b6001600160a01b0316146113da5760405162461bcd60e51b8152600401610cb490614248565b6113e382612eb2565b6113ef82826001612eba565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114935760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610cb4565b5060008051602061442e83398151915290565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a084019161151790614085565b80601f016020809104026020016040519081016040528092919081815260200182805461154390614085565b80156115905780601f1061156557610100808354040283529160200191611590565b820191906000526020600020905b81548152906001019060200180831161157357829003601f168201915b505050918352505060068201546020820152600782015460408201526008820154606082015260098201546080820152600a82015460ff16151560a0820152600b9091015460c09182015281015160e0820151610100909201519097919650945092505050565b6000818152606a60205260408120548190819081908190819087146116535760405162461bcd60e51b81526020600482015260126024820152711b9bdd08195e1a5cdd1959081d9bdd19525960721b6044820152606401610cb4565b50505060009384525050606a6020908152604092839020835160c0810185528154808252600183015493820184905260028301546001600160a01b031695820186905260038301546060830181905260048401546080840181905260059094015460a090930183905290969395945092565b81336116cf612b4a565b6001600160a01b031614806116fd57506000818152606660205260409020600401546001600160a01b031633145b6117195760405162461bcd60e51b8152600401610cb4906140bf565b611721612b6a565b6001600160a01b0316306001600160a01b0316146117515760405162461bcd60e51b8152600401610cb4906140e6565b818061175b610efc565b11156117a95760405162461bcd60e51b815260206004820152601c60248201527f556e646572206d696e2076616c7565206f6620206475726174696f6e000000006044820152606401610cb4565b6117b161275d565b8111156118005760405162461bcd60e51b815260206004820152601a60248201527f4f766572206d61782076616c7565206f66206475726174696f6e0000000000006044820152606401610cb4565b600084815260666020526040902054841461182d5760405162461bcd60e51b8152600401610cb490614163565b6000848152606660205260409020600a015460ff161561185f5760405162461bcd60e51b8152600401610cb49061418f565b6001600085815260666020526040902060090154146118905760405162461bcd60e51b8152600401610cb4906141ba565b600084815260666020526040808220600b810186905590519091339187917ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a91a35050505050565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a084019161194990614085565b80601f016020809104026020016040519081016040528092919081815260200182805461197590614085565b80156119c25780601f10611997576101008083540402835291602001916119c2565b820191906000526020600020905b8154815290600101906020018083116119a557829003601f168201915b50505091835250506006820154602082015260078201546040820152600882015460608083019190915260098301546080830152600a83015460ff16151560a0830152600b9092015460c090910152810151610120820151610140909201519097919650945092505050565b6000611a38612b6a565b6001600160a01b0316306001600160a01b03161415905090565b611a5a612e58565b611a64600061310a565b565b33611a6f612b4a565b6001600160a01b031614611a955760405162461bcd60e51b8152600401610cb4906140bf565b611a9d612b6a565b6001600160a01b0316306001600160a01b031614611acd5760405162461bcd60e51b8152600401610cb4906140e6565b6000828152606660205260409020548214611afa5760405162461bcd60e51b8152600401610cb490614163565b6000828152606760205260409020548214611b575760405162461bcd60e51b815260206004820152601860248201527f6e6f7420657869737465642042616c6c6f744d656d62657200000000000000006044820152606401610cb4565b6000828152606660205260409020600a015460ff1615611b895760405162461bcd60e51b8152600401610cb49061418f565b600160008381526066602052604090206009015414611bba5760405162461bcd60e51b8152600401610cb4906141ba565b6000828152606760205260408082206009810184905590519091339185917ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a91a3505050565b600081815260676020526040812060018101546002820154600383015460048401546005850180546001600160a01b039586169794861696938616959092169360609384938493839291611c5390614085565b80601f0160208091040260200160405190810160405280929190818152602001828054611c7f90614085565b8015611ccc5780601f10611ca157610100808354040283529160200191611ccc565b820191906000526020600020905b815481529060010190602001808311611caf57829003601f168201915b50505050509550806006018054611ce290614085565b80601f0160208091040260200160405190810160405280929190818152602001828054611d0e90614085565b8015611d5b5780601f10611d3057610100808354040283529160200191611d5b565b820191906000526020600020905b815481529060010190602001808311611d3e57829003601f168201915b50505050509450806007018054611d7190614085565b80601f0160208091040260200160405190810160405280929190818152602001828054611d9d90614085565b8015611dea5780601f10611dbf57610100808354040283529160200191611dea565b820191906000526020600020905b815481529060010190602001808311611dcd57829003601f168201915b505050505093508060080154925080600901549150509193959799909294969850565b33611e16612b4a565b6001600160a01b031614611e3c5760405162461bcd60e51b8152600401610cb4906140bf565b611e44612b6a565b6001600160a01b0316306001600160a01b031614611e745760405162461bcd60e51b8152600401610cb4906140e6565b6001821480611e835750600282145b611ec25760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103232b1b4b9b4b7b760811b6044820152606401610cb4565b6000848152606660205260409020548414611eef5760405162461bcd60e51b8152600401610cb490614163565b6000858152606a6020526040902054859003611f465760405162461bcd60e51b8152602060048201526016602482015275185b1c9958591e48195e1a5cdd1959081d9bdd19525960521b6044820152606401610cb4565b6000848152606b602090815260408083206001600160a01b038716845290915290205460ff1615611fa95760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610cb4565b6002600085815260666020526040902060090154146120015760405162461bcd60e51b81526020600482015260146024820152734e6f7420496e50726f677265737320537461746560601b6044820152606401610cb4565b6040518060c00160405280868152602001858152602001846001600160a01b0316815260200183815260200182815260200161203a4290565b90526000868152606a602090815260409182902083518155908301516001820155908201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080820151600482015560a0909101516005909101556120ac8484848461315c565b826001600160a01b031684867f41df84b3b467b06744e40c92613c666324e7c640ce0a41ec06efdf602d367606856040516120e991815260200190565b60405180910390a45050505050565b33612101612b4a565b6001600160a01b0316146121275760405162461bcd60e51b8152600401610cb4906140bf565b61212f612b6a565b6001600160a01b0316306001600160a01b03161461215f5760405162461bcd60e51b8152600401610cb4906140e6565b600082815260666020526040902054821461218c5760405162461bcd60e51b8152600401610cb490614163565b6000828152606660205260409020600a015460ff16156121be5760405162461bcd60e51b8152600401610cb49061418f565b60038114806121cd5750600481145b6122105760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642042616c6c6f7420537461746560601b6044820152606401610cb4565b6000828152606660205260409081902060098101839055600a8101805460ff19166001179055905183907fdc921f027328d7238b58d77649ebcbd0c8b1c494c66ba53dfe53e0de65f6dd9f906122699085815260200190565b60405180910390a2505050565b61227e612e58565b6001600160a01b0381166122d45760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f0000000000006044820152606401610cb4565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b8133612328612b4a565b6001600160a01b0316148061235657506000818152606660205260409020600401546001600160a01b031633145b6123725760405162461bcd60e51b8152600401610cb4906140bf565b61237a612b6a565b6001600160a01b0316306001600160a01b0316146123aa5760405162461bcd60e51b8152600401610cb4906140e6565b60008381526066602052604090205483146123d75760405162461bcd60e51b8152600401610cb490614163565b6000838152606660205260409020600a015460ff16156124095760405162461bcd60e51b8152600401610cb49061418f565b60008381526066602090815260409091208351909161242f916005840191860190613a33565b50604051339085907ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a90600090a350505050565b3361246c612b4a565b6001600160a01b0316146124925760405162461bcd60e51b8152600401610cb4906140bf565b61249a612b6a565b6001600160a01b0316306001600160a01b0316146124ca5760405162461bcd60e51b8152600401610cb4906140e6565b81816000821180156124dc5750600081115b61251c5760405162461bcd60e51b815260206004820152601160248201527007374617274206f7220656e64206973203607c1b6044820152606401610cb4565b81811161255a5760405162461bcd60e51b815260206004820152600c60248201526b1cdd185c9d080f8f48195b9960a21b6044820152606401610cb4565b60008581526066602052604090205485146125875760405162461bcd60e51b8152600401610cb490614163565b6000858152606660205260409020600a015460ff16156125b95760405162461bcd60e51b8152600401610cb49061418f565b6001600086815260666020526040902060090154146125ea5760405162461bcd60e51b8152600401610cb4906141ba565b600085815260666020526040902060018101859055600280820185905560098201556040518490869088907fd9938a514dab5cdce149a77493f694bd70c24a4833a278fd4d86fbdf859099c590600090a4505050505050565b600054610100900460ff16158080156126635750600054600160ff909116105b8061267d5750303b15801561267d575060005460ff166001145b6126e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610cb4565b6000805460ff191660011790558015612703576000805461ff0019166101001790555b61270b6132c4565b61271482612276565b80156113ef576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000612767612e40565b6001600160a01b0316631b27e01b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f43573d6000803e3d6000fd5b336127ad612b4a565b6001600160a01b0316146127d35760405162461bcd60e51b8152600401610cb4906140bf565b6127db612b6a565b6001600160a01b0316306001600160a01b03161461280b5760405162461bcd60e51b8152600401610cb4906140e6565b61281c8b89898989898989896132f3565b6128385760405162461bcd60e51b8152600401610cb490614138565b6128448c8c8c8c612b85565b6128be6040518061014001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160008152602001600081525090565b8c8160000181815250508881602001906001600160a01b031690816001600160a01b0316815250508781604001906001600160a01b031690816001600160a01b0316815250508681606001906001600160a01b031690816001600160a01b0316815250508581608001906001600160a01b031690816001600160a01b031681525050848160a00181905250838160c00181905250828160e00181905250818161010001818152505080606760008f81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a0820151816005019080519060200190612a54929190613a33565b5060c08201518051612a70916006840191602090910190613a33565b5060e08201518051612a8c916007840191602090910190613a33565b5061010082015160088201556101209091015160099091015550505050505050505050505050565b612abc612e58565b6001600160a01b038116612b215760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cb4565b6112198161310a565b612b32612e58565b6001600160a01b03811615611219576111fd81612eb2565b6000610f677111dbdd995c9b985b98d950dbdb9d1c9858dd60721b613752565b6000610f676c42616c6c6f7453746f7261676560981b613752565b8180612b8f610efc565b1115612bdd5760405162461bcd60e51b815260206004820152601c60248201527f556e646572206d696e2076616c7565206f6620206475726174696f6e000000006044820152606401610cb4565b612be561275d565b811115612c345760405162461bcd60e51b815260206004820152601a60248201527f4f766572206d61782076616c7565206f66206475726174696f6e0000000000006044820152606401610cb4565b600085815260666020526040902054859003612c8b5760405162461bcd60e51b8152602060048201526016602482015275105b1c9958591e48195e1a5cdd19590818985b1b1bdd60521b6044820152606401610cb4565b612cfa6040518061018001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081525090565b858152606081018590526001600160a01b0383166080820152600161012082015260006101408201819052610160820185905286815260666020908152604091829020835181558184015160018201559183015160028301556060830151600383015560808301516004830180546001600160a01b0319166001600160a01b0390921691909117905560a08301518051849392612d9e926005850192910190613a33565b5060c0820151600682015560e0820151600782015561010082015160088201556101208201516009820155610140820151600a8201805460ff191691151591909117905561016090910151600b90910155606d54612dfd906001614294565b606d556040516001600160a01b03841690869088907fd1ba591c76ef71222e2d30b8277758713cc6eef1de29efaf98a716744ac2420b90600090a4505050505050565b6000610f6769456e7653746f7261676560b01b613752565b6033546001600160a01b03163314611a645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cb4565b611219612e58565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612ef257612eed836137c6565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612f4c575060408051601f3d908101601f19168201909252612f49918101906141e3565b60015b612faf5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610cb4565b60008051602061442e833981519152811461301e5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610cb4565b50612eed838383613862565b60006005841461304c5760405162461bcd60e51b8152600401610cb49061410b565b826130a35760405162461bcd60e51b815260206004820152602160248201527f496e76616c696420656e7669726f6e6d656e74207661726961626c65206e616d6044820152606560f81b6064820152608401610cb4565b60008251116130ff5760405162461bcd60e51b815260206004820152602260248201527f496e76616c696420656e7669726f6e6d656e74207661726961626c652076616c604482015261756560f01b6064820152608401610cb4565b5060015b9392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600182148061316b5750600282145b6131aa5760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103232b1b4b9b4b7b760811b6044820152606401610cb4565b60008481526066602052604090205484146131d75760405162461bcd60e51b8152600401610cb490614163565b6000848152606b602090815260408083206001600160a01b038716845290915290205460ff161561323a5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610cb4565b6000848152606660209081526040808320606b83528184206001600160a01b0388168552909252909120805460ff19166001908117909155600682015461328091614294565b6006820155600183036132a75781816007015461329d9190614294565b60078201556132bd565b8181600801546132b79190614294565b60088201555b5050505050565b600054610100900460ff166132eb5760405162461bcd60e51b8152600401610cb4906142ba565b611a6461388d565b600060018a10158015613307575060038a11155b6133235760405162461bcd60e51b8152600401610cb49061410b565b60028a036134e2576001600160a01b0389166133515760405162461bcd60e51b8152600401610cb490614305565b6001600160a01b038816156133785760405162461bcd60e51b8152600401610cb49061433c565b6001600160a01b0387161561339f5760405162461bcd60e51b8152600401610cb490614373565b6001600160a01b038616156133c65760405162461bcd60e51b8152600401610cb4906143aa565b84511561340d5760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964206e6577206e6f6465206e616d6560581b6044820152606401610cb4565b8351156134525760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b995dc81b9bd919481a59606a1b6044820152606401610cb4565b8251156134975760405162461bcd60e51b81526020600482015260136024820152720496e76616c6964206e6577206e6f646520495606c1b6044820152606401610cb4565b81156134dd5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b995dc81b9bd91948141bdc9d605a1b6044820152606401610cb4565b613742565b600085511161352b5760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964206e6577206e6f6465206e616d6560581b6044820152606401610cb4565b83516040146135725760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b995dc81b9bd919481a59606a1b6044820152606401610cb4565b60008351116135b95760405162461bcd60e51b81526020600482015260136024820152720496e76616c6964206e6577206e6f646520495606c1b6044820152606401610cb4565b600082116136015760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b995dc81b9bd91948141bdc9d605a1b6044820152606401610cb4565b60018a036136a2576001600160a01b038916156136305760405162461bcd60e51b8152600401610cb490614305565b6001600160a01b0388166136565760405162461bcd60e51b8152600401610cb49061433c565b6001600160a01b03871661367c5760405162461bcd60e51b8152600401610cb490614373565b6001600160a01b0386166134dd5760405162461bcd60e51b8152600401610cb4906143aa565b60038a03613742576001600160a01b0389166136d05760405162461bcd60e51b8152600401610cb490614305565b6001600160a01b0388166136f65760405162461bcd60e51b8152600401610cb49061433c565b6001600160a01b03871661371c5760405162461bcd60e51b8152600401610cb490614373565b6001600160a01b0386166137425760405162461bcd60e51b8152600401610cb4906143aa565b5060019998505050505050505050565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd90602401602060405180830381865afa15801561379c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137c091906143e1565b92915050565b6001600160a01b0381163b6138335760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610cb4565b60008051602061442e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61386b836138bd565b6000825111806138785750805b15612eed5761388783836138fd565b50505050565b600054610100900460ff166138b45760405162461bcd60e51b8152600401610cb4906142ba565b611a643361310a565b6138c6816137c6565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060613103838360405180606001604052806027815260200161444e6027913960606001600160a01b0384163b6139855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610cb4565b600080856001600160a01b0316856040516139a091906143fe565b600060405180830381855af49150503d80600081146139db576040519150601f19603f3d011682016040523d82523d6000602084013e6139e0565b606091505b50915091506139f08282866139fa565b9695505050505050565b60608315613a09575081613103565b825115613a195782518084602001fd5b8160405162461bcd60e51b8152600401610cb4919061441a565b828054613a3f90614085565b90600052602060002090601f016020900481019282613a615760008555613aa7565b82601f10613a7a57805160ff1916838001178555613aa7565b82800160010185558215613aa7579182015b82811115613aa7578251825591602001919060010190613a8c565b50613ab3929150613ab7565b5090565b5b80821115613ab35760008155600101613ab8565b600060208284031215613ade57600080fd5b5035919050565b60005b83811015613b00578181015183820152602001613ae8565b838111156138875750506000910152565b60008151808452613b29816020860160208601613ae5565b601f01601f19169290920160200192915050565b60006101608d83528c60208401528b604084015260018060a01b038b166060840152806080840152613b718184018b613b11565b60a0840199909952505060c081019590955260e085019390935261010084019190915215156101208301526101409091015295945050505050565b6001600160a01b038116811461121957600080fd5b8035613bcc81613bac565b919050565b600080600080600060a08688031215613be957600080fd5b8535945060208601359350604086013592506060860135613c0981613bac565b91506080860135613c1981613bac565b809150509295509295909350565b838152826020820152606060408201526000613c466060830184613b11565b95945050505050565b600080600060608486031215613c6457600080fd5b505081359360208301359350604090920135919050565b600060208284031215613c8d57600080fd5b813561310381613bac565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613cbf57600080fd5b813567ffffffffffffffff80821115613cda57613cda613c98565b604051601f8301601f19908116603f01168101908282118183101715613d0257613d02613c98565b81604052838152866020858801011115613d1b57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600080600060e0888a031215613d5657600080fd5b8735965060208801359550604088013594506060880135613d7681613bac565b93506080880135925060a0880135915060c088013567ffffffffffffffff811115613da057600080fd5b613dac8a828b01613cae565b91505092959891949750929550565b60008060408385031215613dce57600080fd5b8235613dd981613bac565b9150602083013567ffffffffffffffff811115613df557600080fd5b613e0185828601613cae565b9150509250929050565b60008060408385031215613e1e57600080fd5b50508035926020909101359150565b6001600160a01b038a81168252898116602083015288811660408301528716606082015261012060808201819052600090613e6a83820189613b11565b905082810360a0840152613e7e8188613b11565b905082810360c0840152613e928187613b11565b60e084019590955250506101000152979650505050505050565b600080600080600060a08688031215613ec457600080fd5b85359450602086013593506040860135613edd81613bac565b94979396509394606081013594506080013592915050565b60008060408385031215613f0857600080fd5b82359150602083013567ffffffffffffffff811115613df557600080fd5b6000806000806000806000806000806000806101808d8f031215613f4957600080fd5b8c359b5060208d01359a5060408d01359950613f6760608e01613bc1565b9850613f7560808e01613bc1565b9750613f8360a08e01613bc1565b9650613f9160c08e01613bc1565b9550613f9f60e08e01613bc1565b945067ffffffffffffffff6101008e01351115613fbb57600080fd5b613fcc8e6101008f01358f01613cae565b935067ffffffffffffffff6101208e01351115613fe857600080fd5b613ff98e6101208f01358f01613cae565b925067ffffffffffffffff6101408e0135111561401557600080fd5b6140268e6101408f01358f01613cae565b91506101608d013590509295989b509295989b509295989b565b6000806040838503121561405357600080fd5b823566ffffffffffffff8116811461406a57600080fd5b9150602083013561407a81613bac565b809150509250929050565b600181811c9082168061409957607f821691505b6020821081036140b957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b6020808252600b908201526a125cc8111a5cd8589b195960aa1b604082015260600190565b602080825260139082015272496e76616c69642042616c6c6f74205479706560681b604082015260600190565b60208082526011908201527024b73b30b634b2102830b930b6b2ba32b960791b604082015260600190565b6020808252601290820152711b9bdd08195e1a5cdd19590810985b1b1bdd60721b604082015260600190565b602080825260119082015270185b1c9958591e48199a5b985b1a5e9959607a1b604082015260600190565b6020808252600f908201526e4e6f7420526561647920537461746560881b604082015260600190565b6000602082840312156141f557600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b600082198211156142b557634e487b7160e01b600052601160045260246000fd5b500190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601a908201527f496e76616c6964206f6c64207374616b65722061646472657373000000000000604082015260600190565b6020808252601a908201527f496e76616c6964206e6577207374616b65722061646472657373000000000000604082015260600190565b60208082526019908201527f496e76616c6964206e657720766f746572206164647265737300000000000000604082015260600190565b6020808252601a908201527f496e76616c6964206e6577207265776172642061646472657373000000000000604082015260600190565b6000602082840312156143f357600080fd5b815161310381613bac565b60008251614410818460208701613ae5565b9190910192915050565b6020815260006131036020830184613b1156fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d596f8c32db0e2a432c61e3e481cfa3a0849a6a96ced7f94574bcc375400012264736f6c634300080e0033", +} + +// BallotStorageImpABI is the input ABI used to generate the binding from. +// Deprecated: Use BallotStorageImpMetaData.ABI instead. +var BallotStorageImpABI = BallotStorageImpMetaData.ABI + +// Deprecated: Use BallotStorageImpMetaData.Sigs instead. +// BallotStorageImpFuncSigs maps the 4-byte function signature to its string representation. +var BallotStorageImpFuncSigs = BallotStorageImpMetaData.Sigs + +// BallotStorageImpBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use BallotStorageImpMetaData.Bin instead. +var BallotStorageImpBin = BallotStorageImpMetaData.Bin + +// DeployBallotStorageImp deploys a new Ethereum contract, binding an instance of BallotStorageImp to it. +func DeployBallotStorageImp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *BallotStorageImp, error) { + parsed, err := BallotStorageImpMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BallotStorageImpBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &BallotStorageImp{BallotStorageImpCaller: BallotStorageImpCaller{contract: contract}, BallotStorageImpTransactor: BallotStorageImpTransactor{contract: contract}, BallotStorageImpFilterer: BallotStorageImpFilterer{contract: contract}}, nil +} + +// BallotStorageImp is an auto generated Go binding around an Ethereum contract. +type BallotStorageImp struct { + BallotStorageImpCaller // Read-only binding to the contract + BallotStorageImpTransactor // Write-only binding to the contract + BallotStorageImpFilterer // Log filterer for contract events +} + +// BallotStorageImpCaller is an auto generated read-only Go binding around an Ethereum contract. +type BallotStorageImpCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageImpTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BallotStorageImpTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageImpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BallotStorageImpFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BallotStorageImpSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BallotStorageImpSession struct { + Contract *BallotStorageImp // 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 +} + +// BallotStorageImpCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BallotStorageImpCallerSession struct { + Contract *BallotStorageImpCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BallotStorageImpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BallotStorageImpTransactorSession struct { + Contract *BallotStorageImpTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BallotStorageImpRaw is an auto generated low-level Go binding around an Ethereum contract. +type BallotStorageImpRaw struct { + Contract *BallotStorageImp // Generic contract binding to access the raw methods on +} + +// BallotStorageImpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BallotStorageImpCallerRaw struct { + Contract *BallotStorageImpCaller // Generic read-only contract binding to access the raw methods on +} + +// BallotStorageImpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BallotStorageImpTransactorRaw struct { + Contract *BallotStorageImpTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBallotStorageImp creates a new instance of BallotStorageImp, bound to a specific deployed contract. +func NewBallotStorageImp(address common.Address, backend bind.ContractBackend) (*BallotStorageImp, error) { + contract, err := bindBallotStorageImp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &BallotStorageImp{BallotStorageImpCaller: BallotStorageImpCaller{contract: contract}, BallotStorageImpTransactor: BallotStorageImpTransactor{contract: contract}, BallotStorageImpFilterer: BallotStorageImpFilterer{contract: contract}}, nil +} + +// NewBallotStorageImpCaller creates a new read-only instance of BallotStorageImp, bound to a specific deployed contract. +func NewBallotStorageImpCaller(address common.Address, caller bind.ContractCaller) (*BallotStorageImpCaller, error) { + contract, err := bindBallotStorageImp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BallotStorageImpCaller{contract: contract}, nil +} + +// NewBallotStorageImpTransactor creates a new write-only instance of BallotStorageImp, bound to a specific deployed contract. +func NewBallotStorageImpTransactor(address common.Address, transactor bind.ContractTransactor) (*BallotStorageImpTransactor, error) { + contract, err := bindBallotStorageImp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BallotStorageImpTransactor{contract: contract}, nil +} + +// NewBallotStorageImpFilterer creates a new log filterer instance of BallotStorageImp, bound to a specific deployed contract. +func NewBallotStorageImpFilterer(address common.Address, filterer bind.ContractFilterer) (*BallotStorageImpFilterer, error) { + contract, err := bindBallotStorageImp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BallotStorageImpFilterer{contract: contract}, nil +} + +// bindBallotStorageImp binds a generic wrapper to an already deployed contract. +func bindBallotStorageImp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(BallotStorageImpABI)) + 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 (_BallotStorageImp *BallotStorageImpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BallotStorageImp.Contract.BallotStorageImpCaller.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 (_BallotStorageImp *BallotStorageImpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorageImp.Contract.BallotStorageImpTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BallotStorageImp *BallotStorageImpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BallotStorageImp.Contract.BallotStorageImpTransactor.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 (_BallotStorageImp *BallotStorageImpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorageImp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_BallotStorageImp *BallotStorageImpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _BallotStorageImp.Contract.contract.Transact(opts, method, params...) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) BALLOTSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "BALLOT_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.BALLOTSTORAGENAME(&_BallotStorageImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.BALLOTSTORAGENAME(&_BallotStorageImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) ECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) ECOSYSTEMNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.ECOSYSTEMNAME(&_BallotStorageImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) ECOSYSTEMNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.ECOSYSTEMNAME(&_BallotStorageImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) ENVSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "ENV_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) ENVSTORAGENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.ENVSTORAGENAME(&_BallotStorageImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) ENVSTORAGENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.ENVSTORAGENAME(&_BallotStorageImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) GOVNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "GOV_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) GOVNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.GOVNAME(&_BallotStorageImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) GOVNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.GOVNAME(&_BallotStorageImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) MAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) MAINTENANCENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.MAINTENANCENAME(&_BallotStorageImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) MAINTENANCENAME() ([32]byte, error) { + return _BallotStorageImp.Contract.MAINTENANCENAME(&_BallotStorageImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) REWARDPOOLNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "REWARD_POOL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) REWARDPOOLNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.REWARDPOOLNAME(&_BallotStorageImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) REWARDPOOLNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.REWARDPOOLNAME(&_BallotStorageImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) STAKINGNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "STAKING_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) STAKINGNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.STAKINGNAME(&_BallotStorageImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) STAKINGNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.STAKINGNAME(&_BallotStorageImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) STAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) STAKINGREWARDNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.STAKINGREWARDNAME(&_BallotStorageImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) STAKINGREWARDNAME() ([32]byte, error) { + return _BallotStorageImp.Contract.STAKINGREWARDNAME(&_BallotStorageImp.CallOpts) +} + +// GetBallotAddress is a free data retrieval call binding the contract method 0x7efa9ae3. +// +// Solidity: function getBallotAddress(uint256 _id) view returns(address newGovernanceAddress) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotAddress(opts *bind.CallOpts, _id *big.Int) (common.Address, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotAddress", _id) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetBallotAddress is a free data retrieval call binding the contract method 0x7efa9ae3. +// +// Solidity: function getBallotAddress(uint256 _id) view returns(address newGovernanceAddress) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotAddress(_id *big.Int) (common.Address, error) { + return _BallotStorageImp.Contract.GetBallotAddress(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotAddress is a free data retrieval call binding the contract method 0x7efa9ae3. +// +// Solidity: function getBallotAddress(uint256 _id) view returns(address newGovernanceAddress) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotAddress(_id *big.Int) (common.Address, error) { + return _BallotStorageImp.Contract.GetBallotAddress(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotBasic is a free data retrieval call binding the contract method 0x02b385fb. +// +// Solidity: function getBallotBasic(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 ballotType, address creator, bytes memo, uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects, uint256 state, bool isFinalized, uint256 duration) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotBasic(opts *bind.CallOpts, _id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + BallotType *big.Int + Creator common.Address + Memo []byte + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int + State *big.Int + IsFinalized bool + Duration *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotBasic", _id) + + outstruct := new(struct { + StartTime *big.Int + EndTime *big.Int + BallotType *big.Int + Creator common.Address + Memo []byte + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int + State *big.Int + IsFinalized bool + Duration *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.StartTime = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.EndTime = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.BallotType = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.Creator = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Memo = *abi.ConvertType(out[4], new([]byte)).(*[]byte) + outstruct.TotalVoters = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.PowerOfAccepts = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) + outstruct.PowerOfRejects = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) + outstruct.State = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) + outstruct.IsFinalized = *abi.ConvertType(out[9], new(bool)).(*bool) + outstruct.Duration = *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetBallotBasic is a free data retrieval call binding the contract method 0x02b385fb. +// +// Solidity: function getBallotBasic(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 ballotType, address creator, bytes memo, uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects, uint256 state, bool isFinalized, uint256 duration) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotBasic(_id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + BallotType *big.Int + Creator common.Address + Memo []byte + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int + State *big.Int + IsFinalized bool + Duration *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotBasic(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotBasic is a free data retrieval call binding the contract method 0x02b385fb. +// +// Solidity: function getBallotBasic(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 ballotType, address creator, bytes memo, uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects, uint256 state, bool isFinalized, uint256 duration) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotBasic(_id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + BallotType *big.Int + Creator common.Address + Memo []byte + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int + State *big.Int + IsFinalized bool + Duration *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotBasic(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotCount is a free data retrieval call binding the contract method 0xb4741495. +// +// Solidity: function getBallotCount() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotCount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotCount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBallotCount is a free data retrieval call binding the contract method 0xb4741495. +// +// Solidity: function getBallotCount() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotCount() (*big.Int, error) { + return _BallotStorageImp.Contract.GetBallotCount(&_BallotStorageImp.CallOpts) +} + +// GetBallotCount is a free data retrieval call binding the contract method 0xb4741495. +// +// Solidity: function getBallotCount() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotCount() (*big.Int, error) { + return _BallotStorageImp.Contract.GetBallotCount(&_BallotStorageImp.CallOpts) +} + +// GetBallotForExit is a free data retrieval call binding the contract method 0x8c7be692. +// +// Solidity: function getBallotForExit(uint256 _id) view returns(uint256 unlockAmount, uint256 slashing) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotForExit(opts *bind.CallOpts, _id *big.Int) (struct { + UnlockAmount *big.Int + Slashing *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotForExit", _id) + + outstruct := new(struct { + UnlockAmount *big.Int + Slashing *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.UnlockAmount = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Slashing = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetBallotForExit is a free data retrieval call binding the contract method 0x8c7be692. +// +// Solidity: function getBallotForExit(uint256 _id) view returns(uint256 unlockAmount, uint256 slashing) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotForExit(_id *big.Int) (struct { + UnlockAmount *big.Int + Slashing *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotForExit(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotForExit is a free data retrieval call binding the contract method 0x8c7be692. +// +// Solidity: function getBallotForExit(uint256 _id) view returns(uint256 unlockAmount, uint256 slashing) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotForExit(_id *big.Int) (struct { + UnlockAmount *big.Int + Slashing *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotForExit(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotMember is a free data retrieval call binding the contract method 0x73df4e01. +// +// Solidity: function getBallotMember(uint256 _id) view returns(address oldStakerAddress, address newStakerAddress, address newVoterAddress, address newRewardAddress, bytes newNodeName, bytes newNodeId, bytes newNodeIp, uint256 newNodePort, uint256 lockAmount) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotMember(opts *bind.CallOpts, _id *big.Int) (struct { + OldStakerAddress common.Address + NewStakerAddress common.Address + NewVoterAddress common.Address + NewRewardAddress common.Address + NewNodeName []byte + NewNodeId []byte + NewNodeIp []byte + NewNodePort *big.Int + LockAmount *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotMember", _id) + + outstruct := new(struct { + OldStakerAddress common.Address + NewStakerAddress common.Address + NewVoterAddress common.Address + NewRewardAddress common.Address + NewNodeName []byte + NewNodeId []byte + NewNodeIp []byte + NewNodePort *big.Int + LockAmount *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.OldStakerAddress = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.NewStakerAddress = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + outstruct.NewVoterAddress = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + outstruct.NewRewardAddress = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.NewNodeName = *abi.ConvertType(out[4], new([]byte)).(*[]byte) + outstruct.NewNodeId = *abi.ConvertType(out[5], new([]byte)).(*[]byte) + outstruct.NewNodeIp = *abi.ConvertType(out[6], new([]byte)).(*[]byte) + outstruct.NewNodePort = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) + outstruct.LockAmount = *abi.ConvertType(out[8], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetBallotMember is a free data retrieval call binding the contract method 0x73df4e01. +// +// Solidity: function getBallotMember(uint256 _id) view returns(address oldStakerAddress, address newStakerAddress, address newVoterAddress, address newRewardAddress, bytes newNodeName, bytes newNodeId, bytes newNodeIp, uint256 newNodePort, uint256 lockAmount) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotMember(_id *big.Int) (struct { + OldStakerAddress common.Address + NewStakerAddress common.Address + NewVoterAddress common.Address + NewRewardAddress common.Address + NewNodeName []byte + NewNodeId []byte + NewNodeIp []byte + NewNodePort *big.Int + LockAmount *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotMember(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotMember is a free data retrieval call binding the contract method 0x73df4e01. +// +// Solidity: function getBallotMember(uint256 _id) view returns(address oldStakerAddress, address newStakerAddress, address newVoterAddress, address newRewardAddress, bytes newNodeName, bytes newNodeId, bytes newNodeIp, uint256 newNodePort, uint256 lockAmount) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotMember(_id *big.Int) (struct { + OldStakerAddress common.Address + NewStakerAddress common.Address + NewVoterAddress common.Address + NewRewardAddress common.Address + NewNodeName []byte + NewNodeId []byte + NewNodeIp []byte + NewNodePort *big.Int + LockAmount *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotMember(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotPeriod is a free data retrieval call binding the contract method 0x09970688. +// +// Solidity: function getBallotPeriod(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 duration) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotPeriod(opts *bind.CallOpts, _id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + Duration *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotPeriod", _id) + + outstruct := new(struct { + StartTime *big.Int + EndTime *big.Int + Duration *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.StartTime = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.EndTime = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.Duration = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetBallotPeriod is a free data retrieval call binding the contract method 0x09970688. +// +// Solidity: function getBallotPeriod(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 duration) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotPeriod(_id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + Duration *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotPeriod(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotPeriod is a free data retrieval call binding the contract method 0x09970688. +// +// Solidity: function getBallotPeriod(uint256 _id) view returns(uint256 startTime, uint256 endTime, uint256 duration) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotPeriod(_id *big.Int) (struct { + StartTime *big.Int + EndTime *big.Int + Duration *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotPeriod(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotState is a free data retrieval call binding the contract method 0x688ca5b2. +// +// Solidity: function getBallotState(uint256 _id) view returns(uint256 ballotType, uint256 state, bool isFinalized) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotState(opts *bind.CallOpts, _id *big.Int) (struct { + BallotType *big.Int + State *big.Int + IsFinalized bool +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotState", _id) + + outstruct := new(struct { + BallotType *big.Int + State *big.Int + IsFinalized bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.BallotType = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.State = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.IsFinalized = *abi.ConvertType(out[2], new(bool)).(*bool) + + return *outstruct, err + +} + +// GetBallotState is a free data retrieval call binding the contract method 0x688ca5b2. +// +// Solidity: function getBallotState(uint256 _id) view returns(uint256 ballotType, uint256 state, bool isFinalized) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotState(_id *big.Int) (struct { + BallotType *big.Int + State *big.Int + IsFinalized bool +}, error) { + return _BallotStorageImp.Contract.GetBallotState(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotState is a free data retrieval call binding the contract method 0x688ca5b2. +// +// Solidity: function getBallotState(uint256 _id) view returns(uint256 ballotType, uint256 state, bool isFinalized) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotState(_id *big.Int) (struct { + BallotType *big.Int + State *big.Int + IsFinalized bool +}, error) { + return _BallotStorageImp.Contract.GetBallotState(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotVariable is a free data retrieval call binding the contract method 0x1d940da2. +// +// Solidity: function getBallotVariable(uint256 _id) view returns(bytes32 envVariableName, uint256 envVariableType, bytes envVariableValue) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotVariable(opts *bind.CallOpts, _id *big.Int) (struct { + EnvVariableName [32]byte + EnvVariableType *big.Int + EnvVariableValue []byte +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotVariable", _id) + + outstruct := new(struct { + EnvVariableName [32]byte + EnvVariableType *big.Int + EnvVariableValue []byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.EnvVariableName = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.EnvVariableType = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.EnvVariableValue = *abi.ConvertType(out[2], new([]byte)).(*[]byte) + + return *outstruct, err + +} + +// GetBallotVariable is a free data retrieval call binding the contract method 0x1d940da2. +// +// Solidity: function getBallotVariable(uint256 _id) view returns(bytes32 envVariableName, uint256 envVariableType, bytes envVariableValue) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotVariable(_id *big.Int) (struct { + EnvVariableName [32]byte + EnvVariableType *big.Int + EnvVariableValue []byte +}, error) { + return _BallotStorageImp.Contract.GetBallotVariable(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotVariable is a free data retrieval call binding the contract method 0x1d940da2. +// +// Solidity: function getBallotVariable(uint256 _id) view returns(bytes32 envVariableName, uint256 envVariableType, bytes envVariableValue) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotVariable(_id *big.Int) (struct { + EnvVariableName [32]byte + EnvVariableType *big.Int + EnvVariableValue []byte +}, error) { + return _BallotStorageImp.Contract.GetBallotVariable(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotVotingInfo is a free data retrieval call binding the contract method 0x56ba988e. +// +// Solidity: function getBallotVotingInfo(uint256 _id) view returns(uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects) +func (_BallotStorageImp *BallotStorageImpCaller) GetBallotVotingInfo(opts *bind.CallOpts, _id *big.Int) (struct { + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getBallotVotingInfo", _id) + + outstruct := new(struct { + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.TotalVoters = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.PowerOfAccepts = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.PowerOfRejects = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetBallotVotingInfo is a free data retrieval call binding the contract method 0x56ba988e. +// +// Solidity: function getBallotVotingInfo(uint256 _id) view returns(uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects) +func (_BallotStorageImp *BallotStorageImpSession) GetBallotVotingInfo(_id *big.Int) (struct { + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotVotingInfo(&_BallotStorageImp.CallOpts, _id) +} + +// GetBallotVotingInfo is a free data retrieval call binding the contract method 0x56ba988e. +// +// Solidity: function getBallotVotingInfo(uint256 _id) view returns(uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetBallotVotingInfo(_id *big.Int) (struct { + TotalVoters *big.Int + PowerOfAccepts *big.Int + PowerOfRejects *big.Int +}, error) { + return _BallotStorageImp.Contract.GetBallotVotingInfo(&_BallotStorageImp.CallOpts, _id) +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCaller) GetMaxVotingDuration(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getMaxVotingDuration") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) GetMaxVotingDuration() (*big.Int, error) { + return _BallotStorageImp.Contract.GetMaxVotingDuration(&_BallotStorageImp.CallOpts) +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetMaxVotingDuration() (*big.Int, error) { + return _BallotStorageImp.Contract.GetMaxVotingDuration(&_BallotStorageImp.CallOpts) +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCaller) GetMinVotingDuration(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getMinVotingDuration") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) GetMinVotingDuration() (*big.Int, error) { + return _BallotStorageImp.Contract.GetMinVotingDuration(&_BallotStorageImp.CallOpts) +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetMinVotingDuration() (*big.Int, error) { + return _BallotStorageImp.Contract.GetMinVotingDuration(&_BallotStorageImp.CallOpts) +} + +// GetPreviousBallotStorage is a free data retrieval call binding the contract method 0xb23c676c. +// +// Solidity: function getPreviousBallotStorage() view returns(address) +func (_BallotStorageImp *BallotStorageImpCaller) GetPreviousBallotStorage(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getPreviousBallotStorage") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetPreviousBallotStorage is a free data retrieval call binding the contract method 0xb23c676c. +// +// Solidity: function getPreviousBallotStorage() view returns(address) +func (_BallotStorageImp *BallotStorageImpSession) GetPreviousBallotStorage() (common.Address, error) { + return _BallotStorageImp.Contract.GetPreviousBallotStorage(&_BallotStorageImp.CallOpts) +} + +// GetPreviousBallotStorage is a free data retrieval call binding the contract method 0xb23c676c. +// +// Solidity: function getPreviousBallotStorage() view returns(address) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetPreviousBallotStorage() (common.Address, error) { + return _BallotStorageImp.Contract.GetPreviousBallotStorage(&_BallotStorageImp.CallOpts) +} + +// GetTime is a free data retrieval call binding the contract method 0x557ed1ba. +// +// Solidity: function getTime() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCaller) GetTime(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getTime") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTime is a free data retrieval call binding the contract method 0x557ed1ba. +// +// Solidity: function getTime() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) GetTime() (*big.Int, error) { + return _BallotStorageImp.Contract.GetTime(&_BallotStorageImp.CallOpts) +} + +// GetTime is a free data retrieval call binding the contract method 0x557ed1ba. +// +// Solidity: function getTime() view returns(uint256) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetTime() (*big.Int, error) { + return _BallotStorageImp.Contract.GetTime(&_BallotStorageImp.CallOpts) +} + +// GetVote is a free data retrieval call binding the contract method 0x5a55c1f0. +// +// Solidity: function getVote(uint256 _voteId) view returns(uint256 voteId, uint256 ballotId, address voter, uint256 decision, uint256 power, uint256 time) +func (_BallotStorageImp *BallotStorageImpCaller) GetVote(opts *bind.CallOpts, _voteId *big.Int) (struct { + VoteId *big.Int + BallotId *big.Int + Voter common.Address + Decision *big.Int + Power *big.Int + Time *big.Int +}, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "getVote", _voteId) + + outstruct := new(struct { + VoteId *big.Int + BallotId *big.Int + Voter common.Address + Decision *big.Int + Power *big.Int + Time *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.VoteId = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.BallotId = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.Voter = *abi.ConvertType(out[2], new(common.Address)).(*common.Address) + outstruct.Decision = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.Power = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.Time = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetVote is a free data retrieval call binding the contract method 0x5a55c1f0. +// +// Solidity: function getVote(uint256 _voteId) view returns(uint256 voteId, uint256 ballotId, address voter, uint256 decision, uint256 power, uint256 time) +func (_BallotStorageImp *BallotStorageImpSession) GetVote(_voteId *big.Int) (struct { + VoteId *big.Int + BallotId *big.Int + Voter common.Address + Decision *big.Int + Power *big.Int + Time *big.Int +}, error) { + return _BallotStorageImp.Contract.GetVote(&_BallotStorageImp.CallOpts, _voteId) +} + +// GetVote is a free data retrieval call binding the contract method 0x5a55c1f0. +// +// Solidity: function getVote(uint256 _voteId) view returns(uint256 voteId, uint256 ballotId, address voter, uint256 decision, uint256 power, uint256 time) +func (_BallotStorageImp *BallotStorageImpCallerSession) GetVote(_voteId *big.Int) (struct { + VoteId *big.Int + BallotId *big.Int + Voter common.Address + Decision *big.Int + Power *big.Int + Time *big.Int +}, error) { + return _BallotStorageImp.Contract.GetVote(&_BallotStorageImp.CallOpts, _voteId) +} + +// HasAlreadyVoted is a free data retrieval call binding the contract method 0xf680e555. +// +// Solidity: function hasAlreadyVoted(uint56 _ballotId, address _voter) view returns(bool) +func (_BallotStorageImp *BallotStorageImpCaller) HasAlreadyVoted(opts *bind.CallOpts, _ballotId *big.Int, _voter common.Address) (bool, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "hasAlreadyVoted", _ballotId, _voter) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// HasAlreadyVoted is a free data retrieval call binding the contract method 0xf680e555. +// +// Solidity: function hasAlreadyVoted(uint56 _ballotId, address _voter) view returns(bool) +func (_BallotStorageImp *BallotStorageImpSession) HasAlreadyVoted(_ballotId *big.Int, _voter common.Address) (bool, error) { + return _BallotStorageImp.Contract.HasAlreadyVoted(&_BallotStorageImp.CallOpts, _ballotId, _voter) +} + +// HasAlreadyVoted is a free data retrieval call binding the contract method 0xf680e555. +// +// Solidity: function hasAlreadyVoted(uint56 _ballotId, address _voter) view returns(bool) +func (_BallotStorageImp *BallotStorageImpCallerSession) HasAlreadyVoted(_ballotId *big.Int, _voter common.Address) (bool, error) { + return _BallotStorageImp.Contract.HasAlreadyVoted(&_BallotStorageImp.CallOpts, _ballotId, _voter) +} + +// IsDisabled is a free data retrieval call binding the contract method 0x6c57f5a9. +// +// Solidity: function isDisabled() view returns(bool) +func (_BallotStorageImp *BallotStorageImpCaller) IsDisabled(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "isDisabled") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsDisabled is a free data retrieval call binding the contract method 0x6c57f5a9. +// +// Solidity: function isDisabled() view returns(bool) +func (_BallotStorageImp *BallotStorageImpSession) IsDisabled() (bool, error) { + return _BallotStorageImp.Contract.IsDisabled(&_BallotStorageImp.CallOpts) +} + +// IsDisabled is a free data retrieval call binding the contract method 0x6c57f5a9. +// +// Solidity: function isDisabled() view returns(bool) +func (_BallotStorageImp *BallotStorageImpCallerSession) IsDisabled() (bool, error) { + return _BallotStorageImp.Contract.IsDisabled(&_BallotStorageImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_BallotStorageImp *BallotStorageImpCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpSession) Owner() (common.Address, error) { + return _BallotStorageImp.Contract.Owner(&_BallotStorageImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_BallotStorageImp *BallotStorageImpCallerSession) Owner() (common.Address, error) { + return _BallotStorageImp.Contract.Owner(&_BallotStorageImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpSession) ProxiableUUID() ([32]byte, error) { + return _BallotStorageImp.Contract.ProxiableUUID(&_BallotStorageImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_BallotStorageImp *BallotStorageImpCallerSession) ProxiableUUID() ([32]byte, error) { + return _BallotStorageImp.Contract.ProxiableUUID(&_BallotStorageImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_BallotStorageImp *BallotStorageImpCaller) Reg(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BallotStorageImp.contract.Call(opts, &out, "reg") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_BallotStorageImp *BallotStorageImpSession) Reg() (common.Address, error) { + return _BallotStorageImp.Contract.Reg(&_BallotStorageImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_BallotStorageImp *BallotStorageImpCallerSession) Reg() (common.Address, error) { + return _BallotStorageImp.Contract.Reg(&_BallotStorageImp.CallOpts) +} + +// CancelBallot is a paid mutator transaction binding the contract method 0x155ca224. +// +// Solidity: function cancelBallot(uint256 _ballotId) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) CancelBallot(opts *bind.TransactOpts, _ballotId *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "cancelBallot", _ballotId) +} + +// CancelBallot is a paid mutator transaction binding the contract method 0x155ca224. +// +// Solidity: function cancelBallot(uint256 _ballotId) returns() +func (_BallotStorageImp *BallotStorageImpSession) CancelBallot(_ballotId *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CancelBallot(&_BallotStorageImp.TransactOpts, _ballotId) +} + +// CancelBallot is a paid mutator transaction binding the contract method 0x155ca224. +// +// Solidity: function cancelBallot(uint256 _ballotId) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) CancelBallot(_ballotId *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CancelBallot(&_BallotStorageImp.TransactOpts, _ballotId) +} + +// CreateBallotForAddress is a paid mutator transaction binding the contract method 0x0a3a63fe. +// +// Solidity: function createBallotForAddress(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _newGovernanceAddress) returns(uint256) +func (_BallotStorageImp *BallotStorageImpTransactor) CreateBallotForAddress(opts *bind.TransactOpts, _id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _newGovernanceAddress common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "createBallotForAddress", _id, _ballotType, _duration, _creator, _newGovernanceAddress) +} + +// CreateBallotForAddress is a paid mutator transaction binding the contract method 0x0a3a63fe. +// +// Solidity: function createBallotForAddress(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _newGovernanceAddress) returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) CreateBallotForAddress(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _newGovernanceAddress common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForAddress(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _newGovernanceAddress) +} + +// CreateBallotForAddress is a paid mutator transaction binding the contract method 0x0a3a63fe. +// +// Solidity: function createBallotForAddress(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _newGovernanceAddress) returns(uint256) +func (_BallotStorageImp *BallotStorageImpTransactorSession) CreateBallotForAddress(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _newGovernanceAddress common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForAddress(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _newGovernanceAddress) +} + +// CreateBallotForExit is a paid mutator transaction binding the contract method 0x22640859. +// +// Solidity: function createBallotForExit(uint256 _id, uint256 _unlockAmount, uint256 _slashing) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) CreateBallotForExit(opts *bind.TransactOpts, _id *big.Int, _unlockAmount *big.Int, _slashing *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "createBallotForExit", _id, _unlockAmount, _slashing) +} + +// CreateBallotForExit is a paid mutator transaction binding the contract method 0x22640859. +// +// Solidity: function createBallotForExit(uint256 _id, uint256 _unlockAmount, uint256 _slashing) returns() +func (_BallotStorageImp *BallotStorageImpSession) CreateBallotForExit(_id *big.Int, _unlockAmount *big.Int, _slashing *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForExit(&_BallotStorageImp.TransactOpts, _id, _unlockAmount, _slashing) +} + +// CreateBallotForExit is a paid mutator transaction binding the contract method 0x22640859. +// +// Solidity: function createBallotForExit(uint256 _id, uint256 _unlockAmount, uint256 _slashing) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) CreateBallotForExit(_id *big.Int, _unlockAmount *big.Int, _slashing *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForExit(&_BallotStorageImp.TransactOpts, _id, _unlockAmount, _slashing) +} + +// CreateBallotForMember is a paid mutator transaction binding the contract method 0xdaacbb95. +// +// Solidity: function createBallotForMember(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _oldStakerAddress, address _newStakerAddress, address _newVoterAddress, address _newRewardAddress, bytes _newNodeName, bytes _newNodeId, bytes _newNodeIp, uint256 _newNodePort) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) CreateBallotForMember(opts *bind.TransactOpts, _id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _oldStakerAddress common.Address, _newStakerAddress common.Address, _newVoterAddress common.Address, _newRewardAddress common.Address, _newNodeName []byte, _newNodeId []byte, _newNodeIp []byte, _newNodePort *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "createBallotForMember", _id, _ballotType, _duration, _creator, _oldStakerAddress, _newStakerAddress, _newVoterAddress, _newRewardAddress, _newNodeName, _newNodeId, _newNodeIp, _newNodePort) +} + +// CreateBallotForMember is a paid mutator transaction binding the contract method 0xdaacbb95. +// +// Solidity: function createBallotForMember(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _oldStakerAddress, address _newStakerAddress, address _newVoterAddress, address _newRewardAddress, bytes _newNodeName, bytes _newNodeId, bytes _newNodeIp, uint256 _newNodePort) returns() +func (_BallotStorageImp *BallotStorageImpSession) CreateBallotForMember(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _oldStakerAddress common.Address, _newStakerAddress common.Address, _newVoterAddress common.Address, _newRewardAddress common.Address, _newNodeName []byte, _newNodeId []byte, _newNodeIp []byte, _newNodePort *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForMember(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _oldStakerAddress, _newStakerAddress, _newVoterAddress, _newRewardAddress, _newNodeName, _newNodeId, _newNodeIp, _newNodePort) +} + +// CreateBallotForMember is a paid mutator transaction binding the contract method 0xdaacbb95. +// +// Solidity: function createBallotForMember(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, address _oldStakerAddress, address _newStakerAddress, address _newVoterAddress, address _newRewardAddress, bytes _newNodeName, bytes _newNodeId, bytes _newNodeIp, uint256 _newNodePort) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) CreateBallotForMember(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _oldStakerAddress common.Address, _newStakerAddress common.Address, _newVoterAddress common.Address, _newRewardAddress common.Address, _newNodeName []byte, _newNodeId []byte, _newNodeIp []byte, _newNodePort *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForMember(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _oldStakerAddress, _newStakerAddress, _newVoterAddress, _newRewardAddress, _newNodeName, _newNodeId, _newNodeIp, _newNodePort) +} + +// CreateBallotForVariable is a paid mutator transaction binding the contract method 0x4a57823e. +// +// Solidity: function createBallotForVariable(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, bytes32 _envVariableName, uint256 _envVariableType, bytes _envVariableValue) returns(uint256) +func (_BallotStorageImp *BallotStorageImpTransactor) CreateBallotForVariable(opts *bind.TransactOpts, _id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _envVariableName [32]byte, _envVariableType *big.Int, _envVariableValue []byte) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "createBallotForVariable", _id, _ballotType, _duration, _creator, _envVariableName, _envVariableType, _envVariableValue) +} + +// CreateBallotForVariable is a paid mutator transaction binding the contract method 0x4a57823e. +// +// Solidity: function createBallotForVariable(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, bytes32 _envVariableName, uint256 _envVariableType, bytes _envVariableValue) returns(uint256) +func (_BallotStorageImp *BallotStorageImpSession) CreateBallotForVariable(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _envVariableName [32]byte, _envVariableType *big.Int, _envVariableValue []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForVariable(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _envVariableName, _envVariableType, _envVariableValue) +} + +// CreateBallotForVariable is a paid mutator transaction binding the contract method 0x4a57823e. +// +// Solidity: function createBallotForVariable(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator, bytes32 _envVariableName, uint256 _envVariableType, bytes _envVariableValue) returns(uint256) +func (_BallotStorageImp *BallotStorageImpTransactorSession) CreateBallotForVariable(_id *big.Int, _ballotType *big.Int, _duration *big.Int, _creator common.Address, _envVariableName [32]byte, _envVariableType *big.Int, _envVariableValue []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateBallotForVariable(&_BallotStorageImp.TransactOpts, _id, _ballotType, _duration, _creator, _envVariableName, _envVariableType, _envVariableValue) +} + +// CreateVote is a paid mutator transaction binding the contract method 0x96462b9c. +// +// Solidity: function createVote(uint256 _voteId, uint256 _ballotId, address _voter, uint256 _decision, uint256 _power) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) CreateVote(opts *bind.TransactOpts, _voteId *big.Int, _ballotId *big.Int, _voter common.Address, _decision *big.Int, _power *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "createVote", _voteId, _ballotId, _voter, _decision, _power) +} + +// CreateVote is a paid mutator transaction binding the contract method 0x96462b9c. +// +// Solidity: function createVote(uint256 _voteId, uint256 _ballotId, address _voter, uint256 _decision, uint256 _power) returns() +func (_BallotStorageImp *BallotStorageImpSession) CreateVote(_voteId *big.Int, _ballotId *big.Int, _voter common.Address, _decision *big.Int, _power *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateVote(&_BallotStorageImp.TransactOpts, _voteId, _ballotId, _voter, _decision, _power) +} + +// CreateVote is a paid mutator transaction binding the contract method 0x96462b9c. +// +// Solidity: function createVote(uint256 _voteId, uint256 _ballotId, address _voter, uint256 _decision, uint256 _power) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) CreateVote(_voteId *big.Int, _ballotId *big.Int, _voter common.Address, _decision *big.Int, _power *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.CreateVote(&_BallotStorageImp.TransactOpts, _voteId, _ballotId, _voter, _decision, _power) +} + +// FinalizeBallot is a paid mutator transaction binding the contract method 0xa91e59ba. +// +// Solidity: function finalizeBallot(uint256 _ballotId, uint256 _ballotState) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) FinalizeBallot(opts *bind.TransactOpts, _ballotId *big.Int, _ballotState *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "finalizeBallot", _ballotId, _ballotState) +} + +// FinalizeBallot is a paid mutator transaction binding the contract method 0xa91e59ba. +// +// Solidity: function finalizeBallot(uint256 _ballotId, uint256 _ballotState) returns() +func (_BallotStorageImp *BallotStorageImpSession) FinalizeBallot(_ballotId *big.Int, _ballotState *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.FinalizeBallot(&_BallotStorageImp.TransactOpts, _ballotId, _ballotState) +} + +// FinalizeBallot is a paid mutator transaction binding the contract method 0xa91e59ba. +// +// Solidity: function finalizeBallot(uint256 _ballotId, uint256 _ballotState) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) FinalizeBallot(_ballotId *big.Int, _ballotState *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.FinalizeBallot(&_BallotStorageImp.TransactOpts, _ballotId, _ballotState) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) Initialize(opts *bind.TransactOpts, _registry common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "initialize", _registry) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_BallotStorageImp *BallotStorageImpSession) Initialize(_registry common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.Initialize(&_BallotStorageImp.TransactOpts, _registry) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) Initialize(_registry common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.Initialize(&_BallotStorageImp.TransactOpts, _registry) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BallotStorageImp *BallotStorageImpTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BallotStorageImp *BallotStorageImpSession) RenounceOwnership() (*types.Transaction, error) { + return _BallotStorageImp.Contract.RenounceOwnership(&_BallotStorageImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _BallotStorageImp.Contract.RenounceOwnership(&_BallotStorageImp.TransactOpts) +} + +// SetPreviousBallotStorage is a paid mutator transaction binding the contract method 0x2a74f38c. +// +// Solidity: function setPreviousBallotStorage(address _address) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) SetPreviousBallotStorage(opts *bind.TransactOpts, _address common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "setPreviousBallotStorage", _address) +} + +// SetPreviousBallotStorage is a paid mutator transaction binding the contract method 0x2a74f38c. +// +// Solidity: function setPreviousBallotStorage(address _address) returns() +func (_BallotStorageImp *BallotStorageImpSession) SetPreviousBallotStorage(_address common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.SetPreviousBallotStorage(&_BallotStorageImp.TransactOpts, _address) +} + +// SetPreviousBallotStorage is a paid mutator transaction binding the contract method 0x2a74f38c. +// +// Solidity: function setPreviousBallotStorage(address _address) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) SetPreviousBallotStorage(_address common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.SetPreviousBallotStorage(&_BallotStorageImp.TransactOpts, _address) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) SetRegistry(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "setRegistry", _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_BallotStorageImp *BallotStorageImpSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.SetRegistry(&_BallotStorageImp.TransactOpts, _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.SetRegistry(&_BallotStorageImp.TransactOpts, _addr) +} + +// StartBallot is a paid mutator transaction binding the contract method 0xc0b6f186. +// +// Solidity: function startBallot(uint256 _ballotId, uint256 _startTime, uint256 _endTime) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) StartBallot(opts *bind.TransactOpts, _ballotId *big.Int, _startTime *big.Int, _endTime *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "startBallot", _ballotId, _startTime, _endTime) +} + +// StartBallot is a paid mutator transaction binding the contract method 0xc0b6f186. +// +// Solidity: function startBallot(uint256 _ballotId, uint256 _startTime, uint256 _endTime) returns() +func (_BallotStorageImp *BallotStorageImpSession) StartBallot(_ballotId *big.Int, _startTime *big.Int, _endTime *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.StartBallot(&_BallotStorageImp.TransactOpts, _ballotId, _startTime, _endTime) +} + +// StartBallot is a paid mutator transaction binding the contract method 0xc0b6f186. +// +// Solidity: function startBallot(uint256 _ballotId, uint256 _startTime, uint256 _endTime) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) StartBallot(_ballotId *big.Int, _startTime *big.Int, _endTime *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.StartBallot(&_BallotStorageImp.TransactOpts, _ballotId, _startTime, _endTime) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BallotStorageImp *BallotStorageImpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.TransferOwnership(&_BallotStorageImp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.TransferOwnership(&_BallotStorageImp.TransactOpts, newOwner) +} + +// UpdateBallotDuration is a paid mutator transaction binding the contract method 0x656bc633. +// +// Solidity: function updateBallotDuration(uint256 _ballotId, uint256 _duration) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpdateBallotDuration(opts *bind.TransactOpts, _ballotId *big.Int, _duration *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "updateBallotDuration", _ballotId, _duration) +} + +// UpdateBallotDuration is a paid mutator transaction binding the contract method 0x656bc633. +// +// Solidity: function updateBallotDuration(uint256 _ballotId, uint256 _duration) returns() +func (_BallotStorageImp *BallotStorageImpSession) UpdateBallotDuration(_ballotId *big.Int, _duration *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotDuration(&_BallotStorageImp.TransactOpts, _ballotId, _duration) +} + +// UpdateBallotDuration is a paid mutator transaction binding the contract method 0x656bc633. +// +// Solidity: function updateBallotDuration(uint256 _ballotId, uint256 _duration) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpdateBallotDuration(_ballotId *big.Int, _duration *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotDuration(&_BallotStorageImp.TransactOpts, _ballotId, _duration) +} + +// UpdateBallotMemberLockAmount is a paid mutator transaction binding the contract method 0x72d0ec92. +// +// Solidity: function updateBallotMemberLockAmount(uint256 _ballotId, uint256 _lockAmount) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpdateBallotMemberLockAmount(opts *bind.TransactOpts, _ballotId *big.Int, _lockAmount *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "updateBallotMemberLockAmount", _ballotId, _lockAmount) +} + +// UpdateBallotMemberLockAmount is a paid mutator transaction binding the contract method 0x72d0ec92. +// +// Solidity: function updateBallotMemberLockAmount(uint256 _ballotId, uint256 _lockAmount) returns() +func (_BallotStorageImp *BallotStorageImpSession) UpdateBallotMemberLockAmount(_ballotId *big.Int, _lockAmount *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotMemberLockAmount(&_BallotStorageImp.TransactOpts, _ballotId, _lockAmount) +} + +// UpdateBallotMemberLockAmount is a paid mutator transaction binding the contract method 0x72d0ec92. +// +// Solidity: function updateBallotMemberLockAmount(uint256 _ballotId, uint256 _lockAmount) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpdateBallotMemberLockAmount(_ballotId *big.Int, _lockAmount *big.Int) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotMemberLockAmount(&_BallotStorageImp.TransactOpts, _ballotId, _lockAmount) +} + +// UpdateBallotMemo is a paid mutator transaction binding the contract method 0xbce0dbc1. +// +// Solidity: function updateBallotMemo(uint256 _ballotId, bytes _memo) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpdateBallotMemo(opts *bind.TransactOpts, _ballotId *big.Int, _memo []byte) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "updateBallotMemo", _ballotId, _memo) +} + +// UpdateBallotMemo is a paid mutator transaction binding the contract method 0xbce0dbc1. +// +// Solidity: function updateBallotMemo(uint256 _ballotId, bytes _memo) returns() +func (_BallotStorageImp *BallotStorageImpSession) UpdateBallotMemo(_ballotId *big.Int, _memo []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotMemo(&_BallotStorageImp.TransactOpts, _ballotId, _memo) +} + +// UpdateBallotMemo is a paid mutator transaction binding the contract method 0xbce0dbc1. +// +// Solidity: function updateBallotMemo(uint256 _ballotId, bytes _memo) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpdateBallotMemo(_ballotId *big.Int, _memo []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpdateBallotMemo(&_BallotStorageImp.TransactOpts, _ballotId, _memo) +} + +// UpgradeBallotStorage is a paid mutator transaction binding the contract method 0xf51a88e2. +// +// Solidity: function upgradeBallotStorage(address newImp) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpgradeBallotStorage(opts *bind.TransactOpts, newImp common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "upgradeBallotStorage", newImp) +} + +// UpgradeBallotStorage is a paid mutator transaction binding the contract method 0xf51a88e2. +// +// Solidity: function upgradeBallotStorage(address newImp) returns() +func (_BallotStorageImp *BallotStorageImpSession) UpgradeBallotStorage(newImp common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeBallotStorage(&_BallotStorageImp.TransactOpts, newImp) +} + +// UpgradeBallotStorage is a paid mutator transaction binding the contract method 0xf51a88e2. +// +// Solidity: function upgradeBallotStorage(address newImp) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpgradeBallotStorage(newImp common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeBallotStorage(&_BallotStorageImp.TransactOpts, newImp) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_BallotStorageImp *BallotStorageImpSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeTo(&_BallotStorageImp.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeTo(&_BallotStorageImp.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_BallotStorageImp *BallotStorageImpTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _BallotStorageImp.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_BallotStorageImp *BallotStorageImpSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeToAndCall(&_BallotStorageImp.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_BallotStorageImp *BallotStorageImpTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _BallotStorageImp.Contract.UpgradeToAndCall(&_BallotStorageImp.TransactOpts, newImplementation, data) +} + +// BallotStorageImpAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the BallotStorageImp contract. +type BallotStorageImpAdminChangedIterator struct { + Event *BallotStorageImpAdminChanged // 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 *BallotStorageImpAdminChangedIterator) 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(BallotStorageImpAdminChanged) + 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(BallotStorageImpAdminChanged) + 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 *BallotStorageImpAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpAdminChanged represents a AdminChanged event raised by the BallotStorageImp contract. +type BallotStorageImpAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*BallotStorageImpAdminChangedIterator, error) { + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &BallotStorageImpAdminChangedIterator{contract: _BallotStorageImp.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *BallotStorageImpAdminChanged) (event.Subscription, error) { + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "AdminChanged") + 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(BallotStorageImpAdminChanged) + if err := _BallotStorageImp.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseAdminChanged(log types.Log) (*BallotStorageImpAdminChanged, error) { + event := new(BallotStorageImpAdminChanged) + if err := _BallotStorageImp.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBallotCanceledIterator is returned from FilterBallotCanceled and is used to iterate over the raw logs and unpacked data for BallotCanceled events raised by the BallotStorageImp contract. +type BallotStorageImpBallotCanceledIterator struct { + Event *BallotStorageImpBallotCanceled // 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 *BallotStorageImpBallotCanceledIterator) 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(BallotStorageImpBallotCanceled) + 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(BallotStorageImpBallotCanceled) + 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 *BallotStorageImpBallotCanceledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBallotCanceledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBallotCanceled represents a BallotCanceled event raised by the BallotStorageImp contract. +type BallotStorageImpBallotCanceled struct { + BallotId *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBallotCanceled is a free log retrieval operation binding the contract event 0xd5e541d004c50564e5e05fcbc6be2916c68d817507693dc3774c69dde4ce13dc. +// +// Solidity: event BallotCanceled(uint256 indexed ballotId) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBallotCanceled(opts *bind.FilterOpts, ballotId []*big.Int) (*BallotStorageImpBallotCanceledIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BallotCanceled", ballotIdRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBallotCanceledIterator{contract: _BallotStorageImp.contract, event: "BallotCanceled", logs: logs, sub: sub}, nil +} + +// WatchBallotCanceled is a free log subscription operation binding the contract event 0xd5e541d004c50564e5e05fcbc6be2916c68d817507693dc3774c69dde4ce13dc. +// +// Solidity: event BallotCanceled(uint256 indexed ballotId) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBallotCanceled(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBallotCanceled, ballotId []*big.Int) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BallotCanceled", ballotIdRule) + 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(BallotStorageImpBallotCanceled) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotCanceled", 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 +} + +// ParseBallotCanceled is a log parse operation binding the contract event 0xd5e541d004c50564e5e05fcbc6be2916c68d817507693dc3774c69dde4ce13dc. +// +// Solidity: event BallotCanceled(uint256 indexed ballotId) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBallotCanceled(log types.Log) (*BallotStorageImpBallotCanceled, error) { + event := new(BallotStorageImpBallotCanceled) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotCanceled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBallotCreatedIterator is returned from FilterBallotCreated and is used to iterate over the raw logs and unpacked data for BallotCreated events raised by the BallotStorageImp contract. +type BallotStorageImpBallotCreatedIterator struct { + Event *BallotStorageImpBallotCreated // 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 *BallotStorageImpBallotCreatedIterator) 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(BallotStorageImpBallotCreated) + 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(BallotStorageImpBallotCreated) + 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 *BallotStorageImpBallotCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBallotCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBallotCreated represents a BallotCreated event raised by the BallotStorageImp contract. +type BallotStorageImpBallotCreated struct { + BallotId *big.Int + BallotType *big.Int + Creator common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBallotCreated is a free log retrieval operation binding the contract event 0xd1ba591c76ef71222e2d30b8277758713cc6eef1de29efaf98a716744ac2420b. +// +// Solidity: event BallotCreated(uint256 indexed ballotId, uint256 indexed ballotType, address indexed creator) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBallotCreated(opts *bind.FilterOpts, ballotId []*big.Int, ballotType []*big.Int, creator []common.Address) (*BallotStorageImpBallotCreatedIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var ballotTypeRule []interface{} + for _, ballotTypeItem := range ballotType { + ballotTypeRule = append(ballotTypeRule, ballotTypeItem) + } + var creatorRule []interface{} + for _, creatorItem := range creator { + creatorRule = append(creatorRule, creatorItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BallotCreated", ballotIdRule, ballotTypeRule, creatorRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBallotCreatedIterator{contract: _BallotStorageImp.contract, event: "BallotCreated", logs: logs, sub: sub}, nil +} + +// WatchBallotCreated is a free log subscription operation binding the contract event 0xd1ba591c76ef71222e2d30b8277758713cc6eef1de29efaf98a716744ac2420b. +// +// Solidity: event BallotCreated(uint256 indexed ballotId, uint256 indexed ballotType, address indexed creator) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBallotCreated(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBallotCreated, ballotId []*big.Int, ballotType []*big.Int, creator []common.Address) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var ballotTypeRule []interface{} + for _, ballotTypeItem := range ballotType { + ballotTypeRule = append(ballotTypeRule, ballotTypeItem) + } + var creatorRule []interface{} + for _, creatorItem := range creator { + creatorRule = append(creatorRule, creatorItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BallotCreated", ballotIdRule, ballotTypeRule, creatorRule) + 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(BallotStorageImpBallotCreated) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotCreated", 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 +} + +// ParseBallotCreated is a log parse operation binding the contract event 0xd1ba591c76ef71222e2d30b8277758713cc6eef1de29efaf98a716744ac2420b. +// +// Solidity: event BallotCreated(uint256 indexed ballotId, uint256 indexed ballotType, address indexed creator) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBallotCreated(log types.Log) (*BallotStorageImpBallotCreated, error) { + event := new(BallotStorageImpBallotCreated) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotCreated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBallotFinalizedIterator is returned from FilterBallotFinalized and is used to iterate over the raw logs and unpacked data for BallotFinalized events raised by the BallotStorageImp contract. +type BallotStorageImpBallotFinalizedIterator struct { + Event *BallotStorageImpBallotFinalized // 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 *BallotStorageImpBallotFinalizedIterator) 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(BallotStorageImpBallotFinalized) + 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(BallotStorageImpBallotFinalized) + 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 *BallotStorageImpBallotFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBallotFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBallotFinalized represents a BallotFinalized event raised by the BallotStorageImp contract. +type BallotStorageImpBallotFinalized struct { + BallotId *big.Int + State *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBallotFinalized is a free log retrieval operation binding the contract event 0xdc921f027328d7238b58d77649ebcbd0c8b1c494c66ba53dfe53e0de65f6dd9f. +// +// Solidity: event BallotFinalized(uint256 indexed ballotId, uint256 state) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBallotFinalized(opts *bind.FilterOpts, ballotId []*big.Int) (*BallotStorageImpBallotFinalizedIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BallotFinalized", ballotIdRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBallotFinalizedIterator{contract: _BallotStorageImp.contract, event: "BallotFinalized", logs: logs, sub: sub}, nil +} + +// WatchBallotFinalized is a free log subscription operation binding the contract event 0xdc921f027328d7238b58d77649ebcbd0c8b1c494c66ba53dfe53e0de65f6dd9f. +// +// Solidity: event BallotFinalized(uint256 indexed ballotId, uint256 state) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBallotFinalized(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBallotFinalized, ballotId []*big.Int) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BallotFinalized", ballotIdRule) + 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(BallotStorageImpBallotFinalized) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotFinalized", 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 +} + +// ParseBallotFinalized is a log parse operation binding the contract event 0xdc921f027328d7238b58d77649ebcbd0c8b1c494c66ba53dfe53e0de65f6dd9f. +// +// Solidity: event BallotFinalized(uint256 indexed ballotId, uint256 state) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBallotFinalized(log types.Log) (*BallotStorageImpBallotFinalized, error) { + event := new(BallotStorageImpBallotFinalized) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBallotStartedIterator is returned from FilterBallotStarted and is used to iterate over the raw logs and unpacked data for BallotStarted events raised by the BallotStorageImp contract. +type BallotStorageImpBallotStartedIterator struct { + Event *BallotStorageImpBallotStarted // 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 *BallotStorageImpBallotStartedIterator) 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(BallotStorageImpBallotStarted) + 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(BallotStorageImpBallotStarted) + 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 *BallotStorageImpBallotStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBallotStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBallotStarted represents a BallotStarted event raised by the BallotStorageImp contract. +type BallotStorageImpBallotStarted struct { + BallotId *big.Int + StartTime *big.Int + EndTime *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBallotStarted is a free log retrieval operation binding the contract event 0xd9938a514dab5cdce149a77493f694bd70c24a4833a278fd4d86fbdf859099c5. +// +// Solidity: event BallotStarted(uint256 indexed ballotId, uint256 indexed startTime, uint256 indexed endTime) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBallotStarted(opts *bind.FilterOpts, ballotId []*big.Int, startTime []*big.Int, endTime []*big.Int) (*BallotStorageImpBallotStartedIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var startTimeRule []interface{} + for _, startTimeItem := range startTime { + startTimeRule = append(startTimeRule, startTimeItem) + } + var endTimeRule []interface{} + for _, endTimeItem := range endTime { + endTimeRule = append(endTimeRule, endTimeItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BallotStarted", ballotIdRule, startTimeRule, endTimeRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBallotStartedIterator{contract: _BallotStorageImp.contract, event: "BallotStarted", logs: logs, sub: sub}, nil +} + +// WatchBallotStarted is a free log subscription operation binding the contract event 0xd9938a514dab5cdce149a77493f694bd70c24a4833a278fd4d86fbdf859099c5. +// +// Solidity: event BallotStarted(uint256 indexed ballotId, uint256 indexed startTime, uint256 indexed endTime) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBallotStarted(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBallotStarted, ballotId []*big.Int, startTime []*big.Int, endTime []*big.Int) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var startTimeRule []interface{} + for _, startTimeItem := range startTime { + startTimeRule = append(startTimeRule, startTimeItem) + } + var endTimeRule []interface{} + for _, endTimeItem := range endTime { + endTimeRule = append(endTimeRule, endTimeItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BallotStarted", ballotIdRule, startTimeRule, endTimeRule) + 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(BallotStorageImpBallotStarted) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotStarted", 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 +} + +// ParseBallotStarted is a log parse operation binding the contract event 0xd9938a514dab5cdce149a77493f694bd70c24a4833a278fd4d86fbdf859099c5. +// +// Solidity: event BallotStarted(uint256 indexed ballotId, uint256 indexed startTime, uint256 indexed endTime) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBallotStarted(log types.Log) (*BallotStorageImpBallotStarted, error) { + event := new(BallotStorageImpBallotStarted) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBallotUpdatedIterator is returned from FilterBallotUpdated and is used to iterate over the raw logs and unpacked data for BallotUpdated events raised by the BallotStorageImp contract. +type BallotStorageImpBallotUpdatedIterator struct { + Event *BallotStorageImpBallotUpdated // 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 *BallotStorageImpBallotUpdatedIterator) 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(BallotStorageImpBallotUpdated) + 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(BallotStorageImpBallotUpdated) + 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 *BallotStorageImpBallotUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBallotUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBallotUpdated represents a BallotUpdated event raised by the BallotStorageImp contract. +type BallotStorageImpBallotUpdated struct { + BallotId *big.Int + UpdatedBy common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBallotUpdated is a free log retrieval operation binding the contract event 0xf0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a. +// +// Solidity: event BallotUpdated(uint256 indexed ballotId, address indexed updatedBy) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBallotUpdated(opts *bind.FilterOpts, ballotId []*big.Int, updatedBy []common.Address) (*BallotStorageImpBallotUpdatedIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var updatedByRule []interface{} + for _, updatedByItem := range updatedBy { + updatedByRule = append(updatedByRule, updatedByItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BallotUpdated", ballotIdRule, updatedByRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBallotUpdatedIterator{contract: _BallotStorageImp.contract, event: "BallotUpdated", logs: logs, sub: sub}, nil +} + +// WatchBallotUpdated is a free log subscription operation binding the contract event 0xf0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a. +// +// Solidity: event BallotUpdated(uint256 indexed ballotId, address indexed updatedBy) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBallotUpdated(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBallotUpdated, ballotId []*big.Int, updatedBy []common.Address) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var updatedByRule []interface{} + for _, updatedByItem := range updatedBy { + updatedByRule = append(updatedByRule, updatedByItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BallotUpdated", ballotIdRule, updatedByRule) + 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(BallotStorageImpBallotUpdated) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotUpdated", 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 +} + +// ParseBallotUpdated is a log parse operation binding the contract event 0xf0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a. +// +// Solidity: event BallotUpdated(uint256 indexed ballotId, address indexed updatedBy) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBallotUpdated(log types.Log) (*BallotStorageImpBallotUpdated, error) { + event := new(BallotStorageImpBallotUpdated) + if err := _BallotStorageImp.contract.UnpackLog(event, "BallotUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the BallotStorageImp contract. +type BallotStorageImpBeaconUpgradedIterator struct { + Event *BallotStorageImpBeaconUpgraded // 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 *BallotStorageImpBeaconUpgradedIterator) 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(BallotStorageImpBeaconUpgraded) + 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(BallotStorageImpBeaconUpgraded) + 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 *BallotStorageImpBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpBeaconUpgraded represents a BeaconUpgraded event raised by the BallotStorageImp contract. +type BallotStorageImpBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*BallotStorageImpBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &BallotStorageImpBeaconUpgradedIterator{contract: _BallotStorageImp.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *BallotStorageImpBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(BallotStorageImpBeaconUpgraded) + if err := _BallotStorageImp.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseBeaconUpgraded(log types.Log) (*BallotStorageImpBeaconUpgraded, error) { + event := new(BallotStorageImpBeaconUpgraded) + if err := _BallotStorageImp.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the BallotStorageImp contract. +type BallotStorageImpInitializedIterator struct { + Event *BallotStorageImpInitialized // 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 *BallotStorageImpInitializedIterator) 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(BallotStorageImpInitialized) + 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(BallotStorageImpInitialized) + 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 *BallotStorageImpInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpInitialized represents a Initialized event raised by the BallotStorageImp contract. +type BallotStorageImpInitialized 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 (_BallotStorageImp *BallotStorageImpFilterer) FilterInitialized(opts *bind.FilterOpts) (*BallotStorageImpInitializedIterator, error) { + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &BallotStorageImpInitializedIterator{contract: _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BallotStorageImpInitialized) (event.Subscription, error) { + + logs, sub, err := _BallotStorageImp.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(BallotStorageImpInitialized) + if err := _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpFilterer) ParseInitialized(log types.Log) (*BallotStorageImpInitialized, error) { + event := new(BallotStorageImpInitialized) + if err := _BallotStorageImp.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the BallotStorageImp contract. +type BallotStorageImpOwnershipTransferredIterator struct { + Event *BallotStorageImpOwnershipTransferred // 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 *BallotStorageImpOwnershipTransferredIterator) 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(BallotStorageImpOwnershipTransferred) + 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(BallotStorageImpOwnershipTransferred) + 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 *BallotStorageImpOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpOwnershipTransferred represents a OwnershipTransferred event raised by the BallotStorageImp contract. +type BallotStorageImpOwnershipTransferred 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 (_BallotStorageImp *BallotStorageImpFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BallotStorageImpOwnershipTransferredIterator, 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 := _BallotStorageImp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &BallotStorageImpOwnershipTransferredIterator{contract: _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BallotStorageImpOwnershipTransferred, 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 := _BallotStorageImp.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(BallotStorageImpOwnershipTransferred) + if err := _BallotStorageImp.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 (_BallotStorageImp *BallotStorageImpFilterer) ParseOwnershipTransferred(log types.Log) (*BallotStorageImpOwnershipTransferred, error) { + event := new(BallotStorageImpOwnershipTransferred) + if err := _BallotStorageImp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpSetPrevBallotStorageIterator is returned from FilterSetPrevBallotStorage and is used to iterate over the raw logs and unpacked data for SetPrevBallotStorage events raised by the BallotStorageImp contract. +type BallotStorageImpSetPrevBallotStorageIterator struct { + Event *BallotStorageImpSetPrevBallotStorage // 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 *BallotStorageImpSetPrevBallotStorageIterator) 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(BallotStorageImpSetPrevBallotStorage) + 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(BallotStorageImpSetPrevBallotStorage) + 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 *BallotStorageImpSetPrevBallotStorageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpSetPrevBallotStorageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpSetPrevBallotStorage represents a SetPrevBallotStorage event raised by the BallotStorageImp contract. +type BallotStorageImpSetPrevBallotStorage struct { + Previous common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetPrevBallotStorage is a free log retrieval operation binding the contract event 0x3d809312b6e303291a93b307c7ddbd0960c094f5f0fb4e3ba0758775013edeb3. +// +// Solidity: event SetPrevBallotStorage(address indexed previous) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterSetPrevBallotStorage(opts *bind.FilterOpts, previous []common.Address) (*BallotStorageImpSetPrevBallotStorageIterator, error) { + + var previousRule []interface{} + for _, previousItem := range previous { + previousRule = append(previousRule, previousItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "SetPrevBallotStorage", previousRule) + if err != nil { + return nil, err + } + return &BallotStorageImpSetPrevBallotStorageIterator{contract: _BallotStorageImp.contract, event: "SetPrevBallotStorage", logs: logs, sub: sub}, nil +} + +// WatchSetPrevBallotStorage is a free log subscription operation binding the contract event 0x3d809312b6e303291a93b307c7ddbd0960c094f5f0fb4e3ba0758775013edeb3. +// +// Solidity: event SetPrevBallotStorage(address indexed previous) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchSetPrevBallotStorage(opts *bind.WatchOpts, sink chan<- *BallotStorageImpSetPrevBallotStorage, previous []common.Address) (event.Subscription, error) { + + var previousRule []interface{} + for _, previousItem := range previous { + previousRule = append(previousRule, previousItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "SetPrevBallotStorage", previousRule) + 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(BallotStorageImpSetPrevBallotStorage) + if err := _BallotStorageImp.contract.UnpackLog(event, "SetPrevBallotStorage", 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 +} + +// ParseSetPrevBallotStorage is a log parse operation binding the contract event 0x3d809312b6e303291a93b307c7ddbd0960c094f5f0fb4e3ba0758775013edeb3. +// +// Solidity: event SetPrevBallotStorage(address indexed previous) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseSetPrevBallotStorage(log types.Log) (*BallotStorageImpSetPrevBallotStorage, error) { + event := new(BallotStorageImpSetPrevBallotStorage) + if err := _BallotStorageImp.contract.UnpackLog(event, "SetPrevBallotStorage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpSetRegistryIterator is returned from FilterSetRegistry and is used to iterate over the raw logs and unpacked data for SetRegistry events raised by the BallotStorageImp contract. +type BallotStorageImpSetRegistryIterator struct { + Event *BallotStorageImpSetRegistry // 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 *BallotStorageImpSetRegistryIterator) 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(BallotStorageImpSetRegistry) + 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(BallotStorageImpSetRegistry) + 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 *BallotStorageImpSetRegistryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpSetRegistryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpSetRegistry represents a SetRegistry event raised by the BallotStorageImp contract. +type BallotStorageImpSetRegistry struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetRegistry is a free log retrieval operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterSetRegistry(opts *bind.FilterOpts, addr []common.Address) (*BallotStorageImpSetRegistryIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "SetRegistry", addrRule) + if err != nil { + return nil, err + } + return &BallotStorageImpSetRegistryIterator{contract: _BallotStorageImp.contract, event: "SetRegistry", logs: logs, sub: sub}, nil +} + +// WatchSetRegistry is a free log subscription operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchSetRegistry(opts *bind.WatchOpts, sink chan<- *BallotStorageImpSetRegistry, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "SetRegistry", addrRule) + 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(BallotStorageImpSetRegistry) + if err := _BallotStorageImp.contract.UnpackLog(event, "SetRegistry", 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 +} + +// ParseSetRegistry is a log parse operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseSetRegistry(log types.Log) (*BallotStorageImpSetRegistry, error) { + event := new(BallotStorageImpSetRegistry) + if err := _BallotStorageImp.contract.UnpackLog(event, "SetRegistry", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the BallotStorageImp contract. +type BallotStorageImpUpgradedIterator struct { + Event *BallotStorageImpUpgraded // 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 *BallotStorageImpUpgradedIterator) 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(BallotStorageImpUpgraded) + 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(BallotStorageImpUpgraded) + 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 *BallotStorageImpUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpUpgraded represents a Upgraded event raised by the BallotStorageImp contract. +type BallotStorageImpUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*BallotStorageImpUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &BallotStorageImpUpgradedIterator{contract: _BallotStorageImp.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *BallotStorageImpUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(BallotStorageImpUpgraded) + if err := _BallotStorageImp.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseUpgraded(log types.Log) (*BallotStorageImpUpgraded, error) { + event := new(BallotStorageImpUpgraded) + if err := _BallotStorageImp.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BallotStorageImpVotedIterator is returned from FilterVoted and is used to iterate over the raw logs and unpacked data for Voted events raised by the BallotStorageImp contract. +type BallotStorageImpVotedIterator struct { + Event *BallotStorageImpVoted // 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 *BallotStorageImpVotedIterator) 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(BallotStorageImpVoted) + 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(BallotStorageImpVoted) + 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 *BallotStorageImpVotedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BallotStorageImpVotedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BallotStorageImpVoted represents a Voted event raised by the BallotStorageImp contract. +type BallotStorageImpVoted struct { + Voteid *big.Int + BallotId *big.Int + Voter common.Address + Decision *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVoted is a free log retrieval operation binding the contract event 0x41df84b3b467b06744e40c92613c666324e7c640ce0a41ec06efdf602d367606. +// +// Solidity: event Voted(uint256 indexed voteid, uint256 indexed ballotId, address indexed voter, uint256 decision) +func (_BallotStorageImp *BallotStorageImpFilterer) FilterVoted(opts *bind.FilterOpts, voteid []*big.Int, ballotId []*big.Int, voter []common.Address) (*BallotStorageImpVotedIterator, error) { + + var voteidRule []interface{} + for _, voteidItem := range voteid { + voteidRule = append(voteidRule, voteidItem) + } + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _BallotStorageImp.contract.FilterLogs(opts, "Voted", voteidRule, ballotIdRule, voterRule) + if err != nil { + return nil, err + } + return &BallotStorageImpVotedIterator{contract: _BallotStorageImp.contract, event: "Voted", logs: logs, sub: sub}, nil +} + +// WatchVoted is a free log subscription operation binding the contract event 0x41df84b3b467b06744e40c92613c666324e7c640ce0a41ec06efdf602d367606. +// +// Solidity: event Voted(uint256 indexed voteid, uint256 indexed ballotId, address indexed voter, uint256 decision) +func (_BallotStorageImp *BallotStorageImpFilterer) WatchVoted(opts *bind.WatchOpts, sink chan<- *BallotStorageImpVoted, voteid []*big.Int, ballotId []*big.Int, voter []common.Address) (event.Subscription, error) { + + var voteidRule []interface{} + for _, voteidItem := range voteid { + voteidRule = append(voteidRule, voteidItem) + } + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _BallotStorageImp.contract.WatchLogs(opts, "Voted", voteidRule, ballotIdRule, voterRule) + 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(BallotStorageImpVoted) + if err := _BallotStorageImp.contract.UnpackLog(event, "Voted", 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 +} + +// ParseVoted is a log parse operation binding the contract event 0x41df84b3b467b06744e40c92613c666324e7c640ce0a41ec06efdf602d367606. +// +// Solidity: event Voted(uint256 indexed voteid, uint256 indexed ballotId, address indexed voter, uint256 decision) +func (_BallotStorageImp *BallotStorageImpFilterer) ParseVoted(log types.Log) (*BallotStorageImpVoted, error) { + event := new(BallotStorageImpVoted) + if err := _BallotStorageImp.contract.UnpackLog(event, "Voted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/gen_envStorage_abi.go b/wemix/bind/gen_envStorage_abi.go new file mode 100644 index 000000000000..ffe5665b1e2d --- /dev/null +++ b/wemix/bind/gen_envStorage_abi.go @@ -0,0 +1,5443 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// EnvStorageMetaData contains all meta data concerning the EnvStorage contract. +var EnvStorageMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_implementation\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "5c60da1b": "implementation()", + }, + Bin: "0x608060405234801561001057600080fd5b5060405161077238038061077283398101604081905261002f91610326565b604080516020810190915260008152819061006b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61034f565b60008051602061072b8339815191521461008757610087610374565b6100938282600061009b565b505050610405565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b61008b1760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610136838360405180606001604052806027815260200161074b602791396101fd565b9392505050565b610150816102db60201b6100b71760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061072b83398151915260001b6102ea60201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161028091906103b6565b600060405180830381855af49150503d80600081146102bb576040519150601f19603f3d011682016040523d82523d6000602084013e6102c0565b606091505b5090925090506102d18282866102ed565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102fc575081610136565b82511561030c5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103d2565b60006020828403121561033857600080fd5b81516001600160a01b038116811461013657600080fd5b60008282101561036f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156103a557818101518382015260200161038d565b838111156100ca5750506000910152565b600082516103c881846020870161038a565b9190910192915050565b60208152600082518060208401526103f181604085016020870161038a565b601f01601f19169190910160400192915050565b610317806104146000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102bb60279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b60606001600160a01b0384163b61018d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a8919061026b565b600060405180830381855af49150503d80600081146101e3576040519150601f19603f3d011682016040523d82523d6000602084013e6101e8565b606091505b50915091506101f8828286610202565b9695505050505050565b606083156102115750816100b0565b8251156102215782518084602001fd5b8160405162461bcd60e51b81526004016101849190610287565b60005b8381101561025657818101518382015260200161023e565b83811115610265576000848401525b50505050565b6000825161027d81846020870161023b565b9190910192915050565b60208152600082518060208401526102a681604085016020870161023b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122073a93b04f755a8d9dc8a21cd7ced80e99dae623e3f5317cf75e12209357071a664736f6c634300080e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", +} + +// EnvStorageABI is the input ABI used to generate the binding from. +// Deprecated: Use EnvStorageMetaData.ABI instead. +var EnvStorageABI = EnvStorageMetaData.ABI + +// Deprecated: Use EnvStorageMetaData.Sigs instead. +// EnvStorageFuncSigs maps the 4-byte function signature to its string representation. +var EnvStorageFuncSigs = EnvStorageMetaData.Sigs + +// EnvStorageBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EnvStorageMetaData.Bin instead. +var EnvStorageBin = EnvStorageMetaData.Bin + +// DeployEnvStorage deploys a new Ethereum contract, binding an instance of EnvStorage to it. +func DeployEnvStorage(auth *bind.TransactOpts, backend bind.ContractBackend, _implementation common.Address) (common.Address, *types.Transaction, *EnvStorage, error) { + parsed, err := EnvStorageMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EnvStorageBin), backend, _implementation) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EnvStorage{EnvStorageCaller: EnvStorageCaller{contract: contract}, EnvStorageTransactor: EnvStorageTransactor{contract: contract}, EnvStorageFilterer: EnvStorageFilterer{contract: contract}}, nil +} + +// EnvStorage is an auto generated Go binding around an Ethereum contract. +type EnvStorage struct { + EnvStorageCaller // Read-only binding to the contract + EnvStorageTransactor // Write-only binding to the contract + EnvStorageFilterer // Log filterer for contract events +} + +// EnvStorageCaller is an auto generated read-only Go binding around an Ethereum contract. +type EnvStorageCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EnvStorageTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EnvStorageFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EnvStorageSession struct { + Contract *EnvStorage // 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 +} + +// EnvStorageCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EnvStorageCallerSession struct { + Contract *EnvStorageCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EnvStorageTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EnvStorageTransactorSession struct { + Contract *EnvStorageTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EnvStorageRaw is an auto generated low-level Go binding around an Ethereum contract. +type EnvStorageRaw struct { + Contract *EnvStorage // Generic contract binding to access the raw methods on +} + +// EnvStorageCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EnvStorageCallerRaw struct { + Contract *EnvStorageCaller // Generic read-only contract binding to access the raw methods on +} + +// EnvStorageTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EnvStorageTransactorRaw struct { + Contract *EnvStorageTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEnvStorage creates a new instance of EnvStorage, bound to a specific deployed contract. +func NewEnvStorage(address common.Address, backend bind.ContractBackend) (*EnvStorage, error) { + contract, err := bindEnvStorage(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EnvStorage{EnvStorageCaller: EnvStorageCaller{contract: contract}, EnvStorageTransactor: EnvStorageTransactor{contract: contract}, EnvStorageFilterer: EnvStorageFilterer{contract: contract}}, nil +} + +// NewEnvStorageCaller creates a new read-only instance of EnvStorage, bound to a specific deployed contract. +func NewEnvStorageCaller(address common.Address, caller bind.ContractCaller) (*EnvStorageCaller, error) { + contract, err := bindEnvStorage(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EnvStorageCaller{contract: contract}, nil +} + +// NewEnvStorageTransactor creates a new write-only instance of EnvStorage, bound to a specific deployed contract. +func NewEnvStorageTransactor(address common.Address, transactor bind.ContractTransactor) (*EnvStorageTransactor, error) { + contract, err := bindEnvStorage(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EnvStorageTransactor{contract: contract}, nil +} + +// NewEnvStorageFilterer creates a new log filterer instance of EnvStorage, bound to a specific deployed contract. +func NewEnvStorageFilterer(address common.Address, filterer bind.ContractFilterer) (*EnvStorageFilterer, error) { + contract, err := bindEnvStorage(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EnvStorageFilterer{contract: contract}, nil +} + +// bindEnvStorage binds a generic wrapper to an already deployed contract. +func bindEnvStorage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(EnvStorageABI)) + 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 (_EnvStorage *EnvStorageRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EnvStorage.Contract.EnvStorageCaller.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 (_EnvStorage *EnvStorageRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorage.Contract.EnvStorageTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EnvStorage *EnvStorageRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EnvStorage.Contract.EnvStorageTransactor.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 (_EnvStorage *EnvStorageCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EnvStorage.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 (_EnvStorage *EnvStorageTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorage.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EnvStorage *EnvStorageTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EnvStorage.Contract.contract.Transact(opts, method, params...) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_EnvStorage *EnvStorageCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EnvStorage.contract.Call(opts, &out, "implementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_EnvStorage *EnvStorageSession) Implementation() (common.Address, error) { + return _EnvStorage.Contract.Implementation(&_EnvStorage.CallOpts) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_EnvStorage *EnvStorageCallerSession) Implementation() (common.Address, error) { + return _EnvStorage.Contract.Implementation(&_EnvStorage.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_EnvStorage *EnvStorageTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _EnvStorage.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_EnvStorage *EnvStorageSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _EnvStorage.Contract.Fallback(&_EnvStorage.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_EnvStorage *EnvStorageTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _EnvStorage.Contract.Fallback(&_EnvStorage.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EnvStorage *EnvStorageTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorage.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EnvStorage *EnvStorageSession) Receive() (*types.Transaction, error) { + return _EnvStorage.Contract.Receive(&_EnvStorage.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_EnvStorage *EnvStorageTransactorSession) Receive() (*types.Transaction, error) { + return _EnvStorage.Contract.Receive(&_EnvStorage.TransactOpts) +} + +// EnvStorageAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the EnvStorage contract. +type EnvStorageAdminChangedIterator struct { + Event *EnvStorageAdminChanged // 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 *EnvStorageAdminChangedIterator) 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(EnvStorageAdminChanged) + 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(EnvStorageAdminChanged) + 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 *EnvStorageAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageAdminChanged represents a AdminChanged event raised by the EnvStorage contract. +type EnvStorageAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorage *EnvStorageFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*EnvStorageAdminChangedIterator, error) { + + logs, sub, err := _EnvStorage.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &EnvStorageAdminChangedIterator{contract: _EnvStorage.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorage *EnvStorageFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageAdminChanged) (event.Subscription, error) { + + logs, sub, err := _EnvStorage.contract.WatchLogs(opts, "AdminChanged") + 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(EnvStorageAdminChanged) + if err := _EnvStorage.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorage *EnvStorageFilterer) ParseAdminChanged(log types.Log) (*EnvStorageAdminChanged, error) { + event := new(EnvStorageAdminChanged) + if err := _EnvStorage.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the EnvStorage contract. +type EnvStorageBeaconUpgradedIterator struct { + Event *EnvStorageBeaconUpgraded // 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 *EnvStorageBeaconUpgradedIterator) 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(EnvStorageBeaconUpgraded) + 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(EnvStorageBeaconUpgraded) + 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 *EnvStorageBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageBeaconUpgraded represents a BeaconUpgraded event raised by the EnvStorage contract. +type EnvStorageBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorage *EnvStorageFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*EnvStorageBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _EnvStorage.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &EnvStorageBeaconUpgradedIterator{contract: _EnvStorage.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorage *EnvStorageFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *EnvStorageBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _EnvStorage.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(EnvStorageBeaconUpgraded) + if err := _EnvStorage.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorage *EnvStorageFilterer) ParseBeaconUpgraded(log types.Log) (*EnvStorageBeaconUpgraded, error) { + event := new(EnvStorageBeaconUpgraded) + if err := _EnvStorage.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the EnvStorage contract. +type EnvStorageUpgradedIterator struct { + Event *EnvStorageUpgraded // 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 *EnvStorageUpgradedIterator) 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(EnvStorageUpgraded) + 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(EnvStorageUpgraded) + 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 *EnvStorageUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageUpgraded represents a Upgraded event raised by the EnvStorage contract. +type EnvStorageUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorage *EnvStorageFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*EnvStorageUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorage.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &EnvStorageUpgradedIterator{contract: _EnvStorage.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorage *EnvStorageFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *EnvStorageUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorage.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(EnvStorageUpgraded) + if err := _EnvStorage.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorage *EnvStorageFilterer) ParseUpgraded(log types.Log) (*EnvStorageUpgraded, error) { + event := new(EnvStorageUpgraded) + if err := _EnvStorage.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpMetaData contains all meta data concerning the EnvStorageImp contract. +var EnvStorageImpMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_value\",\"type\":\"address\"}],\"name\":\"AddressVarableChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_value\",\"type\":\"bytes32\"}],\"name\":\"Bytes32VarableChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"BytesVarableChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"_value\",\"type\":\"int256\"}],\"name\":\"IntVarableChanged\",\"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\":\"addr\",\"type\":\"address\"}],\"name\":\"SetRegistry\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_value\",\"type\":\"string\"}],\"name\":\"StringVarableChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"UintVarableChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"UpgradeImplementation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"_value\",\"type\":\"string\"}],\"name\":\"VarableChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MIN_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MIN_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_RATE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_CREATION_TIME_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_GASLIMIT_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_AMOUNT_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_METHOD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DENOMINATOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ENV_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GASLIMIT_AND_BASE_FEE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GAS_TARGET_PERCENTAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_BASE_FEE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_IDLE_BLOCK_INTERVAL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_PRIORITY_FEE_PER_GAS_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_POOL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MIN_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MIN_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"envKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"envVal\",\"type\":\"bytes\"}],\"name\":\"checkVariableCondition\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBallotDurationMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBallotDurationMin\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBallotDurationMinMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockCreationTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockRewardAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockRewardDistributionMethod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlocksPer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getBoolean\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getBytes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getBytes32\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasLimitAndBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getInt\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxBaseFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxIdleBlockInterval\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxPriorityFeePerGas\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakingMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakingMin\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakingMinMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getString\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"h\",\"type\":\"bytes32\"}],\"name\":\"getUint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_registry\",\"type\":\"address\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256[]\",\"name\":\"infos\",\"type\":\"uint256[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reg\",\"outputs\":[{\"internalType\":\"contractIRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setBallotDurationMax\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBallotDurationMaxByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setBallotDurationMin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBallotDurationMinByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_max\",\"type\":\"uint256\"}],\"name\":\"setBallotDurationMinMax\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBallotDurationMinMaxByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setBlockCreationTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBlockCreationTimeByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setBlockRewardAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBlockRewardAmountByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block_producer\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_staking_reward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ecofund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maintenance\",\"type\":\"uint256\"}],\"name\":\"setBlockRewardDistributionMethod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBlockRewardDistributionMethodByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setBlocksPer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setBlocksPerByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_block_GasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_baseFeeMaxChangeRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_gasTargetPercentage\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxBaseFee\",\"type\":\"uint256\"}],\"name\":\"setGasLimitAndBaseFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setGasLimitAndBaseFeeByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setMaxBaseFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setMaxBaseFeeByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setMaxIdleBlockInterval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setMaxIdleBlockIntervalByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setMaxPriorityFeePerGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setMaxPriorityFeePerGasByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setStakingMax\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setStakingMaxByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"setStakingMin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setStakingMinByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_max\",\"type\":\"uint256\"}],\"name\":\"setStakingMinMax\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_value\",\"type\":\"bytes\"}],\"name\":\"setStakingMinMaxByBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"envKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"envVal\",\"type\":\"bytes\"}],\"name\":\"setVariable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + Sigs: map[string]string{ + "0015a73b": "BALLOT_DURATION_MAX_NAME()", + "656e3052": "BALLOT_DURATION_MIN_MAX_NAME()", + "6d583ca7": "BALLOT_DURATION_MIN_NAME()", + "9986e4b9": "BALLOT_STORAGE_NAME()", + "c42a0abc": "BASE_FEE_MAX_CHANGE_RATE_NAME()", + "3f35c8fe": "BLOCKS_PER_NAME()", + "c0b4fe15": "BLOCK_CREATION_TIME_NAME()", + "238737b6": "BLOCK_GASLIMIT_NAME()", + "a9b629b2": "BLOCK_REWARD_AMOUNT_NAME()", + "c6713baf": "BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME()", + "7b2bfb01": "BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME()", + "46946416": "BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME()", + "278bb12a": "BLOCK_REWARD_DISTRIBUTION_METHOD_NAME()", + "6167eb45": "BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME()", + "918f8674": "DENOMINATOR()", + "34125c84": "ECOSYSTEM_NAME()", + "7bf46530": "ENV_STORAGE_NAME()", + "c7d3da34": "GASLIMIT_AND_BASE_FEE_NAME()", + "4d273e28": "GAS_TARGET_PERCENTAGE_NAME()", + "6c78d2cf": "GOV_NAME()", + "4bd1ed76": "MAINTENANCE_NAME()", + "f38ecf47": "MAX_BASE_FEE_NAME()", + "b128f880": "MAX_IDLE_BLOCK_INTERVAL_NAME()", + "38294419": "MAX_PRIORITY_FEE_PER_GAS_NAME()", + "2f40992e": "REWARD_POOL_NAME()", + "c00ace6c": "STAKING_MAX_NAME()", + "a6868b7d": "STAKING_MIN_MAX_NAME()", + "6fde207a": "STAKING_MIN_NAME()", + "1e0cba0d": "STAKING_NAME()", + "5a731cca": "STAKING_REWARD_NAME()", + "9801bff9": "checkVariableCondition(bytes32,bytes)", + "21f8a721": "getAddress(bytes32)", + "1b27e01b": "getBallotDurationMax()", + "33be496e": "getBallotDurationMin()", + "cdb9f643": "getBallotDurationMinMax()", + "33e31184": "getBlockCreationTime()", + "5dba8c4a": "getBlockRewardAmount()", + "8f6fe725": "getBlockRewardDistributionMethod()", + "3690057a": "getBlocksPer()", + "3848207a": "getBoolean(bytes32)", + "c031a180": "getBytes(bytes32)", + "a6ed563e": "getBytes32(bytes32)", + "67d1a2e0": "getGasLimitAndBaseFee()", + "dc97d962": "getInt(bytes32)", + "c95437be": "getMaxBaseFee()", + "185582f1": "getMaxIdleBlockInterval()", + "2b2eaa92": "getMaxPriorityFeePerGas()", + "737c59b8": "getStakingMax()", + "076cd77f": "getStakingMin()", + "aba01fee": "getStakingMinMax()", + "986e791a": "getString(bytes32)", + "bd02d0f5": "getUint(bytes32)", + "539927be": "initialize(address,bytes32[],uint256[])", + "8da5cb5b": "owner()", + "52d1902d": "proxiableUUID()", + "738fdd1a": "reg()", + "715018a6": "renounceOwnership()", + "852cf38f": "setBallotDurationMax(uint256)", + "a5d6a581": "setBallotDurationMaxByBytes(bytes)", + "a36f259b": "setBallotDurationMin(uint256)", + "124cea37": "setBallotDurationMinByBytes(bytes)", + "b4d6bd3b": "setBallotDurationMinMax(uint256,uint256)", + "45b5ec29": "setBallotDurationMinMaxByBytes(bytes)", + "3305508e": "setBlockCreationTime(uint256)", + "44b89914": "setBlockCreationTimeByBytes(bytes)", + "2ed19cd5": "setBlockRewardAmount(uint256)", + "3d4c65f3": "setBlockRewardAmountByBytes(bytes)", + "0add66dd": "setBlockRewardDistributionMethod(uint256,uint256,uint256,uint256)", + "8c8b887e": "setBlockRewardDistributionMethodByBytes(bytes)", + "79e85859": "setBlocksPer(uint256)", + "3e8daafe": "setBlocksPerByBytes(bytes)", + "0fca11d2": "setGasLimitAndBaseFee(uint256,uint256,uint256,uint256)", + "be33732a": "setGasLimitAndBaseFeeByBytes(bytes)", + "6fe13177": "setMaxBaseFee(uint256)", + "408d79cf": "setMaxBaseFeeByBytes(bytes)", + "f6fd7129": "setMaxIdleBlockInterval(uint256)", + "0b90a39a": "setMaxIdleBlockIntervalByBytes(bytes)", + "ec3df879": "setMaxPriorityFeePerGas(uint256)", + "0fc238bf": "setMaxPriorityFeePerGasByBytes(bytes)", + "a91ee0dc": "setRegistry(address)", + "f8214591": "setStakingMax(uint256)", + "2eccd832": "setStakingMaxByBytes(bytes)", + "2eb57c65": "setStakingMin(uint256)", + "71c6960d": "setStakingMinByBytes(bytes)", + "8d5cdd7e": "setStakingMinMax(uint256,uint256)", + "e078869f": "setStakingMinMaxByBytes(bytes)", + "88c28019": "setVariable(bytes32,bytes)", + "f2fde38b": "transferOwnership(address)", + "3659cfe6": "upgradeTo(address)", + "4f1ef286": "upgradeToAndCall(address,bytes)", + }, + Bin: "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b603854610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60385460ff9081161015620000e6576038805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805161366f6200011260003960008181611a1e01528181611aa30152611b7b015261366f6000f3fe6080604052600436106104e05760003560e01c80636fde207a11610281578063a6ed563e1161015a578063c42a0abc116100cc578063e078869f11610085578063e078869f146113d0578063ec3df879146113f0578063f2fde38b14611410578063f38ecf4714611430578063f6fd712914611452578063f82145911461147257600080fd5b8063c42a0abc146112a7578063c6713baf146112db578063c7d3da341461130f578063c95437be14611343578063cdb9f6431461138e578063dc97d962146113a357600080fd5b8063b4d6bd3b1161011e578063b4d6bd3b146111d6578063bd02d0f5146111f6578063be33732a14611223578063c00ace6c14611243578063c031a18014611265578063c0b4fe151461128557600080fd5b8063a6ed563e1461111b578063a91ee0dc14611148578063a9b629b214611168578063aba01fee1461118a578063b128f880146111b457600080fd5b80638c8b887e116101f35780639801bff9116101b75780639801bff914611036578063986e791a146110565780639986e4b914611083578063a36f259b146110a7578063a5d6a581146110c7578063a6868b7d146110e757600080fd5b80638c8b887e14610ee45780638d5cdd7e14610f045780638da5cb5b14610f245780638f6fe72514610f42578063918f86741461102057600080fd5b8063738fdd1a11610245578063738fdd1a14610e0f57806379e8585914610e2f5780637b2bfb0114610e4f5780637bf4653014610e83578063852cf38f14610ea457806388c2801914610ec457600080fd5b80636fde207a14610d4d5780636fe1317714610d6f578063715018a614610d8f57806371c6960d14610da4578063737c59b814610dc457600080fd5b80633659cfe6116103be5780634bd1ed76116103305780635dba8c4a116102e95780635dba8c4a14610b985780636167eb4514610be3578063656e305214610c1757806367d1a2e014610c4b5780636c78d2cf14610d025780636d583ca714610d2b57600080fd5b80634bd1ed7614610ad65780634d273e2814610af85780634f1ef28614610b2c57806352d1902d14610b3f578063539927be14610b545780635a731cca14610b7457600080fd5b80633e8daafe116103825780633e8daafe14610a005780633f35c8fe14610a20578063408d79cf14610a4257806344b8991414610a6257806345b5ec2914610a825780634694641614610aa257600080fd5b80633659cfe6146109135780633690057a14610933578063382944191461097e5780633848207a146109a05780633d4c65f3146109e057600080fd5b8063238737b6116104575780632ed19cd51161041b5780632ed19cd5146107fc5780632f40992e1461081c5780633305508e1461083d57806333be496e1461085d57806333e31184146108a857806334125c84146108f357600080fd5b8063238737b614610709578063278bb12a1461073d5780632b2eaa92146107715780632eb57c65146107bc5780632eccd832146107dc57600080fd5b80630fca11d2116104a95780630fca11d2146105c7578063124cea37146105e7578063185582f1146106075780631b27e01b146106525780631e0cba0d1461069d57806321f8a721146106bb57600080fd5b806215a73b146104e5578063076cd77f1461051a5780630add66dd146105655780630b90a39a146105875780630fc238bf146105a7575b600080fd5b3480156104f157600080fd5b5061050760008051602061351383398151915281565b6040519081526020015b60405180910390f35b34801561052657600080fd5b5060008051602061357383398151915260005260026020527fd7a437163435b79030132855d9146a10e26570f1767311219983e0c430cfa69054610507565b34801561057157600080fd5b50610585610580366004612f22565b611497565b005b34801561059357600080fd5b506105856105a236600461300b565b6115ed565b3480156105b357600080fd5b506105856105c236600461300b565b61162d565b3480156105d357600080fd5b506105856105e2366004612f22565b61166a565b3480156105f357600080fd5b5061058561060236600461300b565b61172f565b34801561061357600080fd5b506000805160206134d383398151915260005260026020527fbc779bbce8d4fef90926dc39b56d9135e8e3795964b3adae769767961d4a94d854610507565b34801561065e57600080fd5b5060008051602061351383398151915260005260026020527f5a1993193b8890c75d83157b2c2c12b144545357ab60021d7429856434de051b54610507565b3480156106a957600080fd5b50610507665374616b696e6760c81b81565b3480156106c757600080fd5b506106f16106d6366004613048565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610511565b34801561071557600080fd5b506105077f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27881565b34801561074957600080fd5b506105077f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2281565b34801561077d57600080fd5b5060008051602061355383398151915260005260026020527f270fb31b28afd06ad35288bc3cb901686a4c5a15239e966fd9b64269abd226c354610507565b3480156107c857600080fd5b506105856107d7366004613048565b61176c565b3480156107e857600080fd5b506105856107f736600461300b565b6117b3565b34801561080857600080fd5b50610585610817366004613048565b6117f0565b34801561082857600080fd5b506105076914995dd85c99141bdbdb60b21b81565b34801561084957600080fd5b50610585610858366004613048565b611837565b34801561086957600080fd5b506000805160206135fa83398151915260005260026020527f8e8c0bef3b4557d74ba01e0433728c574990153e35cacae69cb26f23a8a4017554610507565b3480156108b457600080fd5b506000805160206134f383398151915260005260026020527ff3497fe1496bfc19eaef6d253f75ec2e9cfe1b4f6080c29192641567c6fc5d8754610507565b3480156108ff57600080fd5b506105076845636f73797374656d60b81b81565b34801561091f57600080fd5b5061058561092e366004613076565b61187e565b34801561093f57600080fd5b506000805160206135da83398151915260005260026020527f14e650c949c7cc3fca2efe79b3711fc734b4df488cc27c4137f35bd0adaae7fa54610507565b34801561098a57600080fd5b5061050760008051602061355383398151915281565b3480156109ac57600080fd5b506109d06109bb366004613048565b60009081526020819052604090205460ff1690565b6040519015158152602001610511565b3480156109ec57600080fd5b506105856109fb36600461300b565b6118d8565b348015610a0c57600080fd5b50610585610a1b36600461300b565b611915565b348015610a2c57600080fd5b506105076000805160206135da83398151915281565b348015610a4e57600080fd5b50610585610a5d36600461300b565b611952565b348015610a6e57600080fd5b50610585610a7d36600461300b565b61198f565b348015610a8e57600080fd5b50610585610a9d36600461300b565b6119cc565b348015610aae57600080fd5b506105077fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d81565b348015610ae257600080fd5b506105076a4d61696e74656e616e636560a81b81565b348015610b0457600080fd5b506105077f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088881565b610585610b3a366004613093565b611a14565b348015610b4b57600080fd5b50610507611b6e565b348015610b6057600080fd5b50610585610b6f366004613172565b611c21565b348015610b8057600080fd5b506105076c14dd185ada5b99d4995dd85c99609a1b81565b348015610ba457600080fd5b5060008051602061353383398151915260005260026020527f38eb620cc1355554391bc9d0c224a726d66edf7c3eb2d67af166d6e81fe4456254610507565b348015610bef57600080fd5b506105077f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505081565b348015610c2357600080fd5b506105077fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e781565b348015610c5757600080fd5b5060026020527fc77500645c8acbf6137a0e04460f85359483e3b08db30285cca2957db0c90904547fca55256fa8d248a334a7cb4ca72d9aec97700e81b3784b43c388b9a8d0e2b8e3547f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df08886000527fba5524e01c8da4a46e6f70a8f29f4dc63d299ad01d2f01ccae9666cb85f6f7c05460408051938452602084019290925290820152606001610511565b348015610d0e57600080fd5b506105077111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b348015610d3757600080fd5b506105076000805160206135fa83398151915281565b348015610d5957600080fd5b5061050760008051602061357383398151915281565b348015610d7b57600080fd5b50610585610d8a366004613048565b611eca565b348015610d9b57600080fd5b50610585611f11565b348015610db057600080fd5b50610585610dbf36600461300b565b611f25565b348015610dd057600080fd5b506000805160206134b383398151915260005260026020527f673c817b54d53459fa437d6b11ba6445e517d8dc789e6b815675ff10e6aeeb5d54610507565b348015610e1b57600080fd5b50609d546106f1906001600160a01b031681565b348015610e3b57600080fd5b50610585610e4a366004613048565b611f62565b348015610e5b57600080fd5b506105077f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa81565b348015610e8f57600080fd5b5061050769456e7653746f7261676560b01b81565b348015610eb057600080fd5b50610585610ebf366004613048565b611fa9565b348015610ed057600080fd5b50610585610edf36600461323f565b611ff0565b348015610ef057600080fd5b50610585610eff36600461300b565b612164565b348015610f1057600080fd5b50610585610f1f366004613270565b6121ba565b348015610f3057600080fd5b50606b546001600160a01b03166106f1565b348015610f4e57600080fd5b5060026020527fe6679752544e0074a1c9bec26775117fd40d133ce43cc443fb5f2512ebd7c2af547f89fc1b873e9ef0767cf41719c69200c3f894c43d73c49eb537ca60ec0a2d14bc547fa04c555f883d07b5c5fe85061c632b6bfec696b67afa8ad5e9773b89249984b2547fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d6000527f286a480438fb7eb9f5465ec436e6de865b71284ceb2be7ff1cea98f38c26308254604080519485526020850193909352918301526060820152608001610511565b34801561102c57600080fd5b5061050761271081565b34801561104257600080fd5b506109d061105136600461323f565b61228f565b34801561106257600080fd5b50611076611071366004613048565b6123ee565b60405161051191906132ea565b34801561108f57600080fd5b506105076c42616c6c6f7453746f7261676560981b81565b3480156110b357600080fd5b506105856110c2366004613048565b612490565b3480156110d357600080fd5b506105856110e236600461300b565b6124d7565b3480156110f357600080fd5b506105077f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b81565b34801561112757600080fd5b50610507611136366004613048565b60009081526006602052604090205490565b34801561115457600080fd5b50610585611163366004613076565b612514565b34801561117457600080fd5b5061050760008051602061353383398151915281565b34801561119657600080fd5b5061119f6125bc565b60408051928352602083019190915201610511565b3480156111c057600080fd5b506105076000805160206134d383398151915281565b3480156111e257600080fd5b506105856111f1366004613270565b612626565b34801561120257600080fd5b50610507611211366004613048565b60009081526002602052604090205490565b34801561122f57600080fd5b5061058561123e36600461300b565b6126fd565b34801561124f57600080fd5b506105076000805160206134b383398151915281565b34801561127157600080fd5b50611076611280366004613048565b61274c565b34801561129157600080fd5b506105076000805160206134f383398151915281565b3480156112b357600080fd5b506105077fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747381565b3480156112e757600080fd5b506105077fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6081565b34801561131b57600080fd5b506105077f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc81565b34801561134f57600080fd5b5060008051602061361a83398151915260005260026020527f38ddebd16170f2328156b72e009b30efe6e74a1b9fc4389d05f50efa2a42c6f854610507565b34801561139a57600080fd5b5061119f612769565b3480156113af57600080fd5b506105076113be366004613048565b60009081526001602052604090205490565b3480156113dc57600080fd5b506105856113eb36600461300b565b6127cf565b3480156113fc57600080fd5b5061058561140b366004613048565b612812565b34801561141c57600080fd5b5061058561142b366004613076565b612859565b34801561143c57600080fd5b5061050760008051602061361a83398151915281565b34801561145e57600080fd5b5061058561146d366004613048565b6128cf565b34801561147e57600080fd5b5061058561148d366004613048565b612916565b905090565b336114a061295d565b6001600160a01b0316146114cf5760405162461bcd60e51b81526004016114c6906132fd565b60405180910390fd5b61271081836114de868861333a565b6114e8919061333a565b6114f2919061333a565b1461153f5760405162461bcd60e51b815260206004820152601e60248201527f57726f6e6720726577617264206469737472756274696f6e20726174696f000060448201526064016114c6565b6115697fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f608561297d565b6115937f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f50508461297d565b6115bd7f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa8361297d565b6115e77fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d8261297d565b50505050565b336115f661295d565b6001600160a01b03161461161c5760405162461bcd60e51b81526004016114c6906132fd565b61162a61146d826020015190565b50565b3361163661295d565b6001600160a01b03161461165c5760405162461bcd60e51b81526004016114c6906132fd565b61162a61140b826020015190565b3361167361295d565b6001600160a01b0316146116995760405162461bcd60e51b81526004016114c6906132fd565b6116c37f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a2788561297d565b6116ed7fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c6574738461297d565b6117177f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df08888361297d565b6115e760008051602061361a8339815191528261297d565b3361173861295d565b6001600160a01b03161461175e5760405162461bcd60e51b81526004016114c6906132fd565b61162a6110c2826020015190565b3361177561295d565b6001600160a01b03161461179b5760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135738339815191528261297d565b336117bc61295d565b6001600160a01b0316146117e25760405162461bcd60e51b81526004016114c6906132fd565b61162a61148d826020015190565b336117f961295d565b6001600160a01b03161461181f5760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135338339815191528261297d565b3361184061295d565b6001600160a01b0316146118665760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206134f38339815191528261297d565b6118866129cc565b6118a181604051806020016040528060008152506000612a26565b6040516001600160a01b038216907f2a74bbaf99cf25202925743012bb137262ab3432c821e1ba94ddbecac2ea970890600090a250565b336118e161295d565b6001600160a01b0316146119075760405162461bcd60e51b81526004016114c6906132fd565b61162a610817826020015190565b3361191e61295d565b6001600160a01b0316146119445760405162461bcd60e51b81526004016114c6906132fd565b61162a610e4a826020015190565b3361195b61295d565b6001600160a01b0316146119815760405162461bcd60e51b81526004016114c6906132fd565b61162a610d8a826020015190565b3361199861295d565b6001600160a01b0316146119be5760405162461bcd60e51b81526004016114c6906132fd565b61162a610858826020015190565b336119d561295d565b6001600160a01b0316146119fb5760405162461bcd60e51b81526004016114c6906132fd565b60208101516040820151611a0f8282612626565b505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611aa15760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b60648201526084016114c6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611aea600080516020613593833981519152546001600160a01b031690565b6001600160a01b031614611b555760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b60648201526084016114c6565b611b5e82612b91565b611b6a82826001612a26565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611c0e5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016114c6565b5060008051602061359383398151915290565b603854610100900460ff1615808015611c415750603854600160ff909116105b80611c5b5750303b158015611c5b575060385460ff166001145b611cbe5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016114c6565b6038805460ff191660011790558015611ce1576038805461ff0019166101001790555b600080516020613593833981519152546001600160a01b03166001600160a01b0316846001600160a01b031603611d705760405162461bcd60e51b815260206004820152602d60248201527f72656769737472792073686f756c64206e6f742062652073616d65206173206960448201526c36b83632b6b2b73a30ba34b7b760991b60648201526084016114c6565b611d78612bc0565b611d8184612514565b60005b8251811015611e7e576000611dbe858381518110611da457611da4613352565b602002602001015160009081526002602052604090205490565b9050838281518110611dd257611dd2613352565b60200260200101516000141580611de857508015155b611e275760405162461bcd60e51b815260206004820152601060248201526f696e76616c6964207661726961626c6560801b60448201526064016114c6565b80600003611e6b57611e6b858381518110611e4457611e44613352565b6020026020010151858481518110611e5e57611e5e613352565b602002602001015161297d565b5080611e7681613368565b915050611d84565b5080156115e7576038805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b33611ed361295d565b6001600160a01b031614611ef95760405162461bcd60e51b81526004016114c6906132fd565b61162a60008051602061361a8339815191528261297d565b611f196129cc565b611f236000612bef565b565b33611f2e61295d565b6001600160a01b031614611f545760405162461bcd60e51b81526004016114c6906132fd565b61162a6107d7826020015190565b33611f6b61295d565b6001600160a01b031614611f915760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135da8339815191528261297d565b33611fb261295d565b6001600160a01b031614611fd85760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135138339815191528261297d565b6000805160206135da833981519152820361200e57611b6a81611915565b7fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e7820361203e57611b6a816119cc565b7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b820361206e57611b6a816127cf565b6000805160206134d3833981519152820361208c57611b6a816115ed565b6000805160206134f383398151915282036120aa57611b6a8161198f565b60008051602061353383398151915282036120c857611b6a816118d8565b60008051602061355383398151915282036120e657611b6a8161162d565b7f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a22820361211657611b6a81612164565b7f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc820361214657611b6a816126fd565b60008051602061361a8339815191528203611b6a57611b6a81611952565b3361216d61295d565b6001600160a01b0316146121935760405162461bcd60e51b81526004016114c6906132fd565b60208101516040820151606083015160808401516121b384848484611497565b5050505050565b336121c361295d565b6001600160a01b0316146121e95760405162461bcd60e51b81526004016114c6906132fd565b8082111561225f5760405162461bcd60e51b815260206004820152603e60248201527f4d696e696d756d207374616b696e67206d75737420626520736d616c6c65722060448201527f616e6420657175616c207468616e206d6178696d756d207374616b696e67000060648201526084016114c6565b6122776000805160206135738339815191528361297d565b611b6a6000805160206134b38339815191528261297d565b60007f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a22830361231a57600080600080858060200190518101906122d29190613381565b9350935093509350612710818385876122eb919061333a565b6122f5919061333a565b6122ff919061333a565b146123115760009450505050506123e8565b505050506123e4565b7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b83148061236757507fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e783145b156123a1576000808380602001905181019061238391906133b7565b915091508082111561239a576000925050506123e8565b50506123e4565b6000805160206134f383398151915283036123e4576000828060200190518101906123cc91906133db565b90506103e88110156123e25760009150506123e8565b505b5060015b92915050565b600081815260036020526040902080546060919061240b906133f4565b80601f0160208091040260200160405190810160405280929190818152602001828054612437906133f4565b80156124845780601f1061245957610100808354040283529160200191612484565b820191906000526020600020905b81548152906001019060200180831161246757829003601f168201915b50505050509050919050565b3361249961295d565b6001600160a01b0316146124bf5760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135fa8339815191528261297d565b336124e061295d565b6001600160a01b0316146125065760405162461bcd60e51b81526004016114c6906132fd565b61162a610ebf826020015190565b61251c6129cc565b6001600160a01b0381166125725760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064016114c6565b609d80546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b60026020527fd7a437163435b79030132855d9146a10e26570f1767311219983e0c430cfa690546000805160206134b383398151915260009081527f673c817b54d53459fa437d6b11ba6445e517d8dc789e6b815675ff10e6aeeb5d54909182915b915091509091565b3361262f61295d565b6001600160a01b0316146126555760405162461bcd60e51b81526004016114c6906132fd565b808211156126cd576040805162461bcd60e51b81526020600482015260248101919091527f4d696e696d756d206475726174696f6e206d75737420626520736d616c6c657260448201527f20616e6420657175616c207468616e206d6178696d756d206475726174696f6e60648201526084016114c6565b6126e56000805160206135fa8339815191528361297d565b611b6a6000805160206135138339815191528261297d565b3361270661295d565b6001600160a01b03161461272c5760405162461bcd60e51b81526004016114c6906132fd565b60208101516040820151606083015160808401516121b38484848461166a565b600081815260056020526040902080546060919061240b906133f4565b60026020527f8e8c0bef3b4557d74ba01e0433728c574990153e35cacae69cb26f23a8a401755460008051602061351383398151915260009081527f5a1993193b8890c75d83157b2c2c12b144545357ab60021d7429856434de051b549091829161261e565b336127d861295d565b6001600160a01b0316146127fe5760405162461bcd60e51b81526004016114c6906132fd565b60208101516040820151611a0f82826121ba565b3361281b61295d565b6001600160a01b0316146128415760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206135538339815191528261297d565b6128616129cc565b6001600160a01b0381166128c65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016114c6565b61162a81612bef565b336128d861295d565b6001600160a01b0316146128fe5760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206134d38339815191528261297d565b3361291f61295d565b6001600160a01b0316146129455760405162461bcd60e51b81526004016114c6906132fd565b61162a6000805160206134b38339815191528261297d565b60006114927111dbdd995c9b985b98d950dbdb9d1c9858dd60721b612c41565b6000828152600260205260409020819055817f58d7c10adfd5778016889c15d422d57f2975b9292415b54fe5d8cd4241200612826040516129c091815260200190565b60405180910390a25050565b606b546001600160a01b03163314611f235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016114c6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612a5957611a0f83612caf565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612ab3575060408051601f3d908101601f19168201909252612ab0918101906133db565b60015b612b165760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016114c6565b6000805160206135938339815191528114612b855760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016114c6565b50611a0f838383612d4b565b33612b9a61295d565b6001600160a01b03161461162a5760405162461bcd60e51b81526004016114c6906132fd565b603854610100900460ff16612be75760405162461bcd60e51b81526004016114c69061342e565b611f23612d70565b606b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b609d54604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd90602401602060405180830381865afa158015612c8b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e89190613479565b6001600160a01b0381163b612d1c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016114c6565b60008051602061359383398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d5483612da0565b600082511180612d615750805b15611a0f576115e78383612de0565b603854610100900460ff16612d975760405162461bcd60e51b81526004016114c69061342e565b611f2333612bef565b612da981612caf565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060612e0583836040518060600160405280602781526020016135b360279139612e0c565b9392505050565b60606001600160a01b0384163b612e745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016114c6565b600080856001600160a01b031685604051612e8f9190613496565b600060405180830381855af49150503d8060008114612eca576040519150601f19603f3d011682016040523d82523d6000602084013e612ecf565b606091505b5091509150612edf828286612ee9565b9695505050505050565b60608315612ef8575081612e05565b825115612f085782518084602001fd5b8160405162461bcd60e51b81526004016114c691906132ea565b60008060008060808587031215612f3857600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612f9357612f93612f54565b604052919050565b600082601f830112612fac57600080fd5b813567ffffffffffffffff811115612fc657612fc6612f54565b612fd9601f8201601f1916602001612f6a565b818152846020838601011115612fee57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561301d57600080fd5b813567ffffffffffffffff81111561303457600080fd5b61304084828501612f9b565b949350505050565b60006020828403121561305a57600080fd5b5035919050565b6001600160a01b038116811461162a57600080fd5b60006020828403121561308857600080fd5b8135612e0581613061565b600080604083850312156130a657600080fd5b82356130b181613061565b9150602083013567ffffffffffffffff8111156130cd57600080fd5b6130d985828601612f9b565b9150509250929050565b600067ffffffffffffffff8211156130fd576130fd612f54565b5060051b60200190565b600082601f83011261311857600080fd5b8135602061312d613128836130e3565b612f6a565b82815260059290921b8401810191818101908684111561314c57600080fd5b8286015b848110156131675780358352918301918301613150565b509695505050505050565b60008060006060848603121561318757600080fd5b833561319281613061565b925060208481013567ffffffffffffffff808211156131b057600080fd5b818701915087601f8301126131c457600080fd5b81356131d2613128826130e3565b81815260059190911b8301840190848101908a8311156131f157600080fd5b938501935b8285101561320f578435825293850193908501906131f6565b96505050604087013592508083111561322757600080fd5b505061323586828701613107565b9150509250925092565b6000806040838503121561325257600080fd5b82359150602083013567ffffffffffffffff8111156130cd57600080fd5b6000806040838503121561328357600080fd5b50508035926020909101359150565b60005b838110156132ad578181015183820152602001613295565b838111156115e75750506000910152565b600081518084526132d6816020860160208601613292565b601f01601f19169290920160200192915050565b602081526000612e0560208301846132be565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561334d5761334d613324565b500190565b634e487b7160e01b600052603260045260246000fd5b60006001820161337a5761337a613324565b5060010190565b6000806000806080858703121561339757600080fd5b505082516020840151604085015160609095015191969095509092509050565b600080604083850312156133ca57600080fd5b505080516020909101519092909150565b6000602082840312156133ed57600080fd5b5051919050565b600181811c9082168061340857607f821691505b60208210810361342857634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006020828403121561348b57600080fd5b8151612e0581613061565b600082516134a8818460208701613292565b919091019291505056fe18ad4415ef4a621ce1a136395c51ab6c3712bb2e24b79d526059925cea58dcb8829561ab7af084b7efc6600518d2df79b8d95f3f4c3a550f54f8f7ec7d2b80578086da5becff4dfac91a3105821b361078d2d4abba0ccc2401b974cf0dcf05c10c4fbe9dc9de15dd7c0d064975ee1a2f2f9b954fa0e65d4f6cddba94884bdc3e89dd490ecaf395283ed4ff2fd9557ca767fc425dce063451a9b0da6d72f600c3be90e461bbdb9a95a694f7796912ea04244caf7f5b60ad7ded17e16821d3e44c0b09c9badbbeb6c813a598ee910770a39ccda797a1940439bb6e47fc6c87548b360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65642a268972a70c8c688b62366bdfdd9bb09cf19d3e5b6e7e7bb158e671ffdcedd2c69fc6b7d0efc934fd5a3581c7253a7107a952526bb6dbcd814ef8d8dae1f44a7c1150f0e1a39ff55552d52764f97e6c387e2a247e1df344369f122c4254be2fa2646970667358221220baa5bc7f1d90c081dacd5776c70f2fa86c00d6ba71186486575b670769a2c9f864736f6c634300080e0033", +} + +// EnvStorageImpABI is the input ABI used to generate the binding from. +// Deprecated: Use EnvStorageImpMetaData.ABI instead. +var EnvStorageImpABI = EnvStorageImpMetaData.ABI + +// Deprecated: Use EnvStorageImpMetaData.Sigs instead. +// EnvStorageImpFuncSigs maps the 4-byte function signature to its string representation. +var EnvStorageImpFuncSigs = EnvStorageImpMetaData.Sigs + +// EnvStorageImpBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use EnvStorageImpMetaData.Bin instead. +var EnvStorageImpBin = EnvStorageImpMetaData.Bin + +// DeployEnvStorageImp deploys a new Ethereum contract, binding an instance of EnvStorageImp to it. +func DeployEnvStorageImp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EnvStorageImp, error) { + parsed, err := EnvStorageImpMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EnvStorageImpBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &EnvStorageImp{EnvStorageImpCaller: EnvStorageImpCaller{contract: contract}, EnvStorageImpTransactor: EnvStorageImpTransactor{contract: contract}, EnvStorageImpFilterer: EnvStorageImpFilterer{contract: contract}}, nil +} + +// EnvStorageImp is an auto generated Go binding around an Ethereum contract. +type EnvStorageImp struct { + EnvStorageImpCaller // Read-only binding to the contract + EnvStorageImpTransactor // Write-only binding to the contract + EnvStorageImpFilterer // Log filterer for contract events +} + +// EnvStorageImpCaller is an auto generated read-only Go binding around an Ethereum contract. +type EnvStorageImpCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageImpTransactor is an auto generated write-only Go binding around an Ethereum contract. +type EnvStorageImpTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageImpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type EnvStorageImpFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// EnvStorageImpSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type EnvStorageImpSession struct { + Contract *EnvStorageImp // 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 +} + +// EnvStorageImpCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type EnvStorageImpCallerSession struct { + Contract *EnvStorageImpCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// EnvStorageImpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type EnvStorageImpTransactorSession struct { + Contract *EnvStorageImpTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// EnvStorageImpRaw is an auto generated low-level Go binding around an Ethereum contract. +type EnvStorageImpRaw struct { + Contract *EnvStorageImp // Generic contract binding to access the raw methods on +} + +// EnvStorageImpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type EnvStorageImpCallerRaw struct { + Contract *EnvStorageImpCaller // Generic read-only contract binding to access the raw methods on +} + +// EnvStorageImpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type EnvStorageImpTransactorRaw struct { + Contract *EnvStorageImpTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewEnvStorageImp creates a new instance of EnvStorageImp, bound to a specific deployed contract. +func NewEnvStorageImp(address common.Address, backend bind.ContractBackend) (*EnvStorageImp, error) { + contract, err := bindEnvStorageImp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &EnvStorageImp{EnvStorageImpCaller: EnvStorageImpCaller{contract: contract}, EnvStorageImpTransactor: EnvStorageImpTransactor{contract: contract}, EnvStorageImpFilterer: EnvStorageImpFilterer{contract: contract}}, nil +} + +// NewEnvStorageImpCaller creates a new read-only instance of EnvStorageImp, bound to a specific deployed contract. +func NewEnvStorageImpCaller(address common.Address, caller bind.ContractCaller) (*EnvStorageImpCaller, error) { + contract, err := bindEnvStorageImp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &EnvStorageImpCaller{contract: contract}, nil +} + +// NewEnvStorageImpTransactor creates a new write-only instance of EnvStorageImp, bound to a specific deployed contract. +func NewEnvStorageImpTransactor(address common.Address, transactor bind.ContractTransactor) (*EnvStorageImpTransactor, error) { + contract, err := bindEnvStorageImp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &EnvStorageImpTransactor{contract: contract}, nil +} + +// NewEnvStorageImpFilterer creates a new log filterer instance of EnvStorageImp, bound to a specific deployed contract. +func NewEnvStorageImpFilterer(address common.Address, filterer bind.ContractFilterer) (*EnvStorageImpFilterer, error) { + contract, err := bindEnvStorageImp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &EnvStorageImpFilterer{contract: contract}, nil +} + +// bindEnvStorageImp binds a generic wrapper to an already deployed contract. +func bindEnvStorageImp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(EnvStorageImpABI)) + 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 (_EnvStorageImp *EnvStorageImpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EnvStorageImp.Contract.EnvStorageImpCaller.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 (_EnvStorageImp *EnvStorageImpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorageImp.Contract.EnvStorageImpTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EnvStorageImp *EnvStorageImpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EnvStorageImp.Contract.EnvStorageImpTransactor.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 (_EnvStorageImp *EnvStorageImpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorageImp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_EnvStorageImp *EnvStorageImpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _EnvStorageImp.Contract.contract.Transact(opts, method, params...) +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BALLOTDURATIONMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BALLOT_DURATION_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BALLOTDURATIONMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMAXNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BALLOTDURATIONMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMAXNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BALLOTDURATIONMINMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BALLOT_DURATION_MIN_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BALLOTDURATIONMINMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMINMAXNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BALLOTDURATIONMINMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMINMAXNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BALLOTDURATIONMINNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BALLOT_DURATION_MIN_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BALLOTDURATIONMINNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMINNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BALLOTDURATIONMINNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTDURATIONMINNAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BALLOTSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BALLOT_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTSTORAGENAME(&_EnvStorageImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BALLOTSTORAGENAME(&_EnvStorageImp.CallOpts) +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BASEFEEMAXCHANGERATENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BASE_FEE_MAX_CHANGE_RATE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BASEFEEMAXCHANGERATENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BASEFEEMAXCHANGERATENAME(&_EnvStorageImp.CallOpts) +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BASEFEEMAXCHANGERATENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BASEFEEMAXCHANGERATENAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKSPERNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCKS_PER_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKSPERNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKSPERNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKSPERNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKSPERNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKCREATIONTIMENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_CREATION_TIME_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKCREATIONTIMENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKCREATIONTIMENAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKCREATIONTIMENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKCREATIONTIMENAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKGASLIMITNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_GASLIMIT_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKGASLIMITNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKGASLIMITNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKGASLIMITNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKGASLIMITNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDAMOUNTNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_AMOUNT_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDAMOUNTNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDAMOUNTNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDAMOUNTNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDAMOUNTNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDDISTRIBUTIONMETHODNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_METHOD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDDISTRIBUTIONMETHODNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONMETHODNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDDISTRIBUTIONMETHODNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONMETHODNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(&_EnvStorageImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(&_EnvStorageImp.CallOpts) +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) DENOMINATOR(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "DENOMINATOR") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) DENOMINATOR() (*big.Int, error) { + return _EnvStorageImp.Contract.DENOMINATOR(&_EnvStorageImp.CallOpts) +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) DENOMINATOR() (*big.Int, error) { + return _EnvStorageImp.Contract.DENOMINATOR(&_EnvStorageImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) ECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) ECOSYSTEMNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.ECOSYSTEMNAME(&_EnvStorageImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) ECOSYSTEMNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.ECOSYSTEMNAME(&_EnvStorageImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) ENVSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "ENV_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) ENVSTORAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.ENVSTORAGENAME(&_EnvStorageImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) ENVSTORAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.ENVSTORAGENAME(&_EnvStorageImp.CallOpts) +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) GASLIMITANDBASEFEENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "GASLIMIT_AND_BASE_FEE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) GASLIMITANDBASEFEENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GASLIMITANDBASEFEENAME(&_EnvStorageImp.CallOpts) +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) GASLIMITANDBASEFEENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GASLIMITANDBASEFEENAME(&_EnvStorageImp.CallOpts) +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) GASTARGETPERCENTAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "GAS_TARGET_PERCENTAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) GASTARGETPERCENTAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GASTARGETPERCENTAGENAME(&_EnvStorageImp.CallOpts) +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) GASTARGETPERCENTAGENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GASTARGETPERCENTAGENAME(&_EnvStorageImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) GOVNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "GOV_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) GOVNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GOVNAME(&_EnvStorageImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) GOVNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.GOVNAME(&_EnvStorageImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) MAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) MAINTENANCENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAINTENANCENAME(&_EnvStorageImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) MAINTENANCENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAINTENANCENAME(&_EnvStorageImp.CallOpts) +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) MAXBASEFEENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "MAX_BASE_FEE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) MAXBASEFEENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXBASEFEENAME(&_EnvStorageImp.CallOpts) +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) MAXBASEFEENAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXBASEFEENAME(&_EnvStorageImp.CallOpts) +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) MAXIDLEBLOCKINTERVALNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "MAX_IDLE_BLOCK_INTERVAL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) MAXIDLEBLOCKINTERVALNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXIDLEBLOCKINTERVALNAME(&_EnvStorageImp.CallOpts) +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) MAXIDLEBLOCKINTERVALNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXIDLEBLOCKINTERVALNAME(&_EnvStorageImp.CallOpts) +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) MAXPRIORITYFEEPERGASNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "MAX_PRIORITY_FEE_PER_GAS_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) MAXPRIORITYFEEPERGASNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXPRIORITYFEEPERGASNAME(&_EnvStorageImp.CallOpts) +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) MAXPRIORITYFEEPERGASNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.MAXPRIORITYFEEPERGASNAME(&_EnvStorageImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) REWARDPOOLNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "REWARD_POOL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) REWARDPOOLNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.REWARDPOOLNAME(&_EnvStorageImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) REWARDPOOLNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.REWARDPOOLNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) STAKINGMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "STAKING_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) STAKINGMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMAXNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) STAKINGMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMAXNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) STAKINGMINMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "STAKING_MIN_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) STAKINGMINMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMINMAXNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) STAKINGMINMAXNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMINMAXNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) STAKINGMINNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "STAKING_MIN_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) STAKINGMINNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMINNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) STAKINGMINNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGMINNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) STAKINGNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "STAKING_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) STAKINGNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) STAKINGNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) STAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) STAKINGREWARDNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGREWARDNAME(&_EnvStorageImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) STAKINGREWARDNAME() ([32]byte, error) { + return _EnvStorageImp.Contract.STAKINGREWARDNAME(&_EnvStorageImp.CallOpts) +} + +// CheckVariableCondition is a free data retrieval call binding the contract method 0x9801bff9. +// +// Solidity: function checkVariableCondition(bytes32 envKey, bytes envVal) pure returns(bool) +func (_EnvStorageImp *EnvStorageImpCaller) CheckVariableCondition(opts *bind.CallOpts, envKey [32]byte, envVal []byte) (bool, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "checkVariableCondition", envKey, envVal) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CheckVariableCondition is a free data retrieval call binding the contract method 0x9801bff9. +// +// Solidity: function checkVariableCondition(bytes32 envKey, bytes envVal) pure returns(bool) +func (_EnvStorageImp *EnvStorageImpSession) CheckVariableCondition(envKey [32]byte, envVal []byte) (bool, error) { + return _EnvStorageImp.Contract.CheckVariableCondition(&_EnvStorageImp.CallOpts, envKey, envVal) +} + +// CheckVariableCondition is a free data retrieval call binding the contract method 0x9801bff9. +// +// Solidity: function checkVariableCondition(bytes32 envKey, bytes envVal) pure returns(bool) +func (_EnvStorageImp *EnvStorageImpCallerSession) CheckVariableCondition(envKey [32]byte, envVal []byte) (bool, error) { + return _EnvStorageImp.Contract.CheckVariableCondition(&_EnvStorageImp.CallOpts, envKey, envVal) +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 h) view returns(address) +func (_EnvStorageImp *EnvStorageImpCaller) GetAddress(opts *bind.CallOpts, h [32]byte) (common.Address, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getAddress", h) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 h) view returns(address) +func (_EnvStorageImp *EnvStorageImpSession) GetAddress(h [32]byte) (common.Address, error) { + return _EnvStorageImp.Contract.GetAddress(&_EnvStorageImp.CallOpts, h) +} + +// GetAddress is a free data retrieval call binding the contract method 0x21f8a721. +// +// Solidity: function getAddress(bytes32 h) view returns(address) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetAddress(h [32]byte) (common.Address, error) { + return _EnvStorageImp.Contract.GetAddress(&_EnvStorageImp.CallOpts, h) +} + +// GetBallotDurationMax is a free data retrieval call binding the contract method 0x1b27e01b. +// +// Solidity: function getBallotDurationMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBallotDurationMax(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBallotDurationMax") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBallotDurationMax is a free data retrieval call binding the contract method 0x1b27e01b. +// +// Solidity: function getBallotDurationMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBallotDurationMax() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMax(&_EnvStorageImp.CallOpts) +} + +// GetBallotDurationMax is a free data retrieval call binding the contract method 0x1b27e01b. +// +// Solidity: function getBallotDurationMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBallotDurationMax() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMax(&_EnvStorageImp.CallOpts) +} + +// GetBallotDurationMin is a free data retrieval call binding the contract method 0x33be496e. +// +// Solidity: function getBallotDurationMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBallotDurationMin(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBallotDurationMin") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBallotDurationMin is a free data retrieval call binding the contract method 0x33be496e. +// +// Solidity: function getBallotDurationMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBallotDurationMin() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMin(&_EnvStorageImp.CallOpts) +} + +// GetBallotDurationMin is a free data retrieval call binding the contract method 0x33be496e. +// +// Solidity: function getBallotDurationMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBallotDurationMin() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMin(&_EnvStorageImp.CallOpts) +} + +// GetBallotDurationMinMax is a free data retrieval call binding the contract method 0xcdb9f643. +// +// Solidity: function getBallotDurationMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBallotDurationMinMax(opts *bind.CallOpts) (*big.Int, *big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBallotDurationMinMax") + + if err != nil { + return *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return out0, out1, err + +} + +// GetBallotDurationMinMax is a free data retrieval call binding the contract method 0xcdb9f643. +// +// Solidity: function getBallotDurationMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBallotDurationMinMax() (*big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMinMax(&_EnvStorageImp.CallOpts) +} + +// GetBallotDurationMinMax is a free data retrieval call binding the contract method 0xcdb9f643. +// +// Solidity: function getBallotDurationMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBallotDurationMinMax() (*big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetBallotDurationMinMax(&_EnvStorageImp.CallOpts) +} + +// GetBlockCreationTime is a free data retrieval call binding the contract method 0x33e31184. +// +// Solidity: function getBlockCreationTime() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBlockCreationTime(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBlockCreationTime") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBlockCreationTime is a free data retrieval call binding the contract method 0x33e31184. +// +// Solidity: function getBlockCreationTime() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBlockCreationTime() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlockCreationTime(&_EnvStorageImp.CallOpts) +} + +// GetBlockCreationTime is a free data retrieval call binding the contract method 0x33e31184. +// +// Solidity: function getBlockCreationTime() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBlockCreationTime() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlockCreationTime(&_EnvStorageImp.CallOpts) +} + +// GetBlockRewardAmount is a free data retrieval call binding the contract method 0x5dba8c4a. +// +// Solidity: function getBlockRewardAmount() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBlockRewardAmount(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBlockRewardAmount") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBlockRewardAmount is a free data retrieval call binding the contract method 0x5dba8c4a. +// +// Solidity: function getBlockRewardAmount() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBlockRewardAmount() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlockRewardAmount(&_EnvStorageImp.CallOpts) +} + +// GetBlockRewardAmount is a free data retrieval call binding the contract method 0x5dba8c4a. +// +// Solidity: function getBlockRewardAmount() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBlockRewardAmount() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlockRewardAmount(&_EnvStorageImp.CallOpts) +} + +// GetBlockRewardDistributionMethod is a free data retrieval call binding the contract method 0x8f6fe725. +// +// Solidity: function getBlockRewardDistributionMethod() view returns(uint256, uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBlockRewardDistributionMethod(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBlockRewardDistributionMethod") + + if err != nil { + return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return out0, out1, out2, out3, err + +} + +// GetBlockRewardDistributionMethod is a free data retrieval call binding the contract method 0x8f6fe725. +// +// Solidity: function getBlockRewardDistributionMethod() view returns(uint256, uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBlockRewardDistributionMethod() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetBlockRewardDistributionMethod(&_EnvStorageImp.CallOpts) +} + +// GetBlockRewardDistributionMethod is a free data retrieval call binding the contract method 0x8f6fe725. +// +// Solidity: function getBlockRewardDistributionMethod() view returns(uint256, uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBlockRewardDistributionMethod() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetBlockRewardDistributionMethod(&_EnvStorageImp.CallOpts) +} + +// GetBlocksPer is a free data retrieval call binding the contract method 0x3690057a. +// +// Solidity: function getBlocksPer() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetBlocksPer(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBlocksPer") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBlocksPer is a free data retrieval call binding the contract method 0x3690057a. +// +// Solidity: function getBlocksPer() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetBlocksPer() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlocksPer(&_EnvStorageImp.CallOpts) +} + +// GetBlocksPer is a free data retrieval call binding the contract method 0x3690057a. +// +// Solidity: function getBlocksPer() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBlocksPer() (*big.Int, error) { + return _EnvStorageImp.Contract.GetBlocksPer(&_EnvStorageImp.CallOpts) +} + +// GetBoolean is a free data retrieval call binding the contract method 0x3848207a. +// +// Solidity: function getBoolean(bytes32 h) view returns(bool) +func (_EnvStorageImp *EnvStorageImpCaller) GetBoolean(opts *bind.CallOpts, h [32]byte) (bool, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBoolean", h) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// GetBoolean is a free data retrieval call binding the contract method 0x3848207a. +// +// Solidity: function getBoolean(bytes32 h) view returns(bool) +func (_EnvStorageImp *EnvStorageImpSession) GetBoolean(h [32]byte) (bool, error) { + return _EnvStorageImp.Contract.GetBoolean(&_EnvStorageImp.CallOpts, h) +} + +// GetBoolean is a free data retrieval call binding the contract method 0x3848207a. +// +// Solidity: function getBoolean(bytes32 h) view returns(bool) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBoolean(h [32]byte) (bool, error) { + return _EnvStorageImp.Contract.GetBoolean(&_EnvStorageImp.CallOpts, h) +} + +// GetBytes is a free data retrieval call binding the contract method 0xc031a180. +// +// Solidity: function getBytes(bytes32 h) view returns(bytes) +func (_EnvStorageImp *EnvStorageImpCaller) GetBytes(opts *bind.CallOpts, h [32]byte) ([]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBytes", h) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// GetBytes is a free data retrieval call binding the contract method 0xc031a180. +// +// Solidity: function getBytes(bytes32 h) view returns(bytes) +func (_EnvStorageImp *EnvStorageImpSession) GetBytes(h [32]byte) ([]byte, error) { + return _EnvStorageImp.Contract.GetBytes(&_EnvStorageImp.CallOpts, h) +} + +// GetBytes is a free data retrieval call binding the contract method 0xc031a180. +// +// Solidity: function getBytes(bytes32 h) view returns(bytes) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBytes(h [32]byte) ([]byte, error) { + return _EnvStorageImp.Contract.GetBytes(&_EnvStorageImp.CallOpts, h) +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 h) view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) GetBytes32(opts *bind.CallOpts, h [32]byte) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getBytes32", h) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 h) view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) GetBytes32(h [32]byte) ([32]byte, error) { + return _EnvStorageImp.Contract.GetBytes32(&_EnvStorageImp.CallOpts, h) +} + +// GetBytes32 is a free data retrieval call binding the contract method 0xa6ed563e. +// +// Solidity: function getBytes32(bytes32 h) view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetBytes32(h [32]byte) ([32]byte, error) { + return _EnvStorageImp.Contract.GetBytes32(&_EnvStorageImp.CallOpts, h) +} + +// GetGasLimitAndBaseFee is a free data retrieval call binding the contract method 0x67d1a2e0. +// +// Solidity: function getGasLimitAndBaseFee() view returns(uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetGasLimitAndBaseFee(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getGasLimitAndBaseFee") + + if err != nil { + return *new(*big.Int), *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return out0, out1, out2, err + +} + +// GetGasLimitAndBaseFee is a free data retrieval call binding the contract method 0x67d1a2e0. +// +// Solidity: function getGasLimitAndBaseFee() view returns(uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetGasLimitAndBaseFee() (*big.Int, *big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetGasLimitAndBaseFee(&_EnvStorageImp.CallOpts) +} + +// GetGasLimitAndBaseFee is a free data retrieval call binding the contract method 0x67d1a2e0. +// +// Solidity: function getGasLimitAndBaseFee() view returns(uint256, uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetGasLimitAndBaseFee() (*big.Int, *big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetGasLimitAndBaseFee(&_EnvStorageImp.CallOpts) +} + +// GetInt is a free data retrieval call binding the contract method 0xdc97d962. +// +// Solidity: function getInt(bytes32 h) view returns(int256) +func (_EnvStorageImp *EnvStorageImpCaller) GetInt(opts *bind.CallOpts, h [32]byte) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getInt", h) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetInt is a free data retrieval call binding the contract method 0xdc97d962. +// +// Solidity: function getInt(bytes32 h) view returns(int256) +func (_EnvStorageImp *EnvStorageImpSession) GetInt(h [32]byte) (*big.Int, error) { + return _EnvStorageImp.Contract.GetInt(&_EnvStorageImp.CallOpts, h) +} + +// GetInt is a free data retrieval call binding the contract method 0xdc97d962. +// +// Solidity: function getInt(bytes32 h) view returns(int256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetInt(h [32]byte) (*big.Int, error) { + return _EnvStorageImp.Contract.GetInt(&_EnvStorageImp.CallOpts, h) +} + +// GetMaxBaseFee is a free data retrieval call binding the contract method 0xc95437be. +// +// Solidity: function getMaxBaseFee() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetMaxBaseFee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getMaxBaseFee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxBaseFee is a free data retrieval call binding the contract method 0xc95437be. +// +// Solidity: function getMaxBaseFee() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetMaxBaseFee() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxBaseFee(&_EnvStorageImp.CallOpts) +} + +// GetMaxBaseFee is a free data retrieval call binding the contract method 0xc95437be. +// +// Solidity: function getMaxBaseFee() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetMaxBaseFee() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxBaseFee(&_EnvStorageImp.CallOpts) +} + +// GetMaxIdleBlockInterval is a free data retrieval call binding the contract method 0x185582f1. +// +// Solidity: function getMaxIdleBlockInterval() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetMaxIdleBlockInterval(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getMaxIdleBlockInterval") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxIdleBlockInterval is a free data retrieval call binding the contract method 0x185582f1. +// +// Solidity: function getMaxIdleBlockInterval() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetMaxIdleBlockInterval() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxIdleBlockInterval(&_EnvStorageImp.CallOpts) +} + +// GetMaxIdleBlockInterval is a free data retrieval call binding the contract method 0x185582f1. +// +// Solidity: function getMaxIdleBlockInterval() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetMaxIdleBlockInterval() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxIdleBlockInterval(&_EnvStorageImp.CallOpts) +} + +// GetMaxPriorityFeePerGas is a free data retrieval call binding the contract method 0x2b2eaa92. +// +// Solidity: function getMaxPriorityFeePerGas() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetMaxPriorityFeePerGas(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getMaxPriorityFeePerGas") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxPriorityFeePerGas is a free data retrieval call binding the contract method 0x2b2eaa92. +// +// Solidity: function getMaxPriorityFeePerGas() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetMaxPriorityFeePerGas() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxPriorityFeePerGas(&_EnvStorageImp.CallOpts) +} + +// GetMaxPriorityFeePerGas is a free data retrieval call binding the contract method 0x2b2eaa92. +// +// Solidity: function getMaxPriorityFeePerGas() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetMaxPriorityFeePerGas() (*big.Int, error) { + return _EnvStorageImp.Contract.GetMaxPriorityFeePerGas(&_EnvStorageImp.CallOpts) +} + +// GetStakingMax is a free data retrieval call binding the contract method 0x737c59b8. +// +// Solidity: function getStakingMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetStakingMax(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getStakingMax") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetStakingMax is a free data retrieval call binding the contract method 0x737c59b8. +// +// Solidity: function getStakingMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetStakingMax() (*big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMax(&_EnvStorageImp.CallOpts) +} + +// GetStakingMax is a free data retrieval call binding the contract method 0x737c59b8. +// +// Solidity: function getStakingMax() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetStakingMax() (*big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMax(&_EnvStorageImp.CallOpts) +} + +// GetStakingMin is a free data retrieval call binding the contract method 0x076cd77f. +// +// Solidity: function getStakingMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetStakingMin(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getStakingMin") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetStakingMin is a free data retrieval call binding the contract method 0x076cd77f. +// +// Solidity: function getStakingMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetStakingMin() (*big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMin(&_EnvStorageImp.CallOpts) +} + +// GetStakingMin is a free data retrieval call binding the contract method 0x076cd77f. +// +// Solidity: function getStakingMin() view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetStakingMin() (*big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMin(&_EnvStorageImp.CallOpts) +} + +// GetStakingMinMax is a free data retrieval call binding the contract method 0xaba01fee. +// +// Solidity: function getStakingMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetStakingMinMax(opts *bind.CallOpts) (*big.Int, *big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getStakingMinMax") + + if err != nil { + return *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return out0, out1, err + +} + +// GetStakingMinMax is a free data retrieval call binding the contract method 0xaba01fee. +// +// Solidity: function getStakingMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetStakingMinMax() (*big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMinMax(&_EnvStorageImp.CallOpts) +} + +// GetStakingMinMax is a free data retrieval call binding the contract method 0xaba01fee. +// +// Solidity: function getStakingMinMax() view returns(uint256, uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetStakingMinMax() (*big.Int, *big.Int, error) { + return _EnvStorageImp.Contract.GetStakingMinMax(&_EnvStorageImp.CallOpts) +} + +// GetString is a free data retrieval call binding the contract method 0x986e791a. +// +// Solidity: function getString(bytes32 h) view returns(string) +func (_EnvStorageImp *EnvStorageImpCaller) GetString(opts *bind.CallOpts, h [32]byte) (string, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getString", h) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// GetString is a free data retrieval call binding the contract method 0x986e791a. +// +// Solidity: function getString(bytes32 h) view returns(string) +func (_EnvStorageImp *EnvStorageImpSession) GetString(h [32]byte) (string, error) { + return _EnvStorageImp.Contract.GetString(&_EnvStorageImp.CallOpts, h) +} + +// GetString is a free data retrieval call binding the contract method 0x986e791a. +// +// Solidity: function getString(bytes32 h) view returns(string) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetString(h [32]byte) (string, error) { + return _EnvStorageImp.Contract.GetString(&_EnvStorageImp.CallOpts, h) +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 h) view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCaller) GetUint(opts *bind.CallOpts, h [32]byte) (*big.Int, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "getUint", h) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 h) view returns(uint256) +func (_EnvStorageImp *EnvStorageImpSession) GetUint(h [32]byte) (*big.Int, error) { + return _EnvStorageImp.Contract.GetUint(&_EnvStorageImp.CallOpts, h) +} + +// GetUint is a free data retrieval call binding the contract method 0xbd02d0f5. +// +// Solidity: function getUint(bytes32 h) view returns(uint256) +func (_EnvStorageImp *EnvStorageImpCallerSession) GetUint(h [32]byte) (*big.Int, error) { + return _EnvStorageImp.Contract.GetUint(&_EnvStorageImp.CallOpts, h) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EnvStorageImp *EnvStorageImpCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpSession) Owner() (common.Address, error) { + return _EnvStorageImp.Contract.Owner(&_EnvStorageImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_EnvStorageImp *EnvStorageImpCallerSession) Owner() (common.Address, error) { + return _EnvStorageImp.Contract.Owner(&_EnvStorageImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpSession) ProxiableUUID() ([32]byte, error) { + return _EnvStorageImp.Contract.ProxiableUUID(&_EnvStorageImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_EnvStorageImp *EnvStorageImpCallerSession) ProxiableUUID() ([32]byte, error) { + return _EnvStorageImp.Contract.ProxiableUUID(&_EnvStorageImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_EnvStorageImp *EnvStorageImpCaller) Reg(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _EnvStorageImp.contract.Call(opts, &out, "reg") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_EnvStorageImp *EnvStorageImpSession) Reg() (common.Address, error) { + return _EnvStorageImp.Contract.Reg(&_EnvStorageImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_EnvStorageImp *EnvStorageImpCallerSession) Reg() (common.Address, error) { + return _EnvStorageImp.Contract.Reg(&_EnvStorageImp.CallOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x539927be. +// +// Solidity: function initialize(address _registry, bytes32[] names, uint256[] infos) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) Initialize(opts *bind.TransactOpts, _registry common.Address, names [][32]byte, infos []*big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "initialize", _registry, names, infos) +} + +// Initialize is a paid mutator transaction binding the contract method 0x539927be. +// +// Solidity: function initialize(address _registry, bytes32[] names, uint256[] infos) returns() +func (_EnvStorageImp *EnvStorageImpSession) Initialize(_registry common.Address, names [][32]byte, infos []*big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.Initialize(&_EnvStorageImp.TransactOpts, _registry, names, infos) +} + +// Initialize is a paid mutator transaction binding the contract method 0x539927be. +// +// Solidity: function initialize(address _registry, bytes32[] names, uint256[] infos) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) Initialize(_registry common.Address, names [][32]byte, infos []*big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.Initialize(&_EnvStorageImp.TransactOpts, _registry, names, infos) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EnvStorageImp *EnvStorageImpTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EnvStorageImp *EnvStorageImpSession) RenounceOwnership() (*types.Transaction, error) { + return _EnvStorageImp.Contract.RenounceOwnership(&_EnvStorageImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _EnvStorageImp.Contract.RenounceOwnership(&_EnvStorageImp.TransactOpts) +} + +// SetBallotDurationMax is a paid mutator transaction binding the contract method 0x852cf38f. +// +// Solidity: function setBallotDurationMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMax(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMax", _value) +} + +// SetBallotDurationMax is a paid mutator transaction binding the contract method 0x852cf38f. +// +// Solidity: function setBallotDurationMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMax(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMax(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMax is a paid mutator transaction binding the contract method 0x852cf38f. +// +// Solidity: function setBallotDurationMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMax(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMax(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMaxByBytes is a paid mutator transaction binding the contract method 0xa5d6a581. +// +// Solidity: function setBallotDurationMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMaxByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMaxByBytes", _value) +} + +// SetBallotDurationMaxByBytes is a paid mutator transaction binding the contract method 0xa5d6a581. +// +// Solidity: function setBallotDurationMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMaxByBytes is a paid mutator transaction binding the contract method 0xa5d6a581. +// +// Solidity: function setBallotDurationMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMin is a paid mutator transaction binding the contract method 0xa36f259b. +// +// Solidity: function setBallotDurationMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMin(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMin", _value) +} + +// SetBallotDurationMin is a paid mutator transaction binding the contract method 0xa36f259b. +// +// Solidity: function setBallotDurationMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMin(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMin(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMin is a paid mutator transaction binding the contract method 0xa36f259b. +// +// Solidity: function setBallotDurationMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMin(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMin(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMinByBytes is a paid mutator transaction binding the contract method 0x124cea37. +// +// Solidity: function setBallotDurationMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMinByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMinByBytes", _value) +} + +// SetBallotDurationMinByBytes is a paid mutator transaction binding the contract method 0x124cea37. +// +// Solidity: function setBallotDurationMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMinByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMinByBytes is a paid mutator transaction binding the contract method 0x124cea37. +// +// Solidity: function setBallotDurationMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMinByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMinMax is a paid mutator transaction binding the contract method 0xb4d6bd3b. +// +// Solidity: function setBallotDurationMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMinMax(opts *bind.TransactOpts, _min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMinMax", _min, _max) +} + +// SetBallotDurationMinMax is a paid mutator transaction binding the contract method 0xb4d6bd3b. +// +// Solidity: function setBallotDurationMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMinMax(_min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinMax(&_EnvStorageImp.TransactOpts, _min, _max) +} + +// SetBallotDurationMinMax is a paid mutator transaction binding the contract method 0xb4d6bd3b. +// +// Solidity: function setBallotDurationMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMinMax(_min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinMax(&_EnvStorageImp.TransactOpts, _min, _max) +} + +// SetBallotDurationMinMaxByBytes is a paid mutator transaction binding the contract method 0x45b5ec29. +// +// Solidity: function setBallotDurationMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBallotDurationMinMaxByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBallotDurationMinMaxByBytes", _value) +} + +// SetBallotDurationMinMaxByBytes is a paid mutator transaction binding the contract method 0x45b5ec29. +// +// Solidity: function setBallotDurationMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBallotDurationMinMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBallotDurationMinMaxByBytes is a paid mutator transaction binding the contract method 0x45b5ec29. +// +// Solidity: function setBallotDurationMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBallotDurationMinMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBallotDurationMinMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockCreationTime is a paid mutator transaction binding the contract method 0x3305508e. +// +// Solidity: function setBlockCreationTime(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockCreationTime(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockCreationTime", _value) +} + +// SetBlockCreationTime is a paid mutator transaction binding the contract method 0x3305508e. +// +// Solidity: function setBlockCreationTime(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockCreationTime(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockCreationTime(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockCreationTime is a paid mutator transaction binding the contract method 0x3305508e. +// +// Solidity: function setBlockCreationTime(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockCreationTime(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockCreationTime(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockCreationTimeByBytes is a paid mutator transaction binding the contract method 0x44b89914. +// +// Solidity: function setBlockCreationTimeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockCreationTimeByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockCreationTimeByBytes", _value) +} + +// SetBlockCreationTimeByBytes is a paid mutator transaction binding the contract method 0x44b89914. +// +// Solidity: function setBlockCreationTimeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockCreationTimeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockCreationTimeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockCreationTimeByBytes is a paid mutator transaction binding the contract method 0x44b89914. +// +// Solidity: function setBlockCreationTimeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockCreationTimeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockCreationTimeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardAmount is a paid mutator transaction binding the contract method 0x2ed19cd5. +// +// Solidity: function setBlockRewardAmount(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockRewardAmount(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockRewardAmount", _value) +} + +// SetBlockRewardAmount is a paid mutator transaction binding the contract method 0x2ed19cd5. +// +// Solidity: function setBlockRewardAmount(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockRewardAmount(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardAmount(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardAmount is a paid mutator transaction binding the contract method 0x2ed19cd5. +// +// Solidity: function setBlockRewardAmount(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockRewardAmount(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardAmount(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardAmountByBytes is a paid mutator transaction binding the contract method 0x3d4c65f3. +// +// Solidity: function setBlockRewardAmountByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockRewardAmountByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockRewardAmountByBytes", _value) +} + +// SetBlockRewardAmountByBytes is a paid mutator transaction binding the contract method 0x3d4c65f3. +// +// Solidity: function setBlockRewardAmountByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockRewardAmountByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardAmountByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardAmountByBytes is a paid mutator transaction binding the contract method 0x3d4c65f3. +// +// Solidity: function setBlockRewardAmountByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockRewardAmountByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardAmountByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardDistributionMethod is a paid mutator transaction binding the contract method 0x0add66dd. +// +// Solidity: function setBlockRewardDistributionMethod(uint256 _block_producer, uint256 _staking_reward, uint256 _ecofund, uint256 _maintenance) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockRewardDistributionMethod(opts *bind.TransactOpts, _block_producer *big.Int, _staking_reward *big.Int, _ecofund *big.Int, _maintenance *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockRewardDistributionMethod", _block_producer, _staking_reward, _ecofund, _maintenance) +} + +// SetBlockRewardDistributionMethod is a paid mutator transaction binding the contract method 0x0add66dd. +// +// Solidity: function setBlockRewardDistributionMethod(uint256 _block_producer, uint256 _staking_reward, uint256 _ecofund, uint256 _maintenance) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockRewardDistributionMethod(_block_producer *big.Int, _staking_reward *big.Int, _ecofund *big.Int, _maintenance *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardDistributionMethod(&_EnvStorageImp.TransactOpts, _block_producer, _staking_reward, _ecofund, _maintenance) +} + +// SetBlockRewardDistributionMethod is a paid mutator transaction binding the contract method 0x0add66dd. +// +// Solidity: function setBlockRewardDistributionMethod(uint256 _block_producer, uint256 _staking_reward, uint256 _ecofund, uint256 _maintenance) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockRewardDistributionMethod(_block_producer *big.Int, _staking_reward *big.Int, _ecofund *big.Int, _maintenance *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardDistributionMethod(&_EnvStorageImp.TransactOpts, _block_producer, _staking_reward, _ecofund, _maintenance) +} + +// SetBlockRewardDistributionMethodByBytes is a paid mutator transaction binding the contract method 0x8c8b887e. +// +// Solidity: function setBlockRewardDistributionMethodByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlockRewardDistributionMethodByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlockRewardDistributionMethodByBytes", _value) +} + +// SetBlockRewardDistributionMethodByBytes is a paid mutator transaction binding the contract method 0x8c8b887e. +// +// Solidity: function setBlockRewardDistributionMethodByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlockRewardDistributionMethodByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardDistributionMethodByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlockRewardDistributionMethodByBytes is a paid mutator transaction binding the contract method 0x8c8b887e. +// +// Solidity: function setBlockRewardDistributionMethodByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlockRewardDistributionMethodByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlockRewardDistributionMethodByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlocksPer is a paid mutator transaction binding the contract method 0x79e85859. +// +// Solidity: function setBlocksPer(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlocksPer(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlocksPer", _value) +} + +// SetBlocksPer is a paid mutator transaction binding the contract method 0x79e85859. +// +// Solidity: function setBlocksPer(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlocksPer(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlocksPer(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlocksPer is a paid mutator transaction binding the contract method 0x79e85859. +// +// Solidity: function setBlocksPer(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlocksPer(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlocksPer(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlocksPerByBytes is a paid mutator transaction binding the contract method 0x3e8daafe. +// +// Solidity: function setBlocksPerByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetBlocksPerByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setBlocksPerByBytes", _value) +} + +// SetBlocksPerByBytes is a paid mutator transaction binding the contract method 0x3e8daafe. +// +// Solidity: function setBlocksPerByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetBlocksPerByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlocksPerByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetBlocksPerByBytes is a paid mutator transaction binding the contract method 0x3e8daafe. +// +// Solidity: function setBlocksPerByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetBlocksPerByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetBlocksPerByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetGasLimitAndBaseFee is a paid mutator transaction binding the contract method 0x0fca11d2. +// +// Solidity: function setGasLimitAndBaseFee(uint256 _block_GasLimit, uint256 _baseFeeMaxChangeRate, uint256 _gasTargetPercentage, uint256 _maxBaseFee) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetGasLimitAndBaseFee(opts *bind.TransactOpts, _block_GasLimit *big.Int, _baseFeeMaxChangeRate *big.Int, _gasTargetPercentage *big.Int, _maxBaseFee *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setGasLimitAndBaseFee", _block_GasLimit, _baseFeeMaxChangeRate, _gasTargetPercentage, _maxBaseFee) +} + +// SetGasLimitAndBaseFee is a paid mutator transaction binding the contract method 0x0fca11d2. +// +// Solidity: function setGasLimitAndBaseFee(uint256 _block_GasLimit, uint256 _baseFeeMaxChangeRate, uint256 _gasTargetPercentage, uint256 _maxBaseFee) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetGasLimitAndBaseFee(_block_GasLimit *big.Int, _baseFeeMaxChangeRate *big.Int, _gasTargetPercentage *big.Int, _maxBaseFee *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetGasLimitAndBaseFee(&_EnvStorageImp.TransactOpts, _block_GasLimit, _baseFeeMaxChangeRate, _gasTargetPercentage, _maxBaseFee) +} + +// SetGasLimitAndBaseFee is a paid mutator transaction binding the contract method 0x0fca11d2. +// +// Solidity: function setGasLimitAndBaseFee(uint256 _block_GasLimit, uint256 _baseFeeMaxChangeRate, uint256 _gasTargetPercentage, uint256 _maxBaseFee) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetGasLimitAndBaseFee(_block_GasLimit *big.Int, _baseFeeMaxChangeRate *big.Int, _gasTargetPercentage *big.Int, _maxBaseFee *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetGasLimitAndBaseFee(&_EnvStorageImp.TransactOpts, _block_GasLimit, _baseFeeMaxChangeRate, _gasTargetPercentage, _maxBaseFee) +} + +// SetGasLimitAndBaseFeeByBytes is a paid mutator transaction binding the contract method 0xbe33732a. +// +// Solidity: function setGasLimitAndBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetGasLimitAndBaseFeeByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setGasLimitAndBaseFeeByBytes", _value) +} + +// SetGasLimitAndBaseFeeByBytes is a paid mutator transaction binding the contract method 0xbe33732a. +// +// Solidity: function setGasLimitAndBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetGasLimitAndBaseFeeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetGasLimitAndBaseFeeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetGasLimitAndBaseFeeByBytes is a paid mutator transaction binding the contract method 0xbe33732a. +// +// Solidity: function setGasLimitAndBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetGasLimitAndBaseFeeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetGasLimitAndBaseFeeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxBaseFee is a paid mutator transaction binding the contract method 0x6fe13177. +// +// Solidity: function setMaxBaseFee(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxBaseFee(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxBaseFee", _value) +} + +// SetMaxBaseFee is a paid mutator transaction binding the contract method 0x6fe13177. +// +// Solidity: function setMaxBaseFee(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxBaseFee(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxBaseFee(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxBaseFee is a paid mutator transaction binding the contract method 0x6fe13177. +// +// Solidity: function setMaxBaseFee(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxBaseFee(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxBaseFee(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxBaseFeeByBytes is a paid mutator transaction binding the contract method 0x408d79cf. +// +// Solidity: function setMaxBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxBaseFeeByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxBaseFeeByBytes", _value) +} + +// SetMaxBaseFeeByBytes is a paid mutator transaction binding the contract method 0x408d79cf. +// +// Solidity: function setMaxBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxBaseFeeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxBaseFeeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxBaseFeeByBytes is a paid mutator transaction binding the contract method 0x408d79cf. +// +// Solidity: function setMaxBaseFeeByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxBaseFeeByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxBaseFeeByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxIdleBlockInterval is a paid mutator transaction binding the contract method 0xf6fd7129. +// +// Solidity: function setMaxIdleBlockInterval(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxIdleBlockInterval(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxIdleBlockInterval", _value) +} + +// SetMaxIdleBlockInterval is a paid mutator transaction binding the contract method 0xf6fd7129. +// +// Solidity: function setMaxIdleBlockInterval(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxIdleBlockInterval(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxIdleBlockInterval(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxIdleBlockInterval is a paid mutator transaction binding the contract method 0xf6fd7129. +// +// Solidity: function setMaxIdleBlockInterval(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxIdleBlockInterval(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxIdleBlockInterval(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxIdleBlockIntervalByBytes is a paid mutator transaction binding the contract method 0x0b90a39a. +// +// Solidity: function setMaxIdleBlockIntervalByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxIdleBlockIntervalByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxIdleBlockIntervalByBytes", _value) +} + +// SetMaxIdleBlockIntervalByBytes is a paid mutator transaction binding the contract method 0x0b90a39a. +// +// Solidity: function setMaxIdleBlockIntervalByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxIdleBlockIntervalByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxIdleBlockIntervalByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxIdleBlockIntervalByBytes is a paid mutator transaction binding the contract method 0x0b90a39a. +// +// Solidity: function setMaxIdleBlockIntervalByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxIdleBlockIntervalByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxIdleBlockIntervalByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxPriorityFeePerGas is a paid mutator transaction binding the contract method 0xec3df879. +// +// Solidity: function setMaxPriorityFeePerGas(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxPriorityFeePerGas(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxPriorityFeePerGas", _value) +} + +// SetMaxPriorityFeePerGas is a paid mutator transaction binding the contract method 0xec3df879. +// +// Solidity: function setMaxPriorityFeePerGas(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxPriorityFeePerGas(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxPriorityFeePerGas(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxPriorityFeePerGas is a paid mutator transaction binding the contract method 0xec3df879. +// +// Solidity: function setMaxPriorityFeePerGas(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxPriorityFeePerGas(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxPriorityFeePerGas(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxPriorityFeePerGasByBytes is a paid mutator transaction binding the contract method 0x0fc238bf. +// +// Solidity: function setMaxPriorityFeePerGasByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetMaxPriorityFeePerGasByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setMaxPriorityFeePerGasByBytes", _value) +} + +// SetMaxPriorityFeePerGasByBytes is a paid mutator transaction binding the contract method 0x0fc238bf. +// +// Solidity: function setMaxPriorityFeePerGasByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetMaxPriorityFeePerGasByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxPriorityFeePerGasByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetMaxPriorityFeePerGasByBytes is a paid mutator transaction binding the contract method 0x0fc238bf. +// +// Solidity: function setMaxPriorityFeePerGasByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetMaxPriorityFeePerGasByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetMaxPriorityFeePerGasByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetRegistry(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setRegistry", _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetRegistry(&_EnvStorageImp.TransactOpts, _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetRegistry(&_EnvStorageImp.TransactOpts, _addr) +} + +// SetStakingMax is a paid mutator transaction binding the contract method 0xf8214591. +// +// Solidity: function setStakingMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMax(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMax", _value) +} + +// SetStakingMax is a paid mutator transaction binding the contract method 0xf8214591. +// +// Solidity: function setStakingMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMax(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMax(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMax is a paid mutator transaction binding the contract method 0xf8214591. +// +// Solidity: function setStakingMax(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMax(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMax(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMaxByBytes is a paid mutator transaction binding the contract method 0x2eccd832. +// +// Solidity: function setStakingMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMaxByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMaxByBytes", _value) +} + +// SetStakingMaxByBytes is a paid mutator transaction binding the contract method 0x2eccd832. +// +// Solidity: function setStakingMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMaxByBytes is a paid mutator transaction binding the contract method 0x2eccd832. +// +// Solidity: function setStakingMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMin is a paid mutator transaction binding the contract method 0x2eb57c65. +// +// Solidity: function setStakingMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMin(opts *bind.TransactOpts, _value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMin", _value) +} + +// SetStakingMin is a paid mutator transaction binding the contract method 0x2eb57c65. +// +// Solidity: function setStakingMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMin(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMin(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMin is a paid mutator transaction binding the contract method 0x2eb57c65. +// +// Solidity: function setStakingMin(uint256 _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMin(_value *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMin(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMinByBytes is a paid mutator transaction binding the contract method 0x71c6960d. +// +// Solidity: function setStakingMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMinByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMinByBytes", _value) +} + +// SetStakingMinByBytes is a paid mutator transaction binding the contract method 0x71c6960d. +// +// Solidity: function setStakingMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMinByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMinByBytes is a paid mutator transaction binding the contract method 0x71c6960d. +// +// Solidity: function setStakingMinByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMinByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMinMax is a paid mutator transaction binding the contract method 0x8d5cdd7e. +// +// Solidity: function setStakingMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMinMax(opts *bind.TransactOpts, _min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMinMax", _min, _max) +} + +// SetStakingMinMax is a paid mutator transaction binding the contract method 0x8d5cdd7e. +// +// Solidity: function setStakingMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMinMax(_min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinMax(&_EnvStorageImp.TransactOpts, _min, _max) +} + +// SetStakingMinMax is a paid mutator transaction binding the contract method 0x8d5cdd7e. +// +// Solidity: function setStakingMinMax(uint256 _min, uint256 _max) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMinMax(_min *big.Int, _max *big.Int) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinMax(&_EnvStorageImp.TransactOpts, _min, _max) +} + +// SetStakingMinMaxByBytes is a paid mutator transaction binding the contract method 0xe078869f. +// +// Solidity: function setStakingMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetStakingMinMaxByBytes(opts *bind.TransactOpts, _value []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setStakingMinMaxByBytes", _value) +} + +// SetStakingMinMaxByBytes is a paid mutator transaction binding the contract method 0xe078869f. +// +// Solidity: function setStakingMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetStakingMinMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetStakingMinMaxByBytes is a paid mutator transaction binding the contract method 0xe078869f. +// +// Solidity: function setStakingMinMaxByBytes(bytes _value) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetStakingMinMaxByBytes(_value []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetStakingMinMaxByBytes(&_EnvStorageImp.TransactOpts, _value) +} + +// SetVariable is a paid mutator transaction binding the contract method 0x88c28019. +// +// Solidity: function setVariable(bytes32 envKey, bytes envVal) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) SetVariable(opts *bind.TransactOpts, envKey [32]byte, envVal []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "setVariable", envKey, envVal) +} + +// SetVariable is a paid mutator transaction binding the contract method 0x88c28019. +// +// Solidity: function setVariable(bytes32 envKey, bytes envVal) returns() +func (_EnvStorageImp *EnvStorageImpSession) SetVariable(envKey [32]byte, envVal []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetVariable(&_EnvStorageImp.TransactOpts, envKey, envVal) +} + +// SetVariable is a paid mutator transaction binding the contract method 0x88c28019. +// +// Solidity: function setVariable(bytes32 envKey, bytes envVal) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) SetVariable(envKey [32]byte, envVal []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.SetVariable(&_EnvStorageImp.TransactOpts, envKey, envVal) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EnvStorageImp *EnvStorageImpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.TransferOwnership(&_EnvStorageImp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.TransferOwnership(&_EnvStorageImp.TransactOpts, newOwner) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_EnvStorageImp *EnvStorageImpTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_EnvStorageImp *EnvStorageImpSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.UpgradeTo(&_EnvStorageImp.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _EnvStorageImp.Contract.UpgradeTo(&_EnvStorageImp.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_EnvStorageImp *EnvStorageImpTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _EnvStorageImp.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_EnvStorageImp *EnvStorageImpSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.UpgradeToAndCall(&_EnvStorageImp.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_EnvStorageImp *EnvStorageImpTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _EnvStorageImp.Contract.UpgradeToAndCall(&_EnvStorageImp.TransactOpts, newImplementation, data) +} + +// EnvStorageImpAddressVarableChangedIterator is returned from FilterAddressVarableChanged and is used to iterate over the raw logs and unpacked data for AddressVarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpAddressVarableChangedIterator struct { + Event *EnvStorageImpAddressVarableChanged // 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 *EnvStorageImpAddressVarableChangedIterator) 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(EnvStorageImpAddressVarableChanged) + 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(EnvStorageImpAddressVarableChanged) + 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 *EnvStorageImpAddressVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpAddressVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpAddressVarableChanged represents a AddressVarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpAddressVarableChanged struct { + Name [32]byte + Value common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddressVarableChanged is a free log retrieval operation binding the contract event 0x5ba696c1849fe23c6b280f9f6057cb4574c818e0cd542032eed6e211f1e02464. +// +// Solidity: event AddressVarableChanged(bytes32 indexed _name, address _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterAddressVarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpAddressVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "AddressVarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpAddressVarableChangedIterator{contract: _EnvStorageImp.contract, event: "AddressVarableChanged", logs: logs, sub: sub}, nil +} + +// WatchAddressVarableChanged is a free log subscription operation binding the contract event 0x5ba696c1849fe23c6b280f9f6057cb4574c818e0cd542032eed6e211f1e02464. +// +// Solidity: event AddressVarableChanged(bytes32 indexed _name, address _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchAddressVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpAddressVarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "AddressVarableChanged", _nameRule) + 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(EnvStorageImpAddressVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "AddressVarableChanged", 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 +} + +// ParseAddressVarableChanged is a log parse operation binding the contract event 0x5ba696c1849fe23c6b280f9f6057cb4574c818e0cd542032eed6e211f1e02464. +// +// Solidity: event AddressVarableChanged(bytes32 indexed _name, address _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseAddressVarableChanged(log types.Log) (*EnvStorageImpAddressVarableChanged, error) { + event := new(EnvStorageImpAddressVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "AddressVarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the EnvStorageImp contract. +type EnvStorageImpAdminChangedIterator struct { + Event *EnvStorageImpAdminChanged // 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 *EnvStorageImpAdminChangedIterator) 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(EnvStorageImpAdminChanged) + 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(EnvStorageImpAdminChanged) + 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 *EnvStorageImpAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpAdminChanged represents a AdminChanged event raised by the EnvStorageImp contract. +type EnvStorageImpAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*EnvStorageImpAdminChangedIterator, error) { + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &EnvStorageImpAdminChangedIterator{contract: _EnvStorageImp.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpAdminChanged) (event.Subscription, error) { + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "AdminChanged") + 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(EnvStorageImpAdminChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseAdminChanged(log types.Log) (*EnvStorageImpAdminChanged, error) { + event := new(EnvStorageImpAdminChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the EnvStorageImp contract. +type EnvStorageImpBeaconUpgradedIterator struct { + Event *EnvStorageImpBeaconUpgraded // 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 *EnvStorageImpBeaconUpgradedIterator) 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(EnvStorageImpBeaconUpgraded) + 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(EnvStorageImpBeaconUpgraded) + 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 *EnvStorageImpBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpBeaconUpgraded represents a BeaconUpgraded event raised by the EnvStorageImp contract. +type EnvStorageImpBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*EnvStorageImpBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &EnvStorageImpBeaconUpgradedIterator{contract: _EnvStorageImp.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *EnvStorageImpBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(EnvStorageImpBeaconUpgraded) + if err := _EnvStorageImp.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseBeaconUpgraded(log types.Log) (*EnvStorageImpBeaconUpgraded, error) { + event := new(EnvStorageImpBeaconUpgraded) + if err := _EnvStorageImp.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpBytes32VarableChangedIterator is returned from FilterBytes32VarableChanged and is used to iterate over the raw logs and unpacked data for Bytes32VarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpBytes32VarableChangedIterator struct { + Event *EnvStorageImpBytes32VarableChanged // 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 *EnvStorageImpBytes32VarableChangedIterator) 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(EnvStorageImpBytes32VarableChanged) + 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(EnvStorageImpBytes32VarableChanged) + 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 *EnvStorageImpBytes32VarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpBytes32VarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpBytes32VarableChanged represents a Bytes32VarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpBytes32VarableChanged struct { + Name [32]byte + Value [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBytes32VarableChanged is a free log retrieval operation binding the contract event 0xde32aec28e018560c62b0217a8e7cfdc094cda68f1fc7ecd4ed833ee1d4862c9. +// +// Solidity: event Bytes32VarableChanged(bytes32 indexed _name, bytes32 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterBytes32VarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpBytes32VarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "Bytes32VarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpBytes32VarableChangedIterator{contract: _EnvStorageImp.contract, event: "Bytes32VarableChanged", logs: logs, sub: sub}, nil +} + +// WatchBytes32VarableChanged is a free log subscription operation binding the contract event 0xde32aec28e018560c62b0217a8e7cfdc094cda68f1fc7ecd4ed833ee1d4862c9. +// +// Solidity: event Bytes32VarableChanged(bytes32 indexed _name, bytes32 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchBytes32VarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpBytes32VarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "Bytes32VarableChanged", _nameRule) + 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(EnvStorageImpBytes32VarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "Bytes32VarableChanged", 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 +} + +// ParseBytes32VarableChanged is a log parse operation binding the contract event 0xde32aec28e018560c62b0217a8e7cfdc094cda68f1fc7ecd4ed833ee1d4862c9. +// +// Solidity: event Bytes32VarableChanged(bytes32 indexed _name, bytes32 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseBytes32VarableChanged(log types.Log) (*EnvStorageImpBytes32VarableChanged, error) { + event := new(EnvStorageImpBytes32VarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "Bytes32VarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpBytesVarableChangedIterator is returned from FilterBytesVarableChanged and is used to iterate over the raw logs and unpacked data for BytesVarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpBytesVarableChangedIterator struct { + Event *EnvStorageImpBytesVarableChanged // 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 *EnvStorageImpBytesVarableChangedIterator) 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(EnvStorageImpBytesVarableChanged) + 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(EnvStorageImpBytesVarableChanged) + 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 *EnvStorageImpBytesVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpBytesVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpBytesVarableChanged represents a BytesVarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpBytesVarableChanged struct { + Name [32]byte + Value []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBytesVarableChanged is a free log retrieval operation binding the contract event 0x871b63105583c40db6d530b9340369142c5ae265e41a501d300455015dc1283a. +// +// Solidity: event BytesVarableChanged(bytes32 indexed _name, bytes _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterBytesVarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpBytesVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "BytesVarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpBytesVarableChangedIterator{contract: _EnvStorageImp.contract, event: "BytesVarableChanged", logs: logs, sub: sub}, nil +} + +// WatchBytesVarableChanged is a free log subscription operation binding the contract event 0x871b63105583c40db6d530b9340369142c5ae265e41a501d300455015dc1283a. +// +// Solidity: event BytesVarableChanged(bytes32 indexed _name, bytes _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchBytesVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpBytesVarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "BytesVarableChanged", _nameRule) + 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(EnvStorageImpBytesVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "BytesVarableChanged", 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 +} + +// ParseBytesVarableChanged is a log parse operation binding the contract event 0x871b63105583c40db6d530b9340369142c5ae265e41a501d300455015dc1283a. +// +// Solidity: event BytesVarableChanged(bytes32 indexed _name, bytes _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseBytesVarableChanged(log types.Log) (*EnvStorageImpBytesVarableChanged, error) { + event := new(EnvStorageImpBytesVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "BytesVarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the EnvStorageImp contract. +type EnvStorageImpInitializedIterator struct { + Event *EnvStorageImpInitialized // 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 *EnvStorageImpInitializedIterator) 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(EnvStorageImpInitialized) + 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(EnvStorageImpInitialized) + 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 *EnvStorageImpInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpInitialized represents a Initialized event raised by the EnvStorageImp contract. +type EnvStorageImpInitialized 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 (_EnvStorageImp *EnvStorageImpFilterer) FilterInitialized(opts *bind.FilterOpts) (*EnvStorageImpInitializedIterator, error) { + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &EnvStorageImpInitializedIterator{contract: _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *EnvStorageImpInitialized) (event.Subscription, error) { + + logs, sub, err := _EnvStorageImp.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(EnvStorageImpInitialized) + if err := _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpFilterer) ParseInitialized(log types.Log) (*EnvStorageImpInitialized, error) { + event := new(EnvStorageImpInitialized) + if err := _EnvStorageImp.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpIntVarableChangedIterator is returned from FilterIntVarableChanged and is used to iterate over the raw logs and unpacked data for IntVarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpIntVarableChangedIterator struct { + Event *EnvStorageImpIntVarableChanged // 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 *EnvStorageImpIntVarableChangedIterator) 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(EnvStorageImpIntVarableChanged) + 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(EnvStorageImpIntVarableChanged) + 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 *EnvStorageImpIntVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpIntVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpIntVarableChanged represents a IntVarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpIntVarableChanged struct { + Name [32]byte + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterIntVarableChanged is a free log retrieval operation binding the contract event 0x3b274b11383ad4ca069e655ed60df9e4307b7a0f82ba2245a3cb9789ab814bf6. +// +// Solidity: event IntVarableChanged(bytes32 indexed _name, int256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterIntVarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpIntVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "IntVarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpIntVarableChangedIterator{contract: _EnvStorageImp.contract, event: "IntVarableChanged", logs: logs, sub: sub}, nil +} + +// WatchIntVarableChanged is a free log subscription operation binding the contract event 0x3b274b11383ad4ca069e655ed60df9e4307b7a0f82ba2245a3cb9789ab814bf6. +// +// Solidity: event IntVarableChanged(bytes32 indexed _name, int256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchIntVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpIntVarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "IntVarableChanged", _nameRule) + 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(EnvStorageImpIntVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "IntVarableChanged", 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 +} + +// ParseIntVarableChanged is a log parse operation binding the contract event 0x3b274b11383ad4ca069e655ed60df9e4307b7a0f82ba2245a3cb9789ab814bf6. +// +// Solidity: event IntVarableChanged(bytes32 indexed _name, int256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseIntVarableChanged(log types.Log) (*EnvStorageImpIntVarableChanged, error) { + event := new(EnvStorageImpIntVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "IntVarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the EnvStorageImp contract. +type EnvStorageImpOwnershipTransferredIterator struct { + Event *EnvStorageImpOwnershipTransferred // 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 *EnvStorageImpOwnershipTransferredIterator) 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(EnvStorageImpOwnershipTransferred) + 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(EnvStorageImpOwnershipTransferred) + 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 *EnvStorageImpOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpOwnershipTransferred represents a OwnershipTransferred event raised by the EnvStorageImp contract. +type EnvStorageImpOwnershipTransferred 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 (_EnvStorageImp *EnvStorageImpFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*EnvStorageImpOwnershipTransferredIterator, 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 := _EnvStorageImp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &EnvStorageImpOwnershipTransferredIterator{contract: _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *EnvStorageImpOwnershipTransferred, 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 := _EnvStorageImp.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(EnvStorageImpOwnershipTransferred) + if err := _EnvStorageImp.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 (_EnvStorageImp *EnvStorageImpFilterer) ParseOwnershipTransferred(log types.Log) (*EnvStorageImpOwnershipTransferred, error) { + event := new(EnvStorageImpOwnershipTransferred) + if err := _EnvStorageImp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpSetRegistryIterator is returned from FilterSetRegistry and is used to iterate over the raw logs and unpacked data for SetRegistry events raised by the EnvStorageImp contract. +type EnvStorageImpSetRegistryIterator struct { + Event *EnvStorageImpSetRegistry // 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 *EnvStorageImpSetRegistryIterator) 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(EnvStorageImpSetRegistry) + 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(EnvStorageImpSetRegistry) + 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 *EnvStorageImpSetRegistryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpSetRegistryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpSetRegistry represents a SetRegistry event raised by the EnvStorageImp contract. +type EnvStorageImpSetRegistry struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetRegistry is a free log retrieval operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterSetRegistry(opts *bind.FilterOpts, addr []common.Address) (*EnvStorageImpSetRegistryIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "SetRegistry", addrRule) + if err != nil { + return nil, err + } + return &EnvStorageImpSetRegistryIterator{contract: _EnvStorageImp.contract, event: "SetRegistry", logs: logs, sub: sub}, nil +} + +// WatchSetRegistry is a free log subscription operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchSetRegistry(opts *bind.WatchOpts, sink chan<- *EnvStorageImpSetRegistry, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "SetRegistry", addrRule) + 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(EnvStorageImpSetRegistry) + if err := _EnvStorageImp.contract.UnpackLog(event, "SetRegistry", 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 +} + +// ParseSetRegistry is a log parse operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseSetRegistry(log types.Log) (*EnvStorageImpSetRegistry, error) { + event := new(EnvStorageImpSetRegistry) + if err := _EnvStorageImp.contract.UnpackLog(event, "SetRegistry", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpStringVarableChangedIterator is returned from FilterStringVarableChanged and is used to iterate over the raw logs and unpacked data for StringVarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpStringVarableChangedIterator struct { + Event *EnvStorageImpStringVarableChanged // 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 *EnvStorageImpStringVarableChangedIterator) 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(EnvStorageImpStringVarableChanged) + 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(EnvStorageImpStringVarableChanged) + 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 *EnvStorageImpStringVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpStringVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpStringVarableChanged represents a StringVarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpStringVarableChanged struct { + Name [32]byte + Value string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStringVarableChanged is a free log retrieval operation binding the contract event 0x43849fbc1e66a5d2cd0ace04916e2e6c8f314c1904d104cad97150428a370a41. +// +// Solidity: event StringVarableChanged(bytes32 indexed _name, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterStringVarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpStringVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "StringVarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpStringVarableChangedIterator{contract: _EnvStorageImp.contract, event: "StringVarableChanged", logs: logs, sub: sub}, nil +} + +// WatchStringVarableChanged is a free log subscription operation binding the contract event 0x43849fbc1e66a5d2cd0ace04916e2e6c8f314c1904d104cad97150428a370a41. +// +// Solidity: event StringVarableChanged(bytes32 indexed _name, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchStringVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpStringVarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "StringVarableChanged", _nameRule) + 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(EnvStorageImpStringVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "StringVarableChanged", 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 +} + +// ParseStringVarableChanged is a log parse operation binding the contract event 0x43849fbc1e66a5d2cd0ace04916e2e6c8f314c1904d104cad97150428a370a41. +// +// Solidity: event StringVarableChanged(bytes32 indexed _name, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseStringVarableChanged(log types.Log) (*EnvStorageImpStringVarableChanged, error) { + event := new(EnvStorageImpStringVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "StringVarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpUintVarableChangedIterator is returned from FilterUintVarableChanged and is used to iterate over the raw logs and unpacked data for UintVarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpUintVarableChangedIterator struct { + Event *EnvStorageImpUintVarableChanged // 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 *EnvStorageImpUintVarableChangedIterator) 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(EnvStorageImpUintVarableChanged) + 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(EnvStorageImpUintVarableChanged) + 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 *EnvStorageImpUintVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpUintVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpUintVarableChanged represents a UintVarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpUintVarableChanged struct { + Name [32]byte + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUintVarableChanged is a free log retrieval operation binding the contract event 0x58d7c10adfd5778016889c15d422d57f2975b9292415b54fe5d8cd4241200612. +// +// Solidity: event UintVarableChanged(bytes32 indexed _name, uint256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterUintVarableChanged(opts *bind.FilterOpts, _name [][32]byte) (*EnvStorageImpUintVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "UintVarableChanged", _nameRule) + if err != nil { + return nil, err + } + return &EnvStorageImpUintVarableChangedIterator{contract: _EnvStorageImp.contract, event: "UintVarableChanged", logs: logs, sub: sub}, nil +} + +// WatchUintVarableChanged is a free log subscription operation binding the contract event 0x58d7c10adfd5778016889c15d422d57f2975b9292415b54fe5d8cd4241200612. +// +// Solidity: event UintVarableChanged(bytes32 indexed _name, uint256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchUintVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpUintVarableChanged, _name [][32]byte) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "UintVarableChanged", _nameRule) + 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(EnvStorageImpUintVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "UintVarableChanged", 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 +} + +// ParseUintVarableChanged is a log parse operation binding the contract event 0x58d7c10adfd5778016889c15d422d57f2975b9292415b54fe5d8cd4241200612. +// +// Solidity: event UintVarableChanged(bytes32 indexed _name, uint256 _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseUintVarableChanged(log types.Log) (*EnvStorageImpUintVarableChanged, error) { + event := new(EnvStorageImpUintVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "UintVarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpUpgradeImplementationIterator is returned from FilterUpgradeImplementation and is used to iterate over the raw logs and unpacked data for UpgradeImplementation events raised by the EnvStorageImp contract. +type EnvStorageImpUpgradeImplementationIterator struct { + Event *EnvStorageImpUpgradeImplementation // 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 *EnvStorageImpUpgradeImplementationIterator) 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(EnvStorageImpUpgradeImplementation) + 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(EnvStorageImpUpgradeImplementation) + 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 *EnvStorageImpUpgradeImplementationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpUpgradeImplementationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpUpgradeImplementation represents a UpgradeImplementation event raised by the EnvStorageImp contract. +type EnvStorageImpUpgradeImplementation struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgradeImplementation is a free log retrieval operation binding the contract event 0x2a74bbaf99cf25202925743012bb137262ab3432c821e1ba94ddbecac2ea9708. +// +// Solidity: event UpgradeImplementation(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterUpgradeImplementation(opts *bind.FilterOpts, implementation []common.Address) (*EnvStorageImpUpgradeImplementationIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "UpgradeImplementation", implementationRule) + if err != nil { + return nil, err + } + return &EnvStorageImpUpgradeImplementationIterator{contract: _EnvStorageImp.contract, event: "UpgradeImplementation", logs: logs, sub: sub}, nil +} + +// WatchUpgradeImplementation is a free log subscription operation binding the contract event 0x2a74bbaf99cf25202925743012bb137262ab3432c821e1ba94ddbecac2ea9708. +// +// Solidity: event UpgradeImplementation(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchUpgradeImplementation(opts *bind.WatchOpts, sink chan<- *EnvStorageImpUpgradeImplementation, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "UpgradeImplementation", implementationRule) + 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(EnvStorageImpUpgradeImplementation) + if err := _EnvStorageImp.contract.UnpackLog(event, "UpgradeImplementation", 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 +} + +// ParseUpgradeImplementation is a log parse operation binding the contract event 0x2a74bbaf99cf25202925743012bb137262ab3432c821e1ba94ddbecac2ea9708. +// +// Solidity: event UpgradeImplementation(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseUpgradeImplementation(log types.Log) (*EnvStorageImpUpgradeImplementation, error) { + event := new(EnvStorageImpUpgradeImplementation) + if err := _EnvStorageImp.contract.UnpackLog(event, "UpgradeImplementation", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the EnvStorageImp contract. +type EnvStorageImpUpgradedIterator struct { + Event *EnvStorageImpUpgraded // 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 *EnvStorageImpUpgradedIterator) 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(EnvStorageImpUpgraded) + 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(EnvStorageImpUpgraded) + 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 *EnvStorageImpUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpUpgraded represents a Upgraded event raised by the EnvStorageImp contract. +type EnvStorageImpUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*EnvStorageImpUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &EnvStorageImpUpgradedIterator{contract: _EnvStorageImp.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *EnvStorageImpUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(EnvStorageImpUpgraded) + if err := _EnvStorageImp.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseUpgraded(log types.Log) (*EnvStorageImpUpgraded, error) { + event := new(EnvStorageImpUpgraded) + if err := _EnvStorageImp.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// EnvStorageImpVarableChangedIterator is returned from FilterVarableChanged and is used to iterate over the raw logs and unpacked data for VarableChanged events raised by the EnvStorageImp contract. +type EnvStorageImpVarableChangedIterator struct { + Event *EnvStorageImpVarableChanged // 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 *EnvStorageImpVarableChangedIterator) 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(EnvStorageImpVarableChanged) + 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(EnvStorageImpVarableChanged) + 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 *EnvStorageImpVarableChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EnvStorageImpVarableChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EnvStorageImpVarableChanged represents a VarableChanged event raised by the EnvStorageImp contract. +type EnvStorageImpVarableChanged struct { + Name [32]byte + Type *big.Int + Value string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVarableChanged is a free log retrieval operation binding the contract event 0x60841501cd68d1c6414ed8f47a579de24c7e2f9da7e97f10c4932196d92df402. +// +// Solidity: event VarableChanged(bytes32 indexed _name, uint256 indexed _type, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) FilterVarableChanged(opts *bind.FilterOpts, _name [][32]byte, _type []*big.Int) (*EnvStorageImpVarableChangedIterator, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + var _typeRule []interface{} + for _, _typeItem := range _type { + _typeRule = append(_typeRule, _typeItem) + } + + logs, sub, err := _EnvStorageImp.contract.FilterLogs(opts, "VarableChanged", _nameRule, _typeRule) + if err != nil { + return nil, err + } + return &EnvStorageImpVarableChangedIterator{contract: _EnvStorageImp.contract, event: "VarableChanged", logs: logs, sub: sub}, nil +} + +// WatchVarableChanged is a free log subscription operation binding the contract event 0x60841501cd68d1c6414ed8f47a579de24c7e2f9da7e97f10c4932196d92df402. +// +// Solidity: event VarableChanged(bytes32 indexed _name, uint256 indexed _type, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) WatchVarableChanged(opts *bind.WatchOpts, sink chan<- *EnvStorageImpVarableChanged, _name [][32]byte, _type []*big.Int) (event.Subscription, error) { + + var _nameRule []interface{} + for _, _nameItem := range _name { + _nameRule = append(_nameRule, _nameItem) + } + var _typeRule []interface{} + for _, _typeItem := range _type { + _typeRule = append(_typeRule, _typeItem) + } + + logs, sub, err := _EnvStorageImp.contract.WatchLogs(opts, "VarableChanged", _nameRule, _typeRule) + 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(EnvStorageImpVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "VarableChanged", 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 +} + +// ParseVarableChanged is a log parse operation binding the contract event 0x60841501cd68d1c6414ed8f47a579de24c7e2f9da7e97f10c4932196d92df402. +// +// Solidity: event VarableChanged(bytes32 indexed _name, uint256 indexed _type, string _value) +func (_EnvStorageImp *EnvStorageImpFilterer) ParseVarableChanged(log types.Log) (*EnvStorageImpVarableChanged, error) { + event := new(EnvStorageImpVarableChanged) + if err := _EnvStorageImp.contract.UnpackLog(event, "VarableChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/gen_gov_abi.go b/wemix/bind/gen_gov_abi.go new file mode 100644 index 000000000000..3a034fe6bd19 --- /dev/null +++ b/wemix/bind/gen_gov_abi.go @@ -0,0 +1,5304 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// GovImpMemberInfo is an auto generated low-level Go binding around an user-defined struct. +type GovImpMemberInfo struct { + Staker common.Address + Voter common.Address + Reward common.Address + Name []byte + Enode []byte + Ip []byte + Port *big.Int + LockAmount *big.Int + Memo []byte + Duration *big.Int +} + +// GovMetaData contains all meta data concerning the Gov contract. +var GovMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_imp\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "5c60da1b": "implementation()", + }, + Bin: "0x608060405234801561001057600080fd5b5060405161077238038061077283398101604081905261002f91610326565b604080516020810190915260008152819061006b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61034f565b60008051602061072b8339815191521461008757610087610374565b6100938282600061009b565b505050610405565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b61008b1760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610136838360405180606001604052806027815260200161074b602791396101fd565b9392505050565b610150816102db60201b6100b71760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061072b83398151915260001b6102ea60201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161028091906103b6565b600060405180830381855af49150503d80600081146102bb576040519150601f19603f3d011682016040523d82523d6000602084013e6102c0565b606091505b5090925090506102d18282866102ed565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102fc575081610136565b82511561030c5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103d2565b60006020828403121561033857600080fd5b81516001600160a01b038116811461013657600080fd5b60008282101561036f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156103a557818101518382015260200161038d565b838111156100ca5750506000910152565b600082516103c881846020870161038a565b9190910192915050565b60208152600082518060208401526103f181604085016020870161038a565b601f01601f19169190910160400192915050565b610317806104146000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102bb60279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b60606001600160a01b0384163b61018d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a8919061026b565b600060405180830381855af49150503d80600081146101e3576040519150601f19603f3d011682016040523d82523d6000602084013e6101e8565b606091505b50915091506101f8828286610202565b9695505050505050565b606083156102115750816100b0565b8251156102215782518084602001fd5b8160405162461bcd60e51b81526004016101849190610287565b60005b8381101561025657818101518382015260200161023e565b83811115610265576000848401525b50505050565b6000825161027d81846020870161023b565b9190910192915050565b60208152600082518060208401526102a681604085016020870161023b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205c5f915dcf6f7660b1c747da8970454451eff69d1682eba92b7b9f4409ff356864736f6c634300080e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", +} + +// GovABI is the input ABI used to generate the binding from. +// Deprecated: Use GovMetaData.ABI instead. +var GovABI = GovMetaData.ABI + +// Deprecated: Use GovMetaData.Sigs instead. +// GovFuncSigs maps the 4-byte function signature to its string representation. +var GovFuncSigs = GovMetaData.Sigs + +// GovBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use GovMetaData.Bin instead. +var GovBin = GovMetaData.Bin + +// DeployGov deploys a new Ethereum contract, binding an instance of Gov to it. +func DeployGov(auth *bind.TransactOpts, backend bind.ContractBackend, _imp common.Address) (common.Address, *types.Transaction, *Gov, error) { + parsed, err := GovMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GovBin), backend, _imp) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Gov{GovCaller: GovCaller{contract: contract}, GovTransactor: GovTransactor{contract: contract}, GovFilterer: GovFilterer{contract: contract}}, nil +} + +// Gov is an auto generated Go binding around an Ethereum contract. +type Gov struct { + GovCaller // Read-only binding to the contract + GovTransactor // Write-only binding to the contract + GovFilterer // Log filterer for contract events +} + +// GovCaller is an auto generated read-only Go binding around an Ethereum contract. +type GovCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovTransactor is an auto generated write-only Go binding around an Ethereum contract. +type GovTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type GovFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type GovSession struct { + Contract *Gov // 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 +} + +// GovCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type GovCallerSession struct { + Contract *GovCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// GovTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type GovTransactorSession struct { + Contract *GovTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GovRaw is an auto generated low-level Go binding around an Ethereum contract. +type GovRaw struct { + Contract *Gov // Generic contract binding to access the raw methods on +} + +// GovCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type GovCallerRaw struct { + Contract *GovCaller // Generic read-only contract binding to access the raw methods on +} + +// GovTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type GovTransactorRaw struct { + Contract *GovTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewGov creates a new instance of Gov, bound to a specific deployed contract. +func NewGov(address common.Address, backend bind.ContractBackend) (*Gov, error) { + contract, err := bindGov(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Gov{GovCaller: GovCaller{contract: contract}, GovTransactor: GovTransactor{contract: contract}, GovFilterer: GovFilterer{contract: contract}}, nil +} + +// NewGovCaller creates a new read-only instance of Gov, bound to a specific deployed contract. +func NewGovCaller(address common.Address, caller bind.ContractCaller) (*GovCaller, error) { + contract, err := bindGov(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &GovCaller{contract: contract}, nil +} + +// NewGovTransactor creates a new write-only instance of Gov, bound to a specific deployed contract. +func NewGovTransactor(address common.Address, transactor bind.ContractTransactor) (*GovTransactor, error) { + contract, err := bindGov(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &GovTransactor{contract: contract}, nil +} + +// NewGovFilterer creates a new log filterer instance of Gov, bound to a specific deployed contract. +func NewGovFilterer(address common.Address, filterer bind.ContractFilterer) (*GovFilterer, error) { + contract, err := bindGov(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &GovFilterer{contract: contract}, nil +} + +// bindGov binds a generic wrapper to an already deployed contract. +func bindGov(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(GovABI)) + 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 (_Gov *GovRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Gov.Contract.GovCaller.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 (_Gov *GovRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Gov.Contract.GovTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Gov *GovRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Gov.Contract.GovTransactor.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 (_Gov *GovCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Gov.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 (_Gov *GovTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Gov.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Gov *GovTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Gov.Contract.contract.Transact(opts, method, params...) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Gov *GovCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Gov.contract.Call(opts, &out, "implementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Gov *GovSession) Implementation() (common.Address, error) { + return _Gov.Contract.Implementation(&_Gov.CallOpts) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Gov *GovCallerSession) Implementation() (common.Address, error) { + return _Gov.Contract.Implementation(&_Gov.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Gov *GovTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Gov.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Gov *GovSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Gov.Contract.Fallback(&_Gov.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Gov *GovTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Gov.Contract.Fallback(&_Gov.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Gov *GovTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Gov.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Gov *GovSession) Receive() (*types.Transaction, error) { + return _Gov.Contract.Receive(&_Gov.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Gov *GovTransactorSession) Receive() (*types.Transaction, error) { + return _Gov.Contract.Receive(&_Gov.TransactOpts) +} + +// GovAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the Gov contract. +type GovAdminChangedIterator struct { + Event *GovAdminChanged // 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 *GovAdminChangedIterator) 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(GovAdminChanged) + 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(GovAdminChanged) + 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 *GovAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovAdminChanged represents a AdminChanged event raised by the Gov contract. +type GovAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Gov *GovFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*GovAdminChangedIterator, error) { + + logs, sub, err := _Gov.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &GovAdminChangedIterator{contract: _Gov.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Gov *GovFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *GovAdminChanged) (event.Subscription, error) { + + logs, sub, err := _Gov.contract.WatchLogs(opts, "AdminChanged") + 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(GovAdminChanged) + if err := _Gov.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Gov *GovFilterer) ParseAdminChanged(log types.Log) (*GovAdminChanged, error) { + event := new(GovAdminChanged) + if err := _Gov.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the Gov contract. +type GovBeaconUpgradedIterator struct { + Event *GovBeaconUpgraded // 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 *GovBeaconUpgradedIterator) 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(GovBeaconUpgraded) + 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(GovBeaconUpgraded) + 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 *GovBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovBeaconUpgraded represents a BeaconUpgraded event raised by the Gov contract. +type GovBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Gov *GovFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*GovBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _Gov.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &GovBeaconUpgradedIterator{contract: _Gov.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Gov *GovFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *GovBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _Gov.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(GovBeaconUpgraded) + if err := _Gov.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Gov *GovFilterer) ParseBeaconUpgraded(log types.Log) (*GovBeaconUpgraded, error) { + event := new(GovBeaconUpgraded) + if err := _Gov.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Gov contract. +type GovUpgradedIterator struct { + Event *GovUpgraded // 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 *GovUpgradedIterator) 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(GovUpgraded) + 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(GovUpgraded) + 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 *GovUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovUpgraded represents a Upgraded event raised by the Gov contract. +type GovUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Gov *GovFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*GovUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Gov.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &GovUpgradedIterator{contract: _Gov.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Gov *GovFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *GovUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Gov.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(GovUpgraded) + if err := _Gov.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Gov *GovFilterer) ParseUpgraded(log types.Log) (*GovUpgraded, error) { + event := new(GovUpgraded) + if err := _Gov.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpMetaData contains all meta data concerning the GovImp contract. +var GovImpMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"envName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"envType\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"envVal\",\"type\":\"bytes\"}],\"name\":\"EnvChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"GovDataMigrated\",\"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\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"MemberAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newVoter\",\"type\":\"address\"}],\"name\":\"MemberChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"MemberRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"MemberUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"ballotId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"NotApplicable\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPeriod\",\"type\":\"uint256\"}],\"name\":\"SetProposalTimePeriod\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetRegistry\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MIN_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_DURATION_MIN_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BALLOT_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_FEE_MAX_CHANGE_RATE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_CREATION_TIME_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_GASLIMIT_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_AMOUNT_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_METHOD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DENOMINATOR\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ENV_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GASLIMIT_AND_BASE_FEE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GAS_TARGET_PERCENTAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_BASE_FEE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_IDLE_BLOCK_INTERVAL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_PRIORITY_FEE_PER_GAS_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_POOL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MIN_MAX_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_MIN_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"reward\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"enode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"ip\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"port\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"internalType\":\"structGovImp.MemberInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"name\":\"addProposalToAddMember\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"envName\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"envType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"envVal\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"addProposalToChangeEnv\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newGovAddr\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"addProposalToChangeGov\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"reward\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"enode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"ip\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"port\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"internalType\":\"structGovImp.MemberInfo\",\"name\":\"newInfo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"oldStaker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"unlockAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slashing\",\"type\":\"uint256\"}],\"name\":\"addProposalToChangeMember\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"memo\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unlockAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slashing\",\"type\":\"uint256\"}],\"name\":\"addProposalToRemoveMember\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ballotLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"checkUnfinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizeEndedVote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBallotInVoting\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxStaking\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMaxVotingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getMemberFromNodeIdx\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMemberLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinStaking\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMinVotingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getNode\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"enode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"ip\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"port\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getNodeIdxFromMember\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNodeLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getReward\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getStakerAddr\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"idx\",\"type\":\"uint256\"}],\"name\":\"getVoter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"enode\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"ip\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"port\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"oldModifiedBlock\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"}],\"name\":\"initMigration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registry\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"initOnce\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isMember\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isReward\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isStaker\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isVoter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastAddProposalTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oldGov\",\"type\":\"address\"}],\"name\":\"migrateFromLegacy\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"modifiedBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposal_time_period\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reInit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reg\",\"outputs\":[{\"internalType\":\"contractIRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"rewardIdx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newPeriod\",\"type\":\"uint256\"}],\"name\":\"setProposalTimePeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"stakerIdx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ballotIdx\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approval\",\"type\":\"bool\"}],\"name\":\"vote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"voteLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"voterIdx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Sigs: map[string]string{ + "0015a73b": "BALLOT_DURATION_MAX_NAME()", + "656e3052": "BALLOT_DURATION_MIN_MAX_NAME()", + "6d583ca7": "BALLOT_DURATION_MIN_NAME()", + "9986e4b9": "BALLOT_STORAGE_NAME()", + "c42a0abc": "BASE_FEE_MAX_CHANGE_RATE_NAME()", + "3f35c8fe": "BLOCKS_PER_NAME()", + "c0b4fe15": "BLOCK_CREATION_TIME_NAME()", + "238737b6": "BLOCK_GASLIMIT_NAME()", + "a9b629b2": "BLOCK_REWARD_AMOUNT_NAME()", + "c6713baf": "BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME()", + "7b2bfb01": "BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME()", + "46946416": "BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME()", + "278bb12a": "BLOCK_REWARD_DISTRIBUTION_METHOD_NAME()", + "6167eb45": "BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME()", + "918f8674": "DENOMINATOR()", + "34125c84": "ECOSYSTEM_NAME()", + "7bf46530": "ENV_STORAGE_NAME()", + "c7d3da34": "GASLIMIT_AND_BASE_FEE_NAME()", + "4d273e28": "GAS_TARGET_PERCENTAGE_NAME()", + "6c78d2cf": "GOV_NAME()", + "4bd1ed76": "MAINTENANCE_NAME()", + "f38ecf47": "MAX_BASE_FEE_NAME()", + "b128f880": "MAX_IDLE_BLOCK_INTERVAL_NAME()", + "38294419": "MAX_PRIORITY_FEE_PER_GAS_NAME()", + "2f40992e": "REWARD_POOL_NAME()", + "c00ace6c": "STAKING_MAX_NAME()", + "a6868b7d": "STAKING_MIN_MAX_NAME()", + "6fde207a": "STAKING_MIN_NAME()", + "1e0cba0d": "STAKING_NAME()", + "5a731cca": "STAKING_REWARD_NAME()", + "36e83d83": "addProposalToAddMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256))", + "40690353": "addProposalToChangeEnv(bytes32,uint256,bytes,bytes,uint256)", + "0efa4909": "addProposalToChangeGov(address,bytes,uint256)", + "a78a8188": "addProposalToChangeMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256),address,uint256,uint256)", + "894f5111": "addProposalToRemoveMember(address,uint256,bytes,uint256,uint256,uint256)", + "d6f9cfce": "ballotLength()", + "1c12b030": "checkUnfinalized()", + "6ba99181": "finalizeEndedVote()", + "de09b377": "getBallotInVoting()", + "5aaa4040": "getMaxStaking()", + "ce04b9d4": "getMaxVotingDuration()", + "ab3545e5": "getMember(uint256)", + "15bf6b4d": "getMemberFromNodeIdx(uint256)", + "d965ea00": "getMemberLength()", + "af6af2ff": "getMinStaking()", + "1c150171": "getMinVotingDuration()", + "4f0f4aa9": "getNode(uint256)", + "ce6a54ff": "getNodeIdxFromMember(address)", + "72016f75": "getNodeLength()", + "1c4b774b": "getReward(uint256)", + "6f6de96d": "getStakerAddr(address)", + "e75235b8": "getThreshold()", + "d07bff0c": "getVoter(uint256)", + "a8915a3e": "init(address,uint256,bytes,bytes,bytes,uint256)", + "397e38e7": "initMigration(address,uint256,address)", + "351bacda": "initOnce(address,uint256,bytes)", + "a230c524": "isMember(address)", + "4d5ce038": "isReward(address)", + "6f1e8533": "isStaker(address)", + "a7771ee3": "isVoter(address)", + "139d9dd3": "lastAddProposalTime(address)", + "8d39e33a": "migrateFromLegacy(address)", + "7d10dd1b": "modifiedBlock()", + "8da5cb5b": "owner()", + "3310569c": "proposal_time_period()", + "52d1902d": "proxiableUUID()", + "16fbe831": "reInit()", + "738fdd1a": "reg()", + "715018a6": "renounceOwnership()", + "aaf0dd36": "rewardIdx(address)", + "e27bdaef": "setProposalTimePeriod(uint256)", + "a91ee0dc": "setRegistry(address)", + "a0c12683": "stakerIdx(address)", + "f2fde38b": "transferOwnership(address)", + "3659cfe6": "upgradeTo(address)", + "4f1ef286": "upgradeToAndCall(address,bytes)", + "c9d27afe": "vote(uint256,bool)", + "e9523fb5": "voteLength()", + "cec5b622": "voterIdx(address)", + }, + Bin: "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516185c86200012060003960008181611e6501528181611ea5015281816129eb01528181612a2b0152612aa701526185c86000f3fe6080604052600436106104675760003560e01c806372016f751161024a578063af6af2ff11610139578063cec5b622116100b6578063e27bdaef1161007a578063e27bdaef14610fb3578063e75235b814610fd3578063e9523fb514610fe8578063f2fde38b14610ffe578063f38ecf471461101e57600080fd5b8063cec5b62214610f10578063d07bff0c14610f3d578063d6f9cfce14610f73578063d965ea0014610f89578063de09b37714610f9e57600080fd5b8063c6713baf116100fd578063c6713baf14610e3d578063c7d3da3414610e71578063c9d27afe14610ea5578063ce04b9d414610ec5578063ce6a54ff14610eda57600080fd5b8063af6af2ff14610d58578063b128f88014610d6d578063c00ace6c14610da1578063c0b4fe1514610dd5578063c42a0abc14610e0957600080fd5b8063a0c12683116101c7578063a8915a3e1161018b578063a8915a3e14610c81578063a91ee0dc14610ca1578063a9b629b214610cc1578063aaf0dd3614610cf5578063ab3545e514610d2257600080fd5b8063a0c1268314610ba8578063a230c52414610bd5578063a6868b7d14610bf5578063a7771ee314610c29578063a78a818814610c6157600080fd5b8063894f51111161020e578063894f511114610b105780638d39e33a14610b305780638da5cb5b14610b50578063918f867414610b6e5780639986e4b914610b8457600080fd5b806372016f7514610a70578063738fdd1a14610a855780637b2bfb0114610aa55780637bf4653014610ad95780637d10dd1b14610afa57600080fd5b80633f35c8fe116103665780635aaa4040116102e35780636d583ca7116102a75780636d583ca71461099b5780636f1e8533146109cf5780636f6de96d14610a075780636fde207a14610a27578063715018a614610a5b57600080fd5b80635aaa4040146108e05780636167eb45146108f5578063656e3052146109295780636ba991811461095d5780636c78d2cf1461097257600080fd5b80634d5ce0381161032a5780634d5ce038146108445780634f0f4aa9146108645780634f1ef2861461089457806352d1902d146108a75780635a731cca146108bc57600080fd5b80633f35c8fe14610766578063406903531461079a57806346946416146107ba5780634bd1ed76146107ee5780634d273e281461081057600080fd5b8063238737b6116103f4578063351bacda116103b8578063351bacda146106b25780633659cfe6146106d257806336e83d83146106f25780633829441914610712578063397e38e71461074657600080fd5b8063238737b6146105f3578063278bb12a146106275780632f40992e1461065b5780633310569c1461067c57806334125c841461069257600080fd5b806316fbe8311161043b57806316fbe8311461054e5780631c12b030146105655780631c1501711461058a5780631c4b774b1461059f5780631e0cba0d146105d557600080fd5b806215a73b1461046c5780630efa4909146104b3578063139d9dd3146104d357806315bf6b4d14610500575b600080fd5b34801561047857600080fd5b506104a07f0c4fbe9dc9de15dd7c0d064975ee1a2f2f9b954fa0e65d4f6cddba94884bdc3e81565b6040519081526020015b60405180910390f35b3480156104bf57600080fd5b506104a06104ce366004617682565b611052565b3480156104df57600080fd5b506104a06104ee3660046176da565b60ab6020526000908152604090205481565b34801561050c57600080fd5b5061053661051b3660046176f7565b6000908152607360205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020016104aa565b34801561055a57600080fd5b506105636113db565b005b34801561057157600080fd5b5061057a61171a565b60405190151581526020016104aa565b34801561059657600080fd5b506104a061176b565b3480156105ab57600080fd5b506105366105ba3660046176f7565b6000908152606a60205260409020546001600160a01b031690565b3480156105e157600080fd5b506104a0665374616b696e6760c81b81565b3480156105ff57600080fd5b506104a07f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27881565b34801561063357600080fd5b506104a07f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2281565b34801561066757600080fd5b506104a06914995dd85c99141bdbdb60b21b81565b34801561068857600080fd5b506104a060aa5481565b34801561069e57600080fd5b506104a06845636f73797374656d60b81b81565b3480156106be57600080fd5b506105636106cd366004617710565b6117db565b3480156106de57600080fd5b506105636106ed3660046176da565b611e5b565b3480156106fe57600080fd5b506104a061070d366004617876565b611f40565b34801561071e57600080fd5b506104a07fbe90e461bbdb9a95a694f7796912ea04244caf7f5b60ad7ded17e16821d3e44c81565b34801561075257600080fd5b506105636107613660046178b2565b612458565b34801561077257600080fd5b506104a07f2a268972a70c8c688b62366bdfdd9bb09cf19d3e5b6e7e7bb158e671ffdcedd281565b3480156107a657600080fd5b506104a06107b53660046178f4565b612553565b3480156107c657600080fd5b506104a07fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d81565b3480156107fa57600080fd5b506104a06a4d61696e74656e616e636560a81b81565b34801561081c57600080fd5b506104a07f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088881565b34801561085057600080fd5b5061057a61085f3660046176da565b6127e7565b34801561087057600080fd5b5061088461087f3660046176f7565b612804565b6040516104aa94939291906179ca565b6105636108a2366004617a15565b6129e1565b3480156108b357600080fd5b506104a0612a9a565b3480156108c857600080fd5b506104a06c14dd185ada5b99d4995dd85c99609a1b81565b3480156108ec57600080fd5b506104a0612b4d565b34801561090157600080fd5b506104a07f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505081565b34801561093557600080fd5b506104a07fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e781565b34801561096957600080fd5b50610563612b94565b34801561097e57600080fd5b506104a07111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b3480156109a757600080fd5b506104a07fc69fc6b7d0efc934fd5a3581c7253a7107a952526bb6dbcd814ef8d8dae1f44a81565b3480156109db57600080fd5b5061057a6109ea3660046176da565b6001600160a01b03166000908152606d6020526040902054151590565b348015610a1357600080fd5b50610536610a223660046176da565b612c82565b348015610a3357600080fd5b506104a07f0b09c9badbbeb6c813a598ee910770a39ccda797a1940439bb6e47fc6c87548b81565b348015610a6757600080fd5b50610563612cf1565b348015610a7c57600080fd5b506074546104a0565b348015610a9157600080fd5b50606554610536906001600160a01b031681565b348015610ab157600080fd5b506104a07f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa81565b348015610ae557600080fd5b506104a069456e7653746f7261676560b01b81565b348015610b0657600080fd5b506104a060665481565b348015610b1c57600080fd5b506104a0610b2b366004617a64565b612d05565b348015610b3c57600080fd5b506104a0610b4b3660046176da565b613063565b348015610b5c57600080fd5b506033546001600160a01b0316610536565b348015610b7a57600080fd5b506104a061271081565b348015610b9057600080fd5b506104a06c42616c6c6f7453746f7261676560981b81565b348015610bb457600080fd5b506104a0610bc33660046176da565b606d6020526000908152604090205481565b348015610be157600080fd5b5061057a610bf03660046176da565b6138f5565b348015610c0157600080fd5b506104a07f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b81565b348015610c3557600080fd5b5061057a610c443660046176da565b6001600160a01b0316600090815260686020526040902054151590565b348015610c6d57600080fd5b506104a0610c7c366004617ad8565b613938565b348015610c8d57600080fd5b50610563610c9c366004617b36565b614094565b348015610cad57600080fd5b50610563610cbc3660046176da565b6144fd565b348015610ccd57600080fd5b506104a07f89dd490ecaf395283ed4ff2fd9557ca767fc425dce063451a9b0da6d72f600c381565b348015610d0157600080fd5b506104a0610d103660046176da565b606b6020526000908152604090205481565b348015610d2e57600080fd5b50610536610d3d3660046176f7565b6000908152606c60205260409020546001600160a01b031690565b348015610d6457600080fd5b506104a06145a5565b348015610d7957600080fd5b506104a07f829561ab7af084b7efc6600518d2df79b8d95f3f4c3a550f54f8f7ec7d2b805781565b348015610dad57600080fd5b506104a07f18ad4415ef4a621ce1a136395c51ab6c3712bb2e24b79d526059925cea58dcb881565b348015610de157600080fd5b506104a07f8086da5becff4dfac91a3105821b361078d2d4abba0ccc2401b974cf0dcf05c181565b348015610e1557600080fd5b506104a07fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747381565b348015610e4957600080fd5b506104a07fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6081565b348015610e7d57600080fd5b506104a07f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc81565b348015610eb157600080fd5b50610563610ec0366004617bf0565b6145ec565b348015610ed157600080fd5b506104a06147e1565b348015610ee657600080fd5b506104a0610ef53660046176da565b6001600160a01b031660009081526072602052604090205490565b348015610f1c57600080fd5b506104a0610f2b3660046176da565b60686020526000908152604090205481565b348015610f4957600080fd5b50610536610f583660046176f7565b6000908152606760205260409020546001600160a01b031690565b348015610f7f57600080fd5b506104a060755481565b348015610f9557600080fd5b506069546104a0565b348015610faa57600080fd5b506077546104a0565b348015610fbf57600080fd5b50610563610fce3660046176f7565b614828565b348015610fdf57600080fd5b506113896104a0565b348015610ff457600080fd5b506104a060765481565b34801561100a57600080fd5b506105636110193660046176da565b6148ae565b34801561102a57600080fd5b506104a07f7c1150f0e1a39ff55552d52764f97e6c387e2a247e1df344369f122c4254be2f81565b600061105c614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa1580156110a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c69190617c20565b6110eb5760405162461bcd60e51b81526004016110e290617c3d565b60405180910390fd5b60006110f633612c82565b60aa546001600160a01b038216600090815260ab6020526040902054919250906111209042617c7a565b101561113e5760405162461bcd60e51b81526004016110e290617c91565b600061114933612c82565b9050611153612b4d565b61115c82614944565b11158015611179575061116d6145a5565b61117682614944565b10155b6111955760405162461bcd60e51b81526004016110e290617cc8565b6001600160a01b0386166111eb5760405162461bcd60e51b815260206004820152601d60248201527f496d706c656d656e746174696f6e2063616e6e6f74206265207a65726f00000060448201526064016110e2565b6111f36149bb565b6001600160a01b0316866001600160a01b03160361124b5760405162461bcd60e51b815260206004820152601560248201527453616d6520636f6e7472616374206164647265737360581b60448201526064016110e2565b856001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156112a5575060408051601f3d908101601f191682019092526112a291810190617cff565b60015b6112c15760405162461bcd60e51b81526004016110e290617d18565b60008051602061850c83398151915281146112ee5760405162461bcd60e51b81526004016110e290617d66565b506075546112fd906001617daf565b92506113076149d7565b6001600160a01b0316630a3a63fe60755460016113249190617daf565b60046040516001600160e01b031960e085901b16815260048101929092526024820152604481018790523360648201526001600160a01b038916608482015260a4016020604051808303816000875af1158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190617cff565b506113b483866149f2565b5060758290556001600160a01b0316600090815260ab602052604090204290559392505050565b600054600290610100900460ff161580156113fd575060005460ff8083169116105b6114195760405162461bcd60e51b81526004016110e290617dc7565b6000805461ffff191660ff831617610100179055611435614a5d565b60005b6069548110156116e65760008181526071602052604080822081516080810190925280548290829061146990617e15565b80601f016020809104026020016040519081016040528092919081815260200182805461149590617e15565b80156114e25780601f106114b7576101008083540402835291602001916114e2565b820191906000526020600020905b8154815290600101906020018083116114c557829003601f168201915b505050505081526020016001820180546114fb90617e15565b80601f016020809104026020016040519081016040528092919081815260200182805461152790617e15565b80156115745780601f1061154957610100808354040283529160200191611574565b820191906000526020600020905b81548152906001019060200180831161155757829003601f168201915b5050505050815260200160028201805461158d90617e15565b80601f01602080910402602001604051908101604052809291908181526020018280546115b990617e15565b80156116065780601f106115db57610100808354040283529160200191611606565b820191906000526020600020905b8154815290600101906020018083116115e957829003601f168201915b5050505050815260200160038201548152505090506001606e82600001516040516116319190617e49565b90815260405160209181900382018120805460ff191693151593909317909255820151600191606f9161166391617e49565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160706000836040015184606001516040516020016116a9929190617e65565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff191691151591909117905550600101611438565b506000805461ff001916905560405160ff8216815260008051602061852c833981519152906020015b60405180910390a150565b6000607754600014611765576000611733607754614ab7565b509150506000611744607754614b3f565b50915050600119820161176257428110156117625760009250505090565b50505b50600190565b6000611775614bba565b6001600160a01b03166333be496e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d69190617cff565b905090565b600054610100900460ff16158080156117fb5750600054600160ff909116105b806118155750303b158015611815575060005460ff166001145b6118315760405162461bcd60e51b81526004016110e290617dc7565b6000805460ff191660011790558015611854576000805461ff0019166101001790555b61185c614bd2565b611864614c01565b61186d846144fd565b43606655600061187b614c30565b90506118856145a5565b841015801561189b575083611898612b4d565b10155b6118b75760405162461bcd60e51b81526004016110e290617e87565b600080600060608060606000806000905060008060208d0191508c51826118de9190617daf565b90505b80821015611e0c57815199506118f8602083617daf565b915080821061190657600080fd5b81519850611915602083617daf565b915080821061192357600080fd5b81519750611932602083617daf565b915080821061194057600080fd5b819650865160206119519190617daf565b61195b9083617daf565b915080821061196957600080fd5b8195508551602061197a9190617daf565b6119849083617daf565b915080821061199257600080fd5b819450845160206119a39190617daf565b6119ad9083617daf565b91508082106119bb57600080fd5b815193506119ca602083617daf565b91506119d7600184617daf565b92506119e28a6138f5565b1580156119f557506119f3896138f5565b155b8015611a075750611a05886127e7565b155b611a445760405162461bcd60e51b815260206004820152600e60248201526d20b63932b0b23c9036b2b6b132b960911b60448201526064016110e2565b886067600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606860008b6001600160a01b03166001600160a01b031681526020019081526020016000208190555087606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606b60008a6001600160a01b03166001600160a01b031681526020019081526020016000208190555089606c600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606d60008c6001600160a01b03166001600160a01b0316815260200190815260200160002081905550886001600160a01b03168a6001600160a01b03167f6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba660405160405180910390a36040516325d998bb60e01b81526001600160a01b038b811660048301528f91908d16906325d998bb90602401602060405180830381865afa158015611bf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c179190617cff565b1015611c5c5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207374616b696e6760601b60448201526064016110e2565b611c6887878787614c45565b611c845760405162461bcd60e51b81526004016110e290617eb4565b611c8e8a8f614cf4565b600083815260716020908152604090912088519091611cb19183918b019061742c565b508651611cc790600183019060208a019061742c565b508551611cdd906002830190602089019061742c565b508481600301819055506001606e89604051611cf99190617e49565b908152604051908190036020018120805492151560ff1990931692909217909155600190606f90611d2b908a90617e49565b908152602001604051809103902060006101000a81548160ff0219169083151502179055506001607060008888604051602001611d69929190617e65565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055508a6073600086815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555083607260008d6001600160a01b03166001600160a01b0316815260200190815260200160002081905550506118e1565b50506069819055607455505086159550611e55945050505050576000805461ff00191690556040516001815260008051602061852c833981519152906020015b60405180910390a15b50505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611ea35760405162461bcd60e51b81526004016110e290617ee2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611ed56149bb565b6001600160a01b031614611efb5760405162461bcd60e51b81526004016110e290617f2e565b611f0481614d33565b611f3d8160005b6040519080825280601f01601f191660200182016040528015611f35576020820181803683370190505b506000614dc1565b50565b6000611f4a614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190617c20565b611fd05760405162461bcd60e51b81526004016110e290617c3d565b6000611fdb33612c82565b60aa546001600160a01b038216600090815260ab6020526040902054919250906120059042617c7a565b10156120235760405162461bcd60e51b81526004016110e290617c91565b600061202e33612c82565b9050612038612b4d565b61204182614944565b1115801561205e57506120526145a5565b61205b82614944565b10155b61207a5760405162461bcd60e51b81526004016110e290617cc8565b602084015184906001600160a01b03166120c65760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103b37ba32b960991b60448201526064016110e2565b60008160600151511161210f5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206e6f6465206e616d6560781b60448201526064016110e2565b60008160a0015151116121565760405162461bcd60e51b815260206004820152600f60248201526e0496e76616c6964206e6f646520495608c1b60448201526064016110e2565b60008160c001511161219e5760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b9bd919481c1bdc9d607a1b60448201526064016110e2565b6000816080015151116121e85760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206e6f646520656e6f646560701b60448201526064016110e2565b6000816101000151511161222d5760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206d656d6f60a01b60448201526064016110e2565b6000816101200151116122755760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b210323ab930ba34b7b760811b60448201526064016110e2565b61227d6145a5565b8160e001511015801561229b5750612293612b4d565b8160e0015111155b6122dd5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac8105b5bdd5b9d606a1b60448201526064016110e2565b84516122e8906138f5565b1580156122fd575084516122fb906127e7565b155b61233a5760405162461bcd60e51b815260206004820152600e60248201526d20b63932b0b23c9036b2b6b132b960911b60448201526064016110e2565b84602001516001600160a01b031685600001516001600160a01b031614801561237c575084604001516001600160a01b031685600001516001600160a01b0316145b6123be5760405162461bcd60e51b815260206004820152601360248201527229ba30b5b2b91034b9903737ba103b37ba32b960691b60448201526064016110e2565b6123da856060015186608001518760a001518860c00151614c45565b6123f65760405162461bcd60e51b81526004016110e290617eb4565b607554612404906001617daf565b935061241584600133600089614ea8565b612423848660e00151614f4b565b612432848661010001516149f2565b505060758290556001600160a01b0316600090815260ab60205260409020429055919050565b600054610100900460ff16158080156124785750600054600160ff909116105b806124925750303b158015612492575060005460ff166001145b6124ae5760405162461bcd60e51b81526004016110e290617dc7565b6000805460ff1916600117905580156124d1576000805461ff0019166101001790555b6124d9614bd2565b6124e1614c01565b6124ea846144fd565b60668390556124f8826148ae565b60405133907fab2db0a6f442428b686ffa80eadcaabe7d5ee00049c6ae888a237edd3238d85690600090a28015611e55576000805461ff00191690556040516001815260008051602061852c83398151915290602001611e4c565b600061255d614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa1580156125a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c79190617c20565b6125e35760405162461bcd60e51b81526004016110e290617c3d565b60006125ee33612c82565b60aa546001600160a01b038216600090815260ab6020526040902054919250906126189042617c7a565b10156126365760405162461bcd60e51b81526004016110e290617c91565b600061264133612c82565b905061264b612b4d565b61265482614944565b1115801561267157506126656145a5565b61266e82614944565b10155b61268d5760405162461bcd60e51b81526004016110e290617cc8565b8660011115801561269f575060098711155b6126da5760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964207479706560a01b60448201526064016110e2565b6126e48887614f89565b6127205760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b60448201526064016110e2565b60755461272e906001617daf565b92506127386149d7565b6001600160a01b0316634a57823e84600587338d8d8d6040518863ffffffff1660e01b81526004016127709796959493929190617f7a565b6020604051808303816000875af115801561278f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b39190617cff565b506127be83866149f2565b5060758290556001600160a01b0316600090815260ab6020526040902042905595945050505050565b6001600160a01b03166000908152606b6020526040902054151590565b60008181526071602052604081206003810154815460609384938493919290916001830191600284019190849061283a90617e15565b80601f016020809104026020016040519081016040528092919081815260200182805461286690617e15565b80156128b35780601f10612888576101008083540402835291602001916128b3565b820191906000526020600020905b81548152906001019060200180831161289657829003601f168201915b505050505093508280546128c690617e15565b80601f01602080910402602001604051908101604052809291908181526020018280546128f290617e15565b801561293f5780601f106129145761010080835404028352916020019161293f565b820191906000526020600020905b81548152906001019060200180831161292257829003601f168201915b5050505050925081805461295290617e15565b80601f016020809104026020016040519081016040528092919081815260200182805461297e90617e15565b80156129cb5780601f106129a0576101008083540402835291602001916129cb565b820191906000526020600020905b8154815290600101906020018083116129ae57829003601f168201915b5050505050915093509350935093509193509193565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003612a295760405162461bcd60e51b81526004016110e290617ee2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316612a5b6149bb565b6001600160a01b031614612a815760405162461bcd60e51b81526004016110e290617f2e565b612a8a82614d33565b612a9682826001614dc1565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612b3a5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016110e2565b5060008051602061850c83398151915290565b6000612b57614bba565b6001600160a01b031663737c59b86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b612b9c614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015612be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c069190617c20565b612c225760405162461bcd60e51b81526004016110e290617c3d565b612c2a61171a565b15612c6d5760405162461bcd60e51b8152602060048201526013602482015272159bdd1a5b99c81a5cc81b9bdd08195b991959606a1b60448201526064016110e2565b607754612c7b906004615008565b6000607755565b6001600160a01b0381166000908152606d602052604081205415612ca4575090565b6001600160a01b03821660009081526068602052604090205415612cec57506001600160a01b038082166000908152606860209081526040808320548352606c909152902054165b919050565b612cf9614a5d565b612d036000615046565b565b6000612d0f614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015612d55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d799190617c20565b612d955760405162461bcd60e51b81526004016110e290617c3d565b6000612da033612c82565b60aa546001600160a01b038216600090815260ab602052604090205491925090612dca9042617c7a565b1015612de85760405162461bcd60e51b81526004016110e290617c91565b6000612df333612c82565b9050612dfd612b4d565b612e0682614944565b11158015612e235750612e176145a5565b612e2082614944565b10155b612e3f5760405162461bcd60e51b81526004016110e290617cc8565b6001600160a01b038916612e875760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016110e2565b612e90896138f5565b612ec95760405162461bcd60e51b815260206004820152600a6024820152692737b716b6b2b6b132b960b11b60448201526064016110e2565b6001612ed460695490565b11612f215760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742072656d6f7665206120736f6c65206d656d626572000000000060448201526064016110e2565b87612f2b8a614944565b1015612f8c5760405162461bcd60e51b815260206004820152602a60248201527f496e73756666696369656e742062616c616e636520746861742063616e206265604482015269103ab73637b1b5b2b21760b11b60648201526084016110e2565b607554612f9a906001617daf565b604080516101408101825260008082526020808301829052828401829052835182815280820185526060840152835182815280820185526080840152835182815290810190935260a082019290925260c081019190915260e081018a905261010081018990526101208101889052909350613019846002338d85614ea8565b613023848a614f4b565b61302d84896149f2565b613038848787615098565b505060758290556001600160a01b0316600090815260ab602052604090204290559695505050505050565b60008054610100900460ff16158080156130845750600054600160ff909116105b8061309e5750303b15801561309e575060005460ff166001145b6130ba5760405162461bcd60e51b81526004016110e290617dc7565b6000805460ff1916600117905580156130dd576000805461ff0019166101001790555b6130e5614bd2565b6130ed614c01565b6000839050613157816001600160a01b031663738fdd1a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613133573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbc9190617fc6565b436066819055506131c3816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561319f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190617fc6565b60015b816001600160a01b031663d965ea006040518163ffffffff1660e01b8152600401602060405180830381865afa158015613204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132289190617cff565b81116137185760405163ab3545e560e01b8152600481018290526001600160a01b0383169063ab3545e590602401602060405180830381865afa158015613273573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132979190617fc6565b6000828152606c6020908152604080832080546001600160a01b0319166001600160a01b039586169081179091558352606d909152908190208390555163341effc360e21b8152600481018390529083169063d07bff0c90602401602060405180830381865afa15801561330f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133339190617fc6565b600082815260676020908152604080832080546001600160a01b0319166001600160a01b03958616908117909155835260689091529081902083905551631c4b774b60e01b81526004810183905290831690631c4b774b90602401602060405180830381865afa1580156133ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133cf9190617fc6565b6000828152606a6020908152604080832080546001600160a01b0319166001600160a01b03959095169485179055928252606b8152828220849055606984905582516080810184526060808252918101829052928301819052820152604051634f0f4aa960e01b8152600481018390526001600160a01b03841690634f0f4aa990602401600060405180830381865afa158015613470573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134989190810190618033565b6060850181905260408501829052602085018390528385526134bd9392919085615107565b6135095760405162461bcd60e51b815260206004820152601760248201527f6e6f646520696e666f206973206475706c69636174656400000000000000000060448201526064016110e2565b6001606e826000015160405161351f9190617e49565b90815260405160209181900382018120805460ff191693151593909317909255820151600191606f9161355191617e49565b908152602001604051809103902060006101000a81548160ff02191690831515021790555060016070600083604001518460600151604051602001613597929190617e65565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff1916941515949094179093558483526071815291208251805184936135ed92849291019061742c565b506020828101518051613606926001850192019061742c565b506040820151805161362291600284019160209091019061742c565b50606091909101516003909101556000828152606c6020818152604080842080546001600160a01b039081168652607284528286208890558786528154607385529583902080546001600160a01b031916968216969096179095556074879055929091529054905163139d9dd360e01b815290821660048201529084169063139d9dd390602401602060405180830381865afa1580156136c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ea9190617cff565b6000838152606c60209081526040808320546001600160a01b0316835260ab909152902055506001016131c6565b50806001600160a01b0316633310569c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377b9190617cff565b60aa81905550806001600160a01b031663d6f9cfce6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137e39190617cff565b607581905550806001600160a01b031663e9523fb56040518163ffffffff1660e01b8152600401602060405180830381865afa158015613827573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061384b9190617cff565b607681905550806001600160a01b031663de09b3776040518163ffffffff1660e01b8152600401602060405180830381865afa15801561388f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138b39190617cff565b607755506000915080156138ef576000805461ff00191690556040516001815260008051602061852c8339815191529060200160405180910390a15b50919050565b6001600160a01b0381166000908152606d602052604081205415158061393257506001600160a01b03821660009081526068602052604090205415155b92915050565b6000613942614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015613988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139ac9190617c20565b6139c85760405162461bcd60e51b81526004016110e290617c3d565b60006139d333612c82565b60aa546001600160a01b038216600090815260ab6020526040902054919250906139fd9042617c7a565b1015613a1b5760405162461bcd60e51b81526004016110e290617c91565b6000613a2633612c82565b9050613a30612b4d565b613a3982614944565b11158015613a565750613a4a6145a5565b613a5382614944565b10155b613a725760405162461bcd60e51b81526004016110e290617cc8565b602087015187906001600160a01b0316613abe5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103b37ba32b960991b60448201526064016110e2565b600081606001515111613b075760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206e6f6465206e616d6560781b60448201526064016110e2565b60008160a001515111613b4e5760405162461bcd60e51b815260206004820152600f60248201526e0496e76616c6964206e6f646520495608c1b60448201526064016110e2565b60008160c0015111613b965760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b9bd919481c1bdc9d607a1b60448201526064016110e2565b600081608001515111613be05760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206e6f646520656e6f646560701b60448201526064016110e2565b60008161010001515111613c255760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206d656d6f60a01b60448201526064016110e2565b600081610120015111613c6d5760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b210323ab930ba34b7b760811b60448201526064016110e2565b613c756145a5565b8160e0015110158015613c935750613c8b612b4d565b8160e0015111155b613cd55760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac8105b5bdd5b9d606a1b60448201526064016110e2565b6001600160a01b038716613d215760405162461bcd60e51b8152602060048201526013602482015272496e76616c6964206f6c64204164647265737360681b60448201526064016110e2565b613d2a876138f5565b613d635760405162461bcd60e51b815260206004820152600a6024820152692737b716b6b2b6b132b960b11b60448201526064016110e2565b6020808901516001600160a01b038981166000908152606d8452604080822054825260679094529290922054821691161480613db45750866001600160a01b031688602001516001600160a01b0316145b80613dde5750613dc788602001516138f5565b158015613dde5750613ddc88602001516127e7565b155b8015613e6057506040808901516001600160a01b038981166000908152606d6020908152848220548252606a90529290922054821691161480613e365750866001600160a01b031688604001516001600160a01b0316145b80613e605750613e4988604001516138f5565b158015613e605750613e5e88604001516127e7565b155b613e9f5760405162461bcd60e51b815260206004820152601060248201526f20b63932b0b23c90309036b2b6b132b960811b60448201526064016110e2565b336001600160a01b038816148015613ec3575087516001600160a01b038881169116145b15613f185785158015613ed4575084155b613f135760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a59081c1c9bdc1bdcd85b60821b60448201526064016110e2565b613fc7565b87516001600160a01b03888116911614613fc757613f346145a5565b613f3e8688617daf565b1115613fc75760405162461bcd60e51b815260206004820152604c60248201527f496e76616c696420616d6f756e743a2028756e6c6f636b416d6f756e74202b2060448201527f736c617368696e6729206d75737420626520657175616c206f72206c6f77207460648201526b6f206d696e5374616b696e6760a01b608482015260a4016110e2565b607554613fd5906001617daf565b9350613fe5846003338a8c614ea8565b613ff3848960e00151614f4b565b614002848961010001516149f2565b61400d848787615098565b6075849055336001600160a01b038816148015614036575087516001600160a01b038881169116145b1561407057600061404685614b3f565b925050506140608542834261405b9190617daf565b615230565b61406e856003600180615275565b505b50506001600160a01b0316600090815260ab60205260409020429055949350505050565b600054610100900460ff16158080156140b45750600054600160ff909116105b806140ce5750303b1580156140ce575060005460ff166001145b6140ea5760405162461bcd60e51b81526004016110e290617dc7565b6000805460ff19166001179055801561410d576000805461ff0019166101001790555b614115614bd2565b61411d614c01565b614126876144fd565b61412e6145a5565b8610158015614144575085614141612b4d565b10155b6141605760405162461bcd60e51b81526004016110e290617e87565b600061416a614c30565b6040516325d998bb60e01b815233600482015290915087906001600160a01b038316906325d998bb90602401602060405180830381865afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190617cff565b101561421c5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207374616b696e6760601b60448201526064016110e2565b60405163282d3fdf60e01b8152336004820152602481018890526001600160a01b0382169063282d3fdf90604401600060405180830381600087803b15801561426457600080fd5b505af1158015614278573d6000803e3d6000fd5b5050600160698190557f6bee784efeb983674392298ab585b22866bedf00ebb0eea949d1e66f3f50e71d8054336001600160a01b0319918216811790925560008281526068602090815260408083208690557ff585789965ba69220d5ce3dc1b444eb22ff546f2650694fef8fafe9c26560af98054851686179055606b82528083208690557fdcf345d7f6a8deb7427d0fee62009fa15100353a1c666b51bb5387b25addcfa98054909416909417909255606d825291822083905560748390559190526071815288517f169c6be1b0e6ab5de76b532e587a77340130ac65c5591db02be822dcf1dc0ed69350614373925083918a019061742c565b508551614389906001830190602089019061742c565b50845161439f906002830190602088019061742c565b508381600301819055506001606e886040516143bb9190617e49565b908152604051908190036020018120805492151560ff1990931692909217909155600190606f906143ed908990617e49565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160706000878760405160200161442b929190617e65565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff1916941515949094179093556074543380855260728352838520829055908452607390915281832080546001600160a01b03191682179055436066559051909182917f6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba69190a3505080156144f4576000805461ff00191690556040516001815260008051602061852c8339815191529060200160405180910390a15b50505050505050565b614505614a5d565b6001600160a01b03811661455b5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064016110e2565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b60006145af614bba565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b60026078540361463e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016110e2565b600260785561464b614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015614691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146b59190617c20565b6146d15760405162461bcd60e51b81526004016110e290617c3d565b60006146dc33612c82565b90506146e6612b4d565b6146ef82614944565b1115801561470c57506147006145a5565b61470982614944565b10155b6147285760405162461bcd60e51b81526004016110e290617cc8565b61473061171a565b6147665760405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b60448201526064016110e2565b600061477184615300565b905061477d8484615413565b600080614789866154ed565b9250925050600061479961138990565b905080831015806147aa5750808210155b806147bf57506147ba8284617daf565b612710145b156147d3576147d387858486116000615275565b505060016078555050505050565b60006147eb614bba565b6001600160a01b0316631b27e01b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117b2573d6000803e3d6000fd5b614830614a5d565b610e1081106148795760405162461bcd60e51b81526020600482015260156024820152746e6577506572696f6420697320746f6f206c6f6e6760581b60448201526064016110e2565b60aa8190556040518181527f17c6f1d1ce638844b664872f5c6eecb7d150ec0c41187d7f85826a656ee7946f9060200161170f565b6148b6614a5d565b6001600160a01b03811661491b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110e2565b611f3d81615046565b60006117d67111dbdd995c9b985b98d950dbdb9d1c9858dd60721b615527565b600061494e614c30565b604051632c9aab9b60e11b81526001600160a01b03848116600483015291909116906359355736906024015b602060405180830381865afa158015614997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139329190617cff565b60008051602061850c833981519152546001600160a01b031690565b60006117d66c42616c6c6f7453746f7261676560981b615527565b6149fa6149d7565b6001600160a01b031663bce0dbc183836040518363ffffffff1660e01b8152600401614a279291906180c2565b600060405180830381600087803b158015614a4157600080fd5b505af1158015614a55573d6000803e3d6000fd5b505050505050565b6033546001600160a01b03163314612d035760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110e2565b6000806000614ac46149d7565b6001600160a01b031663688ca5b2856040518263ffffffff1660e01b8152600401614af191815260200190565b606060405180830381865afa158015614b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b3291906180db565b9250925092509193909250565b6000806000614b4c6149d7565b6001600160a01b03166309970688856040518263ffffffff1660e01b8152600401614b7991815260200190565b606060405180830381865afa158015614b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b329190618109565b60006117d669456e7653746f7261676560b01b615527565b600054610100900460ff16614bf95760405162461bcd60e51b81526004016110e290618137565b612d03615595565b600054610100900460ff16614c285760405162461bcd60e51b81526004016110e290618137565b612d036155c3565b60006117d6665374616b696e6760c81b615527565b604051600190606f90614c59908690617e49565b9081526040519081900360200190205460ff1615614c75575060005b606e85604051614c859190617e49565b9081526040519081900360200190205460ff1615614ca1575060005b60008383604051602001614cb6929190617e65565b60408051601f1981840301815291815281516020928301206000818152607090935291205490915060ff1615614ceb57600091505b50949350505050565b614cfc614c30565b60405163282d3fdf60e01b81526001600160a01b03848116600483015260248201849052919091169063282d3fdf90604401614a27565b614d3b614924565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015614d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614da59190617c20565b611f3d5760405162461bcd60e51b81526004016110e290617c3d565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615614df957614df4836155f3565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015614e53575060408051601f3d908101601f19168201909252614e5091810190617cff565b60015b614e6f5760405162461bcd60e51b81526004016110e290617d18565b60008051602061850c8339815191528114614e9c5760405162461bcd60e51b81526004016110e290617d66565b50614df483838361568f565b614eb06149d7565b6001600160a01b031663daacbb95868684610120015187878760000151886020015189604001518a606001518b608001518c60a001518d60c001516040518d63ffffffff1660e01b8152600401614f129c9b9a99989796959493929190618182565b600060405180830381600087803b158015614f2c57600080fd5b505af1158015614f40573d6000803e3d6000fd5b505050505050505050565b614f536149d7565b604051633968764960e11b815260048101849052602481018390526001600160a01b0391909116906372d0ec9290604401614a27565b6000614f93614bba565b6001600160a01b0316639801bff984846040518363ffffffff1660e01b8152600401614fc09291906180c2565b602060405180830381865afa158015614fdd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906150019190617c20565b9392505050565b6150106149d7565b60405163548f2cdd60e11b815260048101849052602481018390526001600160a01b03919091169063a91e59ba90604401614a27565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6150a06149d7565b604051632264085960e01b81526004810185905260248101849052604481018390526001600160a01b0391909116906322640859906064015b600060405180830381600087803b1580156150f357600080fd5b505af11580156144f4573d6000803e3d6000fd5b60006001905084805190602001208260200151805190602001201415801561514e5750606f8560405161513a9190617e49565b9081526040519081900360200190205460ff165b15615157575060005b8580519060200120826000015180519060200120141580156151985750606e866040516151849190617e49565b9081526040519081900360200190205460ff165b156151a1575060005b600084846040516020016151b6929190617e65565b60405160208183030381529060405280519060200120905080836040015184606001516040516020016151ea929190617e65565b604051602081830303815290604052805190602001201415801561521c575060008181526070602052604090205460ff165b1561522657600091505b5095945050505050565b6152386149d7565b60405163605b78c360e11b81526004810185905260248101849052604481018390526001600160a01b03919091169063c0b6f186906064016150d9565b600482156152e457506003600019840161529f57615292856156b4565b61529a575060045b6152e4565b600284036152b05761529a85615bbe565b600384036152c25761529285836160fe565b600484036152d35761529a85616698565b600584036152e4576152e485616748565b6152ee8582615008565b816152f95760006077555b5050505050565b600080600061530e84614ab7565b509092509050600181036153ac576077541561533c5760405162461bcd60e51b81526004016110e29061821f565b600061534785614b3f565b9250505061535361176b565b81101561537657615371854261536761176b565b61405b9042617daf565b6153a1565b8061537f6147e1565b10156153925761537185426153676147e1565b6153a1854261405b8482617daf565b50607784905561540c565b600281036153da5760775484146153d55760405162461bcd60e51b81526004016110e29061821f565b61540c565b60405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b60448201526064016110e2565b5092915050565b600060765460016154249190617daf565b9050600061543133612c82565b9050600061543e60695490565b61544a90612710618262565b905060008461545a57600261545d565b60015b90506154676149d7565b6040516325918ae760e21b815260048101869052602481018890526001600160a01b038581166044830152606482018490526084820185905291909116906396462b9c9060a401600060405180830381600087803b1580156154c857600080fd5b505af11580156154dc573d6000803e3d6000fd5b505050607694909455505050505050565b60008060006154fa6149d7565b6001600160a01b03166356ba988e856040518263ffffffff1660e01b8152600401614b7991815260200190565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd90602401602060405180830381865afa158015615571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139329190617fc6565b600054610100900460ff166155bc5760405162461bcd60e51b81526004016110e290618137565b6001607855565b600054610100900460ff166155ea5760405162461bcd60e51b81526004016110e290618137565b612d0333615046565b6001600160a01b0381163b6156605760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016110e2565b60008051602061850c83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6156988361688c565b6000825111806156a55750805b15614df457611e5583836168cc565b60006156c18260016168f1565b6000806000806000806000806156d68a616a0d565b98509850985098509850985098509850506156f0886138f5565b1561574e578960008051602061854c8339815191526040516157369060208082526010908201526f20b63932b0b23c90309036b2b6b132b960811b604082015260600190565b60405180910390a25060009998505050505050505050565b615757866127e7565b1561579f578960008051602061854c8339815191526040516157369060208082526012908201527120b63932b0b23c9030903932bbb0b93232b960711b604082015260600190565b6157a76145a5565b8110806157ba5750806157b8612b4d565b105b156157db578960008051602061854c83398151915260405161573690617e87565b806157e589616ab4565b1015615807578960008051602061854c83398151915260405161573690618284565b866001600160a01b0316886001600160a01b03161415801561583b5750856001600160a01b0316886001600160a01b031614155b15615887578960008051602061854c83398151915260405161573690602080825260169082015275496e76616c6964206d656d626572206164647265737360501b604082015260600190565b6158918882614cf4565b600060695460016158a29190617daf565b9050876067600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606860008a6001600160a01b03166001600160a01b031681526020019081526020016000208190555086606a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606b6000896001600160a01b03166001600160a01b031681526020019081526020016000208190555088606c600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606d60008b6001600160a01b03166001600160a01b0316815260200190815260200160002081905550600060745460016159db9190617daf565b6000818152607160209081526040909120895192935091615a01918391908b019061742c565b508651615a1790600183019060208a019061742c565b508551615a2d906002830190602089019061742c565b508481600301819055506001606e89604051615a499190617e49565b908152604051908190036020018120805492151560ff1990931692909217909155600190606f90615a7b908a90617e49565b908152602001604051809103902060006101000a81548160ff0219169083151502179055506001607060008888604051602001615ab9929190617e65565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055508a6073600084815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081607260008d6001600160a01b03166001600160a01b0316815260200190815260200160002081905550826069819055508160748190555043606681905550896001600160a01b03168b6001600160a01b03167f6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba660405160405180910390a35060019c9b505050505050505050505050565b615bc98160026168f1565b6000615bd482616a0d565b50505050505050509050615be7816138f5565b615c3c578160008051602061854c833981519152604051615c30906020808252601490820152732737ba1030b63932b0b23c90309036b2b6b132b960611b604082015260600190565b60405180910390a25050565b6001600160a01b038082166000818152606d6020818152604080842054606954808652606c8452828620548287526067855283872054606a86529387205497909652939092529094928316939083169216908414615da457606980546000908152606c6020818152604080842080546001600160a01b038c8116808852606d80875285892080549e8a529787528589209087529b821688528488209c909c559486905581546001600160a01b03199081169092558954821690851617909855888452606b8083528185205486548652606a80855283872080548a881689528487528589208054948a529287528589209487528716808952858920939093559087905580548b16905581548a16179055978352606880825288842054945484526067808352898520805489861687528385528b872080548989529386528c8820949095529094168086529985205592905580548616905580549094168517909355919291615e21565b606980546000908152606c6020908152604080832080546001600160a01b03199081169091556001600160a01b038a81168552606d845282852085905585548552606a84528285208054831690558681168552606b8452828520859055945484526067835281842080549091169055928516825260689052908120555b6001606954615e309190617c7a565b6069556000848152607160205260408082209051909190606f90615e58906001850190618364565b908152604051908190036020018120805492151560ff1990931692909217909155600090606e90615e8a908490618364565b90815260405160209181900382018120805460ff19169315159390931790925560038301546000926070928492615ec692600288019201618370565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff1916941515949094179093556074546001600160a01b038a168452607290915291205414616020576001600160a01b038087166000908152607260209081526040808320546074548452607383528184205460719093529220805492985092169550829190615f6190617e15565b615f6c9291906174b0565b5060745460009081526071602052604090206001908101805491830191615f9290617e15565b615f9d9291906174b0565b5060745460009081526071602052604090206002908101805491830191615fc390617e15565b615fce9291906174b0565b506074546000908152607160209081526040808320600390810154908501558783526073825280832080546001600160a01b0319166001600160a01b0389169081179091558352607290915290208590555b60748054600090815260736020908152604080832080546001600160a01b03191690556001600160a01b038a1683526072825280832083905592548252607190529081209061606f828261752b565b61607d60018301600061752b565b61608b60028301600061752b565b6003820160009055505060016074546160a49190617c7a565b607455436066556160b58787616aee565b826001600160a01b0316866001600160a01b03167faa91016c21c52c58ac64f23f71bbe75becc9ada603e18ee671d09ff15492d1c160405160405180910390a350505050505050565b600081616110576161108360036168f1565b60008060008060008060008060006161278c616a0d565b985098509850985098509850985098509850616142896138f5565b6161ae578b60008051602061854c833981519152604051616194906020808252601b908201527f4f6c642061646472657373206973206e6f742061206d656d6265720000000000604082015260600190565b60405180910390a260009950505050505050505050613932565b6161c18c8c8b8b8b8b8b8b8b8b8b616cbc565b6161d75760009950505050505050505050613932565b6001600160a01b03808a166000818152606d6020526040902054918a1614616246576000818152606c6020908152604080832080546001600160a01b0319166001600160a01b038e81169182179092558452606d909252808320849055908c1682528120556162468983614cf4565b6001600160a01b038a166000908152607260209081526040808320548084526071909252808320905191929091606e90616281908490618364565b908152604051908190036020018120805492151560ff1990931692909217909155600090606f906162b6906001850190618364565b90815260405160209181900382018120805460ff191693151593909317909255600383015460009260709284926162f292600288019201618370565b60408051808303601f1901815291815281516020928301208352828201939093529101600020805460ff1916921515929092179091558851616339918391908b019061742c565b50865161634f90600183019060208a019061742c565b508551616365906002830190602089019061742c565b506003810185905543606655604051600190606e90616385908b90617e49565b908152604051908190036020018120805492151560ff1990931692909217909155600190606f906163b7908a90617e49565b908152602001604051809103902060006101000a81548160ff02191690831515021790555060016070600088886040516020016163f5929190617e65565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff191694151594909417909355858352606a90529020546001600160a01b03908116915089168114616491576000838152606a6020908152604080832080546001600160a01b0319166001600160a01b038e81169182179092558452606b90925280832086905590831682528120555b506000828152606760205260409020546001600160a01b03908116908a16811461654357896067600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606860008c6001600160a01b03166001600160a01b0316815260200190815260200160002081905550600060686000836001600160a01b03166001600160a01b03168152602001908152602001600020819055505b50896001600160a01b03168b6001600160a01b03161461664357896073600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080607260008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055506000607260008d6001600160a01b03166001600160a01b03168152602001908152602001600020819055506165f48e8c616aee565b886001600160a01b03168a6001600160a01b03168c6001600160a01b03167f15f4d750630db473a85edd9d47c500527a2648cc5e676f39645e52790cf07be060405160405180910390a4616684565b896001600160a01b03168b6001600160a01b03167f1feee1b4fcb797c62645da41c5c6edd5f91d4291de0054da625c42b823594c1f60405160405180910390a35b5060019d9c50505050505050505050505050565b6166a38160046168f1565b60006166ad6149d7565b6001600160a01b0316637efa9ae3836040518263ffffffff1660e01b81526004016166da91815260200190565b602060405180830381865afa1580156166f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061671b9190617fc6565b90506001600160a01b03811615612a965761673581614d33565b616740816000611f0b565b436066555050565b6167538160056168f1565b60008060006167606149d7565b6001600160a01b0316631d940da2856040518263ffffffff1660e01b815260040161678d91815260200190565b600060405180830381865afa1580156167aa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526167d29190810190618389565b92509250925060006167e2614bba565b6040516388c2801960e01b81529091506001600160a01b038216906388c280199061681390879086906004016180c2565b600060405180830381600087803b15801561682d57600080fd5b505af1158015616841573d6000803e3d6000fd5b50504360665550506040517f701c16c2519cdb79aaac423a84733590e3510d9552055b6ad6908f0ab12b6c299061687d908690869086906183ce565b60405180910390a15050505050565b616895816155f3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060615001838360405180606001604052806027815260200161856c60279139617256565b6000806168fd84614ab7565b50915091508282146169475760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420766f74696e67207479706560681b60448201526064016110e2565b6002811461698e5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f74696e6720737461746560601b60448201526064016110e2565b60008061699a866154ed565b92509250506169a861138990565b821015806169b857506113898110155b806169cd57506169c88183617daf565b612710145b614a555760405162461bcd60e51b8152602060048201526011602482015270139bdd081e595d08199a5b985b1a5e9959607a1b60448201526064016110e2565b6000806000806060806060600080616a236149d7565b6001600160a01b03166373df4e018b6040518263ffffffff1660e01b8152600401616a5091815260200190565b600060405180830381865afa158015616a6d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052616a9591908101906183f6565b9850985098509850985098509850985098509193959799909294969850565b6000616abe614c30565b6040516325d998bb60e01b81526001600160a01b03848116600483015291909116906325d998bb9060240161497a565b600080616afa84617333565b91509150616b066145a5565b616b108284617daf565b1115616ba05760405162461bcd60e51b815260206004820152605360248201527f6d696e5374616b696e672076616c7565206d757374206265206772656174657260448201527f207468616e206f7220657175616c20746f207468652073756d206f6620756e6c6064820152726f636b416d6f756e742c20736c617368696e6760681b608482015260a4016110e2565b6000616baa614c30565b604051632c9aab9b60e11b81526001600160a01b038681166004830152919250600091831690635935573690602401602060405180830381865afa158015616bf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190616c1a9190617cff565b90506000616c266145a5565b616c309083617c7a565b905084821115616cb257616c4486866173b4565b604051634954a85b60e11b81526001600160a01b03878116600483015260248201869052604482018390528416906392a950b690606401600060405180830381600087803b158015616c9557600080fd5b505af1158015616ca9573d6000803e3d6000fd5b505050506144f4565b6144f486836173b4565b60008a616cce57616cce8c60036168f1565b616cd78a6138f5565b616d39578b60008051602061854c833981519152604051616d29906020808252601b908201527f4f6c642061646472657373206973206e6f742061206d656d6265720000000000604082015260600190565b60405180910390a2506000617247565b6001600160a01b03808b166000818152606d6020526040902054918b1614616eb057616d648a6138f5565b15616dc9578c60008051602061854c833981519152604051616db7906020808252601f908201527f6e6577206164647265737320697320616c72656164792061206d656d62657200604082015260600190565b60405180910390a26000915050617247565b886001600160a01b03168a6001600160a01b031614158015616dfd5750876001600160a01b03168a6001600160a01b031614155b15616e48578c60008051602061854c833981519152604051616db790602080825260159082015274496e76616c696420766f746572206164647265737360581b604082015260600190565b616e506145a5565b831080616e63575082616e61612b4d565b105b15616e84578c60008051602061854c833981519152604051616db790617e87565b82616e8e8b616ab4565b1015616eb0578c60008051602061854c833981519152604051616db790618284565b6001600160a01b038b166000908152607260209081526040808320548084526071909252808320815160808101909252805492939282908290616ef290617e15565b80601f0160208091040260200160405190810160405280929190818152602001828054616f1e90617e15565b8015616f6b5780601f10616f4057610100808354040283529160200191616f6b565b820191906000526020600020905b815481529060010190602001808311616f4e57829003601f168201915b50505050508152602001600182018054616f8490617e15565b80601f0160208091040260200160405190810160405280929190818152602001828054616fb090617e15565b8015616ffd5780601f10616fd257610100808354040283529160200191616ffd565b820191906000526020600020905b815481529060010190602001808311616fe057829003601f168201915b5050505050815260200160028201805461701690617e15565b80601f016020809104026020016040519081016040528092919081815260200182805461704290617e15565b801561708f5780601f106170645761010080835404028352916020019161708f565b820191906000526020600020905b81548152906001019060200180831161707257829003601f168201915b5050505050815260200160038201548152505090506170b18989898985615107565b6170e5578e60008051602061854c8339815191526040516170d190617eb4565b60405180910390a260009350505050617247565b506000828152606a60205260409020546001600160a01b03908116908d8116908b16148015906171275750896001600160a01b0316816001600160a01b031614155b801561714657506171378a6138f5565b8061714657506171468a6127e7565b15617192578e60008051602061854c8339815191526040516170d190602080825260169082015275496e76616c696420726577617264206164647265737360501b604082015260600190565b506000828152606760205260409020546001600160a01b03908116908d8116908c16148015906171d457508a6001600160a01b0316816001600160a01b031614155b80156171f357506171e48b6138f5565b806171f357506171f38b6127e7565b1561723f578e60008051602061854c8339815191526040516170d190602080825260169082015275496e76616c696420766f74657273206164647265737360501b604082015260600190565b506001925050505b9b9a5050505050505050505050565b60606001600160a01b0384163b6172be5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016110e2565b600080856001600160a01b0316856040516172d99190617e49565b600060405180830381855af49150503d8060008114617314576040519150601f19603f3d011682016040523d82523d6000602084013e617319565b606091505b50915091506173298282866173f3565b9695505050505050565b60008061733e6149d7565b6001600160a01b0316638c7be692846040518263ffffffff1660e01b815260040161736b91815260200190565b6040805180830381865afa158015617387573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906173ab91906184d4565b91509150915091565b6173bc614c30565b604051637eee288d60e01b81526001600160a01b038481166004830152602482018490529190911690637eee288d90604401614a27565b60608315617402575081615001565b8251156174125782518084602001fd5b8160405162461bcd60e51b81526004016110e291906184f8565b82805461743890617e15565b90600052602060002090601f01602090048101928261745a57600085556174a0565b82601f1061747357805160ff19168380011785556174a0565b828001600101855582156174a0579182015b828111156174a0578251825591602001919060010190617485565b506174ac929150617561565b5090565b8280546174bc90617e15565b90600052602060002090601f0160209004810192826174de57600085556174a0565b82601f106174ef57805485556174a0565b828001600101855582156174a057600052602060002091601f016020900482015b828111156174a0578254825591600101919060010190617510565b50805461753790617e15565b6000825580601f10617547575050565b601f016020900490600052602060002090810190611f3d91905b5b808211156174ac5760008155600101617562565b6001600160a01b0381168114611f3d57600080fd5b8035612cec81617576565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b03811182821017156175cf576175cf617596565b60405290565b604051601f8201601f191681016001600160401b03811182821017156175fd576175fd617596565b604052919050565b60006001600160401b0382111561761e5761761e617596565b50601f01601f191660200190565b600082601f83011261763d57600080fd5b813561765061764b82617605565b6175d5565b81815284602083860101111561766557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060006060848603121561769757600080fd5b83356176a281617576565b925060208401356001600160401b038111156176bd57600080fd5b6176c98682870161762c565b925050604084013590509250925092565b6000602082840312156176ec57600080fd5b813561500181617576565b60006020828403121561770957600080fd5b5035919050565b60008060006060848603121561772557600080fd5b833561773081617576565b92506020840135915060408401356001600160401b0381111561775257600080fd5b61775e8682870161762c565b9150509250925092565b6000610140828403121561777b57600080fd5b6177836175ac565b905061778e8261758b565b815261779c6020830161758b565b60208201526177ad6040830161758b565b604082015260608201356001600160401b03808211156177cc57600080fd5b6177d88583860161762c565b606084015260808401359150808211156177f157600080fd5b6177fd8583860161762c565b608084015260a084013591508082111561781657600080fd5b6178228583860161762c565b60a084015260c084013560c084015260e084013560e08401526101009150818401358181111561785157600080fd5b61785d8682870161762c565b8385015250505061012080830135818301525092915050565b60006020828403121561788857600080fd5b81356001600160401b0381111561789e57600080fd5b6178aa84828501617768565b949350505050565b6000806000606084860312156178c757600080fd5b83356178d281617576565b92506020840135915060408401356178e981617576565b809150509250925092565b600080600080600060a0868803121561790c57600080fd5b853594506020860135935060408601356001600160401b038082111561793157600080fd5b61793d89838a0161762c565b9450606088013591508082111561795357600080fd5b506179608882890161762c565b95989497509295608001359392505050565b60005b8381101561798d578181015183820152602001617975565b83811115611e555750506000910152565b600081518084526179b6816020860160208601617972565b601f01601f19169290920160200192915050565b6080815260006179dd608083018761799e565b82810360208401526179ef818761799e565b90508281036040840152617a03818661799e565b91505082606083015295945050505050565b60008060408385031215617a2857600080fd5b8235617a3381617576565b915060208301356001600160401b03811115617a4e57600080fd5b617a5a8582860161762c565b9150509250929050565b60008060008060008060c08789031215617a7d57600080fd5b8635617a8881617576565b95506020870135945060408701356001600160401b03811115617aaa57600080fd5b617ab689828a0161762c565b945050606087013592506080870135915060a087013590509295509295509295565b60008060008060808587031215617aee57600080fd5b84356001600160401b03811115617b0457600080fd5b617b1087828801617768565b9450506020850135617b2181617576565b93969395505050506040820135916060013590565b60008060008060008060c08789031215617b4f57600080fd5b8635617b5a81617576565b95506020870135945060408701356001600160401b0380821115617b7d57600080fd5b617b898a838b0161762c565b95506060890135915080821115617b9f57600080fd5b617bab8a838b0161762c565b94506080890135915080821115617bc157600080fd5b50617bce89828a0161762c565b92505060a087013590509295509295509295565b8015158114611f3d57600080fd5b60008060408385031215617c0357600080fd5b823591506020830135617c1581617be2565b809150509250929050565b600060208284031215617c3257600080fd5b815161500181617be2565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015617c8c57617c8c617c64565b500390565b6020808252601d908201527f43616e6e6f74206164642070726f706f73616c20746f6f206561726c79000000604082015260600190565b60208082526017908201527f496e76616c6964207374616b696e672062616c616e6365000000000000000000604082015260600190565b600060208284031215617d1157600080fd5b5051919050565b6020808252602e908201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960408201526d6f6e206973206e6f74205555505360901b606082015260800190565b60208082526029908201527f45524331393637557067726164653a20756e737570706f727465642070726f786040820152681a58589b195555525160ba1b606082015260800190565b60008219821115617dc257617dc2617c64565b500190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600181811c90821680617e2957607f821691505b6020821081036138ef57634e487b7160e01b600052602260045260246000fd5b60008251617e5b818460208701617972565b9190910192915050565b60008351617e77818460208801617972565b9190910191825250602001919050565b602080825260139082015272125b9d985b1a59081b1bd8dac8185b5bdd5b9d606a1b604082015260600190565b6020808252601490820152734475706c696361746564206e6f646520696e666f60601b604082015260600190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b87815286602082015285604082015260018060a01b03851660608201528360808201528260a082015260e060c08201526000617fb960e083018461799e565b9998505050505050505050565b600060208284031215617fd857600080fd5b815161500181617576565b8051612cec81617576565b600082601f830112617fff57600080fd5b815161800d61764b82617605565b81815284602083860101111561802257600080fd5b6178aa826020830160208701617972565b6000806000806080858703121561804957600080fd5b84516001600160401b038082111561806057600080fd5b61806c88838901617fee565b9550602087015191508082111561808257600080fd5b61808e88838901617fee565b945060408701519150808211156180a457600080fd5b506180b187828801617fee565b606096909601519497939650505050565b8281526040602082015260006178aa604083018461799e565b6000806000606084860312156180f057600080fd5b835192506020840151915060408401516178e981617be2565b60008060006060848603121561811e57600080fd5b8351925060208401519150604084015190509250925092565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b8c8152602081018c9052604081018b90526001600160a01b038a81166060830152898116608083015288811660a083015287811660c0830152861660e08201526000610180806101008401526181da8184018861799e565b90508281036101208401526181ef818761799e565b9050828103610140840152618204818661799e565b915050826101608301529d9c50505050505050505050505050565b60208082526023908201527f4e6f7720696e20766f74696e67207769746820646966666572656e742062616c6040820152621b1bdd60ea1b606082015260800190565b60008261827f57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526027908201527f496e73756666696369656e742062616c616e636520746861742063616e206265604082015266081b1bd8dad95960ca1b606082015260800190565b8054600090600181811c90808316806182e557607f831692505b6020808410820361830657634e487b7160e01b600052602260045260246000fd5b81801561831a576001811461832b57618358565b60ff19861689528489019650618358565b60008881526020902060005b868110156183505781548b820152908501908301618337565b505084890196505b50505050505092915050565b600061500182846182cb565b600061837c82856182cb565b9283525050602001919050565b60008060006060848603121561839e57600080fd5b835192506020840151915060408401516001600160401b038111156183c257600080fd5b61775e86828701617fee565b8381528260208201526060604082015260006183ed606083018461799e565b95945050505050565b60008060008060008060008060006101208a8c03121561841557600080fd5b61841e8a617fe3565b985061842c60208b01617fe3565b975061843a60408b01617fe3565b965061844860608b01617fe3565b955060808a01516001600160401b038082111561846457600080fd5b6184708d838e01617fee565b965060a08c015191508082111561848657600080fd5b6184928d838e01617fee565b955060c08c01519150808211156184a857600080fd5b506184b58c828d01617fee565b93505060e08a015191506101008a015190509295985092959850929598565b600080604083850312156184e757600080fd5b505080516020909101519092909150565b602081526000615001602083018461799e56fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249885e7f4987c0698db47045ad8cea110b51138f0eecbd94915842328cf6c3dc97d416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201c4c8ec3cb8aea63f16a3c0701f1b93e96a7d982a5f81c50f3144b30002cec4a64736f6c634300080e0033", +} + +// GovImpABI is the input ABI used to generate the binding from. +// Deprecated: Use GovImpMetaData.ABI instead. +var GovImpABI = GovImpMetaData.ABI + +// Deprecated: Use GovImpMetaData.Sigs instead. +// GovImpFuncSigs maps the 4-byte function signature to its string representation. +var GovImpFuncSigs = GovImpMetaData.Sigs + +// GovImpBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use GovImpMetaData.Bin instead. +var GovImpBin = GovImpMetaData.Bin + +// DeployGovImp deploys a new Ethereum contract, binding an instance of GovImp to it. +func DeployGovImp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *GovImp, error) { + parsed, err := GovImpMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(GovImpBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &GovImp{GovImpCaller: GovImpCaller{contract: contract}, GovImpTransactor: GovImpTransactor{contract: contract}, GovImpFilterer: GovImpFilterer{contract: contract}}, nil +} + +// GovImp is an auto generated Go binding around an Ethereum contract. +type GovImp struct { + GovImpCaller // Read-only binding to the contract + GovImpTransactor // Write-only binding to the contract + GovImpFilterer // Log filterer for contract events +} + +// GovImpCaller is an auto generated read-only Go binding around an Ethereum contract. +type GovImpCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovImpTransactor is an auto generated write-only Go binding around an Ethereum contract. +type GovImpTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovImpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type GovImpFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// GovImpSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type GovImpSession struct { + Contract *GovImp // 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 +} + +// GovImpCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type GovImpCallerSession struct { + Contract *GovImpCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// GovImpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type GovImpTransactorSession struct { + Contract *GovImpTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// GovImpRaw is an auto generated low-level Go binding around an Ethereum contract. +type GovImpRaw struct { + Contract *GovImp // Generic contract binding to access the raw methods on +} + +// GovImpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type GovImpCallerRaw struct { + Contract *GovImpCaller // Generic read-only contract binding to access the raw methods on +} + +// GovImpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type GovImpTransactorRaw struct { + Contract *GovImpTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewGovImp creates a new instance of GovImp, bound to a specific deployed contract. +func NewGovImp(address common.Address, backend bind.ContractBackend) (*GovImp, error) { + contract, err := bindGovImp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &GovImp{GovImpCaller: GovImpCaller{contract: contract}, GovImpTransactor: GovImpTransactor{contract: contract}, GovImpFilterer: GovImpFilterer{contract: contract}}, nil +} + +// NewGovImpCaller creates a new read-only instance of GovImp, bound to a specific deployed contract. +func NewGovImpCaller(address common.Address, caller bind.ContractCaller) (*GovImpCaller, error) { + contract, err := bindGovImp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &GovImpCaller{contract: contract}, nil +} + +// NewGovImpTransactor creates a new write-only instance of GovImp, bound to a specific deployed contract. +func NewGovImpTransactor(address common.Address, transactor bind.ContractTransactor) (*GovImpTransactor, error) { + contract, err := bindGovImp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &GovImpTransactor{contract: contract}, nil +} + +// NewGovImpFilterer creates a new log filterer instance of GovImp, bound to a specific deployed contract. +func NewGovImpFilterer(address common.Address, filterer bind.ContractFilterer) (*GovImpFilterer, error) { + contract, err := bindGovImp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &GovImpFilterer{contract: contract}, nil +} + +// bindGovImp binds a generic wrapper to an already deployed contract. +func bindGovImp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(GovImpABI)) + 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 (_GovImp *GovImpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GovImp.Contract.GovImpCaller.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 (_GovImp *GovImpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovImp.Contract.GovImpTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GovImp *GovImpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GovImp.Contract.GovImpTransactor.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 (_GovImp *GovImpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _GovImp.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 (_GovImp *GovImpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovImp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_GovImp *GovImpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _GovImp.Contract.contract.Transact(opts, method, params...) +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BALLOTDURATIONMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BALLOT_DURATION_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BALLOTDURATIONMAXNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMAXNAME(&_GovImp.CallOpts) +} + +// BALLOTDURATIONMAXNAME is a free data retrieval call binding the contract method 0x0015a73b. +// +// Solidity: function BALLOT_DURATION_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BALLOTDURATIONMAXNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMAXNAME(&_GovImp.CallOpts) +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BALLOTDURATIONMINMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BALLOT_DURATION_MIN_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BALLOTDURATIONMINMAXNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMINMAXNAME(&_GovImp.CallOpts) +} + +// BALLOTDURATIONMINMAXNAME is a free data retrieval call binding the contract method 0x656e3052. +// +// Solidity: function BALLOT_DURATION_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BALLOTDURATIONMINMAXNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMINMAXNAME(&_GovImp.CallOpts) +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BALLOTDURATIONMINNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BALLOT_DURATION_MIN_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BALLOTDURATIONMINNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMINNAME(&_GovImp.CallOpts) +} + +// BALLOTDURATIONMINNAME is a free data retrieval call binding the contract method 0x6d583ca7. +// +// Solidity: function BALLOT_DURATION_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BALLOTDURATIONMINNAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTDURATIONMINNAME(&_GovImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BALLOTSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BALLOT_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTSTORAGENAME(&_GovImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _GovImp.Contract.BALLOTSTORAGENAME(&_GovImp.CallOpts) +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BASEFEEMAXCHANGERATENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BASE_FEE_MAX_CHANGE_RATE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BASEFEEMAXCHANGERATENAME() ([32]byte, error) { + return _GovImp.Contract.BASEFEEMAXCHANGERATENAME(&_GovImp.CallOpts) +} + +// BASEFEEMAXCHANGERATENAME is a free data retrieval call binding the contract method 0xc42a0abc. +// +// Solidity: function BASE_FEE_MAX_CHANGE_RATE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BASEFEEMAXCHANGERATENAME() ([32]byte, error) { + return _GovImp.Contract.BASEFEEMAXCHANGERATENAME(&_GovImp.CallOpts) +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKSPERNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCKS_PER_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKSPERNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKSPERNAME(&_GovImp.CallOpts) +} + +// BLOCKSPERNAME is a free data retrieval call binding the contract method 0x3f35c8fe. +// +// Solidity: function BLOCKS_PER_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKSPERNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKSPERNAME(&_GovImp.CallOpts) +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKCREATIONTIMENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_CREATION_TIME_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKCREATIONTIMENAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKCREATIONTIMENAME(&_GovImp.CallOpts) +} + +// BLOCKCREATIONTIMENAME is a free data retrieval call binding the contract method 0xc0b4fe15. +// +// Solidity: function BLOCK_CREATION_TIME_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKCREATIONTIMENAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKCREATIONTIMENAME(&_GovImp.CallOpts) +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKGASLIMITNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_GASLIMIT_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKGASLIMITNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKGASLIMITNAME(&_GovImp.CallOpts) +} + +// BLOCKGASLIMITNAME is a free data retrieval call binding the contract method 0x238737b6. +// +// Solidity: function BLOCK_GASLIMIT_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKGASLIMITNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKGASLIMITNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDAMOUNTNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_AMOUNT_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDAMOUNTNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDAMOUNTNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDAMOUNTNAME is a free data retrieval call binding the contract method 0xa9b629b2. +// +// Solidity: function BLOCK_REWARD_AMOUNT_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDAMOUNTNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDAMOUNTNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME is a free data retrieval call binding the contract method 0xc6713baf. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONBLOCKPRODUCERNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME is a free data retrieval call binding the contract method 0x7b2bfb01. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONECOSYSTEMNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMAINTENANCENAME is a free data retrieval call binding the contract method 0x46946416. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDDISTRIBUTIONMAINTENANCENAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONMAINTENANCENAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDDISTRIBUTIONMETHODNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_METHOD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDDISTRIBUTIONMETHODNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONMETHODNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONMETHODNAME is a free data retrieval call binding the contract method 0x278bb12a. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_METHOD_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDDISTRIBUTIONMETHODNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONMETHODNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(&_GovImp.CallOpts) +} + +// BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME is a free data retrieval call binding the contract method 0x6167eb45. +// +// Solidity: function BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME() ([32]byte, error) { + return _GovImp.Contract.BLOCKREWARDDISTRIBUTIONSTAKINGREWARDNAME(&_GovImp.CallOpts) +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_GovImp *GovImpCaller) DENOMINATOR(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "DENOMINATOR") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_GovImp *GovImpSession) DENOMINATOR() (*big.Int, error) { + return _GovImp.Contract.DENOMINATOR(&_GovImp.CallOpts) +} + +// DENOMINATOR is a free data retrieval call binding the contract method 0x918f8674. +// +// Solidity: function DENOMINATOR() view returns(uint256) +func (_GovImp *GovImpCallerSession) DENOMINATOR() (*big.Int, error) { + return _GovImp.Contract.DENOMINATOR(&_GovImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) ECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) ECOSYSTEMNAME() ([32]byte, error) { + return _GovImp.Contract.ECOSYSTEMNAME(&_GovImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) ECOSYSTEMNAME() ([32]byte, error) { + return _GovImp.Contract.ECOSYSTEMNAME(&_GovImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) ENVSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "ENV_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) ENVSTORAGENAME() ([32]byte, error) { + return _GovImp.Contract.ENVSTORAGENAME(&_GovImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) ENVSTORAGENAME() ([32]byte, error) { + return _GovImp.Contract.ENVSTORAGENAME(&_GovImp.CallOpts) +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) GASLIMITANDBASEFEENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "GASLIMIT_AND_BASE_FEE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) GASLIMITANDBASEFEENAME() ([32]byte, error) { + return _GovImp.Contract.GASLIMITANDBASEFEENAME(&_GovImp.CallOpts) +} + +// GASLIMITANDBASEFEENAME is a free data retrieval call binding the contract method 0xc7d3da34. +// +// Solidity: function GASLIMIT_AND_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) GASLIMITANDBASEFEENAME() ([32]byte, error) { + return _GovImp.Contract.GASLIMITANDBASEFEENAME(&_GovImp.CallOpts) +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) GASTARGETPERCENTAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "GAS_TARGET_PERCENTAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) GASTARGETPERCENTAGENAME() ([32]byte, error) { + return _GovImp.Contract.GASTARGETPERCENTAGENAME(&_GovImp.CallOpts) +} + +// GASTARGETPERCENTAGENAME is a free data retrieval call binding the contract method 0x4d273e28. +// +// Solidity: function GAS_TARGET_PERCENTAGE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) GASTARGETPERCENTAGENAME() ([32]byte, error) { + return _GovImp.Contract.GASTARGETPERCENTAGENAME(&_GovImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) GOVNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "GOV_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) GOVNAME() ([32]byte, error) { + return _GovImp.Contract.GOVNAME(&_GovImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) GOVNAME() ([32]byte, error) { + return _GovImp.Contract.GOVNAME(&_GovImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) MAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) MAINTENANCENAME() ([32]byte, error) { + return _GovImp.Contract.MAINTENANCENAME(&_GovImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) MAINTENANCENAME() ([32]byte, error) { + return _GovImp.Contract.MAINTENANCENAME(&_GovImp.CallOpts) +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) MAXBASEFEENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "MAX_BASE_FEE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) MAXBASEFEENAME() ([32]byte, error) { + return _GovImp.Contract.MAXBASEFEENAME(&_GovImp.CallOpts) +} + +// MAXBASEFEENAME is a free data retrieval call binding the contract method 0xf38ecf47. +// +// Solidity: function MAX_BASE_FEE_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) MAXBASEFEENAME() ([32]byte, error) { + return _GovImp.Contract.MAXBASEFEENAME(&_GovImp.CallOpts) +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) MAXIDLEBLOCKINTERVALNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "MAX_IDLE_BLOCK_INTERVAL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) MAXIDLEBLOCKINTERVALNAME() ([32]byte, error) { + return _GovImp.Contract.MAXIDLEBLOCKINTERVALNAME(&_GovImp.CallOpts) +} + +// MAXIDLEBLOCKINTERVALNAME is a free data retrieval call binding the contract method 0xb128f880. +// +// Solidity: function MAX_IDLE_BLOCK_INTERVAL_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) MAXIDLEBLOCKINTERVALNAME() ([32]byte, error) { + return _GovImp.Contract.MAXIDLEBLOCKINTERVALNAME(&_GovImp.CallOpts) +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) MAXPRIORITYFEEPERGASNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "MAX_PRIORITY_FEE_PER_GAS_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) MAXPRIORITYFEEPERGASNAME() ([32]byte, error) { + return _GovImp.Contract.MAXPRIORITYFEEPERGASNAME(&_GovImp.CallOpts) +} + +// MAXPRIORITYFEEPERGASNAME is a free data retrieval call binding the contract method 0x38294419. +// +// Solidity: function MAX_PRIORITY_FEE_PER_GAS_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) MAXPRIORITYFEEPERGASNAME() ([32]byte, error) { + return _GovImp.Contract.MAXPRIORITYFEEPERGASNAME(&_GovImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) REWARDPOOLNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "REWARD_POOL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) REWARDPOOLNAME() ([32]byte, error) { + return _GovImp.Contract.REWARDPOOLNAME(&_GovImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) REWARDPOOLNAME() ([32]byte, error) { + return _GovImp.Contract.REWARDPOOLNAME(&_GovImp.CallOpts) +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) STAKINGMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "STAKING_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) STAKINGMAXNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMAXNAME(&_GovImp.CallOpts) +} + +// STAKINGMAXNAME is a free data retrieval call binding the contract method 0xc00ace6c. +// +// Solidity: function STAKING_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) STAKINGMAXNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMAXNAME(&_GovImp.CallOpts) +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) STAKINGMINMAXNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "STAKING_MIN_MAX_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) STAKINGMINMAXNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMINMAXNAME(&_GovImp.CallOpts) +} + +// STAKINGMINMAXNAME is a free data retrieval call binding the contract method 0xa6868b7d. +// +// Solidity: function STAKING_MIN_MAX_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) STAKINGMINMAXNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMINMAXNAME(&_GovImp.CallOpts) +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) STAKINGMINNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "STAKING_MIN_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) STAKINGMINNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMINNAME(&_GovImp.CallOpts) +} + +// STAKINGMINNAME is a free data retrieval call binding the contract method 0x6fde207a. +// +// Solidity: function STAKING_MIN_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) STAKINGMINNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGMINNAME(&_GovImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) STAKINGNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "STAKING_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) STAKINGNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGNAME(&_GovImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) STAKINGNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGNAME(&_GovImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpCaller) STAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpSession) STAKINGREWARDNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGREWARDNAME(&_GovImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_GovImp *GovImpCallerSession) STAKINGREWARDNAME() ([32]byte, error) { + return _GovImp.Contract.STAKINGREWARDNAME(&_GovImp.CallOpts) +} + +// BallotLength is a free data retrieval call binding the contract method 0xd6f9cfce. +// +// Solidity: function ballotLength() view returns(uint256) +func (_GovImp *GovImpCaller) BallotLength(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "ballotLength") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BallotLength is a free data retrieval call binding the contract method 0xd6f9cfce. +// +// Solidity: function ballotLength() view returns(uint256) +func (_GovImp *GovImpSession) BallotLength() (*big.Int, error) { + return _GovImp.Contract.BallotLength(&_GovImp.CallOpts) +} + +// BallotLength is a free data retrieval call binding the contract method 0xd6f9cfce. +// +// Solidity: function ballotLength() view returns(uint256) +func (_GovImp *GovImpCallerSession) BallotLength() (*big.Int, error) { + return _GovImp.Contract.BallotLength(&_GovImp.CallOpts) +} + +// CheckUnfinalized is a free data retrieval call binding the contract method 0x1c12b030. +// +// Solidity: function checkUnfinalized() view returns(bool) +func (_GovImp *GovImpCaller) CheckUnfinalized(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "checkUnfinalized") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CheckUnfinalized is a free data retrieval call binding the contract method 0x1c12b030. +// +// Solidity: function checkUnfinalized() view returns(bool) +func (_GovImp *GovImpSession) CheckUnfinalized() (bool, error) { + return _GovImp.Contract.CheckUnfinalized(&_GovImp.CallOpts) +} + +// CheckUnfinalized is a free data retrieval call binding the contract method 0x1c12b030. +// +// Solidity: function checkUnfinalized() view returns(bool) +func (_GovImp *GovImpCallerSession) CheckUnfinalized() (bool, error) { + return _GovImp.Contract.CheckUnfinalized(&_GovImp.CallOpts) +} + +// GetBallotInVoting is a free data retrieval call binding the contract method 0xde09b377. +// +// Solidity: function getBallotInVoting() view returns(uint256) +func (_GovImp *GovImpCaller) GetBallotInVoting(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getBallotInVoting") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetBallotInVoting is a free data retrieval call binding the contract method 0xde09b377. +// +// Solidity: function getBallotInVoting() view returns(uint256) +func (_GovImp *GovImpSession) GetBallotInVoting() (*big.Int, error) { + return _GovImp.Contract.GetBallotInVoting(&_GovImp.CallOpts) +} + +// GetBallotInVoting is a free data retrieval call binding the contract method 0xde09b377. +// +// Solidity: function getBallotInVoting() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetBallotInVoting() (*big.Int, error) { + return _GovImp.Contract.GetBallotInVoting(&_GovImp.CallOpts) +} + +// GetMaxStaking is a free data retrieval call binding the contract method 0x5aaa4040. +// +// Solidity: function getMaxStaking() view returns(uint256) +func (_GovImp *GovImpCaller) GetMaxStaking(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMaxStaking") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxStaking is a free data retrieval call binding the contract method 0x5aaa4040. +// +// Solidity: function getMaxStaking() view returns(uint256) +func (_GovImp *GovImpSession) GetMaxStaking() (*big.Int, error) { + return _GovImp.Contract.GetMaxStaking(&_GovImp.CallOpts) +} + +// GetMaxStaking is a free data retrieval call binding the contract method 0x5aaa4040. +// +// Solidity: function getMaxStaking() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetMaxStaking() (*big.Int, error) { + return _GovImp.Contract.GetMaxStaking(&_GovImp.CallOpts) +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_GovImp *GovImpCaller) GetMaxVotingDuration(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMaxVotingDuration") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_GovImp *GovImpSession) GetMaxVotingDuration() (*big.Int, error) { + return _GovImp.Contract.GetMaxVotingDuration(&_GovImp.CallOpts) +} + +// GetMaxVotingDuration is a free data retrieval call binding the contract method 0xce04b9d4. +// +// Solidity: function getMaxVotingDuration() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetMaxVotingDuration() (*big.Int, error) { + return _GovImp.Contract.GetMaxVotingDuration(&_GovImp.CallOpts) +} + +// GetMember is a free data retrieval call binding the contract method 0xab3545e5. +// +// Solidity: function getMember(uint256 idx) view returns(address) +func (_GovImp *GovImpCaller) GetMember(opts *bind.CallOpts, idx *big.Int) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMember", idx) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetMember is a free data retrieval call binding the contract method 0xab3545e5. +// +// Solidity: function getMember(uint256 idx) view returns(address) +func (_GovImp *GovImpSession) GetMember(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetMember(&_GovImp.CallOpts, idx) +} + +// GetMember is a free data retrieval call binding the contract method 0xab3545e5. +// +// Solidity: function getMember(uint256 idx) view returns(address) +func (_GovImp *GovImpCallerSession) GetMember(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetMember(&_GovImp.CallOpts, idx) +} + +// GetMemberFromNodeIdx is a free data retrieval call binding the contract method 0x15bf6b4d. +// +// Solidity: function getMemberFromNodeIdx(uint256 idx) view returns(address) +func (_GovImp *GovImpCaller) GetMemberFromNodeIdx(opts *bind.CallOpts, idx *big.Int) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMemberFromNodeIdx", idx) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetMemberFromNodeIdx is a free data retrieval call binding the contract method 0x15bf6b4d. +// +// Solidity: function getMemberFromNodeIdx(uint256 idx) view returns(address) +func (_GovImp *GovImpSession) GetMemberFromNodeIdx(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetMemberFromNodeIdx(&_GovImp.CallOpts, idx) +} + +// GetMemberFromNodeIdx is a free data retrieval call binding the contract method 0x15bf6b4d. +// +// Solidity: function getMemberFromNodeIdx(uint256 idx) view returns(address) +func (_GovImp *GovImpCallerSession) GetMemberFromNodeIdx(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetMemberFromNodeIdx(&_GovImp.CallOpts, idx) +} + +// GetMemberLength is a free data retrieval call binding the contract method 0xd965ea00. +// +// Solidity: function getMemberLength() view returns(uint256) +func (_GovImp *GovImpCaller) GetMemberLength(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMemberLength") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMemberLength is a free data retrieval call binding the contract method 0xd965ea00. +// +// Solidity: function getMemberLength() view returns(uint256) +func (_GovImp *GovImpSession) GetMemberLength() (*big.Int, error) { + return _GovImp.Contract.GetMemberLength(&_GovImp.CallOpts) +} + +// GetMemberLength is a free data retrieval call binding the contract method 0xd965ea00. +// +// Solidity: function getMemberLength() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetMemberLength() (*big.Int, error) { + return _GovImp.Contract.GetMemberLength(&_GovImp.CallOpts) +} + +// GetMinStaking is a free data retrieval call binding the contract method 0xaf6af2ff. +// +// Solidity: function getMinStaking() view returns(uint256) +func (_GovImp *GovImpCaller) GetMinStaking(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMinStaking") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMinStaking is a free data retrieval call binding the contract method 0xaf6af2ff. +// +// Solidity: function getMinStaking() view returns(uint256) +func (_GovImp *GovImpSession) GetMinStaking() (*big.Int, error) { + return _GovImp.Contract.GetMinStaking(&_GovImp.CallOpts) +} + +// GetMinStaking is a free data retrieval call binding the contract method 0xaf6af2ff. +// +// Solidity: function getMinStaking() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetMinStaking() (*big.Int, error) { + return _GovImp.Contract.GetMinStaking(&_GovImp.CallOpts) +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_GovImp *GovImpCaller) GetMinVotingDuration(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getMinVotingDuration") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_GovImp *GovImpSession) GetMinVotingDuration() (*big.Int, error) { + return _GovImp.Contract.GetMinVotingDuration(&_GovImp.CallOpts) +} + +// GetMinVotingDuration is a free data retrieval call binding the contract method 0x1c150171. +// +// Solidity: function getMinVotingDuration() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetMinVotingDuration() (*big.Int, error) { + return _GovImp.Contract.GetMinVotingDuration(&_GovImp.CallOpts) +} + +// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9. +// +// Solidity: function getNode(uint256 idx) view returns(bytes name, bytes enode, bytes ip, uint256 port) +func (_GovImp *GovImpCaller) GetNode(opts *bind.CallOpts, idx *big.Int) (struct { + Name []byte + Enode []byte + Ip []byte + Port *big.Int +}, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getNode", idx) + + outstruct := new(struct { + Name []byte + Enode []byte + Ip []byte + Port *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Name = *abi.ConvertType(out[0], new([]byte)).(*[]byte) + outstruct.Enode = *abi.ConvertType(out[1], new([]byte)).(*[]byte) + outstruct.Ip = *abi.ConvertType(out[2], new([]byte)).(*[]byte) + outstruct.Port = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9. +// +// Solidity: function getNode(uint256 idx) view returns(bytes name, bytes enode, bytes ip, uint256 port) +func (_GovImp *GovImpSession) GetNode(idx *big.Int) (struct { + Name []byte + Enode []byte + Ip []byte + Port *big.Int +}, error) { + return _GovImp.Contract.GetNode(&_GovImp.CallOpts, idx) +} + +// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9. +// +// Solidity: function getNode(uint256 idx) view returns(bytes name, bytes enode, bytes ip, uint256 port) +func (_GovImp *GovImpCallerSession) GetNode(idx *big.Int) (struct { + Name []byte + Enode []byte + Ip []byte + Port *big.Int +}, error) { + return _GovImp.Contract.GetNode(&_GovImp.CallOpts, idx) +} + +// GetNodeIdxFromMember is a free data retrieval call binding the contract method 0xce6a54ff. +// +// Solidity: function getNodeIdxFromMember(address addr) view returns(uint256) +func (_GovImp *GovImpCaller) GetNodeIdxFromMember(opts *bind.CallOpts, addr common.Address) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getNodeIdxFromMember", addr) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNodeIdxFromMember is a free data retrieval call binding the contract method 0xce6a54ff. +// +// Solidity: function getNodeIdxFromMember(address addr) view returns(uint256) +func (_GovImp *GovImpSession) GetNodeIdxFromMember(addr common.Address) (*big.Int, error) { + return _GovImp.Contract.GetNodeIdxFromMember(&_GovImp.CallOpts, addr) +} + +// GetNodeIdxFromMember is a free data retrieval call binding the contract method 0xce6a54ff. +// +// Solidity: function getNodeIdxFromMember(address addr) view returns(uint256) +func (_GovImp *GovImpCallerSession) GetNodeIdxFromMember(addr common.Address) (*big.Int, error) { + return _GovImp.Contract.GetNodeIdxFromMember(&_GovImp.CallOpts, addr) +} + +// GetNodeLength is a free data retrieval call binding the contract method 0x72016f75. +// +// Solidity: function getNodeLength() view returns(uint256) +func (_GovImp *GovImpCaller) GetNodeLength(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getNodeLength") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNodeLength is a free data retrieval call binding the contract method 0x72016f75. +// +// Solidity: function getNodeLength() view returns(uint256) +func (_GovImp *GovImpSession) GetNodeLength() (*big.Int, error) { + return _GovImp.Contract.GetNodeLength(&_GovImp.CallOpts) +} + +// GetNodeLength is a free data retrieval call binding the contract method 0x72016f75. +// +// Solidity: function getNodeLength() view returns(uint256) +func (_GovImp *GovImpCallerSession) GetNodeLength() (*big.Int, error) { + return _GovImp.Contract.GetNodeLength(&_GovImp.CallOpts) +} + +// GetReward is a free data retrieval call binding the contract method 0x1c4b774b. +// +// Solidity: function getReward(uint256 idx) view returns(address) +func (_GovImp *GovImpCaller) GetReward(opts *bind.CallOpts, idx *big.Int) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getReward", idx) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetReward is a free data retrieval call binding the contract method 0x1c4b774b. +// +// Solidity: function getReward(uint256 idx) view returns(address) +func (_GovImp *GovImpSession) GetReward(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetReward(&_GovImp.CallOpts, idx) +} + +// GetReward is a free data retrieval call binding the contract method 0x1c4b774b. +// +// Solidity: function getReward(uint256 idx) view returns(address) +func (_GovImp *GovImpCallerSession) GetReward(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetReward(&_GovImp.CallOpts, idx) +} + +// GetStakerAddr is a free data retrieval call binding the contract method 0x6f6de96d. +// +// Solidity: function getStakerAddr(address _addr) view returns(address staker) +func (_GovImp *GovImpCaller) GetStakerAddr(opts *bind.CallOpts, _addr common.Address) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getStakerAddr", _addr) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetStakerAddr is a free data retrieval call binding the contract method 0x6f6de96d. +// +// Solidity: function getStakerAddr(address _addr) view returns(address staker) +func (_GovImp *GovImpSession) GetStakerAddr(_addr common.Address) (common.Address, error) { + return _GovImp.Contract.GetStakerAddr(&_GovImp.CallOpts, _addr) +} + +// GetStakerAddr is a free data retrieval call binding the contract method 0x6f6de96d. +// +// Solidity: function getStakerAddr(address _addr) view returns(address staker) +func (_GovImp *GovImpCallerSession) GetStakerAddr(_addr common.Address) (common.Address, error) { + return _GovImp.Contract.GetStakerAddr(&_GovImp.CallOpts, _addr) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() pure returns(uint256) +func (_GovImp *GovImpCaller) GetThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() pure returns(uint256) +func (_GovImp *GovImpSession) GetThreshold() (*big.Int, error) { + return _GovImp.Contract.GetThreshold(&_GovImp.CallOpts) +} + +// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8. +// +// Solidity: function getThreshold() pure returns(uint256) +func (_GovImp *GovImpCallerSession) GetThreshold() (*big.Int, error) { + return _GovImp.Contract.GetThreshold(&_GovImp.CallOpts) +} + +// GetVoter is a free data retrieval call binding the contract method 0xd07bff0c. +// +// Solidity: function getVoter(uint256 idx) view returns(address) +func (_GovImp *GovImpCaller) GetVoter(opts *bind.CallOpts, idx *big.Int) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "getVoter", idx) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetVoter is a free data retrieval call binding the contract method 0xd07bff0c. +// +// Solidity: function getVoter(uint256 idx) view returns(address) +func (_GovImp *GovImpSession) GetVoter(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetVoter(&_GovImp.CallOpts, idx) +} + +// GetVoter is a free data retrieval call binding the contract method 0xd07bff0c. +// +// Solidity: function getVoter(uint256 idx) view returns(address) +func (_GovImp *GovImpCallerSession) GetVoter(idx *big.Int) (common.Address, error) { + return _GovImp.Contract.GetVoter(&_GovImp.CallOpts, idx) +} + +// IsMember is a free data retrieval call binding the contract method 0xa230c524. +// +// Solidity: function isMember(address addr) view returns(bool) +func (_GovImp *GovImpCaller) IsMember(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "isMember", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsMember is a free data retrieval call binding the contract method 0xa230c524. +// +// Solidity: function isMember(address addr) view returns(bool) +func (_GovImp *GovImpSession) IsMember(addr common.Address) (bool, error) { + return _GovImp.Contract.IsMember(&_GovImp.CallOpts, addr) +} + +// IsMember is a free data retrieval call binding the contract method 0xa230c524. +// +// Solidity: function isMember(address addr) view returns(bool) +func (_GovImp *GovImpCallerSession) IsMember(addr common.Address) (bool, error) { + return _GovImp.Contract.IsMember(&_GovImp.CallOpts, addr) +} + +// IsReward is a free data retrieval call binding the contract method 0x4d5ce038. +// +// Solidity: function isReward(address addr) view returns(bool) +func (_GovImp *GovImpCaller) IsReward(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "isReward", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsReward is a free data retrieval call binding the contract method 0x4d5ce038. +// +// Solidity: function isReward(address addr) view returns(bool) +func (_GovImp *GovImpSession) IsReward(addr common.Address) (bool, error) { + return _GovImp.Contract.IsReward(&_GovImp.CallOpts, addr) +} + +// IsReward is a free data retrieval call binding the contract method 0x4d5ce038. +// +// Solidity: function isReward(address addr) view returns(bool) +func (_GovImp *GovImpCallerSession) IsReward(addr common.Address) (bool, error) { + return _GovImp.Contract.IsReward(&_GovImp.CallOpts, addr) +} + +// IsStaker is a free data retrieval call binding the contract method 0x6f1e8533. +// +// Solidity: function isStaker(address addr) view returns(bool) +func (_GovImp *GovImpCaller) IsStaker(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "isStaker", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsStaker is a free data retrieval call binding the contract method 0x6f1e8533. +// +// Solidity: function isStaker(address addr) view returns(bool) +func (_GovImp *GovImpSession) IsStaker(addr common.Address) (bool, error) { + return _GovImp.Contract.IsStaker(&_GovImp.CallOpts, addr) +} + +// IsStaker is a free data retrieval call binding the contract method 0x6f1e8533. +// +// Solidity: function isStaker(address addr) view returns(bool) +func (_GovImp *GovImpCallerSession) IsStaker(addr common.Address) (bool, error) { + return _GovImp.Contract.IsStaker(&_GovImp.CallOpts, addr) +} + +// IsVoter is a free data retrieval call binding the contract method 0xa7771ee3. +// +// Solidity: function isVoter(address addr) view returns(bool) +func (_GovImp *GovImpCaller) IsVoter(opts *bind.CallOpts, addr common.Address) (bool, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "isVoter", addr) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsVoter is a free data retrieval call binding the contract method 0xa7771ee3. +// +// Solidity: function isVoter(address addr) view returns(bool) +func (_GovImp *GovImpSession) IsVoter(addr common.Address) (bool, error) { + return _GovImp.Contract.IsVoter(&_GovImp.CallOpts, addr) +} + +// IsVoter is a free data retrieval call binding the contract method 0xa7771ee3. +// +// Solidity: function isVoter(address addr) view returns(bool) +func (_GovImp *GovImpCallerSession) IsVoter(addr common.Address) (bool, error) { + return _GovImp.Contract.IsVoter(&_GovImp.CallOpts, addr) +} + +// LastAddProposalTime is a free data retrieval call binding the contract method 0x139d9dd3. +// +// Solidity: function lastAddProposalTime(address ) view returns(uint256) +func (_GovImp *GovImpCaller) LastAddProposalTime(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "lastAddProposalTime", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LastAddProposalTime is a free data retrieval call binding the contract method 0x139d9dd3. +// +// Solidity: function lastAddProposalTime(address ) view returns(uint256) +func (_GovImp *GovImpSession) LastAddProposalTime(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.LastAddProposalTime(&_GovImp.CallOpts, arg0) +} + +// LastAddProposalTime is a free data retrieval call binding the contract method 0x139d9dd3. +// +// Solidity: function lastAddProposalTime(address ) view returns(uint256) +func (_GovImp *GovImpCallerSession) LastAddProposalTime(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.LastAddProposalTime(&_GovImp.CallOpts, arg0) +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_GovImp *GovImpCaller) ModifiedBlock(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "modifiedBlock") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_GovImp *GovImpSession) ModifiedBlock() (*big.Int, error) { + return _GovImp.Contract.ModifiedBlock(&_GovImp.CallOpts) +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_GovImp *GovImpCallerSession) ModifiedBlock() (*big.Int, error) { + return _GovImp.Contract.ModifiedBlock(&_GovImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_GovImp *GovImpCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _GovImp.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 (_GovImp *GovImpSession) Owner() (common.Address, error) { + return _GovImp.Contract.Owner(&_GovImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_GovImp *GovImpCallerSession) Owner() (common.Address, error) { + return _GovImp.Contract.Owner(&_GovImp.CallOpts) +} + +// ProposalTimePeriod is a free data retrieval call binding the contract method 0x3310569c. +// +// Solidity: function proposal_time_period() view returns(uint256) +func (_GovImp *GovImpCaller) ProposalTimePeriod(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "proposal_time_period") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ProposalTimePeriod is a free data retrieval call binding the contract method 0x3310569c. +// +// Solidity: function proposal_time_period() view returns(uint256) +func (_GovImp *GovImpSession) ProposalTimePeriod() (*big.Int, error) { + return _GovImp.Contract.ProposalTimePeriod(&_GovImp.CallOpts) +} + +// ProposalTimePeriod is a free data retrieval call binding the contract method 0x3310569c. +// +// Solidity: function proposal_time_period() view returns(uint256) +func (_GovImp *GovImpCallerSession) ProposalTimePeriod() (*big.Int, error) { + return _GovImp.Contract.ProposalTimePeriod(&_GovImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_GovImp *GovImpCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_GovImp *GovImpSession) ProxiableUUID() ([32]byte, error) { + return _GovImp.Contract.ProxiableUUID(&_GovImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_GovImp *GovImpCallerSession) ProxiableUUID() ([32]byte, error) { + return _GovImp.Contract.ProxiableUUID(&_GovImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_GovImp *GovImpCaller) Reg(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "reg") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_GovImp *GovImpSession) Reg() (common.Address, error) { + return _GovImp.Contract.Reg(&_GovImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_GovImp *GovImpCallerSession) Reg() (common.Address, error) { + return _GovImp.Contract.Reg(&_GovImp.CallOpts) +} + +// RewardIdx is a free data retrieval call binding the contract method 0xaaf0dd36. +// +// Solidity: function rewardIdx(address ) view returns(uint256) +func (_GovImp *GovImpCaller) RewardIdx(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "rewardIdx", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// RewardIdx is a free data retrieval call binding the contract method 0xaaf0dd36. +// +// Solidity: function rewardIdx(address ) view returns(uint256) +func (_GovImp *GovImpSession) RewardIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.RewardIdx(&_GovImp.CallOpts, arg0) +} + +// RewardIdx is a free data retrieval call binding the contract method 0xaaf0dd36. +// +// Solidity: function rewardIdx(address ) view returns(uint256) +func (_GovImp *GovImpCallerSession) RewardIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.RewardIdx(&_GovImp.CallOpts, arg0) +} + +// StakerIdx is a free data retrieval call binding the contract method 0xa0c12683. +// +// Solidity: function stakerIdx(address ) view returns(uint256) +func (_GovImp *GovImpCaller) StakerIdx(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "stakerIdx", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// StakerIdx is a free data retrieval call binding the contract method 0xa0c12683. +// +// Solidity: function stakerIdx(address ) view returns(uint256) +func (_GovImp *GovImpSession) StakerIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.StakerIdx(&_GovImp.CallOpts, arg0) +} + +// StakerIdx is a free data retrieval call binding the contract method 0xa0c12683. +// +// Solidity: function stakerIdx(address ) view returns(uint256) +func (_GovImp *GovImpCallerSession) StakerIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.StakerIdx(&_GovImp.CallOpts, arg0) +} + +// VoteLength is a free data retrieval call binding the contract method 0xe9523fb5. +// +// Solidity: function voteLength() view returns(uint256) +func (_GovImp *GovImpCaller) VoteLength(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "voteLength") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// VoteLength is a free data retrieval call binding the contract method 0xe9523fb5. +// +// Solidity: function voteLength() view returns(uint256) +func (_GovImp *GovImpSession) VoteLength() (*big.Int, error) { + return _GovImp.Contract.VoteLength(&_GovImp.CallOpts) +} + +// VoteLength is a free data retrieval call binding the contract method 0xe9523fb5. +// +// Solidity: function voteLength() view returns(uint256) +func (_GovImp *GovImpCallerSession) VoteLength() (*big.Int, error) { + return _GovImp.Contract.VoteLength(&_GovImp.CallOpts) +} + +// VoterIdx is a free data retrieval call binding the contract method 0xcec5b622. +// +// Solidity: function voterIdx(address ) view returns(uint256) +func (_GovImp *GovImpCaller) VoterIdx(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _GovImp.contract.Call(opts, &out, "voterIdx", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// VoterIdx is a free data retrieval call binding the contract method 0xcec5b622. +// +// Solidity: function voterIdx(address ) view returns(uint256) +func (_GovImp *GovImpSession) VoterIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.VoterIdx(&_GovImp.CallOpts, arg0) +} + +// VoterIdx is a free data retrieval call binding the contract method 0xcec5b622. +// +// Solidity: function voterIdx(address ) view returns(uint256) +func (_GovImp *GovImpCallerSession) VoterIdx(arg0 common.Address) (*big.Int, error) { + return _GovImp.Contract.VoterIdx(&_GovImp.CallOpts, arg0) +} + +// AddProposalToAddMember is a paid mutator transaction binding the contract method 0x36e83d83. +// +// Solidity: function addProposalToAddMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) info) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactor) AddProposalToAddMember(opts *bind.TransactOpts, info GovImpMemberInfo) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "addProposalToAddMember", info) +} + +// AddProposalToAddMember is a paid mutator transaction binding the contract method 0x36e83d83. +// +// Solidity: function addProposalToAddMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) info) returns(uint256 ballotIdx) +func (_GovImp *GovImpSession) AddProposalToAddMember(info GovImpMemberInfo) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToAddMember(&_GovImp.TransactOpts, info) +} + +// AddProposalToAddMember is a paid mutator transaction binding the contract method 0x36e83d83. +// +// Solidity: function addProposalToAddMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) info) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactorSession) AddProposalToAddMember(info GovImpMemberInfo) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToAddMember(&_GovImp.TransactOpts, info) +} + +// AddProposalToChangeEnv is a paid mutator transaction binding the contract method 0x40690353. +// +// Solidity: function addProposalToChangeEnv(bytes32 envName, uint256 envType, bytes envVal, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactor) AddProposalToChangeEnv(opts *bind.TransactOpts, envName [32]byte, envType *big.Int, envVal []byte, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "addProposalToChangeEnv", envName, envType, envVal, memo, duration) +} + +// AddProposalToChangeEnv is a paid mutator transaction binding the contract method 0x40690353. +// +// Solidity: function addProposalToChangeEnv(bytes32 envName, uint256 envType, bytes envVal, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpSession) AddProposalToChangeEnv(envName [32]byte, envType *big.Int, envVal []byte, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeEnv(&_GovImp.TransactOpts, envName, envType, envVal, memo, duration) +} + +// AddProposalToChangeEnv is a paid mutator transaction binding the contract method 0x40690353. +// +// Solidity: function addProposalToChangeEnv(bytes32 envName, uint256 envType, bytes envVal, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactorSession) AddProposalToChangeEnv(envName [32]byte, envType *big.Int, envVal []byte, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeEnv(&_GovImp.TransactOpts, envName, envType, envVal, memo, duration) +} + +// AddProposalToChangeGov is a paid mutator transaction binding the contract method 0x0efa4909. +// +// Solidity: function addProposalToChangeGov(address newGovAddr, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactor) AddProposalToChangeGov(opts *bind.TransactOpts, newGovAddr common.Address, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "addProposalToChangeGov", newGovAddr, memo, duration) +} + +// AddProposalToChangeGov is a paid mutator transaction binding the contract method 0x0efa4909. +// +// Solidity: function addProposalToChangeGov(address newGovAddr, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpSession) AddProposalToChangeGov(newGovAddr common.Address, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeGov(&_GovImp.TransactOpts, newGovAddr, memo, duration) +} + +// AddProposalToChangeGov is a paid mutator transaction binding the contract method 0x0efa4909. +// +// Solidity: function addProposalToChangeGov(address newGovAddr, bytes memo, uint256 duration) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactorSession) AddProposalToChangeGov(newGovAddr common.Address, memo []byte, duration *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeGov(&_GovImp.TransactOpts, newGovAddr, memo, duration) +} + +// AddProposalToChangeMember is a paid mutator transaction binding the contract method 0xa78a8188. +// +// Solidity: function addProposalToChangeMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) newInfo, address oldStaker, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactor) AddProposalToChangeMember(opts *bind.TransactOpts, newInfo GovImpMemberInfo, oldStaker common.Address, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "addProposalToChangeMember", newInfo, oldStaker, unlockAmount, slashing) +} + +// AddProposalToChangeMember is a paid mutator transaction binding the contract method 0xa78a8188. +// +// Solidity: function addProposalToChangeMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) newInfo, address oldStaker, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpSession) AddProposalToChangeMember(newInfo GovImpMemberInfo, oldStaker common.Address, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeMember(&_GovImp.TransactOpts, newInfo, oldStaker, unlockAmount, slashing) +} + +// AddProposalToChangeMember is a paid mutator transaction binding the contract method 0xa78a8188. +// +// Solidity: function addProposalToChangeMember((address,address,address,bytes,bytes,bytes,uint256,uint256,bytes,uint256) newInfo, address oldStaker, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactorSession) AddProposalToChangeMember(newInfo GovImpMemberInfo, oldStaker common.Address, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToChangeMember(&_GovImp.TransactOpts, newInfo, oldStaker, unlockAmount, slashing) +} + +// AddProposalToRemoveMember is a paid mutator transaction binding the contract method 0x894f5111. +// +// Solidity: function addProposalToRemoveMember(address staker, uint256 lockAmount, bytes memo, uint256 duration, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactor) AddProposalToRemoveMember(opts *bind.TransactOpts, staker common.Address, lockAmount *big.Int, memo []byte, duration *big.Int, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "addProposalToRemoveMember", staker, lockAmount, memo, duration, unlockAmount, slashing) +} + +// AddProposalToRemoveMember is a paid mutator transaction binding the contract method 0x894f5111. +// +// Solidity: function addProposalToRemoveMember(address staker, uint256 lockAmount, bytes memo, uint256 duration, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpSession) AddProposalToRemoveMember(staker common.Address, lockAmount *big.Int, memo []byte, duration *big.Int, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToRemoveMember(&_GovImp.TransactOpts, staker, lockAmount, memo, duration, unlockAmount, slashing) +} + +// AddProposalToRemoveMember is a paid mutator transaction binding the contract method 0x894f5111. +// +// Solidity: function addProposalToRemoveMember(address staker, uint256 lockAmount, bytes memo, uint256 duration, uint256 unlockAmount, uint256 slashing) returns(uint256 ballotIdx) +func (_GovImp *GovImpTransactorSession) AddProposalToRemoveMember(staker common.Address, lockAmount *big.Int, memo []byte, duration *big.Int, unlockAmount *big.Int, slashing *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.AddProposalToRemoveMember(&_GovImp.TransactOpts, staker, lockAmount, memo, duration, unlockAmount, slashing) +} + +// FinalizeEndedVote is a paid mutator transaction binding the contract method 0x6ba99181. +// +// Solidity: function finalizeEndedVote() returns() +func (_GovImp *GovImpTransactor) FinalizeEndedVote(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "finalizeEndedVote") +} + +// FinalizeEndedVote is a paid mutator transaction binding the contract method 0x6ba99181. +// +// Solidity: function finalizeEndedVote() returns() +func (_GovImp *GovImpSession) FinalizeEndedVote() (*types.Transaction, error) { + return _GovImp.Contract.FinalizeEndedVote(&_GovImp.TransactOpts) +} + +// FinalizeEndedVote is a paid mutator transaction binding the contract method 0x6ba99181. +// +// Solidity: function finalizeEndedVote() returns() +func (_GovImp *GovImpTransactorSession) FinalizeEndedVote() (*types.Transaction, error) { + return _GovImp.Contract.FinalizeEndedVote(&_GovImp.TransactOpts) +} + +// Init is a paid mutator transaction binding the contract method 0xa8915a3e. +// +// Solidity: function init(address registry, uint256 lockAmount, bytes name, bytes enode, bytes ip, uint256 port) returns() +func (_GovImp *GovImpTransactor) Init(opts *bind.TransactOpts, registry common.Address, lockAmount *big.Int, name []byte, enode []byte, ip []byte, port *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "init", registry, lockAmount, name, enode, ip, port) +} + +// Init is a paid mutator transaction binding the contract method 0xa8915a3e. +// +// Solidity: function init(address registry, uint256 lockAmount, bytes name, bytes enode, bytes ip, uint256 port) returns() +func (_GovImp *GovImpSession) Init(registry common.Address, lockAmount *big.Int, name []byte, enode []byte, ip []byte, port *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.Init(&_GovImp.TransactOpts, registry, lockAmount, name, enode, ip, port) +} + +// Init is a paid mutator transaction binding the contract method 0xa8915a3e. +// +// Solidity: function init(address registry, uint256 lockAmount, bytes name, bytes enode, bytes ip, uint256 port) returns() +func (_GovImp *GovImpTransactorSession) Init(registry common.Address, lockAmount *big.Int, name []byte, enode []byte, ip []byte, port *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.Init(&_GovImp.TransactOpts, registry, lockAmount, name, enode, ip, port) +} + +// InitMigration is a paid mutator transaction binding the contract method 0x397e38e7. +// +// Solidity: function initMigration(address registry, uint256 oldModifiedBlock, address oldOwner) returns() +func (_GovImp *GovImpTransactor) InitMigration(opts *bind.TransactOpts, registry common.Address, oldModifiedBlock *big.Int, oldOwner common.Address) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "initMigration", registry, oldModifiedBlock, oldOwner) +} + +// InitMigration is a paid mutator transaction binding the contract method 0x397e38e7. +// +// Solidity: function initMigration(address registry, uint256 oldModifiedBlock, address oldOwner) returns() +func (_GovImp *GovImpSession) InitMigration(registry common.Address, oldModifiedBlock *big.Int, oldOwner common.Address) (*types.Transaction, error) { + return _GovImp.Contract.InitMigration(&_GovImp.TransactOpts, registry, oldModifiedBlock, oldOwner) +} + +// InitMigration is a paid mutator transaction binding the contract method 0x397e38e7. +// +// Solidity: function initMigration(address registry, uint256 oldModifiedBlock, address oldOwner) returns() +func (_GovImp *GovImpTransactorSession) InitMigration(registry common.Address, oldModifiedBlock *big.Int, oldOwner common.Address) (*types.Transaction, error) { + return _GovImp.Contract.InitMigration(&_GovImp.TransactOpts, registry, oldModifiedBlock, oldOwner) +} + +// InitOnce is a paid mutator transaction binding the contract method 0x351bacda. +// +// Solidity: function initOnce(address registry, uint256 lockAmount, bytes data) returns() +func (_GovImp *GovImpTransactor) InitOnce(opts *bind.TransactOpts, registry common.Address, lockAmount *big.Int, data []byte) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "initOnce", registry, lockAmount, data) +} + +// InitOnce is a paid mutator transaction binding the contract method 0x351bacda. +// +// Solidity: function initOnce(address registry, uint256 lockAmount, bytes data) returns() +func (_GovImp *GovImpSession) InitOnce(registry common.Address, lockAmount *big.Int, data []byte) (*types.Transaction, error) { + return _GovImp.Contract.InitOnce(&_GovImp.TransactOpts, registry, lockAmount, data) +} + +// InitOnce is a paid mutator transaction binding the contract method 0x351bacda. +// +// Solidity: function initOnce(address registry, uint256 lockAmount, bytes data) returns() +func (_GovImp *GovImpTransactorSession) InitOnce(registry common.Address, lockAmount *big.Int, data []byte) (*types.Transaction, error) { + return _GovImp.Contract.InitOnce(&_GovImp.TransactOpts, registry, lockAmount, data) +} + +// MigrateFromLegacy is a paid mutator transaction binding the contract method 0x8d39e33a. +// +// Solidity: function migrateFromLegacy(address oldGov) returns(int256) +func (_GovImp *GovImpTransactor) MigrateFromLegacy(opts *bind.TransactOpts, oldGov common.Address) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "migrateFromLegacy", oldGov) +} + +// MigrateFromLegacy is a paid mutator transaction binding the contract method 0x8d39e33a. +// +// Solidity: function migrateFromLegacy(address oldGov) returns(int256) +func (_GovImp *GovImpSession) MigrateFromLegacy(oldGov common.Address) (*types.Transaction, error) { + return _GovImp.Contract.MigrateFromLegacy(&_GovImp.TransactOpts, oldGov) +} + +// MigrateFromLegacy is a paid mutator transaction binding the contract method 0x8d39e33a. +// +// Solidity: function migrateFromLegacy(address oldGov) returns(int256) +func (_GovImp *GovImpTransactorSession) MigrateFromLegacy(oldGov common.Address) (*types.Transaction, error) { + return _GovImp.Contract.MigrateFromLegacy(&_GovImp.TransactOpts, oldGov) +} + +// ReInit is a paid mutator transaction binding the contract method 0x16fbe831. +// +// Solidity: function reInit() returns() +func (_GovImp *GovImpTransactor) ReInit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "reInit") +} + +// ReInit is a paid mutator transaction binding the contract method 0x16fbe831. +// +// Solidity: function reInit() returns() +func (_GovImp *GovImpSession) ReInit() (*types.Transaction, error) { + return _GovImp.Contract.ReInit(&_GovImp.TransactOpts) +} + +// ReInit is a paid mutator transaction binding the contract method 0x16fbe831. +// +// Solidity: function reInit() returns() +func (_GovImp *GovImpTransactorSession) ReInit() (*types.Transaction, error) { + return _GovImp.Contract.ReInit(&_GovImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovImp *GovImpTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovImp *GovImpSession) RenounceOwnership() (*types.Transaction, error) { + return _GovImp.Contract.RenounceOwnership(&_GovImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_GovImp *GovImpTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _GovImp.Contract.RenounceOwnership(&_GovImp.TransactOpts) +} + +// SetProposalTimePeriod is a paid mutator transaction binding the contract method 0xe27bdaef. +// +// Solidity: function setProposalTimePeriod(uint256 newPeriod) returns() +func (_GovImp *GovImpTransactor) SetProposalTimePeriod(opts *bind.TransactOpts, newPeriod *big.Int) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "setProposalTimePeriod", newPeriod) +} + +// SetProposalTimePeriod is a paid mutator transaction binding the contract method 0xe27bdaef. +// +// Solidity: function setProposalTimePeriod(uint256 newPeriod) returns() +func (_GovImp *GovImpSession) SetProposalTimePeriod(newPeriod *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.SetProposalTimePeriod(&_GovImp.TransactOpts, newPeriod) +} + +// SetProposalTimePeriod is a paid mutator transaction binding the contract method 0xe27bdaef. +// +// Solidity: function setProposalTimePeriod(uint256 newPeriod) returns() +func (_GovImp *GovImpTransactorSession) SetProposalTimePeriod(newPeriod *big.Int) (*types.Transaction, error) { + return _GovImp.Contract.SetProposalTimePeriod(&_GovImp.TransactOpts, newPeriod) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_GovImp *GovImpTransactor) SetRegistry(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "setRegistry", _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_GovImp *GovImpSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _GovImp.Contract.SetRegistry(&_GovImp.TransactOpts, _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_GovImp *GovImpTransactorSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _GovImp.Contract.SetRegistry(&_GovImp.TransactOpts, _addr) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovImp *GovImpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovImp *GovImpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _GovImp.Contract.TransferOwnership(&_GovImp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_GovImp *GovImpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _GovImp.Contract.TransferOwnership(&_GovImp.TransactOpts, newOwner) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_GovImp *GovImpTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_GovImp *GovImpSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _GovImp.Contract.UpgradeTo(&_GovImp.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_GovImp *GovImpTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _GovImp.Contract.UpgradeTo(&_GovImp.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_GovImp *GovImpTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_GovImp *GovImpSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _GovImp.Contract.UpgradeToAndCall(&_GovImp.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_GovImp *GovImpTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _GovImp.Contract.UpgradeToAndCall(&_GovImp.TransactOpts, newImplementation, data) +} + +// Vote is a paid mutator transaction binding the contract method 0xc9d27afe. +// +// Solidity: function vote(uint256 ballotIdx, bool approval) returns() +func (_GovImp *GovImpTransactor) Vote(opts *bind.TransactOpts, ballotIdx *big.Int, approval bool) (*types.Transaction, error) { + return _GovImp.contract.Transact(opts, "vote", ballotIdx, approval) +} + +// Vote is a paid mutator transaction binding the contract method 0xc9d27afe. +// +// Solidity: function vote(uint256 ballotIdx, bool approval) returns() +func (_GovImp *GovImpSession) Vote(ballotIdx *big.Int, approval bool) (*types.Transaction, error) { + return _GovImp.Contract.Vote(&_GovImp.TransactOpts, ballotIdx, approval) +} + +// Vote is a paid mutator transaction binding the contract method 0xc9d27afe. +// +// Solidity: function vote(uint256 ballotIdx, bool approval) returns() +func (_GovImp *GovImpTransactorSession) Vote(ballotIdx *big.Int, approval bool) (*types.Transaction, error) { + return _GovImp.Contract.Vote(&_GovImp.TransactOpts, ballotIdx, approval) +} + +// GovImpAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the GovImp contract. +type GovImpAdminChangedIterator struct { + Event *GovImpAdminChanged // 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 *GovImpAdminChangedIterator) 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(GovImpAdminChanged) + 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(GovImpAdminChanged) + 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 *GovImpAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpAdminChanged represents a AdminChanged event raised by the GovImp contract. +type GovImpAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_GovImp *GovImpFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*GovImpAdminChangedIterator, error) { + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &GovImpAdminChangedIterator{contract: _GovImp.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_GovImp *GovImpFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *GovImpAdminChanged) (event.Subscription, error) { + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "AdminChanged") + 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(GovImpAdminChanged) + if err := _GovImp.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_GovImp *GovImpFilterer) ParseAdminChanged(log types.Log) (*GovImpAdminChanged, error) { + event := new(GovImpAdminChanged) + if err := _GovImp.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the GovImp contract. +type GovImpBeaconUpgradedIterator struct { + Event *GovImpBeaconUpgraded // 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 *GovImpBeaconUpgradedIterator) 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(GovImpBeaconUpgraded) + 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(GovImpBeaconUpgraded) + 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 *GovImpBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpBeaconUpgraded represents a BeaconUpgraded event raised by the GovImp contract. +type GovImpBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_GovImp *GovImpFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*GovImpBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &GovImpBeaconUpgradedIterator{contract: _GovImp.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_GovImp *GovImpFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *GovImpBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(GovImpBeaconUpgraded) + if err := _GovImp.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_GovImp *GovImpFilterer) ParseBeaconUpgraded(log types.Log) (*GovImpBeaconUpgraded, error) { + event := new(GovImpBeaconUpgraded) + if err := _GovImp.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpEnvChangedIterator is returned from FilterEnvChanged and is used to iterate over the raw logs and unpacked data for EnvChanged events raised by the GovImp contract. +type GovImpEnvChangedIterator struct { + Event *GovImpEnvChanged // 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 *GovImpEnvChangedIterator) 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(GovImpEnvChanged) + 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(GovImpEnvChanged) + 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 *GovImpEnvChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpEnvChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpEnvChanged represents a EnvChanged event raised by the GovImp contract. +type GovImpEnvChanged struct { + EnvName [32]byte + EnvType *big.Int + EnvVal []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEnvChanged is a free log retrieval operation binding the contract event 0x701c16c2519cdb79aaac423a84733590e3510d9552055b6ad6908f0ab12b6c29. +// +// Solidity: event EnvChanged(bytes32 envName, uint256 envType, bytes envVal) +func (_GovImp *GovImpFilterer) FilterEnvChanged(opts *bind.FilterOpts) (*GovImpEnvChangedIterator, error) { + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "EnvChanged") + if err != nil { + return nil, err + } + return &GovImpEnvChangedIterator{contract: _GovImp.contract, event: "EnvChanged", logs: logs, sub: sub}, nil +} + +// WatchEnvChanged is a free log subscription operation binding the contract event 0x701c16c2519cdb79aaac423a84733590e3510d9552055b6ad6908f0ab12b6c29. +// +// Solidity: event EnvChanged(bytes32 envName, uint256 envType, bytes envVal) +func (_GovImp *GovImpFilterer) WatchEnvChanged(opts *bind.WatchOpts, sink chan<- *GovImpEnvChanged) (event.Subscription, error) { + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "EnvChanged") + 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(GovImpEnvChanged) + if err := _GovImp.contract.UnpackLog(event, "EnvChanged", 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 +} + +// ParseEnvChanged is a log parse operation binding the contract event 0x701c16c2519cdb79aaac423a84733590e3510d9552055b6ad6908f0ab12b6c29. +// +// Solidity: event EnvChanged(bytes32 envName, uint256 envType, bytes envVal) +func (_GovImp *GovImpFilterer) ParseEnvChanged(log types.Log) (*GovImpEnvChanged, error) { + event := new(GovImpEnvChanged) + if err := _GovImp.contract.UnpackLog(event, "EnvChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpGovDataMigratedIterator is returned from FilterGovDataMigrated and is used to iterate over the raw logs and unpacked data for GovDataMigrated events raised by the GovImp contract. +type GovImpGovDataMigratedIterator struct { + Event *GovImpGovDataMigrated // 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 *GovImpGovDataMigratedIterator) 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(GovImpGovDataMigrated) + 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(GovImpGovDataMigrated) + 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 *GovImpGovDataMigratedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpGovDataMigratedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpGovDataMigrated represents a GovDataMigrated event raised by the GovImp contract. +type GovImpGovDataMigrated struct { + From common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGovDataMigrated is a free log retrieval operation binding the contract event 0xab2db0a6f442428b686ffa80eadcaabe7d5ee00049c6ae888a237edd3238d856. +// +// Solidity: event GovDataMigrated(address indexed from) +func (_GovImp *GovImpFilterer) FilterGovDataMigrated(opts *bind.FilterOpts, from []common.Address) (*GovImpGovDataMigratedIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "GovDataMigrated", fromRule) + if err != nil { + return nil, err + } + return &GovImpGovDataMigratedIterator{contract: _GovImp.contract, event: "GovDataMigrated", logs: logs, sub: sub}, nil +} + +// WatchGovDataMigrated is a free log subscription operation binding the contract event 0xab2db0a6f442428b686ffa80eadcaabe7d5ee00049c6ae888a237edd3238d856. +// +// Solidity: event GovDataMigrated(address indexed from) +func (_GovImp *GovImpFilterer) WatchGovDataMigrated(opts *bind.WatchOpts, sink chan<- *GovImpGovDataMigrated, from []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "GovDataMigrated", fromRule) + 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(GovImpGovDataMigrated) + if err := _GovImp.contract.UnpackLog(event, "GovDataMigrated", 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 +} + +// ParseGovDataMigrated is a log parse operation binding the contract event 0xab2db0a6f442428b686ffa80eadcaabe7d5ee00049c6ae888a237edd3238d856. +// +// Solidity: event GovDataMigrated(address indexed from) +func (_GovImp *GovImpFilterer) ParseGovDataMigrated(log types.Log) (*GovImpGovDataMigrated, error) { + event := new(GovImpGovDataMigrated) + if err := _GovImp.contract.UnpackLog(event, "GovDataMigrated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the GovImp contract. +type GovImpInitializedIterator struct { + Event *GovImpInitialized // 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 *GovImpInitializedIterator) 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(GovImpInitialized) + 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(GovImpInitialized) + 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 *GovImpInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpInitialized represents a Initialized event raised by the GovImp contract. +type GovImpInitialized 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 (_GovImp *GovImpFilterer) FilterInitialized(opts *bind.FilterOpts) (*GovImpInitializedIterator, error) { + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &GovImpInitializedIterator{contract: _GovImp.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 (_GovImp *GovImpFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *GovImpInitialized) (event.Subscription, error) { + + logs, sub, err := _GovImp.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(GovImpInitialized) + if err := _GovImp.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 (_GovImp *GovImpFilterer) ParseInitialized(log types.Log) (*GovImpInitialized, error) { + event := new(GovImpInitialized) + if err := _GovImp.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpMemberAddedIterator is returned from FilterMemberAdded and is used to iterate over the raw logs and unpacked data for MemberAdded events raised by the GovImp contract. +type GovImpMemberAddedIterator struct { + Event *GovImpMemberAdded // 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 *GovImpMemberAddedIterator) 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(GovImpMemberAdded) + 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(GovImpMemberAdded) + 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 *GovImpMemberAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpMemberAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpMemberAdded represents a MemberAdded event raised by the GovImp contract. +type GovImpMemberAdded struct { + Addr common.Address + Voter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMemberAdded is a free log retrieval operation binding the contract event 0x6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba6. +// +// Solidity: event MemberAdded(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) FilterMemberAdded(opts *bind.FilterOpts, addr []common.Address, voter []common.Address) (*GovImpMemberAddedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "MemberAdded", addrRule, voterRule) + if err != nil { + return nil, err + } + return &GovImpMemberAddedIterator{contract: _GovImp.contract, event: "MemberAdded", logs: logs, sub: sub}, nil +} + +// WatchMemberAdded is a free log subscription operation binding the contract event 0x6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba6. +// +// Solidity: event MemberAdded(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) WatchMemberAdded(opts *bind.WatchOpts, sink chan<- *GovImpMemberAdded, addr []common.Address, voter []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "MemberAdded", addrRule, voterRule) + 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(GovImpMemberAdded) + if err := _GovImp.contract.UnpackLog(event, "MemberAdded", 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 +} + +// ParseMemberAdded is a log parse operation binding the contract event 0x6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba6. +// +// Solidity: event MemberAdded(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) ParseMemberAdded(log types.Log) (*GovImpMemberAdded, error) { + event := new(GovImpMemberAdded) + if err := _GovImp.contract.UnpackLog(event, "MemberAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpMemberChangedIterator is returned from FilterMemberChanged and is used to iterate over the raw logs and unpacked data for MemberChanged events raised by the GovImp contract. +type GovImpMemberChangedIterator struct { + Event *GovImpMemberChanged // 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 *GovImpMemberChangedIterator) 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(GovImpMemberChanged) + 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(GovImpMemberChanged) + 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 *GovImpMemberChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpMemberChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpMemberChanged represents a MemberChanged event raised by the GovImp contract. +type GovImpMemberChanged struct { + OldAddr common.Address + NewAddr common.Address + NewVoter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMemberChanged is a free log retrieval operation binding the contract event 0x15f4d750630db473a85edd9d47c500527a2648cc5e676f39645e52790cf07be0. +// +// Solidity: event MemberChanged(address indexed oldAddr, address indexed newAddr, address indexed newVoter) +func (_GovImp *GovImpFilterer) FilterMemberChanged(opts *bind.FilterOpts, oldAddr []common.Address, newAddr []common.Address, newVoter []common.Address) (*GovImpMemberChangedIterator, error) { + + var oldAddrRule []interface{} + for _, oldAddrItem := range oldAddr { + oldAddrRule = append(oldAddrRule, oldAddrItem) + } + var newAddrRule []interface{} + for _, newAddrItem := range newAddr { + newAddrRule = append(newAddrRule, newAddrItem) + } + var newVoterRule []interface{} + for _, newVoterItem := range newVoter { + newVoterRule = append(newVoterRule, newVoterItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "MemberChanged", oldAddrRule, newAddrRule, newVoterRule) + if err != nil { + return nil, err + } + return &GovImpMemberChangedIterator{contract: _GovImp.contract, event: "MemberChanged", logs: logs, sub: sub}, nil +} + +// WatchMemberChanged is a free log subscription operation binding the contract event 0x15f4d750630db473a85edd9d47c500527a2648cc5e676f39645e52790cf07be0. +// +// Solidity: event MemberChanged(address indexed oldAddr, address indexed newAddr, address indexed newVoter) +func (_GovImp *GovImpFilterer) WatchMemberChanged(opts *bind.WatchOpts, sink chan<- *GovImpMemberChanged, oldAddr []common.Address, newAddr []common.Address, newVoter []common.Address) (event.Subscription, error) { + + var oldAddrRule []interface{} + for _, oldAddrItem := range oldAddr { + oldAddrRule = append(oldAddrRule, oldAddrItem) + } + var newAddrRule []interface{} + for _, newAddrItem := range newAddr { + newAddrRule = append(newAddrRule, newAddrItem) + } + var newVoterRule []interface{} + for _, newVoterItem := range newVoter { + newVoterRule = append(newVoterRule, newVoterItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "MemberChanged", oldAddrRule, newAddrRule, newVoterRule) + 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(GovImpMemberChanged) + if err := _GovImp.contract.UnpackLog(event, "MemberChanged", 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 +} + +// ParseMemberChanged is a log parse operation binding the contract event 0x15f4d750630db473a85edd9d47c500527a2648cc5e676f39645e52790cf07be0. +// +// Solidity: event MemberChanged(address indexed oldAddr, address indexed newAddr, address indexed newVoter) +func (_GovImp *GovImpFilterer) ParseMemberChanged(log types.Log) (*GovImpMemberChanged, error) { + event := new(GovImpMemberChanged) + if err := _GovImp.contract.UnpackLog(event, "MemberChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpMemberRemovedIterator is returned from FilterMemberRemoved and is used to iterate over the raw logs and unpacked data for MemberRemoved events raised by the GovImp contract. +type GovImpMemberRemovedIterator struct { + Event *GovImpMemberRemoved // 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 *GovImpMemberRemovedIterator) 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(GovImpMemberRemoved) + 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(GovImpMemberRemoved) + 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 *GovImpMemberRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpMemberRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpMemberRemoved represents a MemberRemoved event raised by the GovImp contract. +type GovImpMemberRemoved struct { + Addr common.Address + Voter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMemberRemoved is a free log retrieval operation binding the contract event 0xaa91016c21c52c58ac64f23f71bbe75becc9ada603e18ee671d09ff15492d1c1. +// +// Solidity: event MemberRemoved(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) FilterMemberRemoved(opts *bind.FilterOpts, addr []common.Address, voter []common.Address) (*GovImpMemberRemovedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "MemberRemoved", addrRule, voterRule) + if err != nil { + return nil, err + } + return &GovImpMemberRemovedIterator{contract: _GovImp.contract, event: "MemberRemoved", logs: logs, sub: sub}, nil +} + +// WatchMemberRemoved is a free log subscription operation binding the contract event 0xaa91016c21c52c58ac64f23f71bbe75becc9ada603e18ee671d09ff15492d1c1. +// +// Solidity: event MemberRemoved(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) WatchMemberRemoved(opts *bind.WatchOpts, sink chan<- *GovImpMemberRemoved, addr []common.Address, voter []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "MemberRemoved", addrRule, voterRule) + 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(GovImpMemberRemoved) + if err := _GovImp.contract.UnpackLog(event, "MemberRemoved", 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 +} + +// ParseMemberRemoved is a log parse operation binding the contract event 0xaa91016c21c52c58ac64f23f71bbe75becc9ada603e18ee671d09ff15492d1c1. +// +// Solidity: event MemberRemoved(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) ParseMemberRemoved(log types.Log) (*GovImpMemberRemoved, error) { + event := new(GovImpMemberRemoved) + if err := _GovImp.contract.UnpackLog(event, "MemberRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpMemberUpdatedIterator is returned from FilterMemberUpdated and is used to iterate over the raw logs and unpacked data for MemberUpdated events raised by the GovImp contract. +type GovImpMemberUpdatedIterator struct { + Event *GovImpMemberUpdated // 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 *GovImpMemberUpdatedIterator) 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(GovImpMemberUpdated) + 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(GovImpMemberUpdated) + 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 *GovImpMemberUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpMemberUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpMemberUpdated represents a MemberUpdated event raised by the GovImp contract. +type GovImpMemberUpdated struct { + Addr common.Address + Voter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMemberUpdated is a free log retrieval operation binding the contract event 0x1feee1b4fcb797c62645da41c5c6edd5f91d4291de0054da625c42b823594c1f. +// +// Solidity: event MemberUpdated(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) FilterMemberUpdated(opts *bind.FilterOpts, addr []common.Address, voter []common.Address) (*GovImpMemberUpdatedIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "MemberUpdated", addrRule, voterRule) + if err != nil { + return nil, err + } + return &GovImpMemberUpdatedIterator{contract: _GovImp.contract, event: "MemberUpdated", logs: logs, sub: sub}, nil +} + +// WatchMemberUpdated is a free log subscription operation binding the contract event 0x1feee1b4fcb797c62645da41c5c6edd5f91d4291de0054da625c42b823594c1f. +// +// Solidity: event MemberUpdated(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) WatchMemberUpdated(opts *bind.WatchOpts, sink chan<- *GovImpMemberUpdated, addr []common.Address, voter []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + var voterRule []interface{} + for _, voterItem := range voter { + voterRule = append(voterRule, voterItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "MemberUpdated", addrRule, voterRule) + 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(GovImpMemberUpdated) + if err := _GovImp.contract.UnpackLog(event, "MemberUpdated", 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 +} + +// ParseMemberUpdated is a log parse operation binding the contract event 0x1feee1b4fcb797c62645da41c5c6edd5f91d4291de0054da625c42b823594c1f. +// +// Solidity: event MemberUpdated(address indexed addr, address indexed voter) +func (_GovImp *GovImpFilterer) ParseMemberUpdated(log types.Log) (*GovImpMemberUpdated, error) { + event := new(GovImpMemberUpdated) + if err := _GovImp.contract.UnpackLog(event, "MemberUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpNotApplicableIterator is returned from FilterNotApplicable and is used to iterate over the raw logs and unpacked data for NotApplicable events raised by the GovImp contract. +type GovImpNotApplicableIterator struct { + Event *GovImpNotApplicable // 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 *GovImpNotApplicableIterator) 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(GovImpNotApplicable) + 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(GovImpNotApplicable) + 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 *GovImpNotApplicableIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpNotApplicableIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpNotApplicable represents a NotApplicable event raised by the GovImp contract. +type GovImpNotApplicable struct { + BallotId *big.Int + Reason string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNotApplicable is a free log retrieval operation binding the contract event 0x85e7f4987c0698db47045ad8cea110b51138f0eecbd94915842328cf6c3dc97d. +// +// Solidity: event NotApplicable(uint256 indexed ballotId, string reason) +func (_GovImp *GovImpFilterer) FilterNotApplicable(opts *bind.FilterOpts, ballotId []*big.Int) (*GovImpNotApplicableIterator, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "NotApplicable", ballotIdRule) + if err != nil { + return nil, err + } + return &GovImpNotApplicableIterator{contract: _GovImp.contract, event: "NotApplicable", logs: logs, sub: sub}, nil +} + +// WatchNotApplicable is a free log subscription operation binding the contract event 0x85e7f4987c0698db47045ad8cea110b51138f0eecbd94915842328cf6c3dc97d. +// +// Solidity: event NotApplicable(uint256 indexed ballotId, string reason) +func (_GovImp *GovImpFilterer) WatchNotApplicable(opts *bind.WatchOpts, sink chan<- *GovImpNotApplicable, ballotId []*big.Int) (event.Subscription, error) { + + var ballotIdRule []interface{} + for _, ballotIdItem := range ballotId { + ballotIdRule = append(ballotIdRule, ballotIdItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "NotApplicable", ballotIdRule) + 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(GovImpNotApplicable) + if err := _GovImp.contract.UnpackLog(event, "NotApplicable", 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 +} + +// ParseNotApplicable is a log parse operation binding the contract event 0x85e7f4987c0698db47045ad8cea110b51138f0eecbd94915842328cf6c3dc97d. +// +// Solidity: event NotApplicable(uint256 indexed ballotId, string reason) +func (_GovImp *GovImpFilterer) ParseNotApplicable(log types.Log) (*GovImpNotApplicable, error) { + event := new(GovImpNotApplicable) + if err := _GovImp.contract.UnpackLog(event, "NotApplicable", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the GovImp contract. +type GovImpOwnershipTransferredIterator struct { + Event *GovImpOwnershipTransferred // 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 *GovImpOwnershipTransferredIterator) 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(GovImpOwnershipTransferred) + 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(GovImpOwnershipTransferred) + 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 *GovImpOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpOwnershipTransferred represents a OwnershipTransferred event raised by the GovImp contract. +type GovImpOwnershipTransferred 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 (_GovImp *GovImpFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*GovImpOwnershipTransferredIterator, 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 := _GovImp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &GovImpOwnershipTransferredIterator{contract: _GovImp.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 (_GovImp *GovImpFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *GovImpOwnershipTransferred, 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 := _GovImp.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(GovImpOwnershipTransferred) + if err := _GovImp.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 (_GovImp *GovImpFilterer) ParseOwnershipTransferred(log types.Log) (*GovImpOwnershipTransferred, error) { + event := new(GovImpOwnershipTransferred) + if err := _GovImp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpSetProposalTimePeriodIterator is returned from FilterSetProposalTimePeriod and is used to iterate over the raw logs and unpacked data for SetProposalTimePeriod events raised by the GovImp contract. +type GovImpSetProposalTimePeriodIterator struct { + Event *GovImpSetProposalTimePeriod // 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 *GovImpSetProposalTimePeriodIterator) 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(GovImpSetProposalTimePeriod) + 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(GovImpSetProposalTimePeriod) + 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 *GovImpSetProposalTimePeriodIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpSetProposalTimePeriodIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpSetProposalTimePeriod represents a SetProposalTimePeriod event raised by the GovImp contract. +type GovImpSetProposalTimePeriod struct { + NewPeriod *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetProposalTimePeriod is a free log retrieval operation binding the contract event 0x17c6f1d1ce638844b664872f5c6eecb7d150ec0c41187d7f85826a656ee7946f. +// +// Solidity: event SetProposalTimePeriod(uint256 newPeriod) +func (_GovImp *GovImpFilterer) FilterSetProposalTimePeriod(opts *bind.FilterOpts) (*GovImpSetProposalTimePeriodIterator, error) { + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "SetProposalTimePeriod") + if err != nil { + return nil, err + } + return &GovImpSetProposalTimePeriodIterator{contract: _GovImp.contract, event: "SetProposalTimePeriod", logs: logs, sub: sub}, nil +} + +// WatchSetProposalTimePeriod is a free log subscription operation binding the contract event 0x17c6f1d1ce638844b664872f5c6eecb7d150ec0c41187d7f85826a656ee7946f. +// +// Solidity: event SetProposalTimePeriod(uint256 newPeriod) +func (_GovImp *GovImpFilterer) WatchSetProposalTimePeriod(opts *bind.WatchOpts, sink chan<- *GovImpSetProposalTimePeriod) (event.Subscription, error) { + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "SetProposalTimePeriod") + 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(GovImpSetProposalTimePeriod) + if err := _GovImp.contract.UnpackLog(event, "SetProposalTimePeriod", 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 +} + +// ParseSetProposalTimePeriod is a log parse operation binding the contract event 0x17c6f1d1ce638844b664872f5c6eecb7d150ec0c41187d7f85826a656ee7946f. +// +// Solidity: event SetProposalTimePeriod(uint256 newPeriod) +func (_GovImp *GovImpFilterer) ParseSetProposalTimePeriod(log types.Log) (*GovImpSetProposalTimePeriod, error) { + event := new(GovImpSetProposalTimePeriod) + if err := _GovImp.contract.UnpackLog(event, "SetProposalTimePeriod", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpSetRegistryIterator is returned from FilterSetRegistry and is used to iterate over the raw logs and unpacked data for SetRegistry events raised by the GovImp contract. +type GovImpSetRegistryIterator struct { + Event *GovImpSetRegistry // 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 *GovImpSetRegistryIterator) 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(GovImpSetRegistry) + 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(GovImpSetRegistry) + 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 *GovImpSetRegistryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpSetRegistryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpSetRegistry represents a SetRegistry event raised by the GovImp contract. +type GovImpSetRegistry struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetRegistry is a free log retrieval operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_GovImp *GovImpFilterer) FilterSetRegistry(opts *bind.FilterOpts, addr []common.Address) (*GovImpSetRegistryIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "SetRegistry", addrRule) + if err != nil { + return nil, err + } + return &GovImpSetRegistryIterator{contract: _GovImp.contract, event: "SetRegistry", logs: logs, sub: sub}, nil +} + +// WatchSetRegistry is a free log subscription operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_GovImp *GovImpFilterer) WatchSetRegistry(opts *bind.WatchOpts, sink chan<- *GovImpSetRegistry, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "SetRegistry", addrRule) + 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(GovImpSetRegistry) + if err := _GovImp.contract.UnpackLog(event, "SetRegistry", 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 +} + +// ParseSetRegistry is a log parse operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_GovImp *GovImpFilterer) ParseSetRegistry(log types.Log) (*GovImpSetRegistry, error) { + event := new(GovImpSetRegistry) + if err := _GovImp.contract.UnpackLog(event, "SetRegistry", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// GovImpUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the GovImp contract. +type GovImpUpgradedIterator struct { + Event *GovImpUpgraded // 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 *GovImpUpgradedIterator) 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(GovImpUpgraded) + 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(GovImpUpgraded) + 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 *GovImpUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *GovImpUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// GovImpUpgraded represents a Upgraded event raised by the GovImp contract. +type GovImpUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_GovImp *GovImpFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*GovImpUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _GovImp.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &GovImpUpgradedIterator{contract: _GovImp.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_GovImp *GovImpFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *GovImpUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _GovImp.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(GovImpUpgraded) + if err := _GovImp.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_GovImp *GovImpFilterer) ParseUpgraded(log types.Log) (*GovImpUpgraded, error) { + event := new(GovImpUpgraded) + if err := _GovImp.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/gen_ncpExit_abi.go b/wemix/bind/gen_ncpExit_abi.go new file mode 100644 index 000000000000..28dda1ab0da2 --- /dev/null +++ b/wemix/bind/gen_ncpExit_abi.go @@ -0,0 +1,2439 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// NCPExitMetaData contains all meta data concerning the NCPExit contract. +var NCPExitMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_imp\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "5c60da1b": "implementation()", + }, + Bin: "0x608060405234801561001057600080fd5b5060405161077238038061077283398101604081905261002f91610326565b604080516020810190915260008152819061006b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61034f565b60008051602061072b8339815191521461008757610087610374565b6100938282600061009b565b505050610405565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b61008b1760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610136838360405180606001604052806027815260200161074b602791396101fd565b9392505050565b610150816102db60201b6100b71760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061072b83398151915260001b6102ea60201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161028091906103b6565b600060405180830381855af49150503d80600081146102bb576040519150601f19603f3d011682016040523d82523d6000602084013e6102c0565b606091505b5090925090506102d18282866102ed565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102fc575081610136565b82511561030c5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103d2565b60006020828403121561033857600080fd5b81516001600160a01b038116811461013657600080fd5b60008282101561036f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156103a557818101518382015260200161038d565b838111156100ca5750506000910152565b600082516103c881846020870161038a565b9190910192915050565b60208152600082518060208401526103f181604085016020870161038a565b601f01601f19169190910160400192915050565b610317806104146000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102bb60279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b60606001600160a01b0384163b61018d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a8919061026b565b600060405180830381855af49150503d80600081146101e3576040519150601f19603f3d011682016040523d82523d6000602084013e6101e8565b606091505b50915091506101f8828286610202565b9695505050505050565b606083156102115750816100b0565b8251156102215782518084602001fd5b8160405162461bcd60e51b81526004016101849190610287565b60005b8381101561025657818101518382015260200161023e565b83811115610265576000848401525b50505050565b6000825161027d81846020870161023b565b9190910192915050565b60208152600082518060208401526102a681604085016020870161023b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e4a9b37c89f90cd2690d55474893040990839e6d9630f2ca907c1c29365285c264736f6c634300080e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", +} + +// NCPExitABI is the input ABI used to generate the binding from. +// Deprecated: Use NCPExitMetaData.ABI instead. +var NCPExitABI = NCPExitMetaData.ABI + +// Deprecated: Use NCPExitMetaData.Sigs instead. +// NCPExitFuncSigs maps the 4-byte function signature to its string representation. +var NCPExitFuncSigs = NCPExitMetaData.Sigs + +// NCPExitBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use NCPExitMetaData.Bin instead. +var NCPExitBin = NCPExitMetaData.Bin + +// DeployNCPExit deploys a new Ethereum contract, binding an instance of NCPExit to it. +func DeployNCPExit(auth *bind.TransactOpts, backend bind.ContractBackend, _imp common.Address) (common.Address, *types.Transaction, *NCPExit, error) { + parsed, err := NCPExitMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(NCPExitBin), backend, _imp) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NCPExit{NCPExitCaller: NCPExitCaller{contract: contract}, NCPExitTransactor: NCPExitTransactor{contract: contract}, NCPExitFilterer: NCPExitFilterer{contract: contract}}, nil +} + +// NCPExit is an auto generated Go binding around an Ethereum contract. +type NCPExit struct { + NCPExitCaller // Read-only binding to the contract + NCPExitTransactor // Write-only binding to the contract + NCPExitFilterer // Log filterer for contract events +} + +// NCPExitCaller is an auto generated read-only Go binding around an Ethereum contract. +type NCPExitCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NCPExitTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NCPExitFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NCPExitSession struct { + Contract *NCPExit // 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 +} + +// NCPExitCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NCPExitCallerSession struct { + Contract *NCPExitCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NCPExitTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NCPExitTransactorSession struct { + Contract *NCPExitTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NCPExitRaw is an auto generated low-level Go binding around an Ethereum contract. +type NCPExitRaw struct { + Contract *NCPExit // Generic contract binding to access the raw methods on +} + +// NCPExitCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NCPExitCallerRaw struct { + Contract *NCPExitCaller // Generic read-only contract binding to access the raw methods on +} + +// NCPExitTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NCPExitTransactorRaw struct { + Contract *NCPExitTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNCPExit creates a new instance of NCPExit, bound to a specific deployed contract. +func NewNCPExit(address common.Address, backend bind.ContractBackend) (*NCPExit, error) { + contract, err := bindNCPExit(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NCPExit{NCPExitCaller: NCPExitCaller{contract: contract}, NCPExitTransactor: NCPExitTransactor{contract: contract}, NCPExitFilterer: NCPExitFilterer{contract: contract}}, nil +} + +// NewNCPExitCaller creates a new read-only instance of NCPExit, bound to a specific deployed contract. +func NewNCPExitCaller(address common.Address, caller bind.ContractCaller) (*NCPExitCaller, error) { + contract, err := bindNCPExit(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NCPExitCaller{contract: contract}, nil +} + +// NewNCPExitTransactor creates a new write-only instance of NCPExit, bound to a specific deployed contract. +func NewNCPExitTransactor(address common.Address, transactor bind.ContractTransactor) (*NCPExitTransactor, error) { + contract, err := bindNCPExit(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NCPExitTransactor{contract: contract}, nil +} + +// NewNCPExitFilterer creates a new log filterer instance of NCPExit, bound to a specific deployed contract. +func NewNCPExitFilterer(address common.Address, filterer bind.ContractFilterer) (*NCPExitFilterer, error) { + contract, err := bindNCPExit(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NCPExitFilterer{contract: contract}, nil +} + +// bindNCPExit binds a generic wrapper to an already deployed contract. +func bindNCPExit(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(NCPExitABI)) + 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 (_NCPExit *NCPExitRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NCPExit.Contract.NCPExitCaller.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 (_NCPExit *NCPExitRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExit.Contract.NCPExitTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NCPExit *NCPExitRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NCPExit.Contract.NCPExitTransactor.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 (_NCPExit *NCPExitCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NCPExit.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 (_NCPExit *NCPExitTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExit.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NCPExit *NCPExitTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NCPExit.Contract.contract.Transact(opts, method, params...) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_NCPExit *NCPExitCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NCPExit.contract.Call(opts, &out, "implementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_NCPExit *NCPExitSession) Implementation() (common.Address, error) { + return _NCPExit.Contract.Implementation(&_NCPExit.CallOpts) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_NCPExit *NCPExitCallerSession) Implementation() (common.Address, error) { + return _NCPExit.Contract.Implementation(&_NCPExit.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_NCPExit *NCPExitTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _NCPExit.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_NCPExit *NCPExitSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _NCPExit.Contract.Fallback(&_NCPExit.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_NCPExit *NCPExitTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _NCPExit.Contract.Fallback(&_NCPExit.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExit *NCPExitTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExit.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExit *NCPExitSession) Receive() (*types.Transaction, error) { + return _NCPExit.Contract.Receive(&_NCPExit.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExit *NCPExitTransactorSession) Receive() (*types.Transaction, error) { + return _NCPExit.Contract.Receive(&_NCPExit.TransactOpts) +} + +// NCPExitAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the NCPExit contract. +type NCPExitAdminChangedIterator struct { + Event *NCPExitAdminChanged // 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 *NCPExitAdminChangedIterator) 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(NCPExitAdminChanged) + 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(NCPExitAdminChanged) + 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 *NCPExitAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitAdminChanged represents a AdminChanged event raised by the NCPExit contract. +type NCPExitAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExit *NCPExitFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*NCPExitAdminChangedIterator, error) { + + logs, sub, err := _NCPExit.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &NCPExitAdminChangedIterator{contract: _NCPExit.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExit *NCPExitFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *NCPExitAdminChanged) (event.Subscription, error) { + + logs, sub, err := _NCPExit.contract.WatchLogs(opts, "AdminChanged") + 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(NCPExitAdminChanged) + if err := _NCPExit.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExit *NCPExitFilterer) ParseAdminChanged(log types.Log) (*NCPExitAdminChanged, error) { + event := new(NCPExitAdminChanged) + if err := _NCPExit.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the NCPExit contract. +type NCPExitBeaconUpgradedIterator struct { + Event *NCPExitBeaconUpgraded // 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 *NCPExitBeaconUpgradedIterator) 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(NCPExitBeaconUpgraded) + 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(NCPExitBeaconUpgraded) + 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 *NCPExitBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitBeaconUpgraded represents a BeaconUpgraded event raised by the NCPExit contract. +type NCPExitBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExit *NCPExitFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*NCPExitBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _NCPExit.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &NCPExitBeaconUpgradedIterator{contract: _NCPExit.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExit *NCPExitFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *NCPExitBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _NCPExit.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(NCPExitBeaconUpgraded) + if err := _NCPExit.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExit *NCPExitFilterer) ParseBeaconUpgraded(log types.Log) (*NCPExitBeaconUpgraded, error) { + event := new(NCPExitBeaconUpgraded) + if err := _NCPExit.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the NCPExit contract. +type NCPExitUpgradedIterator struct { + Event *NCPExitUpgraded // 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 *NCPExitUpgradedIterator) 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(NCPExitUpgraded) + 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(NCPExitUpgraded) + 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 *NCPExitUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitUpgraded represents a Upgraded event raised by the NCPExit contract. +type NCPExitUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExit *NCPExitFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*NCPExitUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _NCPExit.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &NCPExitUpgradedIterator{contract: _NCPExit.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExit *NCPExitFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *NCPExitUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _NCPExit.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(NCPExitUpgraded) + if err := _NCPExit.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExit *NCPExitFilterer) ParseUpgraded(log types.Log) (*NCPExitUpgraded, error) { + event := new(NCPExitUpgraded) + if err := _NCPExit.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpMetaData contains all meta data concerning the NCPExitImp contract. +var NCPExitImpMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"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\":\"addr\",\"type\":\"address\"}],\"name\":\"SetRegistry\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ENV_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_POOL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"exitNcp\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lockedUserBalanceToNCPTotal\",\"type\":\"uint256\"}],\"name\":\"depositExitAmount\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"exitNcp\",\"type\":\"address\"}],\"name\":\"getAvailableAmountForAdministrator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"exitNcp\",\"type\":\"address\"}],\"name\":\"getLockedUserBalanceToNCPTotal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_registry\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reg\",\"outputs\":[{\"internalType\":\"contractIRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newAdministrator\",\"type\":\"address\"}],\"name\":\"setAdministrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newAdministratorSetter\",\"type\":\"address\"}],\"name\":\"setAdministratorSetter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImp\",\"type\":\"address\"}],\"name\":\"upgradeNCPExit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"exitNcp\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdrawForAdministrator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"exitNcp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"exitUser\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawForUser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "9986e4b9": "BALLOT_STORAGE_NAME()", + "34125c84": "ECOSYSTEM_NAME()", + "7bf46530": "ENV_STORAGE_NAME()", + "6c78d2cf": "GOV_NAME()", + "4bd1ed76": "MAINTENANCE_NAME()", + "2f40992e": "REWARD_POOL_NAME()", + "1e0cba0d": "STAKING_NAME()", + "5a731cca": "STAKING_REWARD_NAME()", + "8408bdb1": "depositExitAmount(address,uint256,uint256)", + "dd38f90b": "getAvailableAmountForAdministrator(address)", + "805c5ccc": "getLockedUserBalanceToNCPTotal(address)", + "c4d66de8": "initialize(address)", + "8da5cb5b": "owner()", + "52d1902d": "proxiableUUID()", + "738fdd1a": "reg()", + "715018a6": "renounceOwnership()", + "df8089ef": "setAdministrator(address)", + "8c56c8c3": "setAdministratorSetter(address)", + "a91ee0dc": "setRegistry(address)", + "f2fde38b": "transferOwnership(address)", + "1083fc6e": "upgradeNCPExit(address)", + "3659cfe6": "upgradeTo(address)", + "4f1ef286": "upgradeToAndCall(address,bytes)", + "00fc5701": "withdrawForAdministrator(address,uint256,address)", + "b007a5ad": "withdrawForUser(address,address,uint256)", + }, + Bin: "0x60a06040523060805234801561001457600080fd5b5061001d610022565b6100e2565b600054610100900460ff161561008e5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100e0576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051611a67610119600039600081816105ee0152818161062e015281816106ae015281816106ee01526107810152611a676000f3fe6080604052600436106101695760003560e01c8063738fdd1a116100d15780639986e4b91161008a578063c4d66de811610064578063c4d66de814610439578063dd38f90b14610459578063df8089ef14610479578063f2fde38b1461049957600080fd5b80639986e4b9146103d5578063a91ee0dc146103f9578063b007a5ad1461041957600080fd5b8063738fdd1a146102f55780637bf465301461032d578063805c5ccc1461034e5780638408bdb1146103845780638c56c8c3146103975780638da5cb5b146103b757600080fd5b80634bd1ed76116101235780634bd1ed76146102495780634f1ef2861461026b57806352d1902d1461027e5780635a731cca146102935780636c78d2cf146102b7578063715018a6146102e057600080fd5b8062fc5701146101755780631083fc6e146101975780631e0cba0d146101b75780632f40992e146101e857806334125c84146102095780633659cfe61461022957600080fd5b3661017057005b600080fd5b34801561018157600080fd5b50610195610190366004611588565b6104b9565b005b3480156101a357600080fd5b506101956101b23660046115ca565b6105a5565b3480156101c357600080fd5b506101d5665374616b696e6760c81b81565b6040519081526020015b60405180910390f35b3480156101f457600080fd5b506101d56914995dd85c99141bdbdb60b21b81565b34801561021557600080fd5b506101d56845636f73797374656d60b81b81565b34801561023557600080fd5b506101956102443660046115ca565b6105e4565b34801561025557600080fd5b506101d56a4d61696e74656e616e636560a81b81565b6101956102793660046115fd565b6106a4565b34801561028a57600080fd5b506101d5610774565b34801561029f57600080fd5b506101d56c14dd185ada5b99d4995dd85c99609a1b81565b3480156102c357600080fd5b506101d57111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b3480156102ec57600080fd5b50610195610827565b34801561030157600080fd5b50606554610315906001600160a01b031681565b6040516001600160a01b0390911681526020016101df565b34801561033957600080fd5b506101d569456e7653746f7261676560b01b81565b34801561035a57600080fd5b506101d56103693660046115ca565b6001600160a01b03166000908152609b602052604090205490565b6101956103923660046116c1565b61083b565b3480156103a357600080fd5b506101956103b23660046115ca565b610929565b3480156103c357600080fd5b506033546001600160a01b0316610315565b3480156103e157600080fd5b506101d56c42616c6c6f7453746f7261676560981b81565b34801561040557600080fd5b506101956104143660046115ca565b61099b565b34801561042557600080fd5b506101956104343660046116f6565b610a13565b34801561044557600080fd5b506101956104543660046115ca565b610c10565b34801561046557600080fd5b506101d56104743660046115ca565b610d5f565b34801561048557600080fd5b506101956104943660046115ca565b610dc1565b3480156104a557600080fd5b506101956104b43660046115ca565b610e33565b6002606654036104e45760405162461bcd60e51b81526004016104db90611737565b60405180910390fd5b60026066556098546001600160a01b031633146105135760405162461bcd60e51b81526004016104db9061176e565b6001600160a01b0383166000908152609b6020908152604080832054609a909252909120548391610543916117b8565b101561054e57600080fd5b6001600160a01b0383166000908152609a60205260409020546105729083906117b8565b6001600160a01b038085166000908152609a602052604090209190915561059b90821683610ea9565b5050600160665550565b6105ad610fc7565b6001600160a01b038116156105e1576105c581611021565b604080516000808252602082019092526105e191839190611029565b50565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361062c5760405162461bcd60e51b81526004016104db906117dd565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106756000805160206119eb833981519152546001600160a01b031690565b6001600160a01b03161461069b5760405162461bcd60e51b81526004016104db90611829565b6105c581611021565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106ec5760405162461bcd60e51b81526004016104db906117dd565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107356000805160206119eb833981519152546001600160a01b031690565b6001600160a01b03161461075b5760405162461bcd60e51b81526004016104db90611829565b61076482611021565b61077082826001611029565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146108145760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016104db565b506000805160206119eb83398151915290565b61082f610fc7565b6108396000611194565b565b60026066540361085d5760405162461bcd60e51b81526004016104db90611737565b600260665561086a6111e6565b6001600160a01b0316336001600160a01b0316146108f05760405162461bcd60e51b815260206004820152603860248201527f4f6e6c7920676f7665726e616e6365207374616b696e6720636f6e747261637460448201527f2063616e2063616c6c20746869732066756e6374696f6e2e000000000000000060648201526084016104db565b3482146108fc57600080fd5b6001600160a01b039092166000908152609a6020908152604080832093909355609b905220556001606655565b6099546001600160a01b031633146109535760405162461bcd60e51b81526004016104db90611875565b6001600160a01b0381166109795760405162461bcd60e51b81526004016104db906118b7565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b6109a3610fc7565b6001600160a01b0381166109c95760405162461bcd60e51b81526004016104db906118b7565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b600260665403610a355760405162461bcd60e51b81526004016104db90611737565b6002606655610a426111e6565b6001600160a01b031663f1b8aa1d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa391906118ee565b6001600160a01b0316336001600160a01b031614610b135760405162461bcd60e51b815260206004820152602760248201527f4f6e6c79204e63705374616b696e672063616e2063616c6c20746869732066756044820152663731ba34b7b71760c91b60648201526084016104db565b6001600160a01b0383166000908152609b6020526040902054811115610b935760405162461bcd60e51b815260206004820152602f60248201527f5f6c6f636b65645573657242616c616e6365546f4e4350546f74616c5b65786960448201526e1d1398dc17480f8f48185b5bdd5b9d608a1b60648201526084016104db565b6001600160a01b0383166000908152609a6020526040902054610bb79082906117b8565b6001600160a01b0384166000908152609a6020908152604080832093909355609b90522054610be79082906117b8565b6001600160a01b038085166000908152609b602052604090209190915561059b90831682610ea9565b600054610100900460ff1615808015610c305750600054600160ff909116105b80610c4a5750303b158015610c4a575060005460ff166001145b610cad5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104db565b6000805460ff191660011790558015610cd0576000805461ff0019166101001790555b610cd8611200565b610ce061122f565b610ce98261099b565b603354609880546001600160a01b039092166001600160a01b03199283168117909155609980549092161790558015610770576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6098546000906001600160a01b03163314610d8c5760405162461bcd60e51b81526004016104db9061176e565b6001600160a01b0382166000908152609b6020908152604080832054609a90925290912054610dbb91906117b8565b92915050565b6099546001600160a01b03163314610deb5760405162461bcd60e51b81526004016104db90611875565b6001600160a01b038116610e115760405162461bcd60e51b81526004016104db906118b7565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b610e3b610fc7565b6001600160a01b038116610ea05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104db565b6105e181611194565b80471015610ef95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104db565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f46576040519150601f19603f3d011682016040523d82523d6000602084013e610f4b565b606091505b5050905080610fc25760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104db565b505050565b6033546001600160a01b031633146108395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104db565b6105e1610fc7565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561105c57610fc28361125e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156110b6575060408051601f3d908101601f191682019092526110b39181019061190b565b60015b6111195760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016104db565b6000805160206119eb83398151915281146111885760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016104db565b50610fc28383836112fa565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006111fb665374616b696e6760c81b611325565b905090565b600054610100900460ff166112275760405162461bcd60e51b81526004016104db90611924565b610839611393565b600054610100900460ff166112565760405162461bcd60e51b81526004016104db90611924565b6108396113c3565b6001600160a01b0381163b6112cb5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016104db565b6000805160206119eb83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611303836113f1565b6000825111806113105750805b15610fc25761131f8383611431565b50505050565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd90602401602060405180830381865afa15801561136f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb91906118ee565b600054610100900460ff166113ba5760405162461bcd60e51b81526004016104db90611924565b61083933611194565b600054610100900460ff166113ea5760405162461bcd60e51b81526004016104db90611924565b6001606655565b6113fa8161125e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114568383604051806060016040528060278152602001611a0b6027913961145d565b9392505050565b60606001600160a01b0384163b6114c55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016104db565b600080856001600160a01b0316856040516114e0919061199b565b600060405180830381855af49150503d806000811461151b576040519150601f19603f3d011682016040523d82523d6000602084013e611520565b606091505b509150915061153082828661153a565b9695505050505050565b60608315611549575081611456565b8251156115595782518084602001fd5b8160405162461bcd60e51b81526004016104db91906119b7565b6001600160a01b03811681146105e157600080fd5b60008060006060848603121561159d57600080fd5b83356115a881611573565b92506020840135915060408401356115bf81611573565b809150509250925092565b6000602082840312156115dc57600080fd5b813561145681611573565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561161057600080fd5b823561161b81611573565b9150602083013567ffffffffffffffff8082111561163857600080fd5b818501915085601f83011261164c57600080fd5b81358181111561165e5761165e6115e7565b604051601f8201601f19908116603f01168101908382118183101715611686576116866115e7565b8160405282815288602084870101111561169f57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806000606084860312156116d657600080fd5b83356116e181611573565b95602085013595506040909401359392505050565b60008060006060848603121561170b57600080fd5b833561171681611573565b9250602084013561172681611573565b929592945050506040919091013590565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252602a908201527f4f6e6c792041646d696e6973747261746f722063616e2063616c6c207468697360408201526910333ab731ba34b7b71760b11b606082015260800190565b6000828210156117d857634e487b7160e01b600052601160045260246000fd5b500390565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526022908201527f43616c6c6572206973206e6f742041646d696e6973747261746f725365747465604082015261391760f11b606082015260800190565b6020808252601a908201527f416464726573732073686f756c64206265206e6f6e2d7a65726f000000000000604082015260600190565b60006020828403121561190057600080fd5b815161145681611573565b60006020828403121561191d57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b8381101561198a578181015183820152602001611972565b8381111561131f5750506000910152565b600082516119ad81846020870161196f565b9190910192915050565b60208152600082518060208401526119d681604085016020870161196f565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b00f4e5c886400503c92d7ed21f3804a28036c7ccf34340b73b7a47ece983e6764736f6c634300080e0033", +} + +// NCPExitImpABI is the input ABI used to generate the binding from. +// Deprecated: Use NCPExitImpMetaData.ABI instead. +var NCPExitImpABI = NCPExitImpMetaData.ABI + +// Deprecated: Use NCPExitImpMetaData.Sigs instead. +// NCPExitImpFuncSigs maps the 4-byte function signature to its string representation. +var NCPExitImpFuncSigs = NCPExitImpMetaData.Sigs + +// NCPExitImpBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use NCPExitImpMetaData.Bin instead. +var NCPExitImpBin = NCPExitImpMetaData.Bin + +// DeployNCPExitImp deploys a new Ethereum contract, binding an instance of NCPExitImp to it. +func DeployNCPExitImp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *NCPExitImp, error) { + parsed, err := NCPExitImpMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(NCPExitImpBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &NCPExitImp{NCPExitImpCaller: NCPExitImpCaller{contract: contract}, NCPExitImpTransactor: NCPExitImpTransactor{contract: contract}, NCPExitImpFilterer: NCPExitImpFilterer{contract: contract}}, nil +} + +// NCPExitImp is an auto generated Go binding around an Ethereum contract. +type NCPExitImp struct { + NCPExitImpCaller // Read-only binding to the contract + NCPExitImpTransactor // Write-only binding to the contract + NCPExitImpFilterer // Log filterer for contract events +} + +// NCPExitImpCaller is an auto generated read-only Go binding around an Ethereum contract. +type NCPExitImpCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitImpTransactor is an auto generated write-only Go binding around an Ethereum contract. +type NCPExitImpTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitImpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type NCPExitImpFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// NCPExitImpSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type NCPExitImpSession struct { + Contract *NCPExitImp // 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 +} + +// NCPExitImpCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type NCPExitImpCallerSession struct { + Contract *NCPExitImpCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// NCPExitImpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type NCPExitImpTransactorSession struct { + Contract *NCPExitImpTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// NCPExitImpRaw is an auto generated low-level Go binding around an Ethereum contract. +type NCPExitImpRaw struct { + Contract *NCPExitImp // Generic contract binding to access the raw methods on +} + +// NCPExitImpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type NCPExitImpCallerRaw struct { + Contract *NCPExitImpCaller // Generic read-only contract binding to access the raw methods on +} + +// NCPExitImpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type NCPExitImpTransactorRaw struct { + Contract *NCPExitImpTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewNCPExitImp creates a new instance of NCPExitImp, bound to a specific deployed contract. +func NewNCPExitImp(address common.Address, backend bind.ContractBackend) (*NCPExitImp, error) { + contract, err := bindNCPExitImp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &NCPExitImp{NCPExitImpCaller: NCPExitImpCaller{contract: contract}, NCPExitImpTransactor: NCPExitImpTransactor{contract: contract}, NCPExitImpFilterer: NCPExitImpFilterer{contract: contract}}, nil +} + +// NewNCPExitImpCaller creates a new read-only instance of NCPExitImp, bound to a specific deployed contract. +func NewNCPExitImpCaller(address common.Address, caller bind.ContractCaller) (*NCPExitImpCaller, error) { + contract, err := bindNCPExitImp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &NCPExitImpCaller{contract: contract}, nil +} + +// NewNCPExitImpTransactor creates a new write-only instance of NCPExitImp, bound to a specific deployed contract. +func NewNCPExitImpTransactor(address common.Address, transactor bind.ContractTransactor) (*NCPExitImpTransactor, error) { + contract, err := bindNCPExitImp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &NCPExitImpTransactor{contract: contract}, nil +} + +// NewNCPExitImpFilterer creates a new log filterer instance of NCPExitImp, bound to a specific deployed contract. +func NewNCPExitImpFilterer(address common.Address, filterer bind.ContractFilterer) (*NCPExitImpFilterer, error) { + contract, err := bindNCPExitImp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &NCPExitImpFilterer{contract: contract}, nil +} + +// bindNCPExitImp binds a generic wrapper to an already deployed contract. +func bindNCPExitImp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(NCPExitImpABI)) + 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 (_NCPExitImp *NCPExitImpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NCPExitImp.Contract.NCPExitImpCaller.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 (_NCPExitImp *NCPExitImpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExitImp.Contract.NCPExitImpTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NCPExitImp *NCPExitImpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NCPExitImp.Contract.NCPExitImpTransactor.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 (_NCPExitImp *NCPExitImpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _NCPExitImp.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 (_NCPExitImp *NCPExitImpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExitImp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_NCPExitImp *NCPExitImpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _NCPExitImp.Contract.contract.Transact(opts, method, params...) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) BALLOTSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "BALLOT_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _NCPExitImp.Contract.BALLOTSTORAGENAME(&_NCPExitImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _NCPExitImp.Contract.BALLOTSTORAGENAME(&_NCPExitImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) ECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) ECOSYSTEMNAME() ([32]byte, error) { + return _NCPExitImp.Contract.ECOSYSTEMNAME(&_NCPExitImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) ECOSYSTEMNAME() ([32]byte, error) { + return _NCPExitImp.Contract.ECOSYSTEMNAME(&_NCPExitImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) ENVSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "ENV_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) ENVSTORAGENAME() ([32]byte, error) { + return _NCPExitImp.Contract.ENVSTORAGENAME(&_NCPExitImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) ENVSTORAGENAME() ([32]byte, error) { + return _NCPExitImp.Contract.ENVSTORAGENAME(&_NCPExitImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) GOVNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "GOV_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) GOVNAME() ([32]byte, error) { + return _NCPExitImp.Contract.GOVNAME(&_NCPExitImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) GOVNAME() ([32]byte, error) { + return _NCPExitImp.Contract.GOVNAME(&_NCPExitImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) MAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) MAINTENANCENAME() ([32]byte, error) { + return _NCPExitImp.Contract.MAINTENANCENAME(&_NCPExitImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) MAINTENANCENAME() ([32]byte, error) { + return _NCPExitImp.Contract.MAINTENANCENAME(&_NCPExitImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) REWARDPOOLNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "REWARD_POOL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) REWARDPOOLNAME() ([32]byte, error) { + return _NCPExitImp.Contract.REWARDPOOLNAME(&_NCPExitImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) REWARDPOOLNAME() ([32]byte, error) { + return _NCPExitImp.Contract.REWARDPOOLNAME(&_NCPExitImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) STAKINGNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "STAKING_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) STAKINGNAME() ([32]byte, error) { + return _NCPExitImp.Contract.STAKINGNAME(&_NCPExitImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) STAKINGNAME() ([32]byte, error) { + return _NCPExitImp.Contract.STAKINGNAME(&_NCPExitImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) STAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) STAKINGREWARDNAME() ([32]byte, error) { + return _NCPExitImp.Contract.STAKINGREWARDNAME(&_NCPExitImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) STAKINGREWARDNAME() ([32]byte, error) { + return _NCPExitImp.Contract.STAKINGREWARDNAME(&_NCPExitImp.CallOpts) +} + +// GetAvailableAmountForAdministrator is a free data retrieval call binding the contract method 0xdd38f90b. +// +// Solidity: function getAvailableAmountForAdministrator(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpCaller) GetAvailableAmountForAdministrator(opts *bind.CallOpts, exitNcp common.Address) (*big.Int, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "getAvailableAmountForAdministrator", exitNcp) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetAvailableAmountForAdministrator is a free data retrieval call binding the contract method 0xdd38f90b. +// +// Solidity: function getAvailableAmountForAdministrator(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpSession) GetAvailableAmountForAdministrator(exitNcp common.Address) (*big.Int, error) { + return _NCPExitImp.Contract.GetAvailableAmountForAdministrator(&_NCPExitImp.CallOpts, exitNcp) +} + +// GetAvailableAmountForAdministrator is a free data retrieval call binding the contract method 0xdd38f90b. +// +// Solidity: function getAvailableAmountForAdministrator(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpCallerSession) GetAvailableAmountForAdministrator(exitNcp common.Address) (*big.Int, error) { + return _NCPExitImp.Contract.GetAvailableAmountForAdministrator(&_NCPExitImp.CallOpts, exitNcp) +} + +// GetLockedUserBalanceToNCPTotal is a free data retrieval call binding the contract method 0x805c5ccc. +// +// Solidity: function getLockedUserBalanceToNCPTotal(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpCaller) GetLockedUserBalanceToNCPTotal(opts *bind.CallOpts, exitNcp common.Address) (*big.Int, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "getLockedUserBalanceToNCPTotal", exitNcp) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetLockedUserBalanceToNCPTotal is a free data retrieval call binding the contract method 0x805c5ccc. +// +// Solidity: function getLockedUserBalanceToNCPTotal(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpSession) GetLockedUserBalanceToNCPTotal(exitNcp common.Address) (*big.Int, error) { + return _NCPExitImp.Contract.GetLockedUserBalanceToNCPTotal(&_NCPExitImp.CallOpts, exitNcp) +} + +// GetLockedUserBalanceToNCPTotal is a free data retrieval call binding the contract method 0x805c5ccc. +// +// Solidity: function getLockedUserBalanceToNCPTotal(address exitNcp) view returns(uint256) +func (_NCPExitImp *NCPExitImpCallerSession) GetLockedUserBalanceToNCPTotal(exitNcp common.Address) (*big.Int, error) { + return _NCPExitImp.Contract.GetLockedUserBalanceToNCPTotal(&_NCPExitImp.CallOpts, exitNcp) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_NCPExitImp *NCPExitImpCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NCPExitImp.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 (_NCPExitImp *NCPExitImpSession) Owner() (common.Address, error) { + return _NCPExitImp.Contract.Owner(&_NCPExitImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_NCPExitImp *NCPExitImpCallerSession) Owner() (common.Address, error) { + return _NCPExitImp.Contract.Owner(&_NCPExitImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_NCPExitImp *NCPExitImpSession) ProxiableUUID() ([32]byte, error) { + return _NCPExitImp.Contract.ProxiableUUID(&_NCPExitImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_NCPExitImp *NCPExitImpCallerSession) ProxiableUUID() ([32]byte, error) { + return _NCPExitImp.Contract.ProxiableUUID(&_NCPExitImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_NCPExitImp *NCPExitImpCaller) Reg(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _NCPExitImp.contract.Call(opts, &out, "reg") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_NCPExitImp *NCPExitImpSession) Reg() (common.Address, error) { + return _NCPExitImp.Contract.Reg(&_NCPExitImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_NCPExitImp *NCPExitImpCallerSession) Reg() (common.Address, error) { + return _NCPExitImp.Contract.Reg(&_NCPExitImp.CallOpts) +} + +// DepositExitAmount is a paid mutator transaction binding the contract method 0x8408bdb1. +// +// Solidity: function depositExitAmount(address exitNcp, uint256 totalAmount, uint256 lockedUserBalanceToNCPTotal) payable returns() +func (_NCPExitImp *NCPExitImpTransactor) DepositExitAmount(opts *bind.TransactOpts, exitNcp common.Address, totalAmount *big.Int, lockedUserBalanceToNCPTotal *big.Int) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "depositExitAmount", exitNcp, totalAmount, lockedUserBalanceToNCPTotal) +} + +// DepositExitAmount is a paid mutator transaction binding the contract method 0x8408bdb1. +// +// Solidity: function depositExitAmount(address exitNcp, uint256 totalAmount, uint256 lockedUserBalanceToNCPTotal) payable returns() +func (_NCPExitImp *NCPExitImpSession) DepositExitAmount(exitNcp common.Address, totalAmount *big.Int, lockedUserBalanceToNCPTotal *big.Int) (*types.Transaction, error) { + return _NCPExitImp.Contract.DepositExitAmount(&_NCPExitImp.TransactOpts, exitNcp, totalAmount, lockedUserBalanceToNCPTotal) +} + +// DepositExitAmount is a paid mutator transaction binding the contract method 0x8408bdb1. +// +// Solidity: function depositExitAmount(address exitNcp, uint256 totalAmount, uint256 lockedUserBalanceToNCPTotal) payable returns() +func (_NCPExitImp *NCPExitImpTransactorSession) DepositExitAmount(exitNcp common.Address, totalAmount *big.Int, lockedUserBalanceToNCPTotal *big.Int) (*types.Transaction, error) { + return _NCPExitImp.Contract.DepositExitAmount(&_NCPExitImp.TransactOpts, exitNcp, totalAmount, lockedUserBalanceToNCPTotal) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_NCPExitImp *NCPExitImpTransactor) Initialize(opts *bind.TransactOpts, _registry common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "initialize", _registry) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_NCPExitImp *NCPExitImpSession) Initialize(_registry common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.Initialize(&_NCPExitImp.TransactOpts, _registry) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _registry) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) Initialize(_registry common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.Initialize(&_NCPExitImp.TransactOpts, _registry) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_NCPExitImp *NCPExitImpTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_NCPExitImp *NCPExitImpSession) RenounceOwnership() (*types.Transaction, error) { + return _NCPExitImp.Contract.RenounceOwnership(&_NCPExitImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_NCPExitImp *NCPExitImpTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _NCPExitImp.Contract.RenounceOwnership(&_NCPExitImp.TransactOpts) +} + +// SetAdministrator is a paid mutator transaction binding the contract method 0xdf8089ef. +// +// Solidity: function setAdministrator(address _newAdministrator) returns() +func (_NCPExitImp *NCPExitImpTransactor) SetAdministrator(opts *bind.TransactOpts, _newAdministrator common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "setAdministrator", _newAdministrator) +} + +// SetAdministrator is a paid mutator transaction binding the contract method 0xdf8089ef. +// +// Solidity: function setAdministrator(address _newAdministrator) returns() +func (_NCPExitImp *NCPExitImpSession) SetAdministrator(_newAdministrator common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetAdministrator(&_NCPExitImp.TransactOpts, _newAdministrator) +} + +// SetAdministrator is a paid mutator transaction binding the contract method 0xdf8089ef. +// +// Solidity: function setAdministrator(address _newAdministrator) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) SetAdministrator(_newAdministrator common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetAdministrator(&_NCPExitImp.TransactOpts, _newAdministrator) +} + +// SetAdministratorSetter is a paid mutator transaction binding the contract method 0x8c56c8c3. +// +// Solidity: function setAdministratorSetter(address _newAdministratorSetter) returns() +func (_NCPExitImp *NCPExitImpTransactor) SetAdministratorSetter(opts *bind.TransactOpts, _newAdministratorSetter common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "setAdministratorSetter", _newAdministratorSetter) +} + +// SetAdministratorSetter is a paid mutator transaction binding the contract method 0x8c56c8c3. +// +// Solidity: function setAdministratorSetter(address _newAdministratorSetter) returns() +func (_NCPExitImp *NCPExitImpSession) SetAdministratorSetter(_newAdministratorSetter common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetAdministratorSetter(&_NCPExitImp.TransactOpts, _newAdministratorSetter) +} + +// SetAdministratorSetter is a paid mutator transaction binding the contract method 0x8c56c8c3. +// +// Solidity: function setAdministratorSetter(address _newAdministratorSetter) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) SetAdministratorSetter(_newAdministratorSetter common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetAdministratorSetter(&_NCPExitImp.TransactOpts, _newAdministratorSetter) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_NCPExitImp *NCPExitImpTransactor) SetRegistry(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "setRegistry", _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_NCPExitImp *NCPExitImpSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetRegistry(&_NCPExitImp.TransactOpts, _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.SetRegistry(&_NCPExitImp.TransactOpts, _addr) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_NCPExitImp *NCPExitImpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_NCPExitImp *NCPExitImpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.TransferOwnership(&_NCPExitImp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.TransferOwnership(&_NCPExitImp.TransactOpts, newOwner) +} + +// UpgradeNCPExit is a paid mutator transaction binding the contract method 0x1083fc6e. +// +// Solidity: function upgradeNCPExit(address newImp) returns() +func (_NCPExitImp *NCPExitImpTransactor) UpgradeNCPExit(opts *bind.TransactOpts, newImp common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "upgradeNCPExit", newImp) +} + +// UpgradeNCPExit is a paid mutator transaction binding the contract method 0x1083fc6e. +// +// Solidity: function upgradeNCPExit(address newImp) returns() +func (_NCPExitImp *NCPExitImpSession) UpgradeNCPExit(newImp common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeNCPExit(&_NCPExitImp.TransactOpts, newImp) +} + +// UpgradeNCPExit is a paid mutator transaction binding the contract method 0x1083fc6e. +// +// Solidity: function upgradeNCPExit(address newImp) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) UpgradeNCPExit(newImp common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeNCPExit(&_NCPExitImp.TransactOpts, newImp) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_NCPExitImp *NCPExitImpTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_NCPExitImp *NCPExitImpSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeTo(&_NCPExitImp.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeTo(&_NCPExitImp.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_NCPExitImp *NCPExitImpTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_NCPExitImp *NCPExitImpSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeToAndCall(&_NCPExitImp.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_NCPExitImp *NCPExitImpTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _NCPExitImp.Contract.UpgradeToAndCall(&_NCPExitImp.TransactOpts, newImplementation, data) +} + +// WithdrawForAdministrator is a paid mutator transaction binding the contract method 0x00fc5701. +// +// Solidity: function withdrawForAdministrator(address exitNcp, uint256 amount, address to) returns() +func (_NCPExitImp *NCPExitImpTransactor) WithdrawForAdministrator(opts *bind.TransactOpts, exitNcp common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "withdrawForAdministrator", exitNcp, amount, to) +} + +// WithdrawForAdministrator is a paid mutator transaction binding the contract method 0x00fc5701. +// +// Solidity: function withdrawForAdministrator(address exitNcp, uint256 amount, address to) returns() +func (_NCPExitImp *NCPExitImpSession) WithdrawForAdministrator(exitNcp common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.WithdrawForAdministrator(&_NCPExitImp.TransactOpts, exitNcp, amount, to) +} + +// WithdrawForAdministrator is a paid mutator transaction binding the contract method 0x00fc5701. +// +// Solidity: function withdrawForAdministrator(address exitNcp, uint256 amount, address to) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) WithdrawForAdministrator(exitNcp common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) { + return _NCPExitImp.Contract.WithdrawForAdministrator(&_NCPExitImp.TransactOpts, exitNcp, amount, to) +} + +// WithdrawForUser is a paid mutator transaction binding the contract method 0xb007a5ad. +// +// Solidity: function withdrawForUser(address exitNcp, address exitUser, uint256 amount) returns() +func (_NCPExitImp *NCPExitImpTransactor) WithdrawForUser(opts *bind.TransactOpts, exitNcp common.Address, exitUser common.Address, amount *big.Int) (*types.Transaction, error) { + return _NCPExitImp.contract.Transact(opts, "withdrawForUser", exitNcp, exitUser, amount) +} + +// WithdrawForUser is a paid mutator transaction binding the contract method 0xb007a5ad. +// +// Solidity: function withdrawForUser(address exitNcp, address exitUser, uint256 amount) returns() +func (_NCPExitImp *NCPExitImpSession) WithdrawForUser(exitNcp common.Address, exitUser common.Address, amount *big.Int) (*types.Transaction, error) { + return _NCPExitImp.Contract.WithdrawForUser(&_NCPExitImp.TransactOpts, exitNcp, exitUser, amount) +} + +// WithdrawForUser is a paid mutator transaction binding the contract method 0xb007a5ad. +// +// Solidity: function withdrawForUser(address exitNcp, address exitUser, uint256 amount) returns() +func (_NCPExitImp *NCPExitImpTransactorSession) WithdrawForUser(exitNcp common.Address, exitUser common.Address, amount *big.Int) (*types.Transaction, error) { + return _NCPExitImp.Contract.WithdrawForUser(&_NCPExitImp.TransactOpts, exitNcp, exitUser, amount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExitImp *NCPExitImpTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _NCPExitImp.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExitImp *NCPExitImpSession) Receive() (*types.Transaction, error) { + return _NCPExitImp.Contract.Receive(&_NCPExitImp.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_NCPExitImp *NCPExitImpTransactorSession) Receive() (*types.Transaction, error) { + return _NCPExitImp.Contract.Receive(&_NCPExitImp.TransactOpts) +} + +// NCPExitImpAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the NCPExitImp contract. +type NCPExitImpAdminChangedIterator struct { + Event *NCPExitImpAdminChanged // 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 *NCPExitImpAdminChangedIterator) 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(NCPExitImpAdminChanged) + 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(NCPExitImpAdminChanged) + 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 *NCPExitImpAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpAdminChanged represents a AdminChanged event raised by the NCPExitImp contract. +type NCPExitImpAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExitImp *NCPExitImpFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*NCPExitImpAdminChangedIterator, error) { + + logs, sub, err := _NCPExitImp.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &NCPExitImpAdminChangedIterator{contract: _NCPExitImp.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExitImp *NCPExitImpFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *NCPExitImpAdminChanged) (event.Subscription, error) { + + logs, sub, err := _NCPExitImp.contract.WatchLogs(opts, "AdminChanged") + 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(NCPExitImpAdminChanged) + if err := _NCPExitImp.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_NCPExitImp *NCPExitImpFilterer) ParseAdminChanged(log types.Log) (*NCPExitImpAdminChanged, error) { + event := new(NCPExitImpAdminChanged) + if err := _NCPExitImp.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the NCPExitImp contract. +type NCPExitImpBeaconUpgradedIterator struct { + Event *NCPExitImpBeaconUpgraded // 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 *NCPExitImpBeaconUpgradedIterator) 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(NCPExitImpBeaconUpgraded) + 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(NCPExitImpBeaconUpgraded) + 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 *NCPExitImpBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpBeaconUpgraded represents a BeaconUpgraded event raised by the NCPExitImp contract. +type NCPExitImpBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExitImp *NCPExitImpFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*NCPExitImpBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _NCPExitImp.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &NCPExitImpBeaconUpgradedIterator{contract: _NCPExitImp.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExitImp *NCPExitImpFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *NCPExitImpBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _NCPExitImp.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(NCPExitImpBeaconUpgraded) + if err := _NCPExitImp.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_NCPExitImp *NCPExitImpFilterer) ParseBeaconUpgraded(log types.Log) (*NCPExitImpBeaconUpgraded, error) { + event := new(NCPExitImpBeaconUpgraded) + if err := _NCPExitImp.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the NCPExitImp contract. +type NCPExitImpInitializedIterator struct { + Event *NCPExitImpInitialized // 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 *NCPExitImpInitializedIterator) 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(NCPExitImpInitialized) + 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(NCPExitImpInitialized) + 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 *NCPExitImpInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpInitialized represents a Initialized event raised by the NCPExitImp contract. +type NCPExitImpInitialized 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 (_NCPExitImp *NCPExitImpFilterer) FilterInitialized(opts *bind.FilterOpts) (*NCPExitImpInitializedIterator, error) { + + logs, sub, err := _NCPExitImp.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &NCPExitImpInitializedIterator{contract: _NCPExitImp.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 (_NCPExitImp *NCPExitImpFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *NCPExitImpInitialized) (event.Subscription, error) { + + logs, sub, err := _NCPExitImp.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(NCPExitImpInitialized) + if err := _NCPExitImp.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 (_NCPExitImp *NCPExitImpFilterer) ParseInitialized(log types.Log) (*NCPExitImpInitialized, error) { + event := new(NCPExitImpInitialized) + if err := _NCPExitImp.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the NCPExitImp contract. +type NCPExitImpOwnershipTransferredIterator struct { + Event *NCPExitImpOwnershipTransferred // 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 *NCPExitImpOwnershipTransferredIterator) 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(NCPExitImpOwnershipTransferred) + 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(NCPExitImpOwnershipTransferred) + 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 *NCPExitImpOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpOwnershipTransferred represents a OwnershipTransferred event raised by the NCPExitImp contract. +type NCPExitImpOwnershipTransferred 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 (_NCPExitImp *NCPExitImpFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*NCPExitImpOwnershipTransferredIterator, 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 := _NCPExitImp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &NCPExitImpOwnershipTransferredIterator{contract: _NCPExitImp.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 (_NCPExitImp *NCPExitImpFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *NCPExitImpOwnershipTransferred, 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 := _NCPExitImp.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(NCPExitImpOwnershipTransferred) + if err := _NCPExitImp.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 (_NCPExitImp *NCPExitImpFilterer) ParseOwnershipTransferred(log types.Log) (*NCPExitImpOwnershipTransferred, error) { + event := new(NCPExitImpOwnershipTransferred) + if err := _NCPExitImp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpSetRegistryIterator is returned from FilterSetRegistry and is used to iterate over the raw logs and unpacked data for SetRegistry events raised by the NCPExitImp contract. +type NCPExitImpSetRegistryIterator struct { + Event *NCPExitImpSetRegistry // 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 *NCPExitImpSetRegistryIterator) 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(NCPExitImpSetRegistry) + 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(NCPExitImpSetRegistry) + 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 *NCPExitImpSetRegistryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpSetRegistryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpSetRegistry represents a SetRegistry event raised by the NCPExitImp contract. +type NCPExitImpSetRegistry struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetRegistry is a free log retrieval operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_NCPExitImp *NCPExitImpFilterer) FilterSetRegistry(opts *bind.FilterOpts, addr []common.Address) (*NCPExitImpSetRegistryIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _NCPExitImp.contract.FilterLogs(opts, "SetRegistry", addrRule) + if err != nil { + return nil, err + } + return &NCPExitImpSetRegistryIterator{contract: _NCPExitImp.contract, event: "SetRegistry", logs: logs, sub: sub}, nil +} + +// WatchSetRegistry is a free log subscription operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_NCPExitImp *NCPExitImpFilterer) WatchSetRegistry(opts *bind.WatchOpts, sink chan<- *NCPExitImpSetRegistry, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _NCPExitImp.contract.WatchLogs(opts, "SetRegistry", addrRule) + 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(NCPExitImpSetRegistry) + if err := _NCPExitImp.contract.UnpackLog(event, "SetRegistry", 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 +} + +// ParseSetRegistry is a log parse operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_NCPExitImp *NCPExitImpFilterer) ParseSetRegistry(log types.Log) (*NCPExitImpSetRegistry, error) { + event := new(NCPExitImpSetRegistry) + if err := _NCPExitImp.contract.UnpackLog(event, "SetRegistry", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// NCPExitImpUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the NCPExitImp contract. +type NCPExitImpUpgradedIterator struct { + Event *NCPExitImpUpgraded // 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 *NCPExitImpUpgradedIterator) 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(NCPExitImpUpgraded) + 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(NCPExitImpUpgraded) + 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 *NCPExitImpUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *NCPExitImpUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// NCPExitImpUpgraded represents a Upgraded event raised by the NCPExitImp contract. +type NCPExitImpUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExitImp *NCPExitImpFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*NCPExitImpUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _NCPExitImp.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &NCPExitImpUpgradedIterator{contract: _NCPExitImp.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExitImp *NCPExitImpFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *NCPExitImpUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _NCPExitImp.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(NCPExitImpUpgraded) + if err := _NCPExitImp.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_NCPExitImp *NCPExitImpFilterer) ParseUpgraded(log types.Log) (*NCPExitImpUpgraded, error) { + event := new(NCPExitImpUpgraded) + if err := _NCPExitImp.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/gen_registry_abi.go b/wemix/bind/gen_registry_abi.go new file mode 100644 index 000000000000..c7aa5c0002ce --- /dev/null +++ b/wemix/bind/gen_registry_abi.go @@ -0,0 +1,981 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// RegistryMetaData contains all meta data concerning the Registry contract. +var RegistryMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"setter\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetContractDomain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_contract\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"granted\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"SetPermission\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"contracts\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"}],\"name\":\"getContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_contract\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_granted\",\"type\":\"address\"}],\"name\":\"getPermission\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"found\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"magic\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"modifiedBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"permissions\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_name\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setContractDomain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_contract\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_granted\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_status\",\"type\":\"bool\"}],\"name\":\"setPermission\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Sigs: map[string]string{ + "ec56a373": "contracts(bytes32)", + "0d2020dd": "getContractAddress(bytes32)", + "60d6c7cf": "getPermission(bytes32,address)", + "0d854646": "magic()", + "7d10dd1b": "modifiedBlock()", + "8da5cb5b": "owner()", + "3ec50c6c": "permissions(bytes32,address)", + "715018a6": "renounceOwnership()", + "04af66ad": "setContractDomain(bytes32,address)", + "599e4c70": "setPermission(bytes32,address,bool)", + "f2fde38b": "transferOwnership(address)", + }, + Bin: "0x60806040526d57656d697820526567697374727960015534801561002257600080fd5b5061002c33610031565b610081565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610659806100906000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806360d6c7cf1161007157806360d6c7cf14610159578063715018a6146101925780637d10dd1b1461019c5780638da5cb5b146101a5578063ec56a373146101b6578063f2fde38b146101df57600080fd5b806304af66ad146100ae5780630d2020dd146100d65780630d854646146101015780633ec50c6c14610118578063599e4c7014610146575b600080fd5b6100c16100bc36600461050b565b6101f2565b60405190151581526020015b60405180910390f35b6100e96100e4366004610537565b6102b9565b6040516001600160a01b0390911681526020016100cd565b61010a60015481565b6040519081526020016100cd565b6100c161012636600461050b565b600460209081526000928352604080842090915290825290205460ff1681565b6100c1610154366004610550565b610309565b6100c161016736600461050b565b60009182526004602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61019a6103ce565b005b61010a60025481565b6000546001600160a01b03166100e9565b6100e96101c4366004610537565b6003602052600090815260409020546001600160a01b031681565b61019a6101ed366004610595565b610404565b600080546001600160a01b031633146102265760405162461bcd60e51b815260040161021d906105b7565b60405180910390fd5b6001600160a01b03821661024c5760405162461bcd60e51b815260040161021d906105ec565b60008381526003602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915543600255915133815285917f37724a4a9968ac9654e6ee52f3d0c93e5ef8863e057254ee2e36e8ad3e8429db910160405180910390a350600192915050565b6000818152600360205260408120546001600160a01b03166102ed5760405162461bcd60e51b815260040161021d906105ec565b506000908152600360205260409020546001600160a01b031690565b600080546001600160a01b031633146103345760405162461bcd60e51b815260040161021d906105b7565b6001600160a01b03831661035a5760405162461bcd60e51b815260040161021d906105ec565b60008481526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915543600255905190815286917fe9f5231bbfb4b32867755b94562215cff6c8998489de8ba20926f8d0980e7818910160405180910390a35060019392505050565b6000546001600160a01b031633146103f85760405162461bcd60e51b815260040161021d906105b7565b610402600061049f565b565b6000546001600160a01b0316331461042e5760405162461bcd60e51b815260040161021d906105b7565b6001600160a01b0381166104935760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161021d565b61049c8161049f565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461050657600080fd5b919050565b6000806040838503121561051e57600080fd5b8235915061052e602084016104ef565b90509250929050565b60006020828403121561054957600080fd5b5035919050565b60008060006060848603121561056557600080fd5b83359250610575602085016104ef565b91506040840135801515811461058a57600080fd5b809150509250925092565b6000602082840312156105a757600080fd5b6105b0826104ef565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601a908201527f616464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060408201526060019056fea2646970667358221220b7b950e503cb9742f3e07f2288e28f096b282d71a7b32fe533576ba4d480652064736f6c634300080e0033", +} + +// RegistryABI is the input ABI used to generate the binding from. +// Deprecated: Use RegistryMetaData.ABI instead. +var RegistryABI = RegistryMetaData.ABI + +// Deprecated: Use RegistryMetaData.Sigs instead. +// RegistryFuncSigs maps the 4-byte function signature to its string representation. +var RegistryFuncSigs = RegistryMetaData.Sigs + +// RegistryBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use RegistryMetaData.Bin instead. +var RegistryBin = RegistryMetaData.Bin + +// DeployRegistry deploys a new Ethereum contract, binding an instance of Registry to it. +func DeployRegistry(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Registry, error) { + parsed, err := RegistryMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(RegistryBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Registry{RegistryCaller: RegistryCaller{contract: contract}, RegistryTransactor: RegistryTransactor{contract: contract}, RegistryFilterer: RegistryFilterer{contract: contract}}, nil +} + +// Registry is an auto generated Go binding around an Ethereum contract. +type Registry struct { + RegistryCaller // Read-only binding to the contract + RegistryTransactor // Write-only binding to the contract + RegistryFilterer // Log filterer for contract events +} + +// RegistryCaller is an auto generated read-only Go binding around an Ethereum contract. +type RegistryCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RegistryTransactor is an auto generated write-only Go binding around an Ethereum contract. +type RegistryTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RegistryFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type RegistryFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RegistrySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type RegistrySession struct { + Contract *Registry // 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 +} + +// RegistryCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type RegistryCallerSession struct { + Contract *RegistryCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// RegistryTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type RegistryTransactorSession struct { + Contract *RegistryTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RegistryRaw is an auto generated low-level Go binding around an Ethereum contract. +type RegistryRaw struct { + Contract *Registry // Generic contract binding to access the raw methods on +} + +// RegistryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type RegistryCallerRaw struct { + Contract *RegistryCaller // Generic read-only contract binding to access the raw methods on +} + +// RegistryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type RegistryTransactorRaw struct { + Contract *RegistryTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewRegistry creates a new instance of Registry, bound to a specific deployed contract. +func NewRegistry(address common.Address, backend bind.ContractBackend) (*Registry, error) { + contract, err := bindRegistry(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Registry{RegistryCaller: RegistryCaller{contract: contract}, RegistryTransactor: RegistryTransactor{contract: contract}, RegistryFilterer: RegistryFilterer{contract: contract}}, nil +} + +// NewRegistryCaller creates a new read-only instance of Registry, bound to a specific deployed contract. +func NewRegistryCaller(address common.Address, caller bind.ContractCaller) (*RegistryCaller, error) { + contract, err := bindRegistry(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RegistryCaller{contract: contract}, nil +} + +// NewRegistryTransactor creates a new write-only instance of Registry, bound to a specific deployed contract. +func NewRegistryTransactor(address common.Address, transactor bind.ContractTransactor) (*RegistryTransactor, error) { + contract, err := bindRegistry(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RegistryTransactor{contract: contract}, nil +} + +// NewRegistryFilterer creates a new log filterer instance of Registry, bound to a specific deployed contract. +func NewRegistryFilterer(address common.Address, filterer bind.ContractFilterer) (*RegistryFilterer, error) { + contract, err := bindRegistry(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RegistryFilterer{contract: contract}, nil +} + +// bindRegistry binds a generic wrapper to an already deployed contract. +func bindRegistry(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(RegistryABI)) + 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 (_Registry *RegistryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Registry.Contract.RegistryCaller.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 (_Registry *RegistryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Registry.Contract.RegistryTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Registry *RegistryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Registry.Contract.RegistryTransactor.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 (_Registry *RegistryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Registry.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 (_Registry *RegistryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Registry.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Registry *RegistryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Registry.Contract.contract.Transact(opts, method, params...) +} + +// Contracts is a free data retrieval call binding the contract method 0xec56a373. +// +// Solidity: function contracts(bytes32 ) view returns(address) +func (_Registry *RegistryCaller) Contracts(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "contracts", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Contracts is a free data retrieval call binding the contract method 0xec56a373. +// +// Solidity: function contracts(bytes32 ) view returns(address) +func (_Registry *RegistrySession) Contracts(arg0 [32]byte) (common.Address, error) { + return _Registry.Contract.Contracts(&_Registry.CallOpts, arg0) +} + +// Contracts is a free data retrieval call binding the contract method 0xec56a373. +// +// Solidity: function contracts(bytes32 ) view returns(address) +func (_Registry *RegistryCallerSession) Contracts(arg0 [32]byte) (common.Address, error) { + return _Registry.Contract.Contracts(&_Registry.CallOpts, arg0) +} + +// GetContractAddress is a free data retrieval call binding the contract method 0x0d2020dd. +// +// Solidity: function getContractAddress(bytes32 _name) view returns(address addr) +func (_Registry *RegistryCaller) GetContractAddress(opts *bind.CallOpts, _name [32]byte) (common.Address, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "getContractAddress", _name) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetContractAddress is a free data retrieval call binding the contract method 0x0d2020dd. +// +// Solidity: function getContractAddress(bytes32 _name) view returns(address addr) +func (_Registry *RegistrySession) GetContractAddress(_name [32]byte) (common.Address, error) { + return _Registry.Contract.GetContractAddress(&_Registry.CallOpts, _name) +} + +// GetContractAddress is a free data retrieval call binding the contract method 0x0d2020dd. +// +// Solidity: function getContractAddress(bytes32 _name) view returns(address addr) +func (_Registry *RegistryCallerSession) GetContractAddress(_name [32]byte) (common.Address, error) { + return _Registry.Contract.GetContractAddress(&_Registry.CallOpts, _name) +} + +// GetPermission is a free data retrieval call binding the contract method 0x60d6c7cf. +// +// Solidity: function getPermission(bytes32 _contract, address _granted) view returns(bool found) +func (_Registry *RegistryCaller) GetPermission(opts *bind.CallOpts, _contract [32]byte, _granted common.Address) (bool, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "getPermission", _contract, _granted) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// GetPermission is a free data retrieval call binding the contract method 0x60d6c7cf. +// +// Solidity: function getPermission(bytes32 _contract, address _granted) view returns(bool found) +func (_Registry *RegistrySession) GetPermission(_contract [32]byte, _granted common.Address) (bool, error) { + return _Registry.Contract.GetPermission(&_Registry.CallOpts, _contract, _granted) +} + +// GetPermission is a free data retrieval call binding the contract method 0x60d6c7cf. +// +// Solidity: function getPermission(bytes32 _contract, address _granted) view returns(bool found) +func (_Registry *RegistryCallerSession) GetPermission(_contract [32]byte, _granted common.Address) (bool, error) { + return _Registry.Contract.GetPermission(&_Registry.CallOpts, _contract, _granted) +} + +// Magic is a free data retrieval call binding the contract method 0x0d854646. +// +// Solidity: function magic() view returns(uint256) +func (_Registry *RegistryCaller) Magic(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "magic") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Magic is a free data retrieval call binding the contract method 0x0d854646. +// +// Solidity: function magic() view returns(uint256) +func (_Registry *RegistrySession) Magic() (*big.Int, error) { + return _Registry.Contract.Magic(&_Registry.CallOpts) +} + +// Magic is a free data retrieval call binding the contract method 0x0d854646. +// +// Solidity: function magic() view returns(uint256) +func (_Registry *RegistryCallerSession) Magic() (*big.Int, error) { + return _Registry.Contract.Magic(&_Registry.CallOpts) +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_Registry *RegistryCaller) ModifiedBlock(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "modifiedBlock") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_Registry *RegistrySession) ModifiedBlock() (*big.Int, error) { + return _Registry.Contract.ModifiedBlock(&_Registry.CallOpts) +} + +// ModifiedBlock is a free data retrieval call binding the contract method 0x7d10dd1b. +// +// Solidity: function modifiedBlock() view returns(uint256) +func (_Registry *RegistryCallerSession) ModifiedBlock() (*big.Int, error) { + return _Registry.Contract.ModifiedBlock(&_Registry.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Registry *RegistryCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Registry.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 (_Registry *RegistrySession) Owner() (common.Address, error) { + return _Registry.Contract.Owner(&_Registry.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Registry *RegistryCallerSession) Owner() (common.Address, error) { + return _Registry.Contract.Owner(&_Registry.CallOpts) +} + +// Permissions is a free data retrieval call binding the contract method 0x3ec50c6c. +// +// Solidity: function permissions(bytes32 , address ) view returns(bool) +func (_Registry *RegistryCaller) Permissions(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address) (bool, error) { + var out []interface{} + err := _Registry.contract.Call(opts, &out, "permissions", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Permissions is a free data retrieval call binding the contract method 0x3ec50c6c. +// +// Solidity: function permissions(bytes32 , address ) view returns(bool) +func (_Registry *RegistrySession) Permissions(arg0 [32]byte, arg1 common.Address) (bool, error) { + return _Registry.Contract.Permissions(&_Registry.CallOpts, arg0, arg1) +} + +// Permissions is a free data retrieval call binding the contract method 0x3ec50c6c. +// +// Solidity: function permissions(bytes32 , address ) view returns(bool) +func (_Registry *RegistryCallerSession) Permissions(arg0 [32]byte, arg1 common.Address) (bool, error) { + return _Registry.Contract.Permissions(&_Registry.CallOpts, arg0, arg1) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Registry *RegistryTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Registry.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Registry *RegistrySession) RenounceOwnership() (*types.Transaction, error) { + return _Registry.Contract.RenounceOwnership(&_Registry.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Registry *RegistryTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Registry.Contract.RenounceOwnership(&_Registry.TransactOpts) +} + +// SetContractDomain is a paid mutator transaction binding the contract method 0x04af66ad. +// +// Solidity: function setContractDomain(bytes32 _name, address _addr) returns(bool success) +func (_Registry *RegistryTransactor) SetContractDomain(opts *bind.TransactOpts, _name [32]byte, _addr common.Address) (*types.Transaction, error) { + return _Registry.contract.Transact(opts, "setContractDomain", _name, _addr) +} + +// SetContractDomain is a paid mutator transaction binding the contract method 0x04af66ad. +// +// Solidity: function setContractDomain(bytes32 _name, address _addr) returns(bool success) +func (_Registry *RegistrySession) SetContractDomain(_name [32]byte, _addr common.Address) (*types.Transaction, error) { + return _Registry.Contract.SetContractDomain(&_Registry.TransactOpts, _name, _addr) +} + +// SetContractDomain is a paid mutator transaction binding the contract method 0x04af66ad. +// +// Solidity: function setContractDomain(bytes32 _name, address _addr) returns(bool success) +func (_Registry *RegistryTransactorSession) SetContractDomain(_name [32]byte, _addr common.Address) (*types.Transaction, error) { + return _Registry.Contract.SetContractDomain(&_Registry.TransactOpts, _name, _addr) +} + +// SetPermission is a paid mutator transaction binding the contract method 0x599e4c70. +// +// Solidity: function setPermission(bytes32 _contract, address _granted, bool _status) returns(bool success) +func (_Registry *RegistryTransactor) SetPermission(opts *bind.TransactOpts, _contract [32]byte, _granted common.Address, _status bool) (*types.Transaction, error) { + return _Registry.contract.Transact(opts, "setPermission", _contract, _granted, _status) +} + +// SetPermission is a paid mutator transaction binding the contract method 0x599e4c70. +// +// Solidity: function setPermission(bytes32 _contract, address _granted, bool _status) returns(bool success) +func (_Registry *RegistrySession) SetPermission(_contract [32]byte, _granted common.Address, _status bool) (*types.Transaction, error) { + return _Registry.Contract.SetPermission(&_Registry.TransactOpts, _contract, _granted, _status) +} + +// SetPermission is a paid mutator transaction binding the contract method 0x599e4c70. +// +// Solidity: function setPermission(bytes32 _contract, address _granted, bool _status) returns(bool success) +func (_Registry *RegistryTransactorSession) SetPermission(_contract [32]byte, _granted common.Address, _status bool) (*types.Transaction, error) { + return _Registry.Contract.SetPermission(&_Registry.TransactOpts, _contract, _granted, _status) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Registry *RegistryTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Registry.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Registry *RegistrySession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Registry.Contract.TransferOwnership(&_Registry.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Registry *RegistryTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Registry.Contract.TransferOwnership(&_Registry.TransactOpts, newOwner) +} + +// RegistryOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Registry contract. +type RegistryOwnershipTransferredIterator struct { + Event *RegistryOwnershipTransferred // 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 *RegistryOwnershipTransferredIterator) 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(RegistryOwnershipTransferred) + 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(RegistryOwnershipTransferred) + 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 *RegistryOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RegistryOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RegistryOwnershipTransferred represents a OwnershipTransferred event raised by the Registry contract. +type RegistryOwnershipTransferred 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 (_Registry *RegistryFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*RegistryOwnershipTransferredIterator, 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 := _Registry.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &RegistryOwnershipTransferredIterator{contract: _Registry.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 (_Registry *RegistryFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RegistryOwnershipTransferred, 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 := _Registry.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(RegistryOwnershipTransferred) + if err := _Registry.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 (_Registry *RegistryFilterer) ParseOwnershipTransferred(log types.Log) (*RegistryOwnershipTransferred, error) { + event := new(RegistryOwnershipTransferred) + if err := _Registry.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RegistrySetContractDomainIterator is returned from FilterSetContractDomain and is used to iterate over the raw logs and unpacked data for SetContractDomain events raised by the Registry contract. +type RegistrySetContractDomainIterator struct { + Event *RegistrySetContractDomain // 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 *RegistrySetContractDomainIterator) 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(RegistrySetContractDomain) + 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(RegistrySetContractDomain) + 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 *RegistrySetContractDomainIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RegistrySetContractDomainIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RegistrySetContractDomain represents a SetContractDomain event raised by the Registry contract. +type RegistrySetContractDomain struct { + Setter common.Address + Name [32]byte + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetContractDomain is a free log retrieval operation binding the contract event 0x37724a4a9968ac9654e6ee52f3d0c93e5ef8863e057254ee2e36e8ad3e8429db. +// +// Solidity: event SetContractDomain(address setter, bytes32 indexed name, address indexed addr) +func (_Registry *RegistryFilterer) FilterSetContractDomain(opts *bind.FilterOpts, name [][32]byte, addr []common.Address) (*RegistrySetContractDomainIterator, error) { + + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _Registry.contract.FilterLogs(opts, "SetContractDomain", nameRule, addrRule) + if err != nil { + return nil, err + } + return &RegistrySetContractDomainIterator{contract: _Registry.contract, event: "SetContractDomain", logs: logs, sub: sub}, nil +} + +// WatchSetContractDomain is a free log subscription operation binding the contract event 0x37724a4a9968ac9654e6ee52f3d0c93e5ef8863e057254ee2e36e8ad3e8429db. +// +// Solidity: event SetContractDomain(address setter, bytes32 indexed name, address indexed addr) +func (_Registry *RegistryFilterer) WatchSetContractDomain(opts *bind.WatchOpts, sink chan<- *RegistrySetContractDomain, name [][32]byte, addr []common.Address) (event.Subscription, error) { + + var nameRule []interface{} + for _, nameItem := range name { + nameRule = append(nameRule, nameItem) + } + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _Registry.contract.WatchLogs(opts, "SetContractDomain", nameRule, addrRule) + 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(RegistrySetContractDomain) + if err := _Registry.contract.UnpackLog(event, "SetContractDomain", 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 +} + +// ParseSetContractDomain is a log parse operation binding the contract event 0x37724a4a9968ac9654e6ee52f3d0c93e5ef8863e057254ee2e36e8ad3e8429db. +// +// Solidity: event SetContractDomain(address setter, bytes32 indexed name, address indexed addr) +func (_Registry *RegistryFilterer) ParseSetContractDomain(log types.Log) (*RegistrySetContractDomain, error) { + event := new(RegistrySetContractDomain) + if err := _Registry.contract.UnpackLog(event, "SetContractDomain", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RegistrySetPermissionIterator is returned from FilterSetPermission and is used to iterate over the raw logs and unpacked data for SetPermission events raised by the Registry contract. +type RegistrySetPermissionIterator struct { + Event *RegistrySetPermission // 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 *RegistrySetPermissionIterator) 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(RegistrySetPermission) + 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(RegistrySetPermission) + 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 *RegistrySetPermissionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RegistrySetPermissionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RegistrySetPermission represents a SetPermission event raised by the Registry contract. +type RegistrySetPermission struct { + Contract [32]byte + Granted common.Address + Status bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetPermission is a free log retrieval operation binding the contract event 0xe9f5231bbfb4b32867755b94562215cff6c8998489de8ba20926f8d0980e7818. +// +// Solidity: event SetPermission(bytes32 indexed _contract, address indexed granted, bool status) +func (_Registry *RegistryFilterer) FilterSetPermission(opts *bind.FilterOpts, _contract [][32]byte, granted []common.Address) (*RegistrySetPermissionIterator, error) { + + var _contractRule []interface{} + for _, _contractItem := range _contract { + _contractRule = append(_contractRule, _contractItem) + } + var grantedRule []interface{} + for _, grantedItem := range granted { + grantedRule = append(grantedRule, grantedItem) + } + + logs, sub, err := _Registry.contract.FilterLogs(opts, "SetPermission", _contractRule, grantedRule) + if err != nil { + return nil, err + } + return &RegistrySetPermissionIterator{contract: _Registry.contract, event: "SetPermission", logs: logs, sub: sub}, nil +} + +// WatchSetPermission is a free log subscription operation binding the contract event 0xe9f5231bbfb4b32867755b94562215cff6c8998489de8ba20926f8d0980e7818. +// +// Solidity: event SetPermission(bytes32 indexed _contract, address indexed granted, bool status) +func (_Registry *RegistryFilterer) WatchSetPermission(opts *bind.WatchOpts, sink chan<- *RegistrySetPermission, _contract [][32]byte, granted []common.Address) (event.Subscription, error) { + + var _contractRule []interface{} + for _, _contractItem := range _contract { + _contractRule = append(_contractRule, _contractItem) + } + var grantedRule []interface{} + for _, grantedItem := range granted { + grantedRule = append(grantedRule, grantedItem) + } + + logs, sub, err := _Registry.contract.WatchLogs(opts, "SetPermission", _contractRule, grantedRule) + 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(RegistrySetPermission) + if err := _Registry.contract.UnpackLog(event, "SetPermission", 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 +} + +// ParseSetPermission is a log parse operation binding the contract event 0xe9f5231bbfb4b32867755b94562215cff6c8998489de8ba20926f8d0980e7818. +// +// Solidity: event SetPermission(bytes32 indexed _contract, address indexed granted, bool status) +func (_Registry *RegistryFilterer) ParseSetPermission(log types.Log) (*RegistrySetPermission, error) { + event := new(RegistrySetPermission) + if err := _Registry.contract.UnpackLog(event, "SetPermission", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/gen_staking_abi.go b/wemix/bind/gen_staking_abi.go new file mode 100644 index 000000000000..f1006b530a98 --- /dev/null +++ b/wemix/bind/gen_staking_abi.go @@ -0,0 +1,4177 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package gov + +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 +) + +// StakingMetaData contains all meta data concerning the Staking contract. +var StakingMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_imp\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "5c60da1b": "implementation()", + }, + Bin: "0x608060405234801561001057600080fd5b5060405161077238038061077283398101604081905261002f91610326565b604080516020810190915260008152819061006b60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd61034f565b60008051602061072b8339815191521461008757610087610374565b6100938282600061009b565b505050610405565b6100a4836100d1565b6000825111806100b15750805b156100cc576100ca838361011160201b61008b1760201c565b505b505050565b6100da8161013d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610136838360405180606001604052806027815260200161074b602791396101fd565b9392505050565b610150816102db60201b6100b71760201c565b6101b75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101dc60008051602061072b83398151915260001b6102ea60201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606001600160a01b0384163b6102655760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016101ae565b600080856001600160a01b03168560405161028091906103b6565b600060405180830381855af49150503d80600081146102bb576040519150601f19603f3d011682016040523d82523d6000602084013e6102c0565b606091505b5090925090506102d18282866102ed565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102fc575081610136565b82511561030c5782518084602001fd5b8160405162461bcd60e51b81526004016101ae91906103d2565b60006020828403121561033857600080fd5b81516001600160a01b038116811461013657600080fd5b60008282101561036f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156103a557818101518382015260200161038d565b838111156100ca5750506000910152565b600082516103c881846020870161038a565b9190910192915050565b60208152600082518060208401526103f181604085016020870161038a565b601f01601f19169190910160400192915050565b610317806104146000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102bb60279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b60606001600160a01b0384163b61018d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516101a8919061026b565b600060405180830381855af49150503d80600081146101e3576040519150601f19603f3d011682016040523d82523d6000602084013e6101e8565b606091505b50915091506101f8828286610202565b9695505050505050565b606083156102115750816100b0565b8251156102215782518084602001fd5b8160405162461bcd60e51b81526004016101849190610287565b60005b8381101561025657818101518382015260200161023e565b83811115610265576000848401525b50505050565b6000825161027d81846020870161023b565b9190910192915050565b60208152600082518060208401526102a681604085016020870161023b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204c6da138e4aadf72357da99a86f99d8734efaebb1c66d7fcc80efea9db3acd3264736f6c634300080e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", +} + +// StakingABI is the input ABI used to generate the binding from. +// Deprecated: Use StakingMetaData.ABI instead. +var StakingABI = StakingMetaData.ABI + +// Deprecated: Use StakingMetaData.Sigs instead. +// StakingFuncSigs maps the 4-byte function signature to its string representation. +var StakingFuncSigs = StakingMetaData.Sigs + +// StakingBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use StakingMetaData.Bin instead. +var StakingBin = StakingMetaData.Bin + +// DeployStaking deploys a new Ethereum contract, binding an instance of Staking to it. +func DeployStaking(auth *bind.TransactOpts, backend bind.ContractBackend, _imp common.Address) (common.Address, *types.Transaction, *Staking, error) { + parsed, err := StakingMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StakingBin), backend, _imp) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Staking{StakingCaller: StakingCaller{contract: contract}, StakingTransactor: StakingTransactor{contract: contract}, StakingFilterer: StakingFilterer{contract: contract}}, nil +} + +// Staking is an auto generated Go binding around an Ethereum contract. +type Staking struct { + StakingCaller // Read-only binding to the contract + StakingTransactor // Write-only binding to the contract + StakingFilterer // Log filterer for contract events +} + +// StakingCaller is an auto generated read-only Go binding around an Ethereum contract. +type StakingCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StakingTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StakingFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StakingSession struct { + Contract *Staking // 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 +} + +// StakingCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StakingCallerSession struct { + Contract *StakingCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StakingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StakingTransactorSession struct { + Contract *StakingTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StakingRaw is an auto generated low-level Go binding around an Ethereum contract. +type StakingRaw struct { + Contract *Staking // Generic contract binding to access the raw methods on +} + +// StakingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StakingCallerRaw struct { + Contract *StakingCaller // Generic read-only contract binding to access the raw methods on +} + +// StakingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StakingTransactorRaw struct { + Contract *StakingTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStaking creates a new instance of Staking, bound to a specific deployed contract. +func NewStaking(address common.Address, backend bind.ContractBackend) (*Staking, error) { + contract, err := bindStaking(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Staking{StakingCaller: StakingCaller{contract: contract}, StakingTransactor: StakingTransactor{contract: contract}, StakingFilterer: StakingFilterer{contract: contract}}, nil +} + +// NewStakingCaller creates a new read-only instance of Staking, bound to a specific deployed contract. +func NewStakingCaller(address common.Address, caller bind.ContractCaller) (*StakingCaller, error) { + contract, err := bindStaking(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StakingCaller{contract: contract}, nil +} + +// NewStakingTransactor creates a new write-only instance of Staking, bound to a specific deployed contract. +func NewStakingTransactor(address common.Address, transactor bind.ContractTransactor) (*StakingTransactor, error) { + contract, err := bindStaking(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StakingTransactor{contract: contract}, nil +} + +// NewStakingFilterer creates a new log filterer instance of Staking, bound to a specific deployed contract. +func NewStakingFilterer(address common.Address, filterer bind.ContractFilterer) (*StakingFilterer, error) { + contract, err := bindStaking(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StakingFilterer{contract: contract}, nil +} + +// bindStaking binds a generic wrapper to an already deployed contract. +func bindStaking(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(StakingABI)) + 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 (_Staking *StakingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Staking.Contract.StakingCaller.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 (_Staking *StakingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Staking.Contract.StakingTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Staking *StakingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Staking.Contract.StakingTransactor.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 (_Staking *StakingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Staking.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 (_Staking *StakingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Staking.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Staking *StakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Staking.Contract.contract.Transact(opts, method, params...) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Staking *StakingCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Staking.contract.Call(opts, &out, "implementation") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Staking *StakingSession) Implementation() (common.Address, error) { + return _Staking.Contract.Implementation(&_Staking.CallOpts) +} + +// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// +// Solidity: function implementation() view returns(address) +func (_Staking *StakingCallerSession) Implementation() (common.Address, error) { + return _Staking.Contract.Implementation(&_Staking.CallOpts) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Staking *StakingTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _Staking.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Staking *StakingSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Staking.Contract.Fallback(&_Staking.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_Staking *StakingTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _Staking.Contract.Fallback(&_Staking.TransactOpts, calldata) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Staking *StakingTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Staking.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Staking *StakingSession) Receive() (*types.Transaction, error) { + return _Staking.Contract.Receive(&_Staking.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_Staking *StakingTransactorSession) Receive() (*types.Transaction, error) { + return _Staking.Contract.Receive(&_Staking.TransactOpts) +} + +// StakingAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the Staking contract. +type StakingAdminChangedIterator struct { + Event *StakingAdminChanged // 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 *StakingAdminChangedIterator) 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(StakingAdminChanged) + 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(StakingAdminChanged) + 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 *StakingAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingAdminChanged represents a AdminChanged event raised by the Staking contract. +type StakingAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Staking *StakingFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*StakingAdminChangedIterator, error) { + + logs, sub, err := _Staking.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &StakingAdminChangedIterator{contract: _Staking.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Staking *StakingFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *StakingAdminChanged) (event.Subscription, error) { + + logs, sub, err := _Staking.contract.WatchLogs(opts, "AdminChanged") + 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(StakingAdminChanged) + if err := _Staking.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_Staking *StakingFilterer) ParseAdminChanged(log types.Log) (*StakingAdminChanged, error) { + event := new(StakingAdminChanged) + if err := _Staking.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the Staking contract. +type StakingBeaconUpgradedIterator struct { + Event *StakingBeaconUpgraded // 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 *StakingBeaconUpgradedIterator) 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(StakingBeaconUpgraded) + 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(StakingBeaconUpgraded) + 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 *StakingBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingBeaconUpgraded represents a BeaconUpgraded event raised by the Staking contract. +type StakingBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Staking *StakingFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*StakingBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _Staking.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &StakingBeaconUpgradedIterator{contract: _Staking.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Staking *StakingFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *StakingBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _Staking.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(StakingBeaconUpgraded) + if err := _Staking.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_Staking *StakingFilterer) ParseBeaconUpgraded(log types.Log) (*StakingBeaconUpgraded, error) { + event := new(StakingBeaconUpgraded) + if err := _Staking.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the Staking contract. +type StakingUpgradedIterator struct { + Event *StakingUpgraded // 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 *StakingUpgradedIterator) 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(StakingUpgraded) + 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(StakingUpgraded) + 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 *StakingUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingUpgraded represents a Upgraded event raised by the Staking contract. +type StakingUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Staking *StakingFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*StakingUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Staking.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &StakingUpgradedIterator{contract: _Staking.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Staking *StakingFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *StakingUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _Staking.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(StakingUpgraded) + if err := _Staking.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_Staking *StakingFilterer) ParseUpgraded(log types.Log) (*StakingUpgraded, error) { + event := new(StakingUpgraded) + if err := _Staking.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpMetaData contains all meta data concerning the StakingImp contract. +var StakingImpMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ncpTotalLocked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"userTotalLocked\",\"type\":\"uint256\"}],\"name\":\"DelegateStaked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ncpTotalLocked\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"userTotalLocked\",\"type\":\"uint256\"}],\"name\":\"DelegateUnstaked\",\"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\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"Locked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"}],\"name\":\"NCPAddrChanged\",\"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\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Revoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetRegistry\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"Staked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"TransferLocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"Unlocked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"available\",\"type\":\"uint256\"}],\"name\":\"Unstaked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ECOSYSTEM_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ENV_STORAGE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAINTENANCE_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_POOL_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STAKING_REWARD_NAME\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"availableBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"calcVotingWeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"factor\",\"type\":\"uint32\"}],\"name\":\"calcVotingWeightWithScaleFactor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"}],\"name\":\"delegateDepositAndLockMore\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"delegateUnlockAndWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"}],\"name\":\"getRatioOfUserBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalLockedBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registry\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRevoked\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"}],\"name\":\"lock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"lockAmount\",\"type\":\"uint256\"}],\"name\":\"lockMore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"}],\"name\":\"lockedBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ncpStaking\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reg\",\"outputs\":[{\"internalType\":\"contractIRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revoke\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_ncpStaking\",\"type\":\"address\"}],\"name\":\"setNCPStaking\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"slashing\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ext\",\"type\":\"uint256\"}],\"name\":\"transferLocked\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"payee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"unlockAmount\",\"type\":\"uint256\"}],\"name\":\"unlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImp\",\"type\":\"address\"}],\"name\":\"upgradeStaking\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"userBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ncp\",\"type\":\"address\"}],\"name\":\"userTotalBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + Sigs: map[string]string{ + "9986e4b9": "BALLOT_STORAGE_NAME()", + "34125c84": "ECOSYSTEM_NAME()", + "7bf46530": "ENV_STORAGE_NAME()", + "6c78d2cf": "GOV_NAME()", + "4bd1ed76": "MAINTENANCE_NAME()", + "2f40992e": "REWARD_POOL_NAME()", + "1e0cba0d": "STAKING_NAME()", + "5a731cca": "STAKING_REWARD_NAME()", + "25d998bb": "availableBalanceOf(address)", + "70a08231": "balanceOf(address)", + "884d97a7": "calcVotingWeight(address)", + "7d77a0eb": "calcVotingWeightWithScaleFactor(address,uint32)", + "bac4f338": "delegateDepositAndLockMore(address)", + "f6931822": "delegateUnlockAndWithdraw(address,uint256)", + "d0e30db0": "deposit()", + "2b0b9c5e": "getRatioOfUserBalance(address)", + "d5c25890": "getTotalLockedBalance()", + "c0d91eaf": "init(address,bytes)", + "2bc9ed02": "isRevoked()", + "282d3fdf": "lock(address,uint256)", + "9667e76a": "lockMore(uint256)", + "59355736": "lockedBalanceOf(address)", + "f1b8aa1d": "ncpStaking()", + "8da5cb5b": "owner()", + "52d1902d": "proxiableUUID()", + "738fdd1a": "reg()", + "715018a6": "renounceOwnership()", + "b6549f75": "revoke()", + "7f2f4c06": "setNCPStaking(address)", + "a91ee0dc": "setRegistry(address)", + "92a950b6": "transferLocked(address,uint256,uint256)", + "f2fde38b": "transferOwnership(address)", + "7eee288d": "unlock(address,uint256)", + "f3f63080": "upgradeStaking(address)", + "3659cfe6": "upgradeTo(address)", + "4f1ef286": "upgradeToAndCall(address,bytes)", + "12853615": "userBalanceOf(address,address)", + "193468ac": "userTotalBalanceOf(address)", + "2e1a7d4d": "withdraw(uint256)", + }, + Bin: "0x60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e8565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e6576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516135176200012060003960008181610be601528181610c2601528181610cc501528181610d050152610d9401526135176000f3fe6080604052600436106102345760003560e01c8063738fdd1a1161012e578063a91ee0dc116100ab578063d5c258901161006f578063d5c25890146106b3578063f1b8aa1d146106c8578063f2fde38b146106e8578063f3f6308014610708578063f69318221461072857600080fd5b8063a91ee0dc14610643578063b6549f7514610663578063bac4f33814610678578063c0d91eaf1461068b578063d0e30db0146106ab57600080fd5b8063884d97a7116100f2578063884d97a7146105a15780638da5cb5b146105c157806392a950b6146105df5780639667e76a146105ff5780639986e4b91461061f57600080fd5b8063738fdd1a146104e85780637bf46530146105205780637d77a0eb146105415780637eee288d146105615780637f2f4c061461058157600080fd5b806334125c84116101bc5780635935573611610180578063593557361461041a5780635a731cca146104505780636c78d2cf1461047457806370a082311461049d578063715018a6146104d357600080fd5b806334125c84146103905780633659cfe6146103b05780634bd1ed76146103d05780634f1ef286146103f257806352d1902d1461040557600080fd5b8063282d3fdf11610203578063282d3fdf146102ea5780632b0b9c5e1461030c5780632bc9ed021461032c5780632e1a7d4d1461034f5780632f40992e1461036f57600080fd5b80631285361514610243578063193468ac146102765780631e0cba0d146102ac57806325d998bb146102ca57600080fd5b3661023e57600080fd5b600080fd5b34801561024f57600080fd5b5061026361025e366004612e48565b610748565b6040519081526020015b60405180910390f35b34801561028257600080fd5b50610263610291366004612e81565b6001600160a01b0316600090815260ce602052604090205490565b3480156102b857600080fd5b50610263665374616b696e6760c81b81565b3480156102d657600080fd5b506102636102e5366004612e81565b610775565b3480156102f657600080fd5b5061030a610305366004612e9e565b6107a3565b005b34801561031857600080fd5b50610263610327366004612e81565b6107e9565b34801561033857600080fd5b50609b5460ff16604051901515815260200161026d565b34801561035b57600080fd5b5061030a61036a366004612eca565b610845565b34801561037b57600080fd5b506102636914995dd85c99141bdbdb60b21b81565b34801561039c57600080fd5b506102636845636f73797374656d60b81b81565b3480156103bc57600080fd5b5061030a6103cb366004612e81565b610bdc565b3480156103dc57600080fd5b506102636a4d61696e74656e616e636560a81b81565b61030a610400366004612f2a565b610cbb565b34801561041157600080fd5b50610263610d87565b34801561042657600080fd5b50610263610435366004612e81565b6001600160a01b031660009081526099602052604090205490565b34801561045c57600080fd5b506102636c14dd185ada5b99d4995dd85c99609a1b81565b34801561048057600080fd5b506102637111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b3480156104a957600080fd5b506102636104b8366004612e81565b6001600160a01b031660009081526098602052604090205490565b3480156104df57600080fd5b5061030a610e3a565b3480156104f457600080fd5b50606554610508906001600160a01b031681565b6040516001600160a01b03909116815260200161026d565b34801561052c57600080fd5b5061026369456e7653746f7261676560b01b81565b34801561054d57600080fd5b5061026361055c366004612fd2565b610e4e565b34801561056d57600080fd5b5061030a61057c366004612e9e565b610ec2565b34801561058d57600080fd5b5061030a61059c366004612e81565b610efb565b3480156105ad57600080fd5b506102636105bc366004612e81565b610fa3565b3480156105cd57600080fd5b506033546001600160a01b0316610508565b3480156105eb57600080fd5b5061030a6105fa366004613009565b610fb0565b34801561060b57600080fd5b5061030a61061a366004612eca565b6112e6565b34801561062b57600080fd5b506102636c42616c6c6f7453746f7261676560981b81565b34801561064f57600080fd5b5061030a61065e366004612e81565b6114e1565b34801561066f57600080fd5b5061030a611589565b61030a610686366004612e81565b611693565b34801561069757600080fd5b5061030a6106a6366004612f2a565b611a85565b61030a611c36565b3480156106bf57600080fd5b50609a54610263565b3480156106d457600080fd5b5060cf54610508906001600160a01b031681565b3480156106f457600080fd5b5061030a610703366004612e81565b612000565b34801561071457600080fd5b5061030a610723366004612e81565b612076565b34801561073457600080fd5b5061030a610743366004612e9e565b612096565b6001600160a01b03808316600090815260cd60209081526040808320938516835292905220545b92915050565b6001600160a01b038116600090815260996020908152604080832054609890925282205461076f9190613054565b336107ac61249b565b6001600160a01b0316146107db5760405162461bcd60e51b81526004016107d29061306b565b60405180910390fd5b6107e582826124c0565b5050565b6001600160a01b038116600090815260ce60209081526040808320546099909252822054811580610818575080155b15610827575060009392505050565b80610833836064613092565b61083d91906130b1565b949350505050565b6002606654036108675760405162461bcd60e51b81526004016107d2906130d3565b6002606655609b5460ff161561088f5760405162461bcd60e51b81526004016107d29061310a565b600081116108af5760405162461bcd60e51b81526004016107d29061312e565b60006108b9612735565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a919061316f565b905060006109288383613188565b33600090815260ce602090815260408083205460999092529091205461094e9190613054565b106109615761095d338461274d565b5060015b61096a33610775565b8311156109895760405162461bcd60e51b81526004016107d2906131a0565b336000908152609860205260409020546109a4908490613054565b3360009081526098602052604090205560cf546001600160a01b0316158015906109cb5750805b15610add5760cf546040516000916001600160a01b03169085908381818185875af1925050503d8060008114610a1d576040519150601f19603f3d011682016040523d82523d6000602084013e610a22565b606091505b5050905080610a735760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657220746f204e4350207374616b696e67206661696c6564000060448201526064016107d2565b60cf546040516306aa67f960e01b8152600481018690523360248201526001600160a01b03909116906306aa67f990604401600060405180830381600087803b158015610abf57600080fd5b505af1158015610ad3573d6000803e3d6000fd5b5050505050610b77565b604051600090339085908381818185875af1925050503d8060008114610b1f576040519150601f19603f3d011682016040523d82523d6000602084013e610b24565b606091505b5050905080610b755760405162461bcd60e51b815260206004820152601960248201527f5472616e7366657220746f2073656e646572206661696c65640000000000000060448201526064016107d2565b505b336000818152609860205260409020547f204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00908590610bb484610775565b6040805193845260208401929092529082015260600160405180910390a25050600160665550565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610c245760405162461bcd60e51b81526004016107d2906131f4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c6d60008051602061349b833981519152546001600160a01b031690565b6001600160a01b031614610c935760405162461bcd60e51b81526004016107d290613240565b610c9c81612896565b60408051600080825260208201909252610cb89183919061289e565b50565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610d035760405162461bcd60e51b81526004016107d2906131f4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610d4c60008051602061349b833981519152546001600160a01b031690565b6001600160a01b031614610d725760405162461bcd60e51b81526004016107d290613240565b610d7b82612896565b6107e58282600161289e565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e275760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016107d2565b5060008051602061349b83398151915290565b610e42612a09565b610e4c6000612a63565b565b6001600160a01b0382166000908152609960205260408120541580610e77575063ffffffff8216155b15610e845750600061076f565b609a546001600160a01b038416600090815260996020526040902054610eb19063ffffffff851690613092565b610ebb91906130b1565b9392505050565b33610ecb61249b565b6001600160a01b031614610ef15760405162461bcd60e51b81526004016107d29061306b565b6107e5828261274d565b610f03612a09565b6001600160a01b038116610f595760405162461bcd60e51b815260206004820152601e60248201527f4e43505374616b696e6720697320746865207a65726f2061646472657373000060448201526064016107d2565b60cf80546001600160a01b0319166001600160a01b0383169081179091556040517ffd5754300dde6066eda4fabd23616c1d560a3360c85c0716c46e00649bdeeddf90600090a250565b600061076f826064610e4e565b33610fb961249b565b6001600160a01b031614610fdf5760405162461bcd60e51b81526004016107d29061306b565b6000610ff4661390d4115e1a5d60ca1b612ab5565b90506110008484610ec2565b6001600160a01b038416600090815260986020526040902054611024908490613054565b6001600160a01b038516600090815260986020526040812091909155611048612b23565b6001600160a01b03811660009081526098602052604090205490915061106f908590613188565b6001600160a01b03808316600090815260986020908152604080832094909455918816815260ce909152908120546110a79085613054565b90506110b38682610ec2565b6001600160a01b03861660009081526099602090815260408083205460ce909252909120548110156111665760405162461bcd60e51b815260206004820152605060248201527f7472616e73666572656442616c616e6365206d7573742062652067726561746560448201527f72207468616e206f7220657175616c20746f205f6c6f636b656455736572426160648201526f3630b731b2aa37a721a82a37ba30b61760811b608482015260a4016107d2565b6111708782610ec2565b6001600160a01b038716600090815260986020526040902054611194908290613054565b6001600160a01b0388811660008181526098602090815260408083209590955560ce9052839020549251638408bdb160e01b81526004810191909152602481018490526044810192909252851690638408bdb19083906064016000604051808303818588803b15801561120657600080fd5b505af115801561121a573d6000803e3d6000fd5b505060cf546001600160a01b0316159250611268915050576001600160a01b03808816600090815260ce6020908152604080832083905560cd825280832060cf549094168352929052908120555b6001600160a01b0387167f2caed32a519a1fd89486d3ffe06202febb5ed51534d571dbab93058545a29e2461129d8389613188565b6001600160a01b038a166000908152609860205260409020546112bf8b610775565b6040805193845260208401929092529082015260600160405180910390a250505050505050565b6112ee61249b565b604051636f1e853360e01b81523360048201526001600160a01b039190911690636f1e853390602401602060405180830381865afa158015611334573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611358919061328c565b6113745760405162461bcd60e51b81526004016107d29061306b565b61137e33826124c0565b60cf546001600160a01b031615610cb85760cf5460405163bbc2611360e01b81523360048201526000916001600160a01b03169063bbc2611390602401602060405180830381865afa1580156113d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fc919061316f565b60cf54604051631069f3b560e01b8152600481018390523360248201529192506001600160a01b031690631069f3b59060440160a060405180830381865afa15801561144c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147091906132ae565b60800151156107e55760cf546040516301008e9960e61b8152600481018490523360248201526001600160a01b0390911690634023a64090604401600060405180830381600087803b1580156114c557600080fd5b505af11580156114d9573d6000803e3d6000fd5b505050505050565b6114e9612a09565b6001600160a01b03811661153f5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064016107d2565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b611591612a09565b609b5460ff16156115b45760405162461bcd60e51b81526004016107d29061310a565b60006115c86033546001600160a01b031690565b905047806116065760405162461bcd60e51b815260206004820152600b60248201526a062616c616e6365203d20360ac1b60448201526064016107d2565b6040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561163c573d6000803e3d6000fd5b50609b805460ff191660011790556040516001600160a01b038316907f713b90881ad62c4fa8ab6bd9197fa86481fc0c11b2edba60026514281b2dbac4906116879084815260200190565b60405180910390a25050565b6002606654036116b55760405162461bcd60e51b81526004016107d2906130d3565b6002606655609b5460ff16156116dd5760405162461bcd60e51b81526004016107d29061310a565b60cf546001600160a01b031633146117075760405162461bcd60e51b81526004016107d29061331e565b600034116117275760405162461bcd60e51b81526004016107d29061336d565b61172f61249b565b60405163288c314960e21b81526001600160a01b038381166004830152919091169063a230c52490602401602060405180830381865afa158015611777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179b919061328c565b6117e05760405162461bcd60e51b81526020600482015260166024820152752721a81039b437bab63210313290309036b2b6b132b960511b60448201526064016107d2565b6001600160a01b0381166000908152609860205260409020543490611806908290613188565b6001600160a01b03831660009081526098602052604081209190915561182a612735565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188b919061316f565b90506000611897612735565b6001600160a01b031663737c59b86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f8919061316f565b6001600160a01b038516600090815260996020526040902054909150821180159061194757506001600160a01b0384166000908152609960205260409020548190611944908590613188565b11155b6119935760405162461bcd60e51b815260206004820152601f60248201527f757365722073686f756c6420626520696e207374616b696e672072616e67650060448201526064016107d2565b61199d84846124c0565b6001600160a01b038416600090815260cd602090815260408083203384529091529020546119cc908490613188565b6001600160a01b038516600081815260cd6020908152604080832033845282528083209490945591815260ce9091522054611a08908490613188565b6001600160a01b038516600081815260ce6020908152604080832085905560cd825280832033808552908352928190205481518981529283019590955281019390935290917f74cfc20f0e6d14384c3a60820d3e814f6979d009cdbb43db27fa56fe475172fd9060600160405180910390a3505060016066555050565b600054610100900460ff1615808015611aa55750600054600160ff909116105b80611abf5750303b158015611abf575060005460ff166001145b611b225760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107d2565b6000805460ff191660011790558015611b45576000805461ff0019166101001790555b6000609a55609b805460ff19169055611b5c612b3a565b611b64612b69565b611b6d836114e1565b815115611beb57600080600080602086019150855182611b8d9190613188565b90505b80821015611be65781519350611ba7602083613188565b9150808210611bb557600080fd5b81519250611bc4602083613188565b6001600160a01b03851660009081526098602052604090208490559150611b90565b505050505b8015611c31576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b600260665403611c585760405162461bcd60e51b81526004016107d2906130d3565b6002606655609b5460ff1615611c805760405162461bcd60e51b81526004016107d29061310a565b60003411611ca05760405162461bcd60e51b81526004016107d29061336d565b33600090815260986020526040902054611cbb903490613188565b33600090815260986020526040902055611cd361249b565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c52490602401602060405180830381865afa158015611d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3d919061328c565b15611f9e576000611d4c612735565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dad919061316f565b3360009081526099602052604090205490915081118015611def575033600090815260996020526040902054611de39082613054565b611dec33610775565b10155b15611f9c5760cf546001600160a01b031615611f785760cf5460405163bbc2611360e01b81523360048201526000916001600160a01b03169063bbc2611390602401602060405180830381865afa158015611e4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e72919061316f565b60cf54604051631069f3b560e01b8152600481018390523360248201529192506001600160a01b031690631069f3b59060440160a060405180830381865afa158015611ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee691906132ae565b6080015115611f765760cf54336000908152609960205260409020546001600160a01b0390911690634023a64090611f1e9085613054565b6040516001600160e01b031960e084901b1681526004810191909152336024820152604401600060405180830381600087803b158015611f5d57600080fd5b505af1158015611f71573d6000803e3d6000fd5b505050505b505b33600081815260996020526040902054611f9c9190611f979084613054565b6124c0565b505b336000818152609860205260409020547fb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed903490611fdb84610775565b6040805193845260208401929092529082015260600160405180910390a26001606655565b612008612a09565b6001600160a01b03811661206d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d2565b610cb881612a63565b61207e612a09565b6001600160a01b03811615610cb857610c9c81612896565b6002606654036120b85760405162461bcd60e51b81526004016107d2906130d3565b6002606655609b5460ff16156120e05760405162461bcd60e51b81526004016107d29061310a565b60cf546001600160a01b0316331461210a5760405162461bcd60e51b81526004016107d29061331e565b6000811161212a5760405162461bcd60e51b81526004016107d29061312e565b61213261249b565b60405163288c314960e21b81526001600160a01b038481166004830152919091169063a230c52490602401602060405180830381865afa15801561217a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061219e919061328c565b6121e35760405162461bcd60e51b81526020600482015260166024820152752721a81039b437bab63210313290309036b2b6b132b960511b60448201526064016107d2565b8060006121ee612735565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561222b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224f919061316f565b6001600160a01b038516600090815260cd6020908152604080832033845290915290205490915082118015906122ae575080826122a1866001600160a01b031660009081526099602052604090205490565b6122ab9190613054565b10155b6122ca5760405162461bcd60e51b81526004016107d2906131a0565b6122d4848361274d565b6001600160a01b0384166000908152609860205260409020546122f8908390613054565b6001600160a01b03851660009081526098602090815260408083209390935560cd815282822033835290522054612330908390613054565b6001600160a01b038516600081815260cd6020908152604080832033845282528083209490945591815260ce909152205461236c908390613054565b6001600160a01b03858116600090815260ce60205260408082209390935560cf54925190929091169084908381818185875af1925050503d80600081146123cf576040519150601f19603f3d011682016040523d82523d6000602084013e6123d4565b606091505b50509050806124255760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657220746f204e4350207374616b696e67206661696c6564000060448201526064016107d2565b6001600160a01b038516600081815260ce602090815260408083205460cd835281842033808652908452938290205482518981529384019190915282820152517f03d2bb70c6ccc49d68a465a06edffb976961cf8930888658ca2339fa62b8bda29181900360600190a350506001606655505050565b60006124bb7111dbdd995c9b985b98d950dbdb9d1c9858dd60721b612ab5565b905090565b806000036124cc575050565b6001600160a01b03821660009081526098602052604090205481111561254d5760405162461bcd60e51b815260206004820152603060248201527f4c6f636b20616d6f756e742073686f756c6420626520657175616c206f72206c60448201526f657373207468616e2062616c616e636560801b60648201526084016107d2565b8061255783610775565b10156125b55760405162461bcd60e51b815260206004820152602760248201527f496e73756666696369656e742062616c616e636520746861742063616e206265604482015266081b1bd8dad95960ca1b60648201526084016107d2565b60006125bf612735565b6001600160a01b031663737c59b86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156125fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612620919061316f565b6001600160a01b038416600090815260996020526040902054909150612647908390613188565b6001600160a01b03841660009081526099602052604090208190558110156126bb5760405162461bcd60e51b815260206004820152602160248201527f4c6f636b65642062616c616e6365206973206c6172676572207468616e206d616044820152600f60fb1b60648201526084016107d2565b81609a546126c99190613188565b609a556001600160a01b0383166000818152609860205260409020547f44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c1190849061271287610775565b6040805193845260208401929092529082015260600160405180910390a2505050565b60006124bb69456e7653746f7261676560b01b612ab5565b80600003612759575050565b6001600160a01b0382166000908152609960205260409020548111156127e75760405162461bcd60e51b815260206004820152603960248201527f556e6c6f636b20616d6f756e742073686f756c6420626520657175616c206f7260448201527f206c657373207468616e2062616c616e6365206c6f636b65640000000000000060648201526084016107d2565b6001600160a01b03821660009081526099602052604090205461280b908290613054565b6001600160a01b038316600090815260996020526040902055609a54612832908290613054565b609a556001600160a01b0382166000818152609860205260409020547f5245d528087a96a64f4589a764f00061e4671eab90cb1e019b1a5b24b2e4c2a890839061287b86610775565b60408051938452602084019290925290820152606001611687565b610cb8612a09565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156128d157611c3183612b98565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561292b575060408051601f3d908101601f191682019092526129289181019061316f565b60015b61298e5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016107d2565b60008051602061349b83398151915281146129fd5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016107d2565b50611c31838383612c34565b6033546001600160a01b03163314610e4c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d2565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd90602401602060405180830381865afa158015612aff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906133b7565b60006124bb6845636f73797374656d60b81b612ab5565b600054610100900460ff16612b615760405162461bcd60e51b81526004016107d2906133d4565b610e4c612c5f565b600054610100900460ff16612b905760405162461bcd60e51b81526004016107d2906133d4565b610e4c612c8d565b6001600160a01b0381163b612c055760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016107d2565b60008051602061349b83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612c3d83612cbd565b600082511180612c4a5750805b15611c3157612c598383612cfd565b50505050565b600054610100900460ff16612c865760405162461bcd60e51b81526004016107d2906133d4565b6001606655565b600054610100900460ff16612cb45760405162461bcd60e51b81526004016107d2906133d4565b610e4c33612a63565b612cc681612b98565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610ebb83836040518060600160405280602781526020016134bb6027913960606001600160a01b0384163b612d855760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016107d2565b600080856001600160a01b031685604051612da0919061344b565b600060405180830381855af49150503d8060008114612ddb576040519150601f19603f3d011682016040523d82523d6000602084013e612de0565b606091505b5091509150612df0828286612dfa565b9695505050505050565b60608315612e09575081610ebb565b825115612e195782518084602001fd5b8160405162461bcd60e51b81526004016107d29190613467565b6001600160a01b0381168114610cb857600080fd5b60008060408385031215612e5b57600080fd5b8235612e6681612e33565b91506020830135612e7681612e33565b809150509250929050565b600060208284031215612e9357600080fd5b8135610ebb81612e33565b60008060408385031215612eb157600080fd5b8235612ebc81612e33565b946020939093013593505050565b600060208284031215612edc57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612f2257612f22612ee3565b604052919050565b60008060408385031215612f3d57600080fd5b8235612f4881612e33565b915060208381013567ffffffffffffffff80821115612f6657600080fd5b818601915086601f830112612f7a57600080fd5b813581811115612f8c57612f8c612ee3565b612f9e601f8201601f19168501612ef9565b91508082528784828501011115612fb457600080fd5b80848401858401376000848284010152508093505050509250929050565b60008060408385031215612fe557600080fd5b8235612ff081612e33565b9150602083013563ffffffff81168114612e7657600080fd5b60008060006060848603121561301e57600080fd5b833561302981612e33565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156130665761306661303e565b500390565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b60008160001904831182151516156130ac576130ac61303e565b500290565b6000826130ce57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600a9082015269125cc81c995d9bdad95960b21b604082015260600190565b60208082526021908201527f416d6f756e742073686f756c6420626520626967676572207468616e207a65726040820152606f60f81b606082015260800190565b60006020828403121561318157600080fd5b5051919050565b6000821982111561319b5761319b61303e565b500190565b60208082526034908201527f576974686472617720616d6f756e742073686f756c6420626520657175616c206040820152736f72206c657373207468616e2062616c616e636560601b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60006020828403121561329e57600080fd5b81518015158114610ebb57600080fd5b600060a082840312156132c057600080fd5b60405160a0810181811067ffffffffffffffff821117156132e3576132e3612ee3565b806040525082518152602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b6020808252602f908201527f4f6e6c79204e43505374616b696e6720636f6e74726163742063616e2063616c60408201526e36103a3434b990333ab731ba34b7b760891b606082015260800190565b6020808252602a908201527f4465706f73697420616d6f756e742073686f756c642062652067726561746572604082015269207468616e207a65726f60b01b606082015260800190565b6000602082840312156133c957600080fd5b8151610ebb81612e33565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b8381101561343a578181015183820152602001613422565b83811115612c595750506000910152565b6000825161345d81846020870161341f565b9190910192915050565b602081526000825180602084015261348681604085016020870161341f565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122013c16b0bae42160552b3be738d1a01aeee0a159c353d7f57cf558d5df1a3758564736f6c634300080e0033", +} + +// StakingImpABI is the input ABI used to generate the binding from. +// Deprecated: Use StakingImpMetaData.ABI instead. +var StakingImpABI = StakingImpMetaData.ABI + +// Deprecated: Use StakingImpMetaData.Sigs instead. +// StakingImpFuncSigs maps the 4-byte function signature to its string representation. +var StakingImpFuncSigs = StakingImpMetaData.Sigs + +// StakingImpBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use StakingImpMetaData.Bin instead. +var StakingImpBin = StakingImpMetaData.Bin + +// DeployStakingImp deploys a new Ethereum contract, binding an instance of StakingImp to it. +func DeployStakingImp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *StakingImp, error) { + parsed, err := StakingImpMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(StakingImpBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &StakingImp{StakingImpCaller: StakingImpCaller{contract: contract}, StakingImpTransactor: StakingImpTransactor{contract: contract}, StakingImpFilterer: StakingImpFilterer{contract: contract}}, nil +} + +// StakingImp is an auto generated Go binding around an Ethereum contract. +type StakingImp struct { + StakingImpCaller // Read-only binding to the contract + StakingImpTransactor // Write-only binding to the contract + StakingImpFilterer // Log filterer for contract events +} + +// StakingImpCaller is an auto generated read-only Go binding around an Ethereum contract. +type StakingImpCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingImpTransactor is an auto generated write-only Go binding around an Ethereum contract. +type StakingImpTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingImpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type StakingImpFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// StakingImpSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type StakingImpSession struct { + Contract *StakingImp // 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 +} + +// StakingImpCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type StakingImpCallerSession struct { + Contract *StakingImpCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// StakingImpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type StakingImpTransactorSession struct { + Contract *StakingImpTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// StakingImpRaw is an auto generated low-level Go binding around an Ethereum contract. +type StakingImpRaw struct { + Contract *StakingImp // Generic contract binding to access the raw methods on +} + +// StakingImpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type StakingImpCallerRaw struct { + Contract *StakingImpCaller // Generic read-only contract binding to access the raw methods on +} + +// StakingImpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type StakingImpTransactorRaw struct { + Contract *StakingImpTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewStakingImp creates a new instance of StakingImp, bound to a specific deployed contract. +func NewStakingImp(address common.Address, backend bind.ContractBackend) (*StakingImp, error) { + contract, err := bindStakingImp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &StakingImp{StakingImpCaller: StakingImpCaller{contract: contract}, StakingImpTransactor: StakingImpTransactor{contract: contract}, StakingImpFilterer: StakingImpFilterer{contract: contract}}, nil +} + +// NewStakingImpCaller creates a new read-only instance of StakingImp, bound to a specific deployed contract. +func NewStakingImpCaller(address common.Address, caller bind.ContractCaller) (*StakingImpCaller, error) { + contract, err := bindStakingImp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &StakingImpCaller{contract: contract}, nil +} + +// NewStakingImpTransactor creates a new write-only instance of StakingImp, bound to a specific deployed contract. +func NewStakingImpTransactor(address common.Address, transactor bind.ContractTransactor) (*StakingImpTransactor, error) { + contract, err := bindStakingImp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &StakingImpTransactor{contract: contract}, nil +} + +// NewStakingImpFilterer creates a new log filterer instance of StakingImp, bound to a specific deployed contract. +func NewStakingImpFilterer(address common.Address, filterer bind.ContractFilterer) (*StakingImpFilterer, error) { + contract, err := bindStakingImp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &StakingImpFilterer{contract: contract}, nil +} + +// bindStakingImp binds a generic wrapper to an already deployed contract. +func bindStakingImp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(StakingImpABI)) + 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 (_StakingImp *StakingImpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StakingImp.Contract.StakingImpCaller.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 (_StakingImp *StakingImpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.Contract.StakingImpTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StakingImp *StakingImpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StakingImp.Contract.StakingImpTransactor.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 (_StakingImp *StakingImpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _StakingImp.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 (_StakingImp *StakingImpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_StakingImp *StakingImpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _StakingImp.Contract.contract.Transact(opts, method, params...) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) BALLOTSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "BALLOT_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _StakingImp.Contract.BALLOTSTORAGENAME(&_StakingImp.CallOpts) +} + +// BALLOTSTORAGENAME is a free data retrieval call binding the contract method 0x9986e4b9. +// +// Solidity: function BALLOT_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) BALLOTSTORAGENAME() ([32]byte, error) { + return _StakingImp.Contract.BALLOTSTORAGENAME(&_StakingImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) ECOSYSTEMNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "ECOSYSTEM_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) ECOSYSTEMNAME() ([32]byte, error) { + return _StakingImp.Contract.ECOSYSTEMNAME(&_StakingImp.CallOpts) +} + +// ECOSYSTEMNAME is a free data retrieval call binding the contract method 0x34125c84. +// +// Solidity: function ECOSYSTEM_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) ECOSYSTEMNAME() ([32]byte, error) { + return _StakingImp.Contract.ECOSYSTEMNAME(&_StakingImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) ENVSTORAGENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "ENV_STORAGE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) ENVSTORAGENAME() ([32]byte, error) { + return _StakingImp.Contract.ENVSTORAGENAME(&_StakingImp.CallOpts) +} + +// ENVSTORAGENAME is a free data retrieval call binding the contract method 0x7bf46530. +// +// Solidity: function ENV_STORAGE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) ENVSTORAGENAME() ([32]byte, error) { + return _StakingImp.Contract.ENVSTORAGENAME(&_StakingImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) GOVNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "GOV_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) GOVNAME() ([32]byte, error) { + return _StakingImp.Contract.GOVNAME(&_StakingImp.CallOpts) +} + +// GOVNAME is a free data retrieval call binding the contract method 0x6c78d2cf. +// +// Solidity: function GOV_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) GOVNAME() ([32]byte, error) { + return _StakingImp.Contract.GOVNAME(&_StakingImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) MAINTENANCENAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "MAINTENANCE_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) MAINTENANCENAME() ([32]byte, error) { + return _StakingImp.Contract.MAINTENANCENAME(&_StakingImp.CallOpts) +} + +// MAINTENANCENAME is a free data retrieval call binding the contract method 0x4bd1ed76. +// +// Solidity: function MAINTENANCE_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) MAINTENANCENAME() ([32]byte, error) { + return _StakingImp.Contract.MAINTENANCENAME(&_StakingImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) REWARDPOOLNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "REWARD_POOL_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) REWARDPOOLNAME() ([32]byte, error) { + return _StakingImp.Contract.REWARDPOOLNAME(&_StakingImp.CallOpts) +} + +// REWARDPOOLNAME is a free data retrieval call binding the contract method 0x2f40992e. +// +// Solidity: function REWARD_POOL_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) REWARDPOOLNAME() ([32]byte, error) { + return _StakingImp.Contract.REWARDPOOLNAME(&_StakingImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) STAKINGNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "STAKING_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) STAKINGNAME() ([32]byte, error) { + return _StakingImp.Contract.STAKINGNAME(&_StakingImp.CallOpts) +} + +// STAKINGNAME is a free data retrieval call binding the contract method 0x1e0cba0d. +// +// Solidity: function STAKING_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) STAKINGNAME() ([32]byte, error) { + return _StakingImp.Contract.STAKINGNAME(&_StakingImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCaller) STAKINGREWARDNAME(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "STAKING_REWARD_NAME") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_StakingImp *StakingImpSession) STAKINGREWARDNAME() ([32]byte, error) { + return _StakingImp.Contract.STAKINGREWARDNAME(&_StakingImp.CallOpts) +} + +// STAKINGREWARDNAME is a free data retrieval call binding the contract method 0x5a731cca. +// +// Solidity: function STAKING_REWARD_NAME() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) STAKINGREWARDNAME() ([32]byte, error) { + return _StakingImp.Contract.STAKINGREWARDNAME(&_StakingImp.CallOpts) +} + +// AvailableBalanceOf is a free data retrieval call binding the contract method 0x25d998bb. +// +// Solidity: function availableBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCaller) AvailableBalanceOf(opts *bind.CallOpts, payee common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "availableBalanceOf", payee) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// AvailableBalanceOf is a free data retrieval call binding the contract method 0x25d998bb. +// +// Solidity: function availableBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpSession) AvailableBalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.AvailableBalanceOf(&_StakingImp.CallOpts, payee) +} + +// AvailableBalanceOf is a free data retrieval call binding the contract method 0x25d998bb. +// +// Solidity: function availableBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) AvailableBalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.AvailableBalanceOf(&_StakingImp.CallOpts, payee) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCaller) BalanceOf(opts *bind.CallOpts, payee common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "balanceOf", payee) + + 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 payee) view returns(uint256) +func (_StakingImp *StakingImpSession) BalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.BalanceOf(&_StakingImp.CallOpts, payee) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) BalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.BalanceOf(&_StakingImp.CallOpts, payee) +} + +// CalcVotingWeight is a free data retrieval call binding the contract method 0x884d97a7. +// +// Solidity: function calcVotingWeight(address payee) view returns(uint256) +func (_StakingImp *StakingImpCaller) CalcVotingWeight(opts *bind.CallOpts, payee common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "calcVotingWeight", payee) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// CalcVotingWeight is a free data retrieval call binding the contract method 0x884d97a7. +// +// Solidity: function calcVotingWeight(address payee) view returns(uint256) +func (_StakingImp *StakingImpSession) CalcVotingWeight(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.CalcVotingWeight(&_StakingImp.CallOpts, payee) +} + +// CalcVotingWeight is a free data retrieval call binding the contract method 0x884d97a7. +// +// Solidity: function calcVotingWeight(address payee) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) CalcVotingWeight(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.CalcVotingWeight(&_StakingImp.CallOpts, payee) +} + +// CalcVotingWeightWithScaleFactor is a free data retrieval call binding the contract method 0x7d77a0eb. +// +// Solidity: function calcVotingWeightWithScaleFactor(address payee, uint32 factor) view returns(uint256) +func (_StakingImp *StakingImpCaller) CalcVotingWeightWithScaleFactor(opts *bind.CallOpts, payee common.Address, factor uint32) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "calcVotingWeightWithScaleFactor", payee, factor) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// CalcVotingWeightWithScaleFactor is a free data retrieval call binding the contract method 0x7d77a0eb. +// +// Solidity: function calcVotingWeightWithScaleFactor(address payee, uint32 factor) view returns(uint256) +func (_StakingImp *StakingImpSession) CalcVotingWeightWithScaleFactor(payee common.Address, factor uint32) (*big.Int, error) { + return _StakingImp.Contract.CalcVotingWeightWithScaleFactor(&_StakingImp.CallOpts, payee, factor) +} + +// CalcVotingWeightWithScaleFactor is a free data retrieval call binding the contract method 0x7d77a0eb. +// +// Solidity: function calcVotingWeightWithScaleFactor(address payee, uint32 factor) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) CalcVotingWeightWithScaleFactor(payee common.Address, factor uint32) (*big.Int, error) { + return _StakingImp.Contract.CalcVotingWeightWithScaleFactor(&_StakingImp.CallOpts, payee, factor) +} + +// GetRatioOfUserBalance is a free data retrieval call binding the contract method 0x2b0b9c5e. +// +// Solidity: function getRatioOfUserBalance(address ncp) view returns(uint256) +func (_StakingImp *StakingImpCaller) GetRatioOfUserBalance(opts *bind.CallOpts, ncp common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "getRatioOfUserBalance", ncp) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetRatioOfUserBalance is a free data retrieval call binding the contract method 0x2b0b9c5e. +// +// Solidity: function getRatioOfUserBalance(address ncp) view returns(uint256) +func (_StakingImp *StakingImpSession) GetRatioOfUserBalance(ncp common.Address) (*big.Int, error) { + return _StakingImp.Contract.GetRatioOfUserBalance(&_StakingImp.CallOpts, ncp) +} + +// GetRatioOfUserBalance is a free data retrieval call binding the contract method 0x2b0b9c5e. +// +// Solidity: function getRatioOfUserBalance(address ncp) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) GetRatioOfUserBalance(ncp common.Address) (*big.Int, error) { + return _StakingImp.Contract.GetRatioOfUserBalance(&_StakingImp.CallOpts, ncp) +} + +// GetTotalLockedBalance is a free data retrieval call binding the contract method 0xd5c25890. +// +// Solidity: function getTotalLockedBalance() view returns(uint256) +func (_StakingImp *StakingImpCaller) GetTotalLockedBalance(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "getTotalLockedBalance") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTotalLockedBalance is a free data retrieval call binding the contract method 0xd5c25890. +// +// Solidity: function getTotalLockedBalance() view returns(uint256) +func (_StakingImp *StakingImpSession) GetTotalLockedBalance() (*big.Int, error) { + return _StakingImp.Contract.GetTotalLockedBalance(&_StakingImp.CallOpts) +} + +// GetTotalLockedBalance is a free data retrieval call binding the contract method 0xd5c25890. +// +// Solidity: function getTotalLockedBalance() view returns(uint256) +func (_StakingImp *StakingImpCallerSession) GetTotalLockedBalance() (*big.Int, error) { + return _StakingImp.Contract.GetTotalLockedBalance(&_StakingImp.CallOpts) +} + +// IsRevoked is a free data retrieval call binding the contract method 0x2bc9ed02. +// +// Solidity: function isRevoked() view returns(bool) +func (_StakingImp *StakingImpCaller) IsRevoked(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "isRevoked") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsRevoked is a free data retrieval call binding the contract method 0x2bc9ed02. +// +// Solidity: function isRevoked() view returns(bool) +func (_StakingImp *StakingImpSession) IsRevoked() (bool, error) { + return _StakingImp.Contract.IsRevoked(&_StakingImp.CallOpts) +} + +// IsRevoked is a free data retrieval call binding the contract method 0x2bc9ed02. +// +// Solidity: function isRevoked() view returns(bool) +func (_StakingImp *StakingImpCallerSession) IsRevoked() (bool, error) { + return _StakingImp.Contract.IsRevoked(&_StakingImp.CallOpts) +} + +// LockedBalanceOf is a free data retrieval call binding the contract method 0x59355736. +// +// Solidity: function lockedBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCaller) LockedBalanceOf(opts *bind.CallOpts, payee common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "lockedBalanceOf", payee) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LockedBalanceOf is a free data retrieval call binding the contract method 0x59355736. +// +// Solidity: function lockedBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpSession) LockedBalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.LockedBalanceOf(&_StakingImp.CallOpts, payee) +} + +// LockedBalanceOf is a free data retrieval call binding the contract method 0x59355736. +// +// Solidity: function lockedBalanceOf(address payee) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) LockedBalanceOf(payee common.Address) (*big.Int, error) { + return _StakingImp.Contract.LockedBalanceOf(&_StakingImp.CallOpts, payee) +} + +// NcpStaking is a free data retrieval call binding the contract method 0xf1b8aa1d. +// +// Solidity: function ncpStaking() view returns(address) +func (_StakingImp *StakingImpCaller) NcpStaking(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "ncpStaking") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NcpStaking is a free data retrieval call binding the contract method 0xf1b8aa1d. +// +// Solidity: function ncpStaking() view returns(address) +func (_StakingImp *StakingImpSession) NcpStaking() (common.Address, error) { + return _StakingImp.Contract.NcpStaking(&_StakingImp.CallOpts) +} + +// NcpStaking is a free data retrieval call binding the contract method 0xf1b8aa1d. +// +// Solidity: function ncpStaking() view returns(address) +func (_StakingImp *StakingImpCallerSession) NcpStaking() (common.Address, error) { + return _StakingImp.Contract.NcpStaking(&_StakingImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_StakingImp *StakingImpCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StakingImp.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 (_StakingImp *StakingImpSession) Owner() (common.Address, error) { + return _StakingImp.Contract.Owner(&_StakingImp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_StakingImp *StakingImpCallerSession) Owner() (common.Address, error) { + return _StakingImp.Contract.Owner(&_StakingImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_StakingImp *StakingImpCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_StakingImp *StakingImpSession) ProxiableUUID() ([32]byte, error) { + return _StakingImp.Contract.ProxiableUUID(&_StakingImp.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_StakingImp *StakingImpCallerSession) ProxiableUUID() ([32]byte, error) { + return _StakingImp.Contract.ProxiableUUID(&_StakingImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_StakingImp *StakingImpCaller) Reg(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "reg") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_StakingImp *StakingImpSession) Reg() (common.Address, error) { + return _StakingImp.Contract.Reg(&_StakingImp.CallOpts) +} + +// Reg is a free data retrieval call binding the contract method 0x738fdd1a. +// +// Solidity: function reg() view returns(address) +func (_StakingImp *StakingImpCallerSession) Reg() (common.Address, error) { + return _StakingImp.Contract.Reg(&_StakingImp.CallOpts) +} + +// UserBalanceOf is a free data retrieval call binding the contract method 0x12853615. +// +// Solidity: function userBalanceOf(address ncp, address user) view returns(uint256) +func (_StakingImp *StakingImpCaller) UserBalanceOf(opts *bind.CallOpts, ncp common.Address, user common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "userBalanceOf", ncp, user) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// UserBalanceOf is a free data retrieval call binding the contract method 0x12853615. +// +// Solidity: function userBalanceOf(address ncp, address user) view returns(uint256) +func (_StakingImp *StakingImpSession) UserBalanceOf(ncp common.Address, user common.Address) (*big.Int, error) { + return _StakingImp.Contract.UserBalanceOf(&_StakingImp.CallOpts, ncp, user) +} + +// UserBalanceOf is a free data retrieval call binding the contract method 0x12853615. +// +// Solidity: function userBalanceOf(address ncp, address user) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) UserBalanceOf(ncp common.Address, user common.Address) (*big.Int, error) { + return _StakingImp.Contract.UserBalanceOf(&_StakingImp.CallOpts, ncp, user) +} + +// UserTotalBalanceOf is a free data retrieval call binding the contract method 0x193468ac. +// +// Solidity: function userTotalBalanceOf(address ncp) view returns(uint256) +func (_StakingImp *StakingImpCaller) UserTotalBalanceOf(opts *bind.CallOpts, ncp common.Address) (*big.Int, error) { + var out []interface{} + err := _StakingImp.contract.Call(opts, &out, "userTotalBalanceOf", ncp) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// UserTotalBalanceOf is a free data retrieval call binding the contract method 0x193468ac. +// +// Solidity: function userTotalBalanceOf(address ncp) view returns(uint256) +func (_StakingImp *StakingImpSession) UserTotalBalanceOf(ncp common.Address) (*big.Int, error) { + return _StakingImp.Contract.UserTotalBalanceOf(&_StakingImp.CallOpts, ncp) +} + +// UserTotalBalanceOf is a free data retrieval call binding the contract method 0x193468ac. +// +// Solidity: function userTotalBalanceOf(address ncp) view returns(uint256) +func (_StakingImp *StakingImpCallerSession) UserTotalBalanceOf(ncp common.Address) (*big.Int, error) { + return _StakingImp.Contract.UserTotalBalanceOf(&_StakingImp.CallOpts, ncp) +} + +// DelegateDepositAndLockMore is a paid mutator transaction binding the contract method 0xbac4f338. +// +// Solidity: function delegateDepositAndLockMore(address ncp) payable returns() +func (_StakingImp *StakingImpTransactor) DelegateDepositAndLockMore(opts *bind.TransactOpts, ncp common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "delegateDepositAndLockMore", ncp) +} + +// DelegateDepositAndLockMore is a paid mutator transaction binding the contract method 0xbac4f338. +// +// Solidity: function delegateDepositAndLockMore(address ncp) payable returns() +func (_StakingImp *StakingImpSession) DelegateDepositAndLockMore(ncp common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.DelegateDepositAndLockMore(&_StakingImp.TransactOpts, ncp) +} + +// DelegateDepositAndLockMore is a paid mutator transaction binding the contract method 0xbac4f338. +// +// Solidity: function delegateDepositAndLockMore(address ncp) payable returns() +func (_StakingImp *StakingImpTransactorSession) DelegateDepositAndLockMore(ncp common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.DelegateDepositAndLockMore(&_StakingImp.TransactOpts, ncp) +} + +// DelegateUnlockAndWithdraw is a paid mutator transaction binding the contract method 0xf6931822. +// +// Solidity: function delegateUnlockAndWithdraw(address ncp, uint256 amount) returns() +func (_StakingImp *StakingImpTransactor) DelegateUnlockAndWithdraw(opts *bind.TransactOpts, ncp common.Address, amount *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "delegateUnlockAndWithdraw", ncp, amount) +} + +// DelegateUnlockAndWithdraw is a paid mutator transaction binding the contract method 0xf6931822. +// +// Solidity: function delegateUnlockAndWithdraw(address ncp, uint256 amount) returns() +func (_StakingImp *StakingImpSession) DelegateUnlockAndWithdraw(ncp common.Address, amount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.DelegateUnlockAndWithdraw(&_StakingImp.TransactOpts, ncp, amount) +} + +// DelegateUnlockAndWithdraw is a paid mutator transaction binding the contract method 0xf6931822. +// +// Solidity: function delegateUnlockAndWithdraw(address ncp, uint256 amount) returns() +func (_StakingImp *StakingImpTransactorSession) DelegateUnlockAndWithdraw(ncp common.Address, amount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.DelegateUnlockAndWithdraw(&_StakingImp.TransactOpts, ncp, amount) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_StakingImp *StakingImpTransactor) Deposit(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "deposit") +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_StakingImp *StakingImpSession) Deposit() (*types.Transaction, error) { + return _StakingImp.Contract.Deposit(&_StakingImp.TransactOpts) +} + +// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0. +// +// Solidity: function deposit() payable returns() +func (_StakingImp *StakingImpTransactorSession) Deposit() (*types.Transaction, error) { + return _StakingImp.Contract.Deposit(&_StakingImp.TransactOpts) +} + +// Init is a paid mutator transaction binding the contract method 0xc0d91eaf. +// +// Solidity: function init(address registry, bytes data) returns() +func (_StakingImp *StakingImpTransactor) Init(opts *bind.TransactOpts, registry common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "init", registry, data) +} + +// Init is a paid mutator transaction binding the contract method 0xc0d91eaf. +// +// Solidity: function init(address registry, bytes data) returns() +func (_StakingImp *StakingImpSession) Init(registry common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.Contract.Init(&_StakingImp.TransactOpts, registry, data) +} + +// Init is a paid mutator transaction binding the contract method 0xc0d91eaf. +// +// Solidity: function init(address registry, bytes data) returns() +func (_StakingImp *StakingImpTransactorSession) Init(registry common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.Contract.Init(&_StakingImp.TransactOpts, registry, data) +} + +// Lock is a paid mutator transaction binding the contract method 0x282d3fdf. +// +// Solidity: function lock(address payee, uint256 lockAmount) returns() +func (_StakingImp *StakingImpTransactor) Lock(opts *bind.TransactOpts, payee common.Address, lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "lock", payee, lockAmount) +} + +// Lock is a paid mutator transaction binding the contract method 0x282d3fdf. +// +// Solidity: function lock(address payee, uint256 lockAmount) returns() +func (_StakingImp *StakingImpSession) Lock(payee common.Address, lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Lock(&_StakingImp.TransactOpts, payee, lockAmount) +} + +// Lock is a paid mutator transaction binding the contract method 0x282d3fdf. +// +// Solidity: function lock(address payee, uint256 lockAmount) returns() +func (_StakingImp *StakingImpTransactorSession) Lock(payee common.Address, lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Lock(&_StakingImp.TransactOpts, payee, lockAmount) +} + +// LockMore is a paid mutator transaction binding the contract method 0x9667e76a. +// +// Solidity: function lockMore(uint256 lockAmount) returns() +func (_StakingImp *StakingImpTransactor) LockMore(opts *bind.TransactOpts, lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "lockMore", lockAmount) +} + +// LockMore is a paid mutator transaction binding the contract method 0x9667e76a. +// +// Solidity: function lockMore(uint256 lockAmount) returns() +func (_StakingImp *StakingImpSession) LockMore(lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.LockMore(&_StakingImp.TransactOpts, lockAmount) +} + +// LockMore is a paid mutator transaction binding the contract method 0x9667e76a. +// +// Solidity: function lockMore(uint256 lockAmount) returns() +func (_StakingImp *StakingImpTransactorSession) LockMore(lockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.LockMore(&_StakingImp.TransactOpts, lockAmount) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_StakingImp *StakingImpTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_StakingImp *StakingImpSession) RenounceOwnership() (*types.Transaction, error) { + return _StakingImp.Contract.RenounceOwnership(&_StakingImp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_StakingImp *StakingImpTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _StakingImp.Contract.RenounceOwnership(&_StakingImp.TransactOpts) +} + +// Revoke is a paid mutator transaction binding the contract method 0xb6549f75. +// +// Solidity: function revoke() returns() +func (_StakingImp *StakingImpTransactor) Revoke(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "revoke") +} + +// Revoke is a paid mutator transaction binding the contract method 0xb6549f75. +// +// Solidity: function revoke() returns() +func (_StakingImp *StakingImpSession) Revoke() (*types.Transaction, error) { + return _StakingImp.Contract.Revoke(&_StakingImp.TransactOpts) +} + +// Revoke is a paid mutator transaction binding the contract method 0xb6549f75. +// +// Solidity: function revoke() returns() +func (_StakingImp *StakingImpTransactorSession) Revoke() (*types.Transaction, error) { + return _StakingImp.Contract.Revoke(&_StakingImp.TransactOpts) +} + +// SetNCPStaking is a paid mutator transaction binding the contract method 0x7f2f4c06. +// +// Solidity: function setNCPStaking(address _ncpStaking) returns() +func (_StakingImp *StakingImpTransactor) SetNCPStaking(opts *bind.TransactOpts, _ncpStaking common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "setNCPStaking", _ncpStaking) +} + +// SetNCPStaking is a paid mutator transaction binding the contract method 0x7f2f4c06. +// +// Solidity: function setNCPStaking(address _ncpStaking) returns() +func (_StakingImp *StakingImpSession) SetNCPStaking(_ncpStaking common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.SetNCPStaking(&_StakingImp.TransactOpts, _ncpStaking) +} + +// SetNCPStaking is a paid mutator transaction binding the contract method 0x7f2f4c06. +// +// Solidity: function setNCPStaking(address _ncpStaking) returns() +func (_StakingImp *StakingImpTransactorSession) SetNCPStaking(_ncpStaking common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.SetNCPStaking(&_StakingImp.TransactOpts, _ncpStaking) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_StakingImp *StakingImpTransactor) SetRegistry(opts *bind.TransactOpts, _addr common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "setRegistry", _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_StakingImp *StakingImpSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.SetRegistry(&_StakingImp.TransactOpts, _addr) +} + +// SetRegistry is a paid mutator transaction binding the contract method 0xa91ee0dc. +// +// Solidity: function setRegistry(address _addr) returns() +func (_StakingImp *StakingImpTransactorSession) SetRegistry(_addr common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.SetRegistry(&_StakingImp.TransactOpts, _addr) +} + +// TransferLocked is a paid mutator transaction binding the contract method 0x92a950b6. +// +// Solidity: function transferLocked(address from, uint256 slashing, uint256 ext) returns() +func (_StakingImp *StakingImpTransactor) TransferLocked(opts *bind.TransactOpts, from common.Address, slashing *big.Int, ext *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "transferLocked", from, slashing, ext) +} + +// TransferLocked is a paid mutator transaction binding the contract method 0x92a950b6. +// +// Solidity: function transferLocked(address from, uint256 slashing, uint256 ext) returns() +func (_StakingImp *StakingImpSession) TransferLocked(from common.Address, slashing *big.Int, ext *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.TransferLocked(&_StakingImp.TransactOpts, from, slashing, ext) +} + +// TransferLocked is a paid mutator transaction binding the contract method 0x92a950b6. +// +// Solidity: function transferLocked(address from, uint256 slashing, uint256 ext) returns() +func (_StakingImp *StakingImpTransactorSession) TransferLocked(from common.Address, slashing *big.Int, ext *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.TransferLocked(&_StakingImp.TransactOpts, from, slashing, ext) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_StakingImp *StakingImpTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_StakingImp *StakingImpSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.TransferOwnership(&_StakingImp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_StakingImp *StakingImpTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.TransferOwnership(&_StakingImp.TransactOpts, newOwner) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address payee, uint256 unlockAmount) returns() +func (_StakingImp *StakingImpTransactor) Unlock(opts *bind.TransactOpts, payee common.Address, unlockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "unlock", payee, unlockAmount) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address payee, uint256 unlockAmount) returns() +func (_StakingImp *StakingImpSession) Unlock(payee common.Address, unlockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Unlock(&_StakingImp.TransactOpts, payee, unlockAmount) +} + +// Unlock is a paid mutator transaction binding the contract method 0x7eee288d. +// +// Solidity: function unlock(address payee, uint256 unlockAmount) returns() +func (_StakingImp *StakingImpTransactorSession) Unlock(payee common.Address, unlockAmount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Unlock(&_StakingImp.TransactOpts, payee, unlockAmount) +} + +// UpgradeStaking is a paid mutator transaction binding the contract method 0xf3f63080. +// +// Solidity: function upgradeStaking(address newImp) returns() +func (_StakingImp *StakingImpTransactor) UpgradeStaking(opts *bind.TransactOpts, newImp common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "upgradeStaking", newImp) +} + +// UpgradeStaking is a paid mutator transaction binding the contract method 0xf3f63080. +// +// Solidity: function upgradeStaking(address newImp) returns() +func (_StakingImp *StakingImpSession) UpgradeStaking(newImp common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeStaking(&_StakingImp.TransactOpts, newImp) +} + +// UpgradeStaking is a paid mutator transaction binding the contract method 0xf3f63080. +// +// Solidity: function upgradeStaking(address newImp) returns() +func (_StakingImp *StakingImpTransactorSession) UpgradeStaking(newImp common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeStaking(&_StakingImp.TransactOpts, newImp) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_StakingImp *StakingImpTransactor) UpgradeTo(opts *bind.TransactOpts, newImplementation common.Address) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "upgradeTo", newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_StakingImp *StakingImpSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeTo(&_StakingImp.TransactOpts, newImplementation) +} + +// UpgradeTo is a paid mutator transaction binding the contract method 0x3659cfe6. +// +// Solidity: function upgradeTo(address newImplementation) returns() +func (_StakingImp *StakingImpTransactorSession) UpgradeTo(newImplementation common.Address) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeTo(&_StakingImp.TransactOpts, newImplementation) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_StakingImp *StakingImpTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_StakingImp *StakingImpSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeToAndCall(&_StakingImp.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_StakingImp *StakingImpTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _StakingImp.Contract.UpgradeToAndCall(&_StakingImp.TransactOpts, newImplementation, data) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_StakingImp *StakingImpTransactor) Withdraw(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _StakingImp.contract.Transact(opts, "withdraw", amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_StakingImp *StakingImpSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Withdraw(&_StakingImp.TransactOpts, amount) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 amount) returns() +func (_StakingImp *StakingImpTransactorSession) Withdraw(amount *big.Int) (*types.Transaction, error) { + return _StakingImp.Contract.Withdraw(&_StakingImp.TransactOpts, amount) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StakingImp *StakingImpTransactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) { + return _StakingImp.contract.RawTransact(opts, nil) // calldata is disallowed for receive function +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StakingImp *StakingImpSession) Receive() (*types.Transaction, error) { + return _StakingImp.Contract.Receive(&_StakingImp.TransactOpts) +} + +// Receive is a paid mutator transaction binding the contract receive function. +// +// Solidity: receive() payable returns() +func (_StakingImp *StakingImpTransactorSession) Receive() (*types.Transaction, error) { + return _StakingImp.Contract.Receive(&_StakingImp.TransactOpts) +} + +// StakingImpAdminChangedIterator is returned from FilterAdminChanged and is used to iterate over the raw logs and unpacked data for AdminChanged events raised by the StakingImp contract. +type StakingImpAdminChangedIterator struct { + Event *StakingImpAdminChanged // 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 *StakingImpAdminChangedIterator) 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(StakingImpAdminChanged) + 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(StakingImpAdminChanged) + 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 *StakingImpAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpAdminChanged represents a AdminChanged event raised by the StakingImp contract. +type StakingImpAdminChanged struct { + PreviousAdmin common.Address + NewAdmin common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAdminChanged is a free log retrieval operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_StakingImp *StakingImpFilterer) FilterAdminChanged(opts *bind.FilterOpts) (*StakingImpAdminChangedIterator, error) { + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "AdminChanged") + if err != nil { + return nil, err + } + return &StakingImpAdminChangedIterator{contract: _StakingImp.contract, event: "AdminChanged", logs: logs, sub: sub}, nil +} + +// WatchAdminChanged is a free log subscription operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_StakingImp *StakingImpFilterer) WatchAdminChanged(opts *bind.WatchOpts, sink chan<- *StakingImpAdminChanged) (event.Subscription, error) { + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "AdminChanged") + 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(StakingImpAdminChanged) + if err := _StakingImp.contract.UnpackLog(event, "AdminChanged", 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 +} + +// ParseAdminChanged is a log parse operation binding the contract event 0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f. +// +// Solidity: event AdminChanged(address previousAdmin, address newAdmin) +func (_StakingImp *StakingImpFilterer) ParseAdminChanged(log types.Log) (*StakingImpAdminChanged, error) { + event := new(StakingImpAdminChanged) + if err := _StakingImp.contract.UnpackLog(event, "AdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpBeaconUpgradedIterator is returned from FilterBeaconUpgraded and is used to iterate over the raw logs and unpacked data for BeaconUpgraded events raised by the StakingImp contract. +type StakingImpBeaconUpgradedIterator struct { + Event *StakingImpBeaconUpgraded // 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 *StakingImpBeaconUpgradedIterator) 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(StakingImpBeaconUpgraded) + 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(StakingImpBeaconUpgraded) + 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 *StakingImpBeaconUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpBeaconUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpBeaconUpgraded represents a BeaconUpgraded event raised by the StakingImp contract. +type StakingImpBeaconUpgraded struct { + Beacon common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBeaconUpgraded is a free log retrieval operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_StakingImp *StakingImpFilterer) FilterBeaconUpgraded(opts *bind.FilterOpts, beacon []common.Address) (*StakingImpBeaconUpgradedIterator, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "BeaconUpgraded", beaconRule) + if err != nil { + return nil, err + } + return &StakingImpBeaconUpgradedIterator{contract: _StakingImp.contract, event: "BeaconUpgraded", logs: logs, sub: sub}, nil +} + +// WatchBeaconUpgraded is a free log subscription operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_StakingImp *StakingImpFilterer) WatchBeaconUpgraded(opts *bind.WatchOpts, sink chan<- *StakingImpBeaconUpgraded, beacon []common.Address) (event.Subscription, error) { + + var beaconRule []interface{} + for _, beaconItem := range beacon { + beaconRule = append(beaconRule, beaconItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "BeaconUpgraded", beaconRule) + 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(StakingImpBeaconUpgraded) + if err := _StakingImp.contract.UnpackLog(event, "BeaconUpgraded", 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 +} + +// ParseBeaconUpgraded is a log parse operation binding the contract event 0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e. +// +// Solidity: event BeaconUpgraded(address indexed beacon) +func (_StakingImp *StakingImpFilterer) ParseBeaconUpgraded(log types.Log) (*StakingImpBeaconUpgraded, error) { + event := new(StakingImpBeaconUpgraded) + if err := _StakingImp.contract.UnpackLog(event, "BeaconUpgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpDelegateStakedIterator is returned from FilterDelegateStaked and is used to iterate over the raw logs and unpacked data for DelegateStaked events raised by the StakingImp contract. +type StakingImpDelegateStakedIterator struct { + Event *StakingImpDelegateStaked // 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 *StakingImpDelegateStakedIterator) 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(StakingImpDelegateStaked) + 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(StakingImpDelegateStaked) + 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 *StakingImpDelegateStakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpDelegateStakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpDelegateStaked represents a DelegateStaked event raised by the StakingImp contract. +type StakingImpDelegateStaked struct { + Payee common.Address + Amount *big.Int + Ncp common.Address + NcpTotalLocked *big.Int + UserTotalLocked *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateStaked is a free log retrieval operation binding the contract event 0x74cfc20f0e6d14384c3a60820d3e814f6979d009cdbb43db27fa56fe475172fd. +// +// Solidity: event DelegateStaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) FilterDelegateStaked(opts *bind.FilterOpts, payee []common.Address, ncp []common.Address) (*StakingImpDelegateStakedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "DelegateStaked", payeeRule, ncpRule) + if err != nil { + return nil, err + } + return &StakingImpDelegateStakedIterator{contract: _StakingImp.contract, event: "DelegateStaked", logs: logs, sub: sub}, nil +} + +// WatchDelegateStaked is a free log subscription operation binding the contract event 0x74cfc20f0e6d14384c3a60820d3e814f6979d009cdbb43db27fa56fe475172fd. +// +// Solidity: event DelegateStaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) WatchDelegateStaked(opts *bind.WatchOpts, sink chan<- *StakingImpDelegateStaked, payee []common.Address, ncp []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "DelegateStaked", payeeRule, ncpRule) + 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(StakingImpDelegateStaked) + if err := _StakingImp.contract.UnpackLog(event, "DelegateStaked", 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 +} + +// ParseDelegateStaked is a log parse operation binding the contract event 0x74cfc20f0e6d14384c3a60820d3e814f6979d009cdbb43db27fa56fe475172fd. +// +// Solidity: event DelegateStaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) ParseDelegateStaked(log types.Log) (*StakingImpDelegateStaked, error) { + event := new(StakingImpDelegateStaked) + if err := _StakingImp.contract.UnpackLog(event, "DelegateStaked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpDelegateUnstakedIterator is returned from FilterDelegateUnstaked and is used to iterate over the raw logs and unpacked data for DelegateUnstaked events raised by the StakingImp contract. +type StakingImpDelegateUnstakedIterator struct { + Event *StakingImpDelegateUnstaked // 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 *StakingImpDelegateUnstakedIterator) 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(StakingImpDelegateUnstaked) + 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(StakingImpDelegateUnstaked) + 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 *StakingImpDelegateUnstakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpDelegateUnstakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpDelegateUnstaked represents a DelegateUnstaked event raised by the StakingImp contract. +type StakingImpDelegateUnstaked struct { + Payee common.Address + Amount *big.Int + Ncp common.Address + NcpTotalLocked *big.Int + UserTotalLocked *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateUnstaked is a free log retrieval operation binding the contract event 0x03d2bb70c6ccc49d68a465a06edffb976961cf8930888658ca2339fa62b8bda2. +// +// Solidity: event DelegateUnstaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) FilterDelegateUnstaked(opts *bind.FilterOpts, payee []common.Address, ncp []common.Address) (*StakingImpDelegateUnstakedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "DelegateUnstaked", payeeRule, ncpRule) + if err != nil { + return nil, err + } + return &StakingImpDelegateUnstakedIterator{contract: _StakingImp.contract, event: "DelegateUnstaked", logs: logs, sub: sub}, nil +} + +// WatchDelegateUnstaked is a free log subscription operation binding the contract event 0x03d2bb70c6ccc49d68a465a06edffb976961cf8930888658ca2339fa62b8bda2. +// +// Solidity: event DelegateUnstaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) WatchDelegateUnstaked(opts *bind.WatchOpts, sink chan<- *StakingImpDelegateUnstaked, payee []common.Address, ncp []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "DelegateUnstaked", payeeRule, ncpRule) + 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(StakingImpDelegateUnstaked) + if err := _StakingImp.contract.UnpackLog(event, "DelegateUnstaked", 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 +} + +// ParseDelegateUnstaked is a log parse operation binding the contract event 0x03d2bb70c6ccc49d68a465a06edffb976961cf8930888658ca2339fa62b8bda2. +// +// Solidity: event DelegateUnstaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked) +func (_StakingImp *StakingImpFilterer) ParseDelegateUnstaked(log types.Log) (*StakingImpDelegateUnstaked, error) { + event := new(StakingImpDelegateUnstaked) + if err := _StakingImp.contract.UnpackLog(event, "DelegateUnstaked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the StakingImp contract. +type StakingImpInitializedIterator struct { + Event *StakingImpInitialized // 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 *StakingImpInitializedIterator) 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(StakingImpInitialized) + 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(StakingImpInitialized) + 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 *StakingImpInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpInitialized represents a Initialized event raised by the StakingImp contract. +type StakingImpInitialized 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 (_StakingImp *StakingImpFilterer) FilterInitialized(opts *bind.FilterOpts) (*StakingImpInitializedIterator, error) { + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &StakingImpInitializedIterator{contract: _StakingImp.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 (_StakingImp *StakingImpFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *StakingImpInitialized) (event.Subscription, error) { + + logs, sub, err := _StakingImp.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(StakingImpInitialized) + if err := _StakingImp.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 (_StakingImp *StakingImpFilterer) ParseInitialized(log types.Log) (*StakingImpInitialized, error) { + event := new(StakingImpInitialized) + if err := _StakingImp.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpLockedIterator is returned from FilterLocked and is used to iterate over the raw logs and unpacked data for Locked events raised by the StakingImp contract. +type StakingImpLockedIterator struct { + Event *StakingImpLocked // 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 *StakingImpLockedIterator) 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(StakingImpLocked) + 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(StakingImpLocked) + 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 *StakingImpLockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpLocked represents a Locked event raised by the StakingImp contract. +type StakingImpLocked struct { + Payee common.Address + Amount *big.Int + Total *big.Int + Available *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLocked is a free log retrieval operation binding the contract event 0x44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11. +// +// Solidity: event Locked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) FilterLocked(opts *bind.FilterOpts, payee []common.Address) (*StakingImpLockedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Locked", payeeRule) + if err != nil { + return nil, err + } + return &StakingImpLockedIterator{contract: _StakingImp.contract, event: "Locked", logs: logs, sub: sub}, nil +} + +// WatchLocked is a free log subscription operation binding the contract event 0x44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11. +// +// Solidity: event Locked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) WatchLocked(opts *bind.WatchOpts, sink chan<- *StakingImpLocked, payee []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Locked", payeeRule) + 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(StakingImpLocked) + if err := _StakingImp.contract.UnpackLog(event, "Locked", 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 +} + +// ParseLocked is a log parse operation binding the contract event 0x44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11. +// +// Solidity: event Locked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) ParseLocked(log types.Log) (*StakingImpLocked, error) { + event := new(StakingImpLocked) + if err := _StakingImp.contract.UnpackLog(event, "Locked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpNCPAddrChangedIterator is returned from FilterNCPAddrChanged and is used to iterate over the raw logs and unpacked data for NCPAddrChanged events raised by the StakingImp contract. +type StakingImpNCPAddrChangedIterator struct { + Event *StakingImpNCPAddrChanged // 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 *StakingImpNCPAddrChangedIterator) 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(StakingImpNCPAddrChanged) + 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(StakingImpNCPAddrChanged) + 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 *StakingImpNCPAddrChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpNCPAddrChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpNCPAddrChanged represents a NCPAddrChanged event raised by the StakingImp contract. +type StakingImpNCPAddrChanged struct { + Ncp common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNCPAddrChanged is a free log retrieval operation binding the contract event 0xfd5754300dde6066eda4fabd23616c1d560a3360c85c0716c46e00649bdeeddf. +// +// Solidity: event NCPAddrChanged(address indexed ncp) +func (_StakingImp *StakingImpFilterer) FilterNCPAddrChanged(opts *bind.FilterOpts, ncp []common.Address) (*StakingImpNCPAddrChangedIterator, error) { + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "NCPAddrChanged", ncpRule) + if err != nil { + return nil, err + } + return &StakingImpNCPAddrChangedIterator{contract: _StakingImp.contract, event: "NCPAddrChanged", logs: logs, sub: sub}, nil +} + +// WatchNCPAddrChanged is a free log subscription operation binding the contract event 0xfd5754300dde6066eda4fabd23616c1d560a3360c85c0716c46e00649bdeeddf. +// +// Solidity: event NCPAddrChanged(address indexed ncp) +func (_StakingImp *StakingImpFilterer) WatchNCPAddrChanged(opts *bind.WatchOpts, sink chan<- *StakingImpNCPAddrChanged, ncp []common.Address) (event.Subscription, error) { + + var ncpRule []interface{} + for _, ncpItem := range ncp { + ncpRule = append(ncpRule, ncpItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "NCPAddrChanged", ncpRule) + 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(StakingImpNCPAddrChanged) + if err := _StakingImp.contract.UnpackLog(event, "NCPAddrChanged", 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 +} + +// ParseNCPAddrChanged is a log parse operation binding the contract event 0xfd5754300dde6066eda4fabd23616c1d560a3360c85c0716c46e00649bdeeddf. +// +// Solidity: event NCPAddrChanged(address indexed ncp) +func (_StakingImp *StakingImpFilterer) ParseNCPAddrChanged(log types.Log) (*StakingImpNCPAddrChanged, error) { + event := new(StakingImpNCPAddrChanged) + if err := _StakingImp.contract.UnpackLog(event, "NCPAddrChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the StakingImp contract. +type StakingImpOwnershipTransferredIterator struct { + Event *StakingImpOwnershipTransferred // 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 *StakingImpOwnershipTransferredIterator) 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(StakingImpOwnershipTransferred) + 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(StakingImpOwnershipTransferred) + 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 *StakingImpOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpOwnershipTransferred represents a OwnershipTransferred event raised by the StakingImp contract. +type StakingImpOwnershipTransferred 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 (_StakingImp *StakingImpFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*StakingImpOwnershipTransferredIterator, 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 := _StakingImp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &StakingImpOwnershipTransferredIterator{contract: _StakingImp.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 (_StakingImp *StakingImpFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *StakingImpOwnershipTransferred, 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 := _StakingImp.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(StakingImpOwnershipTransferred) + if err := _StakingImp.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 (_StakingImp *StakingImpFilterer) ParseOwnershipTransferred(log types.Log) (*StakingImpOwnershipTransferred, error) { + event := new(StakingImpOwnershipTransferred) + if err := _StakingImp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpRevokedIterator is returned from FilterRevoked and is used to iterate over the raw logs and unpacked data for Revoked events raised by the StakingImp contract. +type StakingImpRevokedIterator struct { + Event *StakingImpRevoked // 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 *StakingImpRevokedIterator) 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(StakingImpRevoked) + 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(StakingImpRevoked) + 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 *StakingImpRevokedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpRevokedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpRevoked represents a Revoked event raised by the StakingImp contract. +type StakingImpRevoked struct { + Owner common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRevoked is a free log retrieval operation binding the contract event 0x713b90881ad62c4fa8ab6bd9197fa86481fc0c11b2edba60026514281b2dbac4. +// +// Solidity: event Revoked(address indexed owner, uint256 amount) +func (_StakingImp *StakingImpFilterer) FilterRevoked(opts *bind.FilterOpts, owner []common.Address) (*StakingImpRevokedIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Revoked", ownerRule) + if err != nil { + return nil, err + } + return &StakingImpRevokedIterator{contract: _StakingImp.contract, event: "Revoked", logs: logs, sub: sub}, nil +} + +// WatchRevoked is a free log subscription operation binding the contract event 0x713b90881ad62c4fa8ab6bd9197fa86481fc0c11b2edba60026514281b2dbac4. +// +// Solidity: event Revoked(address indexed owner, uint256 amount) +func (_StakingImp *StakingImpFilterer) WatchRevoked(opts *bind.WatchOpts, sink chan<- *StakingImpRevoked, owner []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Revoked", ownerRule) + 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(StakingImpRevoked) + if err := _StakingImp.contract.UnpackLog(event, "Revoked", 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 +} + +// ParseRevoked is a log parse operation binding the contract event 0x713b90881ad62c4fa8ab6bd9197fa86481fc0c11b2edba60026514281b2dbac4. +// +// Solidity: event Revoked(address indexed owner, uint256 amount) +func (_StakingImp *StakingImpFilterer) ParseRevoked(log types.Log) (*StakingImpRevoked, error) { + event := new(StakingImpRevoked) + if err := _StakingImp.contract.UnpackLog(event, "Revoked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpSetRegistryIterator is returned from FilterSetRegistry and is used to iterate over the raw logs and unpacked data for SetRegistry events raised by the StakingImp contract. +type StakingImpSetRegistryIterator struct { + Event *StakingImpSetRegistry // 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 *StakingImpSetRegistryIterator) 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(StakingImpSetRegistry) + 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(StakingImpSetRegistry) + 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 *StakingImpSetRegistryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpSetRegistryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpSetRegistry represents a SetRegistry event raised by the StakingImp contract. +type StakingImpSetRegistry struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetRegistry is a free log retrieval operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_StakingImp *StakingImpFilterer) FilterSetRegistry(opts *bind.FilterOpts, addr []common.Address) (*StakingImpSetRegistryIterator, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "SetRegistry", addrRule) + if err != nil { + return nil, err + } + return &StakingImpSetRegistryIterator{contract: _StakingImp.contract, event: "SetRegistry", logs: logs, sub: sub}, nil +} + +// WatchSetRegistry is a free log subscription operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_StakingImp *StakingImpFilterer) WatchSetRegistry(opts *bind.WatchOpts, sink chan<- *StakingImpSetRegistry, addr []common.Address) (event.Subscription, error) { + + var addrRule []interface{} + for _, addrItem := range addr { + addrRule = append(addrRule, addrItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "SetRegistry", addrRule) + 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(StakingImpSetRegistry) + if err := _StakingImp.contract.UnpackLog(event, "SetRegistry", 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 +} + +// ParseSetRegistry is a log parse operation binding the contract event 0x278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd. +// +// Solidity: event SetRegistry(address indexed addr) +func (_StakingImp *StakingImpFilterer) ParseSetRegistry(log types.Log) (*StakingImpSetRegistry, error) { + event := new(StakingImpSetRegistry) + if err := _StakingImp.contract.UnpackLog(event, "SetRegistry", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpStakedIterator is returned from FilterStaked and is used to iterate over the raw logs and unpacked data for Staked events raised by the StakingImp contract. +type StakingImpStakedIterator struct { + Event *StakingImpStaked // 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 *StakingImpStakedIterator) 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(StakingImpStaked) + 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(StakingImpStaked) + 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 *StakingImpStakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpStakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpStaked represents a Staked event raised by the StakingImp contract. +type StakingImpStaked struct { + Payee common.Address + Amount *big.Int + Total *big.Int + Available *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStaked is a free log retrieval operation binding the contract event 0xb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed. +// +// Solidity: event Staked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) FilterStaked(opts *bind.FilterOpts, payee []common.Address) (*StakingImpStakedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Staked", payeeRule) + if err != nil { + return nil, err + } + return &StakingImpStakedIterator{contract: _StakingImp.contract, event: "Staked", logs: logs, sub: sub}, nil +} + +// WatchStaked is a free log subscription operation binding the contract event 0xb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed. +// +// Solidity: event Staked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) WatchStaked(opts *bind.WatchOpts, sink chan<- *StakingImpStaked, payee []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Staked", payeeRule) + 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(StakingImpStaked) + if err := _StakingImp.contract.UnpackLog(event, "Staked", 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 +} + +// ParseStaked is a log parse operation binding the contract event 0xb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed. +// +// Solidity: event Staked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) ParseStaked(log types.Log) (*StakingImpStaked, error) { + event := new(StakingImpStaked) + if err := _StakingImp.contract.UnpackLog(event, "Staked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpTransferLockedIterator is returned from FilterTransferLocked and is used to iterate over the raw logs and unpacked data for TransferLocked events raised by the StakingImp contract. +type StakingImpTransferLockedIterator struct { + Event *StakingImpTransferLocked // 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 *StakingImpTransferLockedIterator) 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(StakingImpTransferLocked) + 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(StakingImpTransferLocked) + 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 *StakingImpTransferLockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpTransferLockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpTransferLocked represents a TransferLocked event raised by the StakingImp contract. +type StakingImpTransferLocked struct { + Payee common.Address + Amount *big.Int + Total *big.Int + Available *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransferLocked is a free log retrieval operation binding the contract event 0x2caed32a519a1fd89486d3ffe06202febb5ed51534d571dbab93058545a29e24. +// +// Solidity: event TransferLocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) FilterTransferLocked(opts *bind.FilterOpts, payee []common.Address) (*StakingImpTransferLockedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "TransferLocked", payeeRule) + if err != nil { + return nil, err + } + return &StakingImpTransferLockedIterator{contract: _StakingImp.contract, event: "TransferLocked", logs: logs, sub: sub}, nil +} + +// WatchTransferLocked is a free log subscription operation binding the contract event 0x2caed32a519a1fd89486d3ffe06202febb5ed51534d571dbab93058545a29e24. +// +// Solidity: event TransferLocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) WatchTransferLocked(opts *bind.WatchOpts, sink chan<- *StakingImpTransferLocked, payee []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "TransferLocked", payeeRule) + 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(StakingImpTransferLocked) + if err := _StakingImp.contract.UnpackLog(event, "TransferLocked", 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 +} + +// ParseTransferLocked is a log parse operation binding the contract event 0x2caed32a519a1fd89486d3ffe06202febb5ed51534d571dbab93058545a29e24. +// +// Solidity: event TransferLocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) ParseTransferLocked(log types.Log) (*StakingImpTransferLocked, error) { + event := new(StakingImpTransferLocked) + if err := _StakingImp.contract.UnpackLog(event, "TransferLocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpUnlockedIterator is returned from FilterUnlocked and is used to iterate over the raw logs and unpacked data for Unlocked events raised by the StakingImp contract. +type StakingImpUnlockedIterator struct { + Event *StakingImpUnlocked // 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 *StakingImpUnlockedIterator) 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(StakingImpUnlocked) + 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(StakingImpUnlocked) + 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 *StakingImpUnlockedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpUnlockedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpUnlocked represents a Unlocked event raised by the StakingImp contract. +type StakingImpUnlocked struct { + Payee common.Address + Amount *big.Int + Total *big.Int + Available *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnlocked is a free log retrieval operation binding the contract event 0x5245d528087a96a64f4589a764f00061e4671eab90cb1e019b1a5b24b2e4c2a8. +// +// Solidity: event Unlocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) FilterUnlocked(opts *bind.FilterOpts, payee []common.Address) (*StakingImpUnlockedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Unlocked", payeeRule) + if err != nil { + return nil, err + } + return &StakingImpUnlockedIterator{contract: _StakingImp.contract, event: "Unlocked", logs: logs, sub: sub}, nil +} + +// WatchUnlocked is a free log subscription operation binding the contract event 0x5245d528087a96a64f4589a764f00061e4671eab90cb1e019b1a5b24b2e4c2a8. +// +// Solidity: event Unlocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) WatchUnlocked(opts *bind.WatchOpts, sink chan<- *StakingImpUnlocked, payee []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Unlocked", payeeRule) + 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(StakingImpUnlocked) + if err := _StakingImp.contract.UnpackLog(event, "Unlocked", 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 +} + +// ParseUnlocked is a log parse operation binding the contract event 0x5245d528087a96a64f4589a764f00061e4671eab90cb1e019b1a5b24b2e4c2a8. +// +// Solidity: event Unlocked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) ParseUnlocked(log types.Log) (*StakingImpUnlocked, error) { + event := new(StakingImpUnlocked) + if err := _StakingImp.contract.UnpackLog(event, "Unlocked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpUnstakedIterator is returned from FilterUnstaked and is used to iterate over the raw logs and unpacked data for Unstaked events raised by the StakingImp contract. +type StakingImpUnstakedIterator struct { + Event *StakingImpUnstaked // 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 *StakingImpUnstakedIterator) 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(StakingImpUnstaked) + 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(StakingImpUnstaked) + 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 *StakingImpUnstakedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpUnstakedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpUnstaked represents a Unstaked event raised by the StakingImp contract. +type StakingImpUnstaked struct { + Payee common.Address + Amount *big.Int + Total *big.Int + Available *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnstaked is a free log retrieval operation binding the contract event 0x204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00. +// +// Solidity: event Unstaked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) FilterUnstaked(opts *bind.FilterOpts, payee []common.Address) (*StakingImpUnstakedIterator, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Unstaked", payeeRule) + if err != nil { + return nil, err + } + return &StakingImpUnstakedIterator{contract: _StakingImp.contract, event: "Unstaked", logs: logs, sub: sub}, nil +} + +// WatchUnstaked is a free log subscription operation binding the contract event 0x204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00. +// +// Solidity: event Unstaked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) WatchUnstaked(opts *bind.WatchOpts, sink chan<- *StakingImpUnstaked, payee []common.Address) (event.Subscription, error) { + + var payeeRule []interface{} + for _, payeeItem := range payee { + payeeRule = append(payeeRule, payeeItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Unstaked", payeeRule) + 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(StakingImpUnstaked) + if err := _StakingImp.contract.UnpackLog(event, "Unstaked", 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 +} + +// ParseUnstaked is a log parse operation binding the contract event 0x204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00. +// +// Solidity: event Unstaked(address indexed payee, uint256 amount, uint256 total, uint256 available) +func (_StakingImp *StakingImpFilterer) ParseUnstaked(log types.Log) (*StakingImpUnstaked, error) { + event := new(StakingImpUnstaked) + if err := _StakingImp.contract.UnpackLog(event, "Unstaked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// StakingImpUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the StakingImp contract. +type StakingImpUpgradedIterator struct { + Event *StakingImpUpgraded // 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 *StakingImpUpgradedIterator) 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(StakingImpUpgraded) + 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(StakingImpUpgraded) + 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 *StakingImpUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *StakingImpUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// StakingImpUpgraded represents a Upgraded event raised by the StakingImp contract. +type StakingImpUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_StakingImp *StakingImpFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*StakingImpUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _StakingImp.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &StakingImpUpgradedIterator{contract: _StakingImp.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_StakingImp *StakingImpFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *StakingImpUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _StakingImp.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(StakingImpUpgraded) + if err := _StakingImp.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_StakingImp *StakingImpFilterer) ParseUpgraded(log types.Log) (*StakingImpUpgraded, error) { + event := new(StakingImpUpgraded) + if err := _StakingImp.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/wemix/bind/structs.go b/wemix/bind/structs.go new file mode 100644 index 000000000000..6b96eb697580 --- /dev/null +++ b/wemix/bind/structs.go @@ -0,0 +1,474 @@ +package gov + +import ( + "bytes" + "context" + "encoding/hex" + "fmt" + "math/big" + "reflect" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/wemix/metclient" + "github.com/pkg/errors" +) + +//go:generate go run ../governance-contract/contracts/abigen.go --root=../governance-contract/contracts + +var ( + magic = new(big.Int).SetBytes(hexutil.MustDecode("0x57656d6978205265676973747279")) +) + +type GovContracts struct { + Registry *Registry + Gov *Gov + GovImp *GovImp + Staking *Staking + StakingImp *StakingImp + BallotStorage *BallotStorage + BallotStorageImp *BallotStorageImp + EnvStorage *EnvStorage + EnvStorageImp *EnvStorageImp + NCPExit *NCPExit + NCPExitImp *NCPExitImp + address struct { + Registry common.Address + Gov common.Address + Staking common.Address + BallotStorage common.Address + EnvStorage common.Address + NCPExit common.Address + } +} + +func NewGovContracts(backend bind.ContractBackend, registry common.Address) (*GovContracts, error) { + ctx, cancel := context.WithCancel(context.TODO()) + defer cancel() + + gov := new(GovContracts) + + if contract, err := NewRegistry(registry, backend); err != nil { + return nil, err + } else { + gov.Registry, gov.address.Registry = contract, registry + } + var ( + err error + cfg = &uupsConfig{ + callOpts: &bind.CallOpts{Context: ctx}, + backend: backend, + registry: gov.Registry, + } + ) + + if gov.address.Gov, gov.Gov, gov.GovImp, err = newUUPSContracts(cfg, DOMAIN_Gov, NewGov, NewGovImp); err != nil { + return nil, errors.Wrap(err, DOMAIN_Gov) + } else if gov.address.Staking, gov.Staking, gov.StakingImp, err = newUUPSContracts(cfg, DOMAIN_Staking, NewStaking, NewStakingImp); err != nil { + return nil, errors.Wrap(err, DOMAIN_Staking) + } else if gov.address.BallotStorage, gov.BallotStorage, gov.BallotStorageImp, err = newUUPSContracts(cfg, DOMAIN_BallotStorage, NewBallotStorage, NewBallotStorageImp); err != nil { + return nil, errors.Wrap(err, DOMAIN_BallotStorage) + } else if gov.address.EnvStorage, gov.EnvStorage, gov.EnvStorageImp, err = newUUPSContracts(cfg, DOMAIN_EnvStorage, NewEnvStorage, NewEnvStorageImp); err != nil { + return nil, errors.Wrap(err, DOMAIN_EnvStorage) + } else if gov.address.NCPExit, gov.NCPExit, gov.NCPExitImp, err = newUUPSContracts(cfg, DOMAIN_NCPExit, NewNCPExit, NewNCPExitImp); err != nil { + return nil, errors.Wrap(err, DOMAIN_NCPExit) + } else { + return gov, nil + } +} + +func DeployGovContracts(opts *bind.TransactOpts, backend iBackend, optionDomains map[string]common.Address) (*GovContracts, error) { + if opts.Context == nil { + ctx, cancel := context.WithCancel(context.Background()) + opts.Context = ctx + defer func() { cancel(); opts.Context = nil }() + } + + if optionDomains == nil { + optionDomains = make(map[string]common.Address) + } + + var ( + err error + + gov = new(GovContracts) + logger = log.New("func", "DeployGovContracts") + txPool = &txPool{backend: backend, logger: logger, opts: opts, txs: make([]*types.Transaction, 0)} + impAddress = struct { + Gov common.Address + Staking common.Address + BallotStorage common.Address + EnvStorage common.Address + NCPExit common.Address + }{} + ) + + // deploy registry + if address, tx, contract, err := DeployRegistry(opts, backend); err != nil { + return nil, errors.Wrap(err, REGISTRY) + } else { + logger.Info(fmt.Sprintf("Deploying Registry at %s...", address)) + txPool.AppendTx(tx, nil) + gov.address.Registry, gov.Registry = address, contract + } + + // deploy imps + logger.Info("Deploy Logic Contracts...") + if impAddress.Gov, err = deployLogic(txPool, DeployGovImp); err != nil { + return nil, errors.Wrap(err, GOV_IMP) + } else if impAddress.Staking, err = deployLogic(txPool, DeployStakingImp); err != nil { + return nil, errors.Wrap(err, STAKING_IMP) + } else if impAddress.BallotStorage, err = deployLogic(txPool, DeployBallotStorageImp); err != nil { + return nil, errors.Wrap(err, BALLOTSTORAGE_IMP) + } else if impAddress.EnvStorage, err = deployLogic(txPool, DeployEnvStorageImp); err != nil { + return nil, errors.Wrap(err, ENVSTORAGE_IMP) + } else if impAddress.NCPExit, err = deployLogic(txPool, DeployNCPExitImp); err != nil { + return nil, errors.Wrap(err, NCPEXIT_IMP) + } else if err = txPool.WaitMined(); err != nil { + return nil, err + } + + // deploy proxies + logger.Info("Deploy Governance Contracts...") + if gov.address.Gov, gov.Gov, err = deployProxy(txPool, impAddress.Gov, DeployGov); err != nil { + return nil, errors.Wrap(err, GOV) + } else if gov.address.Staking, gov.Staking, err = deployProxy(txPool, impAddress.Staking, DeployStaking); err != nil { + return nil, errors.Wrap(err, STAKING) + } else if gov.address.BallotStorage, gov.BallotStorage, err = deployProxy(txPool, impAddress.BallotStorage, DeployBallotStorage); err != nil { + return nil, errors.Wrap(err, BALLOTSTORAGE) + } else if gov.address.EnvStorage, gov.EnvStorage, err = deployProxy(txPool, impAddress.EnvStorage, DeployEnvStorage); err != nil { + return nil, errors.Wrap(err, ENVSTORAGE) + } else if gov.address.NCPExit, gov.NCPExit, err = deployProxy(txPool, impAddress.NCPExit, DeployNCPExit); err != nil { + return nil, errors.Wrap(err, NCPEXIT) + } else if err = txPool.WaitMined(); err != nil { + return nil, err + } else { + optionDomains[DOMAIN_Gov] = gov.address.Gov + optionDomains[DOMAIN_Staking] = gov.address.Staking + optionDomains[DOMAIN_BallotStorage] = gov.address.BallotStorage + optionDomains[DOMAIN_EnvStorage] = gov.address.EnvStorage + optionDomains[DOMAIN_NCPExit] = gov.address.NCPExit + } + + // setup registry + logger.Info("Setting Domains...") + for name, address := range optionDomains { + if err := txPool.AppendTx(gov.Registry.SetContractDomain(opts, metclient.ToBytes32(name), address)); err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("SetContractDomain(%s)", name)) + } + } + if err := txPool.WaitMined(); err != nil { + return nil, err + } + + // init impContracts + if gov.GovImp, err = NewGovImp(gov.address.Gov, backend); err != nil { + return nil, errors.Wrap(err, GOV_IMP) + } else if gov.StakingImp, err = NewStakingImp(gov.address.Staking, backend); err != nil { + return nil, errors.Wrap(err, STAKING_IMP) + } else if gov.BallotStorageImp, err = NewBallotStorageImp(gov.address.BallotStorage, backend); err != nil { + return nil, errors.Wrap(err, BALLOTSTORAGE_IMP) + } else if gov.EnvStorageImp, err = NewEnvStorageImp(gov.address.EnvStorage, backend); err != nil { + return nil, errors.Wrap(err, ENVSTORAGE_IMP) + } else if gov.NCPExitImp, err = NewNCPExitImp(gov.address.NCPExit, backend); err != nil { + return nil, errors.Wrap(err, NCPEXIT_IMP) + } else { + return gov, nil + } +} + +func ExecuteInitialize(gov *GovContracts, opts *bind.TransactOpts, backend iBackend, lockAmount *big.Int, envConfig InitEnvStorage, members InitMembers) error { + if lockAmount.Cmp(envConfig.STAKING_MIN) < 0 || lockAmount.Cmp(envConfig.STAKING_MAX) > 0 { + return fmt.Errorf("invalid lock amount, input:%v, min:%v, max:%v", lockAmount, envConfig.STAKING_MIN, envConfig.STAKING_MAX) + } + + var ( + registryAddress = gov.address.Registry + logger = log.New("func", "ExecuteInitialize") + txPool = &txPool{backend: backend, logger: logger, opts: opts, txs: make([]*types.Transaction, 0)} + ) + + logger.Info("Initializing Staking...") + if err := txPool.AppendTx(gov.StakingImp.Init(opts, registryAddress, members.StakingInit())); err != nil { + return errors.Wrap(err, "StakingImp.Init") + } + + logger.Info("Initializing BallotStorage...") + if err := txPool.AppendTx(gov.BallotStorageImp.Initialize(opts, registryAddress)); err != nil { + return errors.Wrap(err, "BallotStorageImp.Initialize") + } + + logger.Info("Initializing NCPExit...") + if err := txPool.AppendTx(gov.NCPExitImp.Initialize(opts, registryAddress)); err != nil { + return errors.Wrap(err, "NCPExitImp.Initialize") + } + + logger.Info("Initializing EnvStorage...") + envNames, envValues := envConfig.Args() + if err := txPool.AppendTx(gov.EnvStorageImp.Initialize(opts, registryAddress, envNames, envValues)); err != nil { + return errors.Wrap(err, "EnvStorageImp.Initialize") + } + if err := txPool.WaitMined(); err != nil { + return err + } + + logger.Info("Initializing Gov...") + if datas, err := members.GovInitOnce(); err != nil { + return errors.Wrap(err, "members.GovInitOnce") + } else if err := txPool.AppendTx(gov.GovImp.InitOnce(opts, registryAddress, lockAmount, datas)); err != nil { + return errors.Wrap(err, "GovImp.InitOnce") + } else { + return txPool.WaitMined() + } +} + +func (gov *GovContracts) Address() struct { + Registry common.Address + Gov common.Address + Staking common.Address + BallotStorage common.Address + EnvStorage common.Address + NCPExit common.Address +} { + return gov.address +} + +func (src *GovContracts) Equal(dst *GovContracts) bool { + return reflect.DeepEqual(src.address, dst.address) +} + +func GetGovContractsByOwner(opts *bind.CallOpts, backend bind.ContractBackend, owner common.Address) (*GovContracts, error) { + address, _, err := GetRegistryByOwner(opts, backend, owner) + if err != nil { + return nil, err + } + return NewGovContracts(backend, address) +} + +func GetRegistryByOwner(opts *bind.CallOpts, backend bind.ContractBackend, owner common.Address) (common.Address, *Registry, error) { + for i := uint64(0); i < 10; i++ { + address := crypto.CreateAddress(owner, i) + registry, err := GetRegistryByAddress(opts, backend, address) + if err == nil { + return address, registry, nil + } + } + return common.Address{}, nil, errors.Wrap(ethereum.NotFound, REGISTRY) +} + +func GetRegistryByAddress(opts *bind.CallOpts, backend bind.ContractBackend, address common.Address) (*Registry, error) { + if registry, err := NewRegistry(address, backend); err != nil { + return nil, err + } else if callMagic, err := registry.Magic(opts); err != nil { + return nil, err + } else if callMagic != nil && magic.Cmp(callMagic) == 0 { + return registry, nil + } else { + return nil, ethereum.NotFound + } +} + +// ////////////////////// +// InitEnvStorage // +// ////////////////////// + +type InitEnvStorage struct { + BLOCKS_PER *big.Int `name:"blocksPer"` + BALLOT_DURATION_MIN *big.Int `name:"ballotDurationMin"` + BALLOT_DURATION_MAX *big.Int `name:"ballotDurationMax"` + STAKING_MIN *big.Int `name:"stakingMin"` + STAKING_MAX *big.Int `name:"stakingMax"` + MAX_IDLE_BLOCK_INTERVAL *big.Int `name:"MaxIdleBlockInterval"` + BLOCK_CREATION_TIME *big.Int `name:"blockCreationTime"` + BLOCK_REWARD_AMOUNT *big.Int `name:"blockRewardAmount"` + MAX_PRIORITY_FEE_PER_GAS *big.Int `name:"maxPriorityFeePerGas"` + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER *big.Int `name:"blockRewardDistributionBlockProducer"` + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD *big.Int `name:"blockRewardDistributionStakingReward"` + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM *big.Int `name:"blockRewardDistributionEcosystem"` + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE *big.Int `name:"blockRewardDistributionMaintenance"` + MAX_BASE_FEE *big.Int `name:"maxBaseFee"` + BLOCK_GASLIMIT *big.Int `name:"blockGasLimit"` + BASE_FEE_MAX_CHANGE_RATE *big.Int `name:"baseFeeMaxChangeRate"` + GAS_TARGET_PERCENTAGE *big.Int `name:"gasTargetPercentage"` +} + +func (cfg InitEnvStorage) Args() (names [][32]byte, values []*big.Int) { + v := reflect.ValueOf(cfg) + t := reflect.TypeOf(cfg) + numField := v.NumField() + names = [][32]byte{} + values = []*big.Int{} + for i := 0; i < numField; i++ { + value, ok := v.Field(i).Interface().(*big.Int) + if ok && value != nil && value.Sign() > 0 { + tag := t.Field(i).Tag.Get("name") + names = append(names, crypto.Keccak256Hash([]byte(tag))) + values = append(values, value) + } + } + return +} + +var DefaultInitEnvStorage = InitEnvStorage{ + BLOCKS_PER: big.NewInt(1), + BALLOT_DURATION_MIN: big.NewInt(86400), + BALLOT_DURATION_MAX: big.NewInt(604800), + STAKING_MIN: new(big.Int).Mul(big.NewInt(1500000), big.NewInt(params.Ether)), + STAKING_MAX: new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 256), common.Big1), // type(uint256).max + MAX_IDLE_BLOCK_INTERVAL: big.NewInt(5), + BLOCK_CREATION_TIME: big.NewInt(1000), + BLOCK_REWARD_AMOUNT: new(big.Int).Mul(big.NewInt(1), big.NewInt(params.Ether)), + MAX_PRIORITY_FEE_PER_GAS: new(big.Int).Mul(big.NewInt(100), big.NewInt(params.GWei)), + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER: big.NewInt(5000), + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD: big.NewInt(0), + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM: big.NewInt(2500), + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE: big.NewInt(2500), + MAX_BASE_FEE: new(big.Int).Mul(big.NewInt(5000), big.NewInt(params.GWei)), + BLOCK_GASLIMIT: big.NewInt(1050000000), + BASE_FEE_MAX_CHANGE_RATE: big.NewInt(46), + GAS_TARGET_PERCENTAGE: big.NewInt(30), +} + +// ///////////////////////// +// Init Governance Member // +// ///////////////////////// +type InitMember struct { + Staker common.Address `json:"staker"` + Voter common.Address `json:"voter"` + Reward common.Address `json:"reward"` + Name string `json:"name"` + Enode string `json:"enode"` + Ip string `json:"ip"` + Port int `json:"port"` + Deposit *big.Int `json:"deposit"` +} + +type InitMembers []InitMember + +func (members InitMembers) GovInitOnce() ([]byte, error) { + var datas bytes.Buffer + for _, m := range members { + var ( + staker, voter, reward *big.Int + id []byte + err error + ) + staker = new(big.Int).SetBytes(m.Staker[:]) + voter = new(big.Int).SetBytes(m.Voter[:]) + reward = new(big.Int).SetBytes(m.Reward[:]) + switch len(m.Enode) { + case 128: + id, err = hex.DecodeString(m.Enode) + case 130: + id, err = hex.DecodeString(m.Enode[2:]) + default: + err = fmt.Errorf("invalid enode id %s", m.Enode) + } + if err != nil { + return nil, err + } + + datas.Write(metclient.PackNum(reflect.ValueOf(staker))) + datas.Write(metclient.PackNum(reflect.ValueOf(voter))) + datas.Write(metclient.PackNum(reflect.ValueOf(reward))) + datas.Write(metclient.PackNum(reflect.ValueOf(len(m.Name)))) + datas.Write([]byte(m.Name)) + datas.Write(metclient.PackNum(reflect.ValueOf(len(id)))) + datas.Write(id) + datas.Write(metclient.PackNum(reflect.ValueOf(len(m.Ip)))) + datas.Write([]byte(m.Ip)) + datas.Write(metclient.PackNum(reflect.ValueOf(m.Port))) + } + + return datas.Bytes(), nil +} + +func (members InitMembers) StakingInit() []byte { + var datas bytes.Buffer + for _, m := range members { + staker := new(big.Int).SetBytes(m.Staker[:]) + datas.Write(metclient.PackNum(reflect.ValueOf(staker))) + datas.Write(metclient.PackNum(reflect.ValueOf(m.Deposit))) + } + return datas.Bytes() +} + +// //////// +// utils // +// //////// + +type uupsConfig struct { + backend bind.ContractBackend + callOpts *bind.CallOpts + registry *Registry +} + +func newUUPSContracts[P, L any]( + cfg *uupsConfig, + name string, + newProxy func(common.Address, bind.ContractBackend) (*P, error), + newLogic func(common.Address, bind.ContractBackend) (*L, error), +) (common.Address, *P, *L, error) { + if address, err := cfg.registry.GetContractAddress(cfg.callOpts, metclient.ToBytes32(name)); err != nil { + return common.Address{}, nil, nil, errors.Wrap(err, "GetContractAddress") + } else if proxy, err := newProxy(address, cfg.backend); err != nil { + return common.Address{}, nil, nil, errors.Wrap(err, "newProxy") + } else if imp, err := newLogic(address, cfg.backend); err != nil { + return common.Address{}, nil, nil, errors.Wrap(err, "newLogic") + } else { + return address, proxy, imp, nil + } +} + +type iBackend interface { + bind.ContractBackend + bind.DeployBackend +} + +type txPool struct { + backend iBackend + logger log.Logger + opts *bind.TransactOpts + txs []*types.Transaction +} + +func (pool *txPool) WaitMined() error { + pool.logger.Info("Waiting for receipts...", "count", len(pool.txs)) + + ctx, cancel := context.WithTimeout(context.Background(), 5e9) + defer cancel() + for _, tx := range pool.txs { + receipt, err := bind.WaitMined(ctx, pool.backend, tx) + if err != nil { + return err + } + if receipt.Status != types.ReceiptStatusSuccessful { + return errors.New("execute reverted") + } + } + pool.txs = pool.txs[:0] + return nil +} + +func (pool *txPool) AppendTx(tx *types.Transaction, err error) error { + if tx != nil { + pool.txs = append(pool.txs, tx) + } + return err +} + +func deployProxy[T any](pool *txPool, logic common.Address, deploy func(*bind.TransactOpts, bind.ContractBackend, common.Address) (common.Address, *types.Transaction, *T, error)) (common.Address, *T, error) { + address, tx, proxy, err := deploy(pool.opts, pool.backend, logic) + return address, proxy, pool.AppendTx(tx, err) +} + +func deployLogic[T any](pool *txPool, deploy func(*bind.TransactOpts, bind.ContractBackend) (common.Address, *types.Transaction, *T, error)) (common.Address, error) { + address, tx, _, err := deploy(pool.opts, pool.backend) + return address, pool.AppendTx(tx, err) +} diff --git a/wemix/contracts/WemixGovernance.js b/wemix/contracts/WemixGovernance.js deleted file mode 100644 index 964906693af9..000000000000 --- a/wemix/contracts/WemixGovernance.js +++ /dev/null @@ -1,644 +0,0 @@ -var Gov_data = "0x608060405234801561001057600080fd5b506040516106fc3803806106fc83398101604081905261002f91610301565b80604051806020016040528060008152506100528282600061005a60201b60201c565b5050506103a5565b61006383610090565b6000825111806100705750805b1561008b5761008983836100d060201b61008b1760201c565b505b505050565b610099816100fc565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100f583836040518060600160405280602781526020016106d5602791396101ce565b9392505050565b61010f8161024760201b6100b71760201c565b6101765760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101ad7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61025660201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101eb919061032a565b600060405180830381855af49150503d8060008114610226576040519150601f19603f3d011682016040523d82523d6000602084013e61022b565b606091505b50909250905061023d86838387610259565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102c55782516102be576001600160a01b0385163b6102be5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161016d565b50816102cf565b6102cf83836102d7565b949350505050565b8151156102e75781518083602001fd5b8060405162461bcd60e51b815260040161016d9190610346565b60006020828403121561031357600080fd5b81516001600160a01b03811681146100f557600080fd5b6000825161033c818460208701610379565b9190910192915050565b6020815260008251806020840152610365816040850160208701610379565b601f01601f19169190910160400192915050565b60005b8381101561039457818101518382015260200161037c565b838111156100895750506000910152565b610321806103b46000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102c560279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161013d9190610245565b600060405180830381855af49150503d8060008114610178576040519150601f19603f3d011682016040523d82523d6000602084013e61017d565b606091505b509150915061018e86838387610198565b9695505050505050565b60608315610209578251610202576001600160a01b0385163b6102025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610213565b610213838361021b565b949350505050565b81511561022b5781518083602001fd5b8060405162461bcd60e51b81526004016101f99190610261565b60008251610257818460208701610294565b9190910192915050565b6020815260008251806020840152610280816040850160208701610294565b601f01601f19169190910160400192915050565b60005b838110156102af578181015183820152602001610297565b838111156102be576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207465332dc618a2f5eb63fb7bbbf1a8bdc5122d00040dba21b4a8ec1e9ece14cc64736f6c63430008060033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564"; -var Gov_contract = web3.eth.contract([{"inputs":[{"internalType":"address","name":"_imp","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]); - -function Gov_new() { - return Gov_contract.new( - { - from: web3.eth.accounts[0], - data: Gov_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Gov_load(addr) { - return Gov_contract.at(addr); -} -var GovChecker_data = "0x608060405234801561001057600080fd5b5061044a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063715018a61161008c5780638da5cb5b116100665780638da5cb5b146101b05780639986e4b9146101c1578063a91ee0dc146101d8578063f2fde38b146101eb57600080fd5b8063715018a614610167578063738fdd1a146101715780637bf465301461019c57600080fd5b80631e0cba0d146100d45780632f40992e146100f857806334125c841461010c5780634bd1ed761461011f5780635a731cca146101345780636c78d2cf1461014b575b600080fd5b6100e5665374616b696e6760c81b81565b6040519081526020015b60405180910390f35b6100e56914995dd85c99141bdbdb60b21b81565b6100e56845636f73797374656d60b81b81565b6100e56a4d61696e74656e616e636560a81b81565b6100e56c14dd185ada5b99d4995dd85c99609a1b81565b6100e57111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b61016f6101fe565b005b606554610184906001600160a01b031681565b6040516001600160a01b0390911681526020016100ef565b6100e569456e7653746f7261676560b01b81565b6033546001600160a01b0316610184565b6100e56c42616c6c6f7453746f7261676560981b81565b61016f6101e63660046103e4565b610212565b61016f6101f93660046103e4565b6102bf565b610206610338565b6102106000610392565b565b61021a610338565b6001600160a01b0381166102755760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064015b60405180910390fd5b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b6102c7610338565b6001600160a01b03811661032c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161026c565b61033581610392565b50565b6033546001600160a01b031633146102105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161026c565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156103f657600080fd5b81356001600160a01b038116811461040d57600080fd5b939250505056fea2646970667358221220b535bc527ced07912974506f7ab75828bfc3ac177e8912e3fd2555b419df60db64736f6c63430008060033"; -var GovChecker_contract = web3.eth.contract([{"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":"addr","type":"address"}],"name":"SetRegistry","type":"event"},{"inputs":[],"name":"BALLOT_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ENV_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTENANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_POOL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reg","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]); - -function GovChecker_new() { - return GovChecker_contract.new( - { - from: web3.eth.accounts[0], - data: GovChecker_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function GovChecker_load(addr) { - return GovChecker_contract.at(addr); -} -var GovImp_data = "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000ea565b600054610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e8576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c6177ba6200012560003960008181611dac01528181611dec015281816127380152818161277801526127f401526177ba6000f3fe6080604052600436106104515760003560e01c8063738fdd1a1161023f578063c00ace6c11610139578063d07bff0c116100b6578063e27bdaef1161007a578063e27bdaef14610f5d578063e75235b814610f7d578063e9523fb514610f92578063f2fde38b14610fa8578063f38ecf4714610fc857600080fd5b8063d07bff0c14610ec7578063d13a174414610efd578063d6f9cfce14610f1d578063d965ea0014610f33578063de09b37714610f4857600080fd5b8063c9d27afe116100fd578063c9d27afe14610e0f578063ce04b9d414610e2f578063ce6a54ff14610e44578063ce93a23614610e7a578063cec5b62214610e9a57600080fd5b8063c00ace6c14610d0b578063c0b4fe1514610d3f578063c42a0abc14610d73578063c6713baf14610da7578063c7d3da3414610ddb57600080fd5b8063a6868b7d116101c7578063aaf0dd361161018b578063aaf0dd3614610c3f578063ab3545e514610c6c578063af08557e14610ca2578063af6af2ff14610cc2578063b128f88014610cd757600080fd5b8063a6868b7d14610b5f578063a7771ee314610b93578063a8915a3e14610bcb578063a91ee0dc14610beb578063a9b629b214610c0b57600080fd5b80638da5cb5b1161020e5780638da5cb5b14610aba578063918f867414610ad85780639986e4b914610aee578063a0c1268314610b12578063a230c52414610b3f57600080fd5b8063738fdd1a14610a2f5780637b2bfb0114610a4f5780637bf4653014610a835780637d10dd1b14610aa457600080fd5b80633f35c8fe116103505780636167eb45116102d85780636f1e85331161029c5780636f1e8533146109795780636f6de96d146109b15780636fde207a146109d1578063715018a614610a0557806372016f7514610a1a57600080fd5b80636167eb451461089f578063656e3052146108d35780636ba99181146109075780636c78d2cf1461091c5780636d583ca71461094557600080fd5b80634f0f4aa91161031f5780634f0f4aa91461080e5780634f1ef2861461083e57806352d1902d146108515780635a731cca146108665780635aaa40401461088a57600080fd5b80633f35c8fe1461076457806340690353146107985780634bd1ed76146107b85780634d273e28146107da57600080fd5b80631e0cba0d116103de57806334125c84116103a257806334125c84146106b0578063351bacda146106d05780633659cfe6146106f057806336e83d8314610710578063382944191461073057600080fd5b80631e0cba0d146105f3578063238737b614610611578063278bb12a146106455780632f40992e146106795780633310569c1461069a57600080fd5b806315bf6b4d1161042557806315bf6b4d1461051e57806316fbe8311461056c5780631c12b030146105835780631c150171146105a85780631c4b774b146105bd57600080fd5b806215a73b146104565780630b1d39b81461049d5780630efa4909146104d1578063139d9dd3146104f1575b600080fd5b34801561046257600080fd5b5061048a7f0c4fbe9dc9de15dd7c0d064975ee1a2f2f9b954fa0e65d4f6cddba94884bdc3e81565b6040519081526020015b60405180910390f35b3480156104a957600080fd5b5061048a7fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d81565b3480156104dd57600080fd5b5061048a6104ec366004616ab6565b610ffc565b3480156104fd57600080fd5b5061048a61050c36600461694f565b60a86020526000908152604090205481565b34801561052a57600080fd5b50610554610539366004616ea5565b6000908152607060205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610494565b34801561057857600080fd5b50610581611346565b005b34801561058f57600080fd5b50610598611685565b6040519015158152602001610494565b3480156105b457600080fd5b5061048a6116d6565b3480156105c957600080fd5b506105546105d8366004616ea5565b6000908152606a60205260409020546001600160a01b031690565b3480156105ff57600080fd5b5061048a665374616b696e6760c81b81565b34801561061d57600080fd5b5061048a7f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27881565b34801561065157600080fd5b5061048a7f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2281565b34801561068557600080fd5b5061048a6914995dd85c99141bdbdb60b21b81565b3480156106a657600080fd5b5061048a60a75481565b3480156106bc57600080fd5b5061048a6845636f73797374656d60b81b81565b3480156106dc57600080fd5b506105816106eb366004616b0e565b611755565b3480156106fc57600080fd5b5061058161070b36600461694f565b611da1565b34801561071c57600080fd5b5061048a61072b366004616e20565b611e87565b34801561073c57600080fd5b5061048a7fbe90e461bbdb9a95a694f7796912ea04244caf7f5b60ad7ded17e16821d3e44c81565b34801561077057600080fd5b5061048a7f2a268972a70c8c688b62366bdfdd9bb09cf19d3e5b6e7e7bb158e671ffdcedd281565b3480156107a457600080fd5b5061048a6107b3366004616da2565b61229e565b3480156107c457600080fd5b5061048a6a4d61696e74656e616e636560a81b81565b3480156107e657600080fd5b5061048a7f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088881565b34801561081a57600080fd5b5061082e610829366004616ea5565b612550565b60405161049494939291906170b4565b61058161084c366004616a67565b61272d565b34801561085d57600080fd5b5061048a6127e7565b34801561087257600080fd5b5061048a6c14dd185ada5b99d4995dd85c99609a1b81565b34801561089657600080fd5b5061048a61289a565b3480156108ab57600080fd5b5061048a7f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505081565b3480156108df57600080fd5b5061048a7fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e781565b34801561091357600080fd5b506105816128dc565b34801561092857600080fd5b5061048a7111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b34801561095157600080fd5b5061048a7fc69fc6b7d0efc934fd5a3581c7253a7107a952526bb6dbcd814ef8d8dae1f44a81565b34801561098557600080fd5b5061059861099436600461694f565b6001600160a01b03166000908152606d6020526040902054151590565b3480156109bd57600080fd5b506105546109cc36600461694f565b6129d9565b3480156109dd57600080fd5b5061048a7f0b09c9badbbeb6c813a598ee910770a39ccda797a1940439bb6e47fc6c87548b81565b348015610a1157600080fd5b50610581612a48565b348015610a2657600080fd5b5060715461048a565b348015610a3b57600080fd5b50606554610554906001600160a01b031681565b348015610a5b57600080fd5b5061048a7f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa81565b348015610a8f57600080fd5b5061048a69456e7653746f7261676560b01b81565b348015610ab057600080fd5b5061048a60665481565b348015610ac657600080fd5b506033546001600160a01b0316610554565b348015610ae457600080fd5b5061048a61271081565b348015610afa57600080fd5b5061048a6c42616c6c6f7453746f7261676560981b81565b348015610b1e57600080fd5b5061048a610b2d36600461694f565b606d6020526000908152604090205481565b348015610b4b57600080fd5b50610598610b5a36600461694f565b612a5c565b348015610b6b57600080fd5b5061048a7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b81565b348015610b9f57600080fd5b50610598610bae36600461694f565b6001600160a01b0316600090815260686020526040902054151590565b348015610bd757600080fd5b50610581610be6366004616b66565b612a9f565b348015610bf757600080fd5b50610581610c0636600461694f565b612f0f565b348015610c1757600080fd5b5061048a7f89dd490ecaf395283ed4ff2fd9557ca767fc425dce063451a9b0da6d72f600c381565b348015610c4b57600080fd5b5061048a610c5a36600461694f565b606b6020526000908152604090205481565b348015610c7857600080fd5b50610554610c87366004616ea5565b6000908152606c60205260409020546001600160a01b031690565b348015610cae57600080fd5b50610581610cbd366004616c72565b612fb7565b348015610cce57600080fd5b5061048a61322a565b348015610ce357600080fd5b5061048a7f829561ab7af084b7efc6600518d2df79b8d95f3f4c3a550f54f8f7ec7d2b805781565b348015610d1757600080fd5b5061048a7f18ad4415ef4a621ce1a136395c51ab6c3712bb2e24b79d526059925cea58dcb881565b348015610d4b57600080fd5b5061048a7f8086da5becff4dfac91a3105821b361078d2d4abba0ccc2401b974cf0dcf05c181565b348015610d7f57600080fd5b5061048a7fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747381565b348015610db357600080fd5b5061048a7fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6081565b348015610de757600080fd5b5061048a7f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc81565b348015610e1b57600080fd5b50610581610e2a366004616ebe565b61326c565b348015610e3b57600080fd5b5061048a613422565b348015610e5057600080fd5b5061048a610e5f36600461694f565b6001600160a01b03166000908152606f602052604090205490565b348015610e8657600080fd5b5061048a610e95366004616e54565b613464565b348015610ea657600080fd5b5061048a610eb536600461694f565b60686020526000908152604090205481565b348015610ed357600080fd5b50610554610ee2366004616ea5565b6000908152606760205260409020546001600160a01b031690565b348015610f0957600080fd5b5061048a610f18366004616c12565b61390b565b348015610f2957600080fd5b5061048a60725481565b348015610f3f57600080fd5b5060695461048a565b348015610f5457600080fd5b5060745461048a565b348015610f6957600080fd5b50610581610f78366004616ea5565b613c6b565b348015610f8957600080fd5b5061138961048a565b348015610f9e57600080fd5b5061048a60735481565b348015610fb457600080fd5b50610581610fc336600461694f565b613cf1565b348015610fd457600080fd5b5061048a7f7c1150f0e1a39ff55552d52764f97e6c387e2a247e1df344369f122c4254be2f81565b6000611006613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b15801561104757600080fd5b505afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190616d27565b6110a45760405162461bcd60e51b815260040161109b90617288565b60405180910390fd5b60006110af336129d9565b90506110b961289a565b6110c282613d87565b111580156110df57506110d361322a565b6110dc82613d87565b10155b6110fb5760405162461bcd60e51b815260040161109b9061739b565b6001600160a01b0385166111515760405162461bcd60e51b815260206004820152601d60248201527f496d706c656d656e746174696f6e2063616e6e6f74206265207a65726f000000604482015260640161109b565b611159613e0d565b6001600160a01b0316856001600160a01b031614156111b25760405162461bcd60e51b815260206004820152601560248201527453616d6520636f6e7472616374206164647265737360581b604482015260640161109b565b846001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111eb57600080fd5b505afa92505050801561121b575060408051601f3d908101601f1916820190925261121891810190616d44565b60015b6112375760405162461bcd60e51b815260040161109b906172dd565b6000805160206176fe83398151915281146112645760405162461bcd60e51b815260040161109b906171f1565b506072546112739060016175e0565b915061127d613e29565b6001600160a01b0316630a3a63fe607254600161129a91906175e0565b60046040516001600160e01b031960e085901b16815260048101929092526024820152604481018690523360648201526001600160a01b038816608482015260a401602060405180830381600087803b1580156112f657600080fd5b505af115801561130a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132e9190616d44565b506113398285613e44565b5060728190559392505050565b600054600290610100900460ff16158015611368575060005460ff8083169116105b6113845760405162461bcd60e51b815260040161109b9061723a565b6000805461ffff191660ff8316176101001790556113a0613eaf565b60005b606954811015611651576000818152606e60205260408082208151608081019092528054829082906113d49061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546114009061765d565b801561144d5780601f106114225761010080835404028352916020019161144d565b820191906000526020600020905b81548152906001019060200180831161143057829003601f168201915b505050505081526020016001820180546114669061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546114929061765d565b80156114df5780601f106114b4576101008083540402835291602001916114df565b820191906000526020600020905b8154815290600101906020018083116114c257829003601f168201915b505050505081526020016002820180546114f89061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546115249061765d565b80156115715780601f1061154657610100808354040283529160200191611571565b820191906000526020600020905b81548152906001019060200180831161155457829003601f168201915b505050505081526020016003820154815250509050600160a9826000015160405161159c9190617010565b90815260405160209181900382018120805460ff19169315159390931790925582015160019160aa916115ce91617010565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160ab60008360400151846060015160405160200161161492919061702c565b60408051808303601f19018152918152815160209283012083529082019290925201600020805460ff1916911515919091179055506001016113a3565b506000805461ff001916905560405160ff8216815260008051602061771e833981519152906020015b60405180910390a150565b60006074546000146116d057600061169e607454613f09565b5091505060006116af607454613fa0565b5091505060028214156116cd57428110156116cd5760009250505090565b50505b50600190565b60006116e061402a565b6001600160a01b03166333be496e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171857600080fd5b505afa15801561172c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117509190616d44565b905090565b600054610100900460ff16158080156117755750600054600160ff909116105b8061178f5750303b15801561178f575060005460ff166001145b6117ab5760405162461bcd60e51b815260040161109b9061723a565b6000805460ff1916600117905580156117ce576000805461ff0019166101001790555b6117d6614042565b6117de614071565b6117e784612f0f565b4360665560006117f56140a0565b90506117ff61322a565b841015801561181557508361181261289a565b10155b6118315760405162461bcd60e51b815260040161109b9061732b565b600080600060608060606000806000905060008060208d0191508c518261185891906175e0565b90505b80821015611d5357815199506118726020836175e0565b915080821061188057600080fd5b8151985061188f6020836175e0565b915080821061189d57600080fd5b815197506118ac6020836175e0565b91508082106118ba57600080fd5b819650865160206118cb91906175e0565b6118d590836175e0565b91508082106118e357600080fd5b819550855160206118f491906175e0565b6118fe90836175e0565b915080821061190c57600080fd5b8194508451602061191d91906175e0565b61192790836175e0565b915080821061193557600080fd5b815193506119446020836175e0565b91506119516001846175e0565b925061195c8a612a5c565b15801561196f575061196d89612a5c565b155b6119ac5760405162461bcd60e51b815260206004820152600e60248201526d20b63932b0b23c9036b2b6b132b960911b604482015260640161109b565b886067600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606860008b6001600160a01b03166001600160a01b031681526020019081526020016000208190555087606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606b60008a6001600160a01b03166001600160a01b031681526020019081526020016000208190555089606c600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606d60008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055508d8b6001600160a01b03166325d998bb8c6040518263ffffffff1660e01b8152600401611b0e91906001600160a01b0391909116815260200190565b60206040518083038186803b158015611b2657600080fd5b505afa158015611b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5e9190616d44565b1015611ba35760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207374616b696e6760601b604482015260640161109b565b611baf878787876140b5565b611bcb5760405162461bcd60e51b815260040161109b906172af565b611bd58a8f614164565b6000838152606e6020908152604090912088519091611bf89183918b01906165d0565b508651611c0e90600183019060208a01906165d0565b508551611c2490600283019060208901906165d0565b50848160030181905550600160a989604051611c409190617010565b908152604051908190036020018120805492151560ff199093169290921790915560019060aa90611c72908a90617010565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160ab60008888604051602001611cb092919061702c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055508a6070600086815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555083606f60008d6001600160a01b03166001600160a01b03168152602001908152602001600020819055505061185b565b50506069819055607155505086159550611d9b945050505050576000805461ff00191690556040516001815260008051602061771e8339815191529060200160405180910390a15b50505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415611dea5760405162461bcd60e51b815260040161109b90617112565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611e1c613e0d565b6001600160a01b031614611e425760405162461bcd60e51b815260040161109b906171a5565b611e4b816141a3565b611e848160005b6040519080825280601f01601f191660200182016040528015611e7c576020820181803683370190505b506000614240565b50565b6000611e91613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b158015611ed257600080fd5b505afa158015611ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0a9190616d27565b611f265760405162461bcd60e51b815260040161109b90617288565b6000611f31336129d9565b60a7546001600160a01b038216600090815260a8602052604090205491925090611f5b904261761a565b1015611f795760405162461bcd60e51b815260040161109b9061741d565b6000611f84336129d9565b9050611f8e61289a565b611f9782613d87565b11158015611fb45750611fa861322a565b611fb182613d87565b10155b611fd05760405162461bcd60e51b815260040161109b9061739b565b602084015184906001600160a01b031661201c5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103b37ba32b960991b604482015260640161109b565b6000816060015151116120655760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206e6f6465206e616d6560781b604482015260640161109b565b60008160a0015151116120ac5760405162461bcd60e51b815260206004820152600f60248201526e0496e76616c6964206e6f646520495608c1b604482015260640161109b565b60008160c00151116120f45760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b9bd919481c1bdc9d607a1b604482015260640161109b565b6120fc61322a565b8160e001511015801561211a575061211261289a565b8160e0015111155b61215c5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac8105b5bdd5b9d606a1b604482015260640161109b565b845161216790612a5c565b156121a55760405162461bcd60e51b815260206004820152600e60248201526d20b63932b0b23c9036b2b6b132b960911b604482015260640161109b565b84602001516001600160a01b031685600001516001600160a01b0316146122045760405162461bcd60e51b815260206004820152601360248201527229ba30b5b2b91034b9903737ba103b37ba32b960691b604482015260640161109b565b612220856060015186608001518760a001518860c001516140b5565b61223c5760405162461bcd60e51b815260040161109b906172af565b60725461224a9060016175e0565b935061225b84600133600089614336565b612269848660e001516143d9565b61227884866101000151613e44565b505060728290556001600160a01b0316600090815260a860205260409020429055919050565b60006122a8613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b1580156122e957600080fd5b505afa1580156122fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123219190616d27565b61233d5760405162461bcd60e51b815260040161109b90617288565b6000612348336129d9565b60a7546001600160a01b038216600090815260a8602052604090205491925090612372904261761a565b10156123905760405162461bcd60e51b815260040161109b9061741d565b600061239b336129d9565b90506123a561289a565b6123ae82613d87565b111580156123cb57506123bf61322a565b6123c882613d87565b10155b6123e75760405162461bcd60e51b815260040161109b9061739b565b866001111580156123f9575060098711155b6124345760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964207479706560a01b604482015260640161109b565b61243e8887614417565b61247a5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642076616c756560981b604482015260640161109b565b6072546124889060016175e0565b9250612492613e29565b6001600160a01b0316634a57823e84600587338d8d8d6040518863ffffffff1660e01b81526004016124ca97969594939291906174f1565b602060405180830381600087803b1580156124e457600080fd5b505af11580156124f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251c9190616d44565b506125278386613e44565b5060728290556001600160a01b0316600090815260a86020526040902042905595945050505050565b6000818152606e60205260408120600381015481546060938493849391929091600183019160028401919084906125869061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546125b29061765d565b80156125ff5780601f106125d4576101008083540402835291602001916125ff565b820191906000526020600020905b8154815290600101906020018083116125e257829003601f168201915b505050505093508280546126129061765d565b80601f016020809104026020016040519081016040528092919081815260200182805461263e9061765d565b801561268b5780601f106126605761010080835404028352916020019161268b565b820191906000526020600020905b81548152906001019060200180831161266e57829003601f168201915b5050505050925081805461269e9061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546126ca9061765d565b80156127175780601f106126ec57610100808354040283529160200191612717565b820191906000526020600020905b8154815290600101906020018083116126fa57829003601f168201915b5050505050915093509350935093509193509193565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156127765760405162461bcd60e51b815260040161109b90617112565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166127a8613e0d565b6001600160a01b0316146127ce5760405162461bcd60e51b815260040161109b906171a5565b6127d7826141a3565b6127e382826001614240565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146128875760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161109b565b506000805160206176fe83398151915290565b60006128a461402a565b6001600160a01b031663737c59b86040518163ffffffff1660e01b815260040160206040518083038186803b15801561171857600080fd5b6128e4613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b15801561292557600080fd5b505afa158015612939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295d9190616d27565b6129795760405162461bcd60e51b815260040161109b90617288565b612981611685565b156129c45760405162461bcd60e51b8152602060048201526013602482015272159bdd1a5b99c81a5cc81b9bdd08195b991959606a1b604482015260640161109b565b6074546129d29060046144a5565b6000607455565b6001600160a01b0381166000908152606d6020526040812054156129fb575090565b6001600160a01b03821660009081526068602052604090205415612a4357506001600160a01b038082166000908152606860209081526040808320548352606c909152902054165b919050565b612a50613eaf565b612a5a60006144e3565b565b6001600160a01b0381166000908152606d6020526040812054151580612a9957506001600160a01b03821660009081526068602052604090205415155b92915050565b600054610100900460ff1615808015612abf5750600054600160ff909116105b80612ad95750303b158015612ad9575060005460ff166001145b612af55760405162461bcd60e51b815260040161109b9061723a565b6000805460ff191660011790558015612b18576000805461ff0019166101001790555b60008611612b745760405162461bcd60e51b815260206004820152602360248201527f6c6f636b416d6f756e742073686f756c64206265206d6f7265207468656e207a60448201526265726f60e81b606482015260840161109b565b612b7c614042565b612b84614071565b612b8d87612f0f565b6000612b976140a0565b6040516325d998bb60e01b815233600482015290915087906001600160a01b038316906325d998bb9060240160206040518083038186803b158015612bdb57600080fd5b505afa158015612bef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c139190616d44565b1015612c585760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207374616b696e6760601b604482015260640161109b565b60405163282d3fdf60e01b8152336004820152602481018890526001600160a01b0382169063282d3fdf90604401600060405180830381600087803b158015612ca057600080fd5b505af1158015612cb4573d6000803e3d6000fd5b5050600160698190557f6bee784efeb983674392298ab585b22866bedf00ebb0eea949d1e66f3f50e71d8054336001600160a01b0319918216811790925560008281526068602090815260408083208690557ff585789965ba69220d5ce3dc1b444eb22ff546f2650694fef8fafe9c26560af98054851686179055606b82528083208690557fdcf345d7f6a8deb7427d0fee62009fa15100353a1c666b51bb5387b25addcfa98054909416909417909255606d82529182208390556071839055919052606e815288517f44e4f44bb0aae4b5d1e07207f82567d4201c1d09f6b5859dddcfb50647f55a709350612daf925083918a01906165d0565b508551612dc590600183019060208901906165d0565b508451612ddb90600283019060208801906165d0565b50838160030181905550600160a988604051612df79190617010565b908152604051908190036020018120805492151560ff199093169290921790915560019060aa90612e29908990617010565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160ab60008787604051602001612e6792919061702c565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff19169415159490941790935560715433808552606f83528385208290559084526070909152912080546001600160a01b03191690911790555050436066558015612f06576000805461ff00191690556040516001815260008051602061771e8339815191529060200160405180910390a15b50505050505050565b612f17613eaf565b6001600160a01b038116612f6d5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f000000000000604482015260640161109b565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b600054600390610100900460ff16158015612fd9575060005460ff8083169116105b612ff55760405162461bcd60e51b815260040161109b9061723a565b6000805461ffff191660ff831617610100179055613011613eaf565b60005b83518110156130a8576000818152606a602052604081205484516001600160a01b03909116919085906000198501908110613051576130516176ae565b6020908102919091018101516000858152606a8352604080822080546001600160a01b0319166001600160a01b039485169081179091558252606b9093528281208690559316835282209190915550600101613014565b506028600052606e60205260405160019060a9906130e7907f04079abe36e73820234ca7dbf98752b8db3cab495520d93e9301720bfccf3f4f9061704e565b90815260405160209181900382018120805460ff1916931515939093179092556028600052606e905260019060aa90613141907f04079abe36e73820234ca7dbf98752b8db3cab495520d93e9301720bfccf3f509061704e565b90815260405160209181900382018120805460ff19169315159390931790925560286000908152606e82527f04079abe36e73820234ca7dbf98752b8db3cab495520d93e9301720bfccf3f525460019360ab936131c2927f04079abe36e73820234ca7dbf98752b8db3cab495520d93e9301720bfccf3f519290910161705a565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff191694151594909417909355825461ff0019169092555160ff8316815260008051602061771e833981519152910160405180910390a1505050565b600061323461402a565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171857600080fd5b613274613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b1580156132b557600080fd5b505afa1580156132c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ed9190616d27565b6133095760405162461bcd60e51b815260040161109b90617288565b613311614535565b600061331c336129d9565b905061332661289a565b61332f82613d87565b1115801561334c575061334061322a565b61334982613d87565b10155b6133685760405162461bcd60e51b815260040161109b9061739b565b613370611685565b6133a65760405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b604482015260640161109b565b60006133b18461458f565b90506133bd84846146a4565b6000806133c98661477e565b925092505060006133d961138990565b905080831015806133ea5750808210155b806133ff57506133fa82846175e0565b612710145b1561341357613413878584861160006147b8565b50505050506127e36001607555565b600061342c61402a565b6001600160a01b0316631b27e01b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171857600080fd5b600061346e613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b1580156134af57600080fd5b505afa1580156134c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134e79190616d27565b6135035760405162461bcd60e51b815260040161109b90617288565b600061350e336129d9565b60a7546001600160a01b038216600090815260a8602052604090205491925090613538904261761a565b10156135565760405162461bcd60e51b815260040161109b9061741d565b6000613561336129d9565b905061356b61289a565b61357482613d87565b11158015613591575061358561322a565b61358e82613d87565b10155b6135ad5760405162461bcd60e51b815260040161109b9061739b565b602085015185906001600160a01b03166135f95760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103b37ba32b960991b604482015260640161109b565b6000816060015151116136425760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964206e6f6465206e616d6560781b604482015260640161109b565b60008160a0015151116136895760405162461bcd60e51b815260206004820152600f60248201526e0496e76616c6964206e6f646520495608c1b604482015260640161109b565b60008160c00151116136d15760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081b9bd919481c1bdc9d607a1b604482015260640161109b565b6136d961322a565b8160e00151101580156136f757506136ef61289a565b8160e0015111155b6137395760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b1bd8dac8105b5bdd5b9d606a1b604482015260640161109b565b6001600160a01b0385166137855760405162461bcd60e51b8152602060048201526013602482015272496e76616c6964206f6c64204164647265737360681b604482015260640161109b565b61378e85612a5c565b6137c75760405162461bcd60e51b815260206004820152600a6024820152692737b716b6b2b6b132b960b11b604482015260640161109b565b6020808701516001600160a01b038781166000908152606d845260408082205482526067909452929092205482169116148061380d575061380b8660200151612a5c565b155b61384b5760405162461bcd60e51b815260206004820152600f60248201526e20b63932b0b23c9030903b37ba32b960891b604482015260640161109b565b6072546138599060016175e0565b935061386984600333888a614336565b613877848760e001516143d9565b61388684876101000151613e44565b6072849055336001600160a01b0386161480156138af575085516001600160a01b038681169116145b156138e95760006138bf85613fa0565b925050506138d9854283426138d491906175e0565b61484e565b6138e78560036001806147b8565b505b50506001600160a01b0316600090815260a86020526040902042905592915050565b6000613915613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b15801561395657600080fd5b505afa15801561396a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398e9190616d27565b6139aa5760405162461bcd60e51b815260040161109b90617288565b60006139b5336129d9565b60a7546001600160a01b038216600090815260a86020526040902054919250906139df904261761a565b10156139fd5760405162461bcd60e51b815260040161109b9061741d565b6000613a08336129d9565b9050613a1261289a565b613a1b82613d87565b11158015613a385750613a2c61322a565b613a3582613d87565b10155b613a545760405162461bcd60e51b815260040161109b9061739b565b6001600160a01b038716613a9c5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015260640161109b565b613aa587612a5c565b613ade5760405162461bcd60e51b815260206004820152600a6024820152692737b716b6b2b6b132b960b11b604482015260640161109b565b6001613ae960695490565b11613b365760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742072656d6f7665206120736f6c65206d656d6265720000000000604482015260640161109b565b85613b4088613d87565b1015613ba15760405162461bcd60e51b815260206004820152602a60248201527f496e73756666696369656e742062616c616e636520746861742063616e206265604482015269103ab73637b1b5b2b21760b11b606482015260840161109b565b607254613baf9060016175e0565b604080516101408101825260008082526020808301829052828401829052835182815280820185526060840152835182815280820185526080840152835182815290810190935260a082019290925260c081019190915260e0810188905261010081018790526101208101869052909350613c2e846002338b85614336565b613c3884886143d9565b613c428487613e44565b505060728290556001600160a01b0316600090815260a860205260409020429055949350505050565b613c73613eaf565b610e108110613cbc5760405162461bcd60e51b81526020600482015260156024820152746e6577506572696f6420697320746f6f206c6f6e6760581b604482015260640161109b565b60a78190556040518181527f17c6f1d1ce638844b664872f5c6eecb7d150ec0c41187d7f85826a656ee7946f9060200161167a565b613cf9613eaf565b6001600160a01b038116613d5e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161109b565b611e84816144e3565b60006117507111dbdd995c9b985b98d950dbdb9d1c9858dd60721b6148bc565b6000613d916140a0565b604051632c9aab9b60e11b81526001600160a01b03848116600483015291909116906359355736906024015b60206040518083038186803b158015613dd557600080fd5b505afa158015613de9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a999190616d44565b6000805160206176fe833981519152546001600160a01b031690565b60006117506c42616c6c6f7453746f7261676560981b6148bc565b613e4c613e29565b6001600160a01b031663bce0dbc183836040518363ffffffff1660e01b8152600401613e79929190617073565b600060405180830381600087803b158015613e9357600080fd5b505af1158015613ea7573d6000803e3d6000fd5b505050505050565b6033546001600160a01b03163314612a5a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161109b565b6000806000613f16613e29565b6001600160a01b031663688ca5b2856040518263ffffffff1660e01b8152600401613f4391815260200190565b60606040518083038186803b158015613f5b57600080fd5b505afa158015613f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f939190616ee3565b9250925092509193909250565b6000806000613fad613e29565b6001600160a01b03166309970688856040518263ffffffff1660e01b8152600401613fda91815260200190565b60606040518083038186803b158015613ff257600080fd5b505afa158015614006573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f939190616f1c565b600061175069456e7653746f7261676560b01b6148bc565b600054610100900460ff166140695760405162461bcd60e51b815260040161109b906173d2565b612a5a614939565b600054610100900460ff166140985760405162461bcd60e51b815260040161109b906173d2565b612a5a614960565b6000611750665374616b696e6760c81b6148bc565b60405160019060aa906140c9908690617010565b9081526040519081900360200190205460ff16156140e5575060005b60a9856040516140f59190617010565b9081526040519081900360200190205460ff1615614111575060005b6000838360405160200161412692919061702c565b60408051601f198184030181529181528151602092830120600081815260ab90935291205490915060ff161561415b57600091505b50949350505050565b61416c6140a0565b60405163282d3fdf60e01b81526001600160a01b03848116600483015260248201849052919091169063282d3fdf90604401613e79565b6141ab613d67565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b1580156141ec57600080fd5b505afa158015614200573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142249190616d27565b611e845760405162461bcd60e51b815260040161109b90617288565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156142785761427383614990565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156142b157600080fd5b505afa9250505080156142e1575060408051601f3d908101601f191682019092526142de91810190616d44565b60015b6142fd5760405162461bcd60e51b815260040161109b906172dd565b6000805160206176fe833981519152811461432a5760405162461bcd60e51b815260040161109b906171f1565b50614273838383614a2c565b61433e613e29565b6001600160a01b031663daacbb95868684610120015187878760000151886020015189604001518a606001518b608001518c60a001518d60c001516040518d63ffffffff1660e01b81526004016143a09c9b9a99989796959493929190617454565b600060405180830381600087803b1580156143ba57600080fd5b505af11580156143ce573d6000803e3d6000fd5b505050505050505050565b6143e1613e29565b604051633968764960e11b815260048101849052602481018390526001600160a01b0391909116906372d0ec9290604401613e79565b600061442161402a565b6001600160a01b0316639801bff984846040518363ffffffff1660e01b815260040161444e929190617073565b60206040518083038186803b15801561446657600080fd5b505afa15801561447a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061449e9190616d27565b9392505050565b6144ad613e29565b60405163548f2cdd60e11b815260048101849052602481018390526001600160a01b03919091169063a91e59ba90604401613e79565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260755414156145885760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161109b565b6002607555565b600080600061459d84613f09565b509092509050600181141561463c57607454156145cc5760405162461bcd60e51b815260040161109b90617358565b60006145d785613fa0565b925050506145e36116d6565b8110156146065761460185426145f76116d6565b6138d490426175e0565b614631565b8061460f613422565b10156146225761460185426145f7613422565b61463185426138d484826175e0565b50607484905561469d565b600281141561466b5760745484146146665760405162461bcd60e51b815260040161109b90617358565b61469d565b60405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b604482015260640161109b565b5092915050565b600060735460016146b591906175e0565b905060006146c2336129d9565b905060006146cf60695490565b6146db906127106175f8565b90506000846146eb5760026146ee565b60015b90506146f8613e29565b6040516325918ae760e21b815260048101869052602481018890526001600160a01b038581166044830152606482018490526084820185905291909116906396462b9c9060a401600060405180830381600087803b15801561475957600080fd5b505af115801561476d573d6000803e3d6000fd5b505050607394909455505050505050565b600080600061478b613e29565b6001600160a01b03166356ba988e856040518263ffffffff1660e01b8152600401613fda91815260200190565b6004821561482b5750600360018414156147e2576147d585614a51565b6147dd575060045b61482b565b60028414156147f4576147dd85614f15565b6003841415614807576147d58583615459565b6004841415614819576147dd85615db6565b600584141561482b5761482b85615e75565b61483585826144a5565b816148405760006074555b5050505050565b6001607555565b614856613e29565b60405163605b78c360e11b81526004810185905260248101849052604481018390526001600160a01b03919091169063c0b6f18690606401600060405180830381600087803b1580156148a857600080fd5b505af1158015612f06573d6000803e3d6000fd5b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd9060240160206040518083038186803b15801561490157600080fd5b505afa158015614915573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a99919061696c565b600054610100900460ff166148475760405162461bcd60e51b815260040161109b906173d2565b600054610100900460ff166149875760405162461bcd60e51b815260040161109b906173d2565b612a5a336144e3565b6001600160a01b0381163b6149fd5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161109b565b6000805160206176fe83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b614a3583615fc8565b600082511180614a425750805b1561427357611d9b8383616008565b6000614a5e82600161602d565b600080600080600080600080614a738a616134565b9850985098509850985098509850985050614a8d88612a5c565b15614aeb578960008051602061773e833981519152604051614ad39060208082526010908201526f20b63932b0b23c90309036b2b6b132b960811b604082015260600190565b60405180910390a25060009998505050505050505050565b614af361322a565b811080614b06575080614b0461289a565b105b15614b27578960008051602061773e833981519152604051614ad39061732b565b80614b31896161ea565b1015614b53578960008051602061773e833981519152604051614ad39061715e565b866001600160a01b0316886001600160a01b031614158015614b875750856001600160a01b0316886001600160a01b031614155b15614bd3578960008051602061773e833981519152604051614ad390602080825260169082015275496e76616c6964206d656d626572206164647265737360501b604082015260600190565b614bdd8882614164565b60006069546001614bee91906175e0565b9050876067600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606860008a6001600160a01b03166001600160a01b031681526020019081526020016000208190555086606a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606b6000896001600160a01b03166001600160a01b031681526020019081526020016000208190555088606c600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606d60008b6001600160a01b03166001600160a01b031681526020019081526020016000208190555060006071546001614d2791906175e0565b6000818152606e60209081526040909120895192935091614d4d918391908b01906165d0565b508651614d6390600183019060208a01906165d0565b508551614d7990600283019060208901906165d0565b50848160030181905550600160a989604051614d959190617010565b908152604051908190036020018120805492151560ff199093169290921790915560019060aa90614dc7908a90617010565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160ab60008888604051602001614e0592919061702c565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055508a6070600084815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081606f60008d6001600160a01b03166001600160a01b031681526020019081526020016000208190555087816000019080519060200190614eba9291906165d0565b5060698390556071829055436066556040516001600160a01b03808c1691908d16907f6a2af11b2d73f347f9d5840aea46899e17609730b5cd91bd9c312098038acba690600090a35060019c9b505050505050505050505050565b614f2081600261602d565b600080614f2c83616134565b9850505050505050509150614f4082612a5c565b614f96578260008051602061773e833981519152604051614f89906020808252601490820152732737ba1030b63932b0b23c90309036b2b6b132b960611b604082015260600190565b60405180910390a2505050565b6001600160a01b038083166000818152606d6020818152604080842054606954808652606c8452828620548287526067855283872054606a865293872054979096529390925290949283169390831692169084146150fe57606980546000908152606c6020818152604080842080546001600160a01b038d8116808852606d80875285892080549e8a529787528589209087529b821688528488209c909c559486905581546001600160a01b03199081169092558954821690851617909855888452606b8083528185205486548652606a80855283872080548a881689528487528589208054948a529287528589209487528716808952858920939093559087905580548b16905581548a16179055978352606880825288842054945484526067808352898520805489861687528385528b872080548989529386528c882094909552909416808652998520559290558054861690558054909416851790935591929161517b565b606980546000908152606c6020908152604080832080546001600160a01b03199081169091556001600160a01b038b81168552606d845282852085905585548552606a84528285208054831690558681168552606b8452828520859055945484526067835281842080549091169055928516825260689052908120555b600160695461518a919061761a565b6069556000848152606e6020526040808220905190919060aa906151b290600185019061704e565b908152604051908190036020018120805492151560ff199093169290921790915560009060a9906151e490849061704e565b90815260405160209181900382018120805460ff191693151593909317909255600383015460009260ab9284926152209260028801920161705a565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff1916941515949094179093556071546001600160a01b038b168452606f9091529120541461537a576001600160a01b038088166000908152606f602090815260408083205460715484526070835281842054606e90935292208054929850921695508291906152bb9061765d565b6152c6929190616654565b506071546000908152606e6020526040902060019081018054918301916152ec9061765d565b6152f7929190616654565b506071546000908152606e60205260409020600290810180549183019161531d9061765d565b615328929190616654565b506071546000908152606e60209081526040808320600390810154908501558783526070825280832080546001600160a01b0319166001600160a01b0389169081179091558352606f90915290208590555b60718054600090815260706020908152604080832080546001600160a01b03191690556001600160a01b038b168352606f825280832083905592548252606e9052908120906153c982826166cf565b6153d76001830160006166cf565b6153e56002830160006166cf565b6003820160009055505060016071546153fe919061761a565b6071554360665561540f8787616224565b826001600160a01b0316876001600160a01b03167faa91016c21c52c58ac64f23f71bbe75becc9ada603e18ee671d09ff15492d1c160405160405180910390a35050505050505050565b60008161546b5761546b83600361602d565b60008060008060008060008060006154828c616134565b98509850985098509850985098509850985061549d89612a5c565b615509578b60008051602061773e8339815191526040516154ef906020808252601b908201527f4f6c642061646472657373206973206e6f742061206d656d6265720000000000604082015260600190565b60405180910390a260009950505050505050505050612a99565b6001600160a01b03808a166000818152606d6020526040902054918a16146156d65761553489612a5c565b156155a2578c60008051602061773e833981519152604051615587906020808252601f908201527f6e6577206164647265737320697320616c72656164792061206d656d62657200604082015260600190565b60405180910390a260009a5050505050505050505050612a99565b876001600160a01b0316896001600160a01b0316141580156155d65750866001600160a01b0316896001600160a01b031614155b15615621578c60008051602061773e83398151915260405161558790602080825260159082015274496e76616c696420766f746572206164647265737360581b604082015260600190565b6000818152606c6020908152604080832080546001600160a01b0319166001600160a01b038e81169182179092558452606d909252808320849055908c16825281205561566c61322a565b82108061567f57508161567d61289a565b105b156156a0578c60008051602061773e8339815191526040516155879061732b565b816156aa8a6161ea565b10156156cc578c60008051602061773e8339815191526040516155879061715e565b6156d68983614164565b6000606f60008c6001600160a01b03166001600160a01b031681526020019081526020016000205490506000606e600083815260200190815260200160002090506158ef888888888560405180608001604052908160008201805461573a9061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546157669061765d565b80156157b35780601f10615788576101008083540402835291602001916157b3565b820191906000526020600020905b81548152906001019060200180831161579657829003601f168201915b505050505081526020016001820180546157cc9061765d565b80601f01602080910402602001604051908101604052809291908181526020018280546157f89061765d565b80156158455780601f1061581a57610100808354040283529160200191615845565b820191906000526020600020905b81548152906001019060200180831161582857829003601f168201915b5050505050815260200160028201805461585e9061765d565b80601f016020809104026020016040519081016040528092919081815260200182805461588a9061765d565b80156158d75780601f106158ac576101008083540402835291602001916158d7565b820191906000526020600020905b8154815290600101906020018083116158ba57829003601f168201915b50505050508152602001600382015481525050616348565b61592c578e60008051602061773e83398151915260405161590f906172af565b60405180910390a260009c50505050505050505050505050612a99565b600060a982600001604051615941919061704e565b908152604051908190036020018120805492151560ff199093169290921790915560009060aa9061597690600185019061704e565b90815260405160209181900382018120805460ff191693151593909317909255600383015460009260ab9284926159b29260028801920161705a565b60408051808303601f1901815291815281516020928301208352828201939093529101600020805460ff19169215159290921790915588516159f9918391908b01906165d0565b508651615a0f90600183019060208a01906165d0565b508551615a2590600283019060208901906165d0565b50600381018590554360665560405160019060a990615a45908b90617010565b908152604051908190036020018120805492151560ff199093169290921790915560019060aa90615a77908a90617010565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600160ab60008888604051602001615ab592919061702c565b60408051808303601f1901815291815281516020928301208352828201939093529082016000908120805460ff191694151594909417909355858352606a90529020546001600160a01b03908116915089168114615b51576000838152606a6020908152604080832080546001600160a01b0319166001600160a01b038e81169182179092558452606b90925280832086905590831682528120555b506000828152606760205260409020546001600160a01b03908116908a168114615c61576001600160a01b038a1660009081526068602052604090205415615bd3578e60008051602061773e83398151915260405161590f906020808252600f908201526e20b63932b0b23c9030903b37ba32b960891b604082015260600190565b896067600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082606860008c6001600160a01b03166001600160a01b0316815260200190815260200160002081905550600060686000836001600160a01b03166001600160a01b03168152602001908152602001600020819055505b50896001600160a01b03168b6001600160a01b031614615d6157896070600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080606f60008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055506000606f60008d6001600160a01b03166001600160a01b0316815260200190815260200160002081905550615d128b84616224565b886001600160a01b03168a6001600160a01b03168c6001600160a01b03167f15f4d750630db473a85edd9d47c500527a2648cc5e676f39645e52790cf07be060405160405180910390a4615da2565b896001600160a01b03168b6001600160a01b03167f1feee1b4fcb797c62645da41c5c6edd5f91d4291de0054da625c42b823594c1f60405160405180910390a35b5060019d9c50505050505050505050505050565b615dc181600461602d565b6000615dcb613e29565b6001600160a01b0316637efa9ae3836040518263ffffffff1660e01b8152600401615df891815260200190565b60206040518083038186803b158015615e1057600080fd5b505afa158015615e24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190615e48919061696c565b90506001600160a01b038116156127e357615e62816141a3565b615e6d816000611e52565b436066555050565b615e8081600561602d565b6000806000615e8d613e29565b6001600160a01b0316631d940da2856040518263ffffffff1660e01b8152600401615eba91815260200190565b60006040518083038186803b158015615ed257600080fd5b505afa158015615ee6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052615f0e9190810190616d5d565b9250925092506000615f1e61402a565b6040516388c2801960e01b81529091506001600160a01b038216906388c2801990615f4f9087908690600401617073565b600060405180830381600087803b158015615f6957600080fd5b505af1158015615f7d573d6000803e3d6000fd5b50504360665550506040517f701c16c2519cdb79aaac423a84733590e3510d9552055b6ad6908f0ab12b6c2990615fb99086908690869061708c565b60405180910390a15050505050565b615fd181614990565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061449e838360405180606001604052806027815260200161775e60279139616471565b60008061603984613f09565b50915091508282146160835760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420766f74696e67207479706560681b604482015260640161109b565b600281146160ca5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f74696e6720737461746560601b604482015260640161109b565b6000806160d68661477e565b92509250506160e461138990565b821015806160f457506113898110155b613ea75760405162461bcd60e51b8152602060048201526011602482015270139bdd081e595d08199a5b985b1a5e9959607a1b604482015260640161109b565b600080600080606080606060008061614a613e29565b6001600160a01b03166373df4e018b6040518263ffffffff1660e01b815260040161617791815260200190565b60006040518083038186803b15801561618f57600080fd5b505afa1580156161a3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526161cb9190810190616989565b9850985098509850985098509850985098509193959799909294969850565b60006161f46140a0565b6040516325d998bb60e01b81526001600160a01b03848116600483015291909116906325d998bb90602401613dbd565b600061622e6140a0565b604051632c9aab9b60e11b81526001600160a01b03858116600483015291925060009183169063593557369060240160206040518083038186803b15801561627557600080fd5b505afa158015616289573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906162ad9190616d44565b90508281111561633e576001600160a01b038216637756c908856162d1868561761a565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561631757600080fd5b505af115801561632b573d6000803e3d6000fd5b5050505061633984846164e9565b611d9b565b611d9b84826164e9565b60006001905084805190602001208260200151805190602001201415801561638f575060aa8560405161637b9190617010565b9081526040519081900360200190205460ff165b15616398575060005b8580519060200120826000015180519060200120141580156163d9575060a9866040516163c59190617010565b9081526040519081900360200190205460ff165b156163e2575060005b600084846040516020016163f792919061702c565b604051602081830303815290604052805190602001209050808360400151846060015160405160200161642b92919061702c565b604051602081830303815290604052805190602001201415801561645d5750600081815260ab602052604090205460ff165b1561646757600091505b5095945050505050565b6060600080856001600160a01b03168560405161648e9190617010565b600060405180830381855af49150503d80600081146164c9576040519150601f19603f3d011682016040523d82523d6000602084013e6164ce565b606091505b50915091506164df86838387616528565b9695505050505050565b6164f16140a0565b604051637eee288d60e01b81526001600160a01b038481166004830152602482018490529190911690637eee288d90604401613e79565b6060831561659457825161658d576001600160a01b0385163b61658d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161109b565b508161659e565b61659e83836165a6565b949350505050565b8151156165b65781518083602001fd5b8060405162461bcd60e51b815260040161109b91906170ff565b8280546165dc9061765d565b90600052602060002090601f0160209004810192826165fe5760008555616644565b82601f1061661757805160ff1916838001178555616644565b82800160010185558215616644579182015b82811115616644578251825591602001919060010190616629565b50616650929150616705565b5090565b8280546166609061765d565b90600052602060002090601f0160209004810192826166825760008555616644565b82601f106166935780548555616644565b8280016001018555821561664457600052602060002091601f016020900482015b828111156166445782548255916001019190600101906166b4565b5080546166db9061765d565b6000825580601f106166eb575050565b601f016020900490600052602060002090810190611e8491905b5b808211156166505760008155600101616706565b8035612a43816176da565b8051612a43816176da565b600082601f83011261674157600080fd5b8135602061675661675183617596565b617566565b80838252828201915082860187848660051b890101111561677657600080fd5b60005b8581101561679e57813561678c816176da565b84529284019290840190600101616779565b5090979650505050505050565b600082601f8301126167bc57600080fd5b81356167ca616751826175b9565b8181528460208386010111156167df57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261680d57600080fd5b815161681b616751826175b9565b81815284602083860101111561683057600080fd5b61659e826020830160208701617631565b6000610140828403121561685457600080fd5b61685c61753d565b90506168678261671a565b81526168756020830161671a565b60208201526168866040830161671a565b604082015260608201356001600160401b03808211156168a557600080fd5b6168b1858386016167ab565b606084015260808401359150808211156168ca57600080fd5b6168d6858386016167ab565b608084015260a08401359150808211156168ef57600080fd5b6168fb858386016167ab565b60a084015260c084013560c084015260e084013560e08401526101009150818401358181111561692a57600080fd5b616936868287016167ab565b8385015250505061012080830135818301525092915050565b60006020828403121561696157600080fd5b813561449e816176da565b60006020828403121561697e57600080fd5b815161449e816176da565b60008060008060008060008060006101208a8c0312156169a857600080fd5b6169b18a616725565b98506169bf60208b01616725565b97506169cd60408b01616725565b96506169db60608b01616725565b955060808a01516001600160401b03808211156169f757600080fd5b616a038d838e016167fc565b965060a08c0151915080821115616a1957600080fd5b616a258d838e016167fc565b955060c08c0151915080821115616a3b57600080fd5b50616a488c828d016167fc565b93505060e08a015191506101008a015190509295985092959850929598565b60008060408385031215616a7a57600080fd5b8235616a85816176da565b915060208301356001600160401b03811115616aa057600080fd5b616aac858286016167ab565b9150509250929050565b600080600060608486031215616acb57600080fd5b8335616ad6816176da565b925060208401356001600160401b03811115616af157600080fd5b616afd868287016167ab565b925050604084013590509250925092565b600080600060608486031215616b2357600080fd5b8335616b2e816176da565b92506020840135915060408401356001600160401b03811115616b5057600080fd5b616b5c868287016167ab565b9150509250925092565b60008060008060008060c08789031215616b7f57600080fd5b8635616b8a816176da565b95506020870135945060408701356001600160401b0380821115616bad57600080fd5b616bb98a838b016167ab565b95506060890135915080821115616bcf57600080fd5b616bdb8a838b016167ab565b94506080890135915080821115616bf157600080fd5b50616bfe89828a016167ab565b92505060a087013590509295509295509295565b60008060008060808587031215616c2857600080fd5b8435616c33816176da565b93506020850135925060408501356001600160401b03811115616c5557600080fd5b616c61878288016167ab565b949793965093946060013593505050565b60008060408385031215616c8557600080fd5b82356001600160401b0380821115616c9c57600080fd5b818501915085601f830112616cb057600080fd5b81356020616cc061675183617596565b8083825282820191508286018a848660051b8901011115616ce057600080fd5b600096505b84871015616d03578035835260019690960195918301918301616ce5565b5096505086013592505080821115616d1a57600080fd5b50616aac85828601616730565b600060208284031215616d3957600080fd5b815161449e816176ef565b600060208284031215616d5657600080fd5b5051919050565b600080600060608486031215616d7257600080fd5b835192506020840151915060408401516001600160401b03811115616d9657600080fd5b616b5c868287016167fc565b600080600080600060a08688031215616dba57600080fd5b853594506020860135935060408601356001600160401b0380821115616ddf57600080fd5b616deb89838a016167ab565b94506060880135915080821115616e0157600080fd5b50616e0e888289016167ab565b95989497509295608001359392505050565b600060208284031215616e3257600080fd5b81356001600160401b03811115616e4857600080fd5b61659e84828501616841565b60008060408385031215616e6757600080fd5b82356001600160401b03811115616e7d57600080fd5b616e8985828601616841565b9250506020830135616e9a816176da565b809150509250929050565b600060208284031215616eb757600080fd5b5035919050565b60008060408385031215616ed157600080fd5b823591506020830135616e9a816176ef565b600080600060608486031215616ef857600080fd5b83519250602084015191506040840151616f11816176ef565b809150509250925092565b600080600060608486031215616f3157600080fd5b8351925060208401519150604084015190509250925092565b60008151808452616f62816020860160208601617631565b601f01601f19169290920160200192915050565b8054600090600181811c9080831680616f9057607f831692505b6020808410821415616fb257634e487b7160e01b600052602260045260246000fd5b818015616fc65760018114616fd757617004565b60ff19861689528489019650617004565b60008881526020902060005b86811015616ffc5781548b820152908501908301616fe3565b505084890196505b50505050505092915050565b60008251617022818460208701617631565b9190910192915050565b6000835161703e818460208801617631565b9190910191825250602001919050565b600061449e8284616f76565b60006170668285616f76565b9283525050602001919050565b82815260406020820152600061659e6040830184616f4a565b8381528260208201526060604082015260006170ab6060830184616f4a565b95945050505050565b6080815260006170c76080830187616f4a565b82810360208401526170d98187616f4a565b905082810360408401526170ed8186616f4a565b91505082606083015295945050505050565b60208152600061449e6020830184616f4a565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b60208082526027908201527f496e73756666696369656e742062616c616e636520746861742063616e206265604082015266081b1bd8dad95960ca1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526029908201527f45524331393637557067726164653a20756e737570706f727465642070726f786040820152681a58589b195555525160ba1b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b6020808252601490820152734475706c696361746564206e6f646520696e666f60601b604082015260600190565b6020808252602e908201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960408201526d6f6e206973206e6f74205555505360901b606082015260800190565b602080825260139082015272125b9d985b1a59081b1bd8dac8185b5bdd5b9d606a1b604082015260600190565b60208082526023908201527f4e6f7720696e20766f74696e67207769746820646966666572656e742062616c6040820152621b1bdd60ea1b606082015260800190565b60208082526017908201527f496e76616c6964207374616b696e672062616c616e6365000000000000000000604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601d908201527f43616e6e6f74206164642070726f706f73616c20746f6f206561726c79000000604082015260600190565b8c8152602081018c9052604081018b90526001600160a01b038a81166060830152898116608083015288811660a083015287811660c0830152861660e08201526000610180806101008401526174ac81840188616f4a565b90508281036101208401526174c18187616f4a565b90508281036101408401526174d68186616f4a565b915050826101608301529d9c50505050505050505050505050565b87815286602082015285604082015260018060a01b03851660608201528360808201528260a082015260e060c0820152600061753060e0830184616f4a565b9998505050505050505050565b60405161014081016001600160401b0381118282101715617560576175606176c4565b60405290565b604051601f8201601f191681016001600160401b038111828210171561758e5761758e6176c4565b604052919050565b60006001600160401b038211156175af576175af6176c4565b5060051b60200190565b60006001600160401b038211156175d2576175d26176c4565b50601f01601f191660200190565b600082198211156175f3576175f3617698565b500190565b60008261761557634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561762c5761762c617698565b500390565b60005b8381101561764c578181015183820152602001617634565b83811115611d9b5750506000910152565b600181811c9082168061767157607f821691505b6020821081141561769257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611e8457600080fd5b8015158114611e8457600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249885e7f4987c0698db47045ad8cea110b51138f0eecbd94915842328cf6c3dc97d416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212203a2bbee45b822c4012cf11fc82497b3003f417d49c0f0e6d6062c409c902f88864736f6c63430008060033"; -var GovImp_contract = web3.eth.contract([{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"envName","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"envType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"envVal","type":"bytes"}],"name":"EnvChanged","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":"addr","type":"address"},{"indexed":true,"internalType":"address","name":"voter","type":"address"}],"name":"MemberAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddr","type":"address"},{"indexed":true,"internalType":"address","name":"newAddr","type":"address"},{"indexed":true,"internalType":"address","name":"newVoter","type":"address"}],"name":"MemberChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":true,"internalType":"address","name":"voter","type":"address"}],"name":"MemberRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":true,"internalType":"address","name":"voter","type":"address"}],"name":"MemberUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"NotApplicable","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newPeriod","type":"uint256"}],"name":"SetProposalTimePeriod","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"BALLOT_DURATION_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_FEE_MAX_CHANGE_RATE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKS_PER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_CREATION_TIME_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_GASLIMIT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_AMOUNT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_MAINTANANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_METHOD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ENV_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GASLIMIT_AND_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAS_TARGET_PERCENTAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTENANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_IDLE_BLOCK_INTERVAL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRIORITY_FEE_PER_GAS_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_POOL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"address","name":"voter","type":"address"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"bytes","name":"name","type":"bytes"},{"internalType":"bytes","name":"enode","type":"bytes"},{"internalType":"bytes","name":"ip","type":"bytes"},{"internalType":"uint256","name":"port","type":"uint256"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct GovImp.MemberInfo","name":"info","type":"tuple"}],"name":"addProposalToAddMember","outputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"envName","type":"bytes32"},{"internalType":"uint256","name":"envType","type":"uint256"},{"internalType":"bytes","name":"envVal","type":"bytes"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"addProposalToChangeEnv","outputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGovAddr","type":"address"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"addProposalToChangeGov","outputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"address","name":"voter","type":"address"},{"internalType":"address","name":"reward","type":"address"},{"internalType":"bytes","name":"name","type":"bytes"},{"internalType":"bytes","name":"enode","type":"bytes"},{"internalType":"bytes","name":"ip","type":"bytes"},{"internalType":"uint256","name":"port","type":"uint256"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct GovImp.MemberInfo","name":"newInfo","type":"tuple"},{"internalType":"address","name":"oldStaker","type":"address"}],"name":"addProposalToChangeMember","outputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"addProposalToRemoveMember","outputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ballotLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkUnfinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalizeEndedVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBallotInVoting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxStaking","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxVotingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getMemberFromNodeIdx","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMemberLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinStaking","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinVotingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getNode","outputs":[{"internalType":"bytes","name":"name","type":"bytes"},{"internalType":"bytes","name":"enode","type":"bytes"},{"internalType":"bytes","name":"ip","type":"bytes"},{"internalType":"uint256","name":"port","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getNodeIdxFromMember","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNodeLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getReward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getStakerAddr","outputs":[{"internalType":"address","name":"staker","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"idx","type":"uint256"}],"name":"getVoter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"bytes","name":"name","type":"bytes"},{"internalType":"bytes","name":"enode","type":"bytes"},{"internalType":"bytes","name":"ip","type":"bytes"},{"internalType":"uint256","name":"port","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"uint256","name":"lockAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"initOnce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isMember","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isStaker","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isVoter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastAddProposalTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"modifiedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposal_time_period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"indices","type":"uint256[]"},{"internalType":"address[]","name":"newRewards","type":"address[]"}],"name":"reInitV3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reg","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardIdx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPeriod","type":"uint256"}],"name":"setProposalTimePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakerIdx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotIdx","type":"uint256"},{"internalType":"bool","name":"approval","type":"bool"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voteLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"voterIdx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]); - -function GovImp_new() { - return GovImp_contract.new( - { - from: web3.eth.accounts[0], - data: GovImp_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function GovImp_load(addr) { - return GovImp_contract.at(addr); -} -var Registry_data = "0x60806040526d57656d697820526567697374727960015534801561002257600080fd5b5061002c33610031565b610081565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6105f8806100906000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806360d6c7cf1161007157806360d6c7cf14610159578063715018a6146101925780637d10dd1b1461019c5780638da5cb5b146101a5578063ec56a373146101b6578063f2fde38b146101df57600080fd5b806304af66ad146100ae5780630d2020dd146100d65780630d854646146101015780633ec50c6c14610118578063599e4c7014610146575b600080fd5b6100c16100bc36600461051a565b6101f2565b60405190151581526020015b60405180910390f35b6100e96100e4366004610501565b610298565b6040516001600160a01b0390911681526020016100cd565b61010a60015481565b6040519081526020016100cd565b6100c161012636600461051a565b600460209081526000928352604080842090915290825290205460ff1681565b6100c1610154366004610546565b6102e8565b6100c161016736600461051a565b60009182526004602090815260408084206001600160a01b0393909316845291905290205460ff1690565b61019a61038c565b005b61010a60025481565b6000546001600160a01b03166100e9565b6100e96101c4366004610501565b6003602052600090815260409020546001600160a01b031681565b61019a6101ed3660046104df565b6103a0565b60006101fc610419565b6001600160a01b03821661022b5760405162461bcd60e51b81526004016102229061058b565b60405180910390fd5b60008381526003602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915543600255915133815285917f37724a4a9968ac9654e6ee52f3d0c93e5ef8863e057254ee2e36e8ad3e8429db910160405180910390a350600192915050565b6000818152600360205260408120546001600160a01b03166102cc5760405162461bcd60e51b81526004016102229061058b565b506000908152600360205260409020546001600160a01b031690565b60006102f2610419565b6001600160a01b0383166103185760405162461bcd60e51b81526004016102229061058b565b60008481526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915543600255905190815286917fe9f5231bbfb4b32867755b94562215cff6c8998489de8ba20926f8d0980e7818910160405180910390a35060019392505050565b610394610419565b61039e6000610473565b565b6103a8610419565b6001600160a01b03811661040d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610222565b61041681610473565b50565b6000546001600160a01b0316331461039e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610222565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b03811681146104da57600080fd5b919050565b6000602082840312156104f157600080fd5b6104fa826104c3565b9392505050565b60006020828403121561051357600080fd5b5035919050565b6000806040838503121561052d57600080fd5b8235915061053d602084016104c3565b90509250929050565b60008060006060848603121561055b57600080fd5b8335925061056b602085016104c3565b91506040840135801515811461058057600080fd5b809150509250925092565b6020808252601a908201527f616464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060408201526060019056fea2646970667358221220ace1d66b72bec2834a1452da82bfec0907eb0c949c79ae3ed7e43001d360266964736f6c63430008060033"; -var Registry_contract = web3.eth.contract([{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"SetContractDomain","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_contract","type":"bytes32"},{"indexed":true,"internalType":"address","name":"granted","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SetPermission","type":"event"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"contracts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"}],"name":"getContractAddress","outputs":[{"internalType":"address","name":"addr","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_contract","type":"bytes32"},{"internalType":"address","name":"_granted","type":"address"}],"name":"getPermission","outputs":[{"internalType":"bool","name":"found","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magic","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"modifiedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"}],"name":"permissions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_name","type":"bytes32"},{"internalType":"address","name":"_addr","type":"address"}],"name":"setContractDomain","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_contract","type":"bytes32"},{"internalType":"address","name":"_granted","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setPermission","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]); - -function Registry_new() { - return Registry_contract.new( - { - from: web3.eth.accounts[0], - data: Registry_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Registry_load(addr) { - return Registry_contract.at(addr); -} -var StakingImp_data = "0x60a06040523060601b608052609b805460ff191690553480156200002257600080fd5b506200002d62000033565b620000f4565b600054610100900460ff1615620000a05760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000f2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c612f216200012f60003960008181610b7101528181610bb101528181610c4e01528181610c8e0152610d1d0152612f216000f3fe6080604052600436106102345760003560e01c8063738fdd1a1161012e578063a91ee0dc116100ab578063d5c258901161006f578063d5c25890146106b3578063f1b8aa1d146106c8578063f2fde38b146106e8578063f3f6308014610708578063f69318221461072857600080fd5b8063a91ee0dc14610643578063b6549f7514610663578063bac4f33814610678578063c0d91eaf1461068b578063d0e30db0146106ab57600080fd5b80637f2f4c06116100f25780637f2f4c06146105a1578063884d97a7146105c15780638da5cb5b146105e15780639667e76a146105ff5780639986e4b91461061f57600080fd5b8063738fdd1a146104e85780637756c908146105205780637bf46530146105405780637d77a0eb146105615780637eee288d1461058157600080fd5b806334125c84116101bc5780635935573611610180578063593557361461041a5780635a731cca146104505780636c78d2cf1461047457806370a082311461049d578063715018a6146104d357600080fd5b806334125c84146103905780633659cfe6146103b05780634bd1ed76146103d05780634f1ef286146103f257806352d1902d1461040557600080fd5b8063282d3fdf11610203578063282d3fdf146102ea5780632b0b9c5e1461030c5780632bc9ed021461032c5780632e1a7d4d1461034f5780632f40992e1461036f57600080fd5b80631285361514610243578063193468ac146102765780631e0cba0d146102ac57806325d998bb146102ca57600080fd5b3661023e57600080fd5b600080fd5b34801561024f57600080fd5b5061026361025e366004612968565b610748565b6040519081526020015b60405180910390f35b34801561028257600080fd5b5061026361029136600461292e565b6001600160a01b0316600090815260ce602052604090205490565b3480156102b857600080fd5b50610263665374616b696e6760c81b81565b3480156102d657600080fd5b506102636102e536600461292e565b610775565b3480156102f657600080fd5b5061030a610305366004612a65565b6107a3565b005b34801561031857600080fd5b5061026361032736600461292e565b6107e9565b34801561033857600080fd5b50609b5460ff16604051901515815260200161026d565b34801561035b57600080fd5b5061030a61036a366004612b03565b610845565b34801561037b57600080fd5b506102636914995dd85c99141bdbdb60b21b81565b34801561039c57600080fd5b506102636845636f73797374656d60b81b81565b3480156103bc57600080fd5b5061030a6103cb36600461292e565b610b66565b3480156103dc57600080fd5b506102636a4d61696e74656e616e636560a81b81565b61030a6104003660046129a1565b610c43565b34801561041157600080fd5b50610263610d10565b34801561042657600080fd5b5061026361043536600461292e565b6001600160a01b031660009081526099602052604090205490565b34801561045c57600080fd5b506102636c14dd185ada5b99d4995dd85c99609a1b81565b34801561048057600080fd5b506102637111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b3480156104a957600080fd5b506102636104b836600461292e565b6001600160a01b031660009081526098602052604090205490565b3480156104df57600080fd5b5061030a610dc3565b3480156104f457600080fd5b50606554610508906001600160a01b031681565b6040516001600160a01b03909116815260200161026d565b34801561052c57600080fd5b5061030a61053b366004612a65565b610dd7565b34801561054c57600080fd5b5061026369456e7653746f7261676560b01b81565b34801561056d57600080fd5b5061026361057c366004612a91565b610f00565b34801561058d57600080fd5b5061030a61059c366004612a65565b610f74565b3480156105ad57600080fd5b5061030a6105bc36600461292e565b610fad565b3480156105cd57600080fd5b506102636105dc36600461292e565b61102d565b3480156105ed57600080fd5b506033546001600160a01b0316610508565b34801561060b57600080fd5b5061030a61061a366004612b03565b61103a565b34801561062b57600080fd5b506102636c42616c6c6f7453746f7261676560981b81565b34801561064f57600080fd5b5061030a61065e36600461292e565b611159565b34801561066f57600080fd5b5061030a611201565b61030a61068636600461292e565b61130b565b34801561069757600080fd5b5061030a6106a63660046129a1565b61170d565b61030a6118b8565b3480156106bf57600080fd5b50609a54610263565b3480156106d457600080fd5b5060cf54610508906001600160a01b031681565b3480156106f457600080fd5b5061030a61070336600461292e565b611b98565b34801561071457600080fd5b5061030a61072336600461292e565b611c0e565b34801561073457600080fd5b5061030a610743366004612a65565b611c2e565b6001600160a01b03808316600090815260cd60209081526040808320938516835292905220545b92915050565b6001600160a01b038116600090815260996020908152604080832054609890925282205461076f9190612e20565b336107ac611fc9565b6001600160a01b0316146107db5760405162461bcd60e51b81526004016107d290612c9c565b60405180910390fd5b6107e58282611fee565b5050565b6001600160a01b038116600090815260ce60209081526040808320546099909252822054811580610818575080155b15610827575060009392505050565b80610833836064612e01565b61083d9190612ddf565b949350505050565b61084d61224c565b609b5460ff16156108705760405162461bcd60e51b81526004016107d290612d17565b600081116108905760405162461bcd60e51b81526004016107d290612d3b565b600061089a6122a6565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d257600080fd5b505afa1580156108e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a9190612aea565b905060006109188383612dc7565b33600090815260ce602090815260408083205460999092529091205461093e9190612e20565b106109515761094d33846122be565b5060015b61095a33610775565b8311156109795760405162461bcd60e51b81526004016107d290612cc3565b33600090815260986020526040902054610994908490612e20565b3360009081526098602052604090205560cf546001600160a01b0316158015906109bb5750805b15610acd5760cf546040516000916001600160a01b03169085908381818185875af1925050503d8060008114610a0d576040519150601f19603f3d011682016040523d82523d6000602084013e610a12565b606091505b5050905080610a635760405162461bcd60e51b815260206004820152601e60248201527f5472616e7366657220746f204e4350207374616b696e67206661696c6564000060448201526064016107d2565b60cf546040516306aa67f960e01b8152600481018690523360248201526001600160a01b03909116906306aa67f990604401600060405180830381600087803b158015610aaf57600080fd5b505af1158015610ac3573d6000803e3d6000fd5b5050505050610afc565b604051339084156108fc029085906000818181858888f19350505050158015610afa573d6000803e3d6000fd5b505b336000818152609860205260409020547f204fccf0d92ed8d48f204adb39b2e81e92bad0dedb93f5716ca9478cfb57de00908590610b3984610775565b6040805193845260208401929092529082015260600160405180910390a25050610b636001606655565b50565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610baf5760405162461bcd60e51b81526004016107d290612bba565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610bf8600080516020612ea5833981519152546001600160a01b031690565b6001600160a01b031614610c1e5760405162461bcd60e51b81526004016107d290612c06565b610c278161237d565b60408051600080825260208201909252610b6391839190612385565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610c8c5760405162461bcd60e51b81526004016107d290612bba565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610cd5600080516020612ea5833981519152546001600160a01b031690565b6001600160a01b031614610cfb5760405162461bcd60e51b81526004016107d290612c06565b610d048261237d565b6107e582826001612385565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610db05760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016107d2565b50600080516020612ea583398151915290565b610dcb6124ff565b610dd56000612559565b565b33610de0611fc9565b6001600160a01b031614610e065760405162461bcd60e51b81526004016107d290612c9c565b80610e0f575050565b610e198282610f74565b6001600160a01b038216600090815260986020526040902054610e3d908290612e20565b6001600160a01b038316600090815260986020526040812091909155610e616125ab565b6001600160a01b038116600090815260986020526040902054909150610e88908390612dc7565b6001600160a01b0380831660009081526098602052604080822093909355908516808252919020547f2caed32a519a1fd89486d3ffe06202febb5ed51534d571dbab93058545a29e24908490610edd87610775565b6040805193845260208401929092529082015260600160405180910390a2505050565b6001600160a01b0382166000908152609960205260408120541580610f29575063ffffffff8216155b15610f365750600061076f565b609a546001600160a01b038416600090815260996020526040902054610f639063ffffffff851690612e01565b610f6d9190612ddf565b9392505050565b33610f7d611fc9565b6001600160a01b031614610fa35760405162461bcd60e51b81526004016107d290612c9c565b6107e582826122be565b610fb56124ff565b6001600160a01b03811661100b5760405162461bcd60e51b815260206004820152601e60248201527f4e43505374616b696e6720697320746865207a65726f2061646472657373000060448201526064016107d2565b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b600061076f826064610f00565b611042611fc9565b604051636f1e853360e01b81523360048201526001600160a01b039190911690636f1e85339060240160206040518083038186803b15801561108357600080fd5b505afa158015611097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bb9190612ac8565b6110d75760405162461bcd60e51b81526004016107d290612c9c565b6110e13382611fee565b60cf546001600160a01b031615610b635760cf546040516301008e9960e61b8152600481018390523360248201526001600160a01b0390911690634023a64090604401600060405180830381600087803b15801561113e57600080fd5b505af1158015611152573d6000803e3d6000fd5b5050505050565b6111616124ff565b6001600160a01b0381166111b75760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064016107d2565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b6112096124ff565b609b5460ff161561122c5760405162461bcd60e51b81526004016107d290612d17565b60006112406033546001600160a01b031690565b9050478061127e5760405162461bcd60e51b815260206004820152600b60248201526a062616c616e6365203d20360ac1b60448201526064016107d2565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156112b4573d6000803e3d6000fd5b50609b805460ff191660011790556040516001600160a01b038316907f713b90881ad62c4fa8ab6bd9197fa86481fc0c11b2edba60026514281b2dbac4906112ff9084815260200190565b60405180910390a25050565b61131361224c565b609b5460ff16156113365760405162461bcd60e51b81526004016107d290612d17565b60cf546001600160a01b031633146113605760405162461bcd60e51b81526004016107d290612b6b565b600034116113805760405162461bcd60e51b81526004016107d290612c52565b611388611fc9565b60405163288c314960e21b81526001600160a01b038381166004830152919091169063a230c5249060240160206040518083038186803b1580156113cb57600080fd5b505afa1580156113df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114039190612ac8565b6114485760405162461bcd60e51b81526020600482015260166024820152752721a81039b437bab63210313290309036b2b6b132b960511b60448201526064016107d2565b6001600160a01b038116600090815260986020526040902054349061146e908290612dc7565b6001600160a01b0383166000908152609860205260408120919091556114926122a6565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ca57600080fd5b505afa1580156114de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115029190612aea565b9050600061150e6122a6565b6001600160a01b031663737c59b86040518163ffffffff1660e01b815260040160206040518083038186803b15801561154657600080fd5b505afa15801561155a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157e9190612aea565b6001600160a01b03851660009081526099602052604090205490915082118015906115cd57506001600160a01b03841660009081526099602052604090205481906115ca908590612dc7565b11155b6116195760405162461bcd60e51b815260206004820152601f60248201527f757365722073686f756c6420626520696e207374616b696e672072616e67650060448201526064016107d2565b6116238484611fee565b6001600160a01b038416600090815260cd60209081526040808320338452909152902054611652908490612dc7565b6001600160a01b038516600081815260cd6020908152604080832033845282528083209490945591815260ce909152205461168e908490612dc7565b6001600160a01b038516600081815260ce6020908152604080832085905560cd825280832033808552908352928190205481518981529283019590955281019390935290917f74cfc20f0e6d14384c3a60820d3e814f6979d009cdbb43db27fa56fe475172fd9060600160405180910390a3505050610b636001606655565b600054610100900460ff161580801561172d5750600054600160ff909116105b806117475750303b158015611747575060005460ff166001145b6117aa5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107d2565b6000805460ff1916600117905580156117cd576000805461ff0019166101001790555b6000609a556117da6125c2565b6117e26125f1565b6117eb83611159565b81516117f65761186d565b60008060008060208601915085518261180f9190612dc7565b90505b808210156118685781519350611829602083612dc7565b915080821061183757600080fd5b81519250611846602083612dc7565b6001600160a01b03851660009081526098602052604090208490559150611812565b505050505b80156118b3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6118c061224c565b609b5460ff16156118e35760405162461bcd60e51b81526004016107d290612d17565b600034116119035760405162461bcd60e51b81526004016107d290612c52565b3360009081526098602052604090205461191e903490612dc7565b33600090815260986020526040902055611936611fc9565b60405163288c314960e21b81523360048201526001600160a01b03919091169063a230c5249060240160206040518083038186803b15801561197757600080fd5b505afa15801561198b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119af9190612ac8565b15611b335760006119be6122a6565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f657600080fd5b505afa158015611a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2e9190612aea565b3360009081526099602052604090205490915081118015611a70575033600090815260996020526040902054611a649082612e20565b611a6d33610775565b10155b15611b315733600081815260996020526040902054611a999190611a949084612e20565b611fee565b60cf546001600160a01b031615611b315760cf54336000908152609960205260409020546001600160a01b0390911690634023a64090611ad99084612e20565b6040516001600160e01b031960e084901b1681526004810191909152336024820152604401600060405180830381600087803b158015611b1857600080fd5b505af1158015611b2c573d6000803e3d6000fd5b505050505b505b336000818152609860205260409020547fb4caaf29adda3eefee3ad552a8e85058589bf834c7466cae4ee58787f70589ed903490611b7084610775565b6040805193845260208401929092529082015260600160405180910390a2610dd56001606655565b611ba06124ff565b6001600160a01b038116611c055760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d2565b610b6381612559565b611c166124ff565b6001600160a01b03811615610b6357610c278161237d565b611c3661224c565b609b5460ff1615611c595760405162461bcd60e51b81526004016107d290612d17565b60cf546001600160a01b03163314611c835760405162461bcd60e51b81526004016107d290612b6b565b60008111611ca35760405162461bcd60e51b81526004016107d290612d3b565b611cab611fc9565b60405163288c314960e21b81526001600160a01b038481166004830152919091169063a230c5249060240160206040518083038186803b158015611cee57600080fd5b505afa158015611d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d269190612ac8565b611d6b5760405162461bcd60e51b81526020600482015260166024820152752721a81039b437bab63210313290309036b2b6b132b960511b60448201526064016107d2565b806000611d766122a6565b6001600160a01b031663076cd77f6040518163ffffffff1660e01b815260040160206040518083038186803b158015611dae57600080fd5b505afa158015611dc2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de69190612aea565b6001600160a01b038516600090815260cd602090815260408083203384529091529020549091508211801590611e4557508082611e38866001600160a01b031660009081526099602052604090205490565b611e429190612e20565b10155b611e615760405162461bcd60e51b81526004016107d290612cc3565b611e6b84836122be565b6001600160a01b038416600090815260986020526040902054611e8f908390612e20565b6001600160a01b03851660009081526098602090815260408083209390935560cd815282822033835290522054611ec7908390612e20565b6001600160a01b038516600081815260cd6020908152604080832033845282528083209490945591815260ce9091522054611f03908390612e20565b6001600160a01b03808616600090815260ce60205260408082209390935560cf549251929091169184156108fc0291859190818181858888f19350505050158015611f52573d6000803e3d6000fd5b506001600160a01b038416600081815260ce602090815260408083205460cd835281842033808652908452938290205482518881529384019190915282820152517f03d2bb70c6ccc49d68a465a06edffb976961cf8930888658ca2339fa62b8bda29181900360600190a350506107e56001606655565b6000611fe97111dbdd995c9b985b98d950dbdb9d1c9858dd60721b612620565b905090565b80611ff7575050565b6001600160a01b0382166000908152609860205260409020548111156120785760405162461bcd60e51b815260206004820152603060248201527f4c6f636b20616d6f756e742073686f756c6420626520657175616c206f72206c60448201526f657373207468616e2062616c616e636560801b60648201526084016107d2565b8061208283610775565b10156120e05760405162461bcd60e51b815260206004820152602760248201527f496e73756666696369656e742062616c616e636520746861742063616e206265604482015266081b1bd8dad95960ca1b60648201526084016107d2565b60006120ea6122a6565b6001600160a01b031663737c59b86040518163ffffffff1660e01b815260040160206040518083038186803b15801561212257600080fd5b505afa158015612136573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215a9190612aea565b6001600160a01b038416600090815260996020526040902054909150612181908390612dc7565b6001600160a01b03841660009081526099602052604090208190558110156121f55760405162461bcd60e51b815260206004820152602160248201527f4c6f636b65642062616c616e6365206973206c6172676572207468616e206d616044820152600f60fb1b60648201526084016107d2565b81609a546122039190612dc7565b609a556001600160a01b0383166000818152609860205260409020547f44cebfefa4561bee5b61d675ccfd8dc9969fff9cc15e7a4eccccd62af94f9c11908490610edd87610775565b6002606654141561229f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107d2565b6002606655565b6000611fe969456e7653746f7261676560b01b612620565b806122c7575050565b6001600160a01b0382166000908152609960205260409020546122eb908290612e20565b6001600160a01b038316600090815260996020526040902055609a54612312908290612e20565b609a556001600160a01b0382166000818152609860205260409020547f5245d528087a96a64f4589a764f00061e4671eab90cb1e019b1a5b24b2e4c2a890839061235b86610775565b604080519384526020840192909252908201526060016112ff565b6001606655565b610b636124ff565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156123b8576118b38361269d565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156123f157600080fd5b505afa925050508015612421575060408051601f3d908101601f1916820190925261241e91810190612aea565b60015b6124845760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016107d2565b600080516020612ea583398151915281146124f35760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016107d2565b506118b3838383612739565b6033546001600160a01b03163314610dd55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d2565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611fe96845636f73797374656d60b81b612620565b600054610100900460ff166125e95760405162461bcd60e51b81526004016107d290612d7c565b610dd5612764565b600054610100900460ff166126185760405162461bcd60e51b81526004016107d290612d7c565b610dd561278b565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd9060240160206040518083038186803b15801561266557600080fd5b505afa158015612679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f919061294b565b6001600160a01b0381163b61270a5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016107d2565b600080516020612ea583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612742836127bb565b60008251118061274f5750805b156118b35761275e83836127fb565b50505050565b600054610100900460ff166123765760405162461bcd60e51b81526004016107d290612d7c565b600054610100900460ff166127b25760405162461bcd60e51b81526004016107d290612d7c565b610dd533612559565b6127c48161269d565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610f6d8383604051806060016040528060278152602001612ec5602791396060600080856001600160a01b0316856040516128389190612b1c565b600060405180830381855af49150503d8060008114612873576040519150601f19603f3d011682016040523d82523d6000602084013e612878565b606091505b509150915061288986838387612893565b9695505050505050565b606083156128ff5782516128f8576001600160a01b0385163b6128f85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d2565b508161083d565b61083d83838151156129145781518083602001fd5b8060405162461bcd60e51b81526004016107d29190612b38565b60006020828403121561294057600080fd5b8135610f6d81612e8f565b60006020828403121561295d57600080fd5b8151610f6d81612e8f565b6000806040838503121561297b57600080fd5b823561298681612e8f565b9150602083013561299681612e8f565b809150509250929050565b600080604083850312156129b457600080fd5b82356129bf81612e8f565b9150602083013567ffffffffffffffff808211156129dc57600080fd5b818501915085601f8301126129f057600080fd5b813581811115612a0257612a02612e79565b604051601f8201601f19908116603f01168101908382118183101715612a2a57612a2a612e79565b81604052828152886020848701011115612a4357600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008060408385031215612a7857600080fd5b8235612a8381612e8f565b946020939093013593505050565b60008060408385031215612aa457600080fd5b8235612aaf81612e8f565b9150602083013563ffffffff8116811461299657600080fd5b600060208284031215612ada57600080fd5b81518015158114610f6d57600080fd5b600060208284031215612afc57600080fd5b5051919050565b600060208284031215612b1557600080fd5b5035919050565b60008251612b2e818460208701612e37565b9190910192915050565b6020815260008251806020840152612b57816040850160208701612e37565b601f01601f19169190910160400192915050565b6020808252602f908201527f4f6e6c79204e43505374616b696e6720636f6e74726163742063616e2063616c60408201526e36103a3434b990333ab731ba34b7b760891b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602a908201527f4465706f73697420616d6f756e742073686f756c642062652067726561746572604082015269207468616e207a65726f60b01b606082015260800190565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b60208082526034908201527f576974686472617720616d6f756e742073686f756c6420626520657175616c206040820152736f72206c657373207468616e2062616c616e636560601b606082015260800190565b6020808252600a9082015269125cc81c995d9bdad95960b21b604082015260600190565b60208082526021908201527f416d6f756e742073686f756c6420626520626967676572207468616e207a65726040820152606f60f81b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115612dda57612dda612e63565b500190565b600082612dfc57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612e1b57612e1b612e63565b500290565b600082821015612e3257612e32612e63565b500390565b60005b83811015612e52578181015183820152602001612e3a565b8381111561275e5750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b6357600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122042e83c34556c2fc1280f674a79356265caae9e5830724b9c1fe5109a1ac1a48c64736f6c63430008060033"; -var StakingImp_contract = web3.eth.contract([{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"ncp","type":"address"},{"indexed":false,"internalType":"uint256","name":"ncpTotalLocked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userTotalLocked","type":"uint256"}],"name":"DelegateStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"ncp","type":"address"},{"indexed":false,"internalType":"uint256","name":"ncpTotalLocked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"userTotalLocked","type":"uint256"}],"name":"DelegateUnstaked","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":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"available","type":"uint256"}],"name":"Locked","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":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Revoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"available","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"available","type":"uint256"}],"name":"TransferLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"available","type":"uint256"}],"name":"Unlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"available","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"BALLOT_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ENV_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTENANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_POOL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"}],"name":"availableBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"}],"name":"calcVotingWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint32","name":"factor","type":"uint32"}],"name":"calcVotingWeightWithScaleFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ncp","type":"address"}],"name":"delegateDepositAndLockMore","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"ncp","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"delegateUnlockAndWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"ncp","type":"address"}],"name":"getRatioOfUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalLockedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint256","name":"lockAmount","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockAmount","type":"uint256"}],"name":"lockMore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"}],"name":"lockedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ncpStaking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reg","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ncpStaking","type":"address"}],"name":"setNCPStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferLocked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint256","name":"unlockAmount","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImp","type":"address"}],"name":"upgradeStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"ncp","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"userBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ncp","type":"address"}],"name":"userTotalBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]); - -function StakingImp_new() { - return StakingImp_contract.new( - { - from: web3.eth.accounts[0], - data: StakingImp_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function StakingImp_load(addr) { - return StakingImp_contract.at(addr); -} - -function AEnvStorage_new() { - return AEnvStorage_contract.new( - { - from: web3.eth.accounts[0], - data: AEnvStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function AEnvStorage_load(addr) { - return AEnvStorage_contract.at(addr); -} - -function AGov_new() { - return AGov_contract.new( - { - from: web3.eth.accounts[0], - data: AGov_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function AGov_load(addr) { - return AGov_contract.at(addr); -} -var BallotEnums_data = "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122091a15a61427e97bd4bc0a2766ba7c9d2f0fc00ff6d4c94d4b3851693f6a2a9db64736f6c63430008060033"; -var BallotEnums_contract = web3.eth.contract([]); - -function BallotEnums_new() { - return BallotEnums_contract.new( - { - from: web3.eth.accounts[0], - data: BallotEnums_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function BallotEnums_load(addr) { - return BallotEnums_contract.at(addr); -} -var EnvConstants_data = "0x608060405234801561001057600080fd5b506104ca806100206000396000f3fe608060405234801561001057600080fd5b50600436106101415760003560e01c80637b2bfb01116100b8578063c00ace6c1161007c578063c00ace6c146103aa578063c0b4fe15146103d1578063c42a0abc146103f8578063c6713baf1461041f578063c7d3da3414610446578063f38ecf471461046d57600080fd5b80637b2bfb0114610305578063918f86741461032c578063a6868b7d14610335578063a9b629b21461035c578063b128f8801461038357600080fd5b80633f35c8fe1161010a5780633f35c8fe1461021b5780634d273e28146102425780636167eb4514610269578063656e3052146102905780636d583ca7146102b75780636fde207a146102de57600080fd5b806215a73b146101465780630b1d39b81461017f578063238737b6146101a6578063278bb12a146101cd57806338294419146101f4575b600080fd5b61016d7f0c4fbe9dc9de15dd7c0d064975ee1a2f2f9b954fa0e65d4f6cddba94884bdc3e81565b60405190815260200160405180910390f35b61016d7fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d81565b61016d7f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27881565b61016d7f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2281565b61016d7fbe90e461bbdb9a95a694f7796912ea04244caf7f5b60ad7ded17e16821d3e44c81565b61016d7f2a268972a70c8c688b62366bdfdd9bb09cf19d3e5b6e7e7bb158e671ffdcedd281565b61016d7f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088881565b61016d7f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505081565b61016d7fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e781565b61016d7fc69fc6b7d0efc934fd5a3581c7253a7107a952526bb6dbcd814ef8d8dae1f44a81565b61016d7f0b09c9badbbeb6c813a598ee910770a39ccda797a1940439bb6e47fc6c87548b81565b61016d7f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa81565b61016d61271081565b61016d7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b81565b61016d7f89dd490ecaf395283ed4ff2fd9557ca767fc425dce063451a9b0da6d72f600c381565b61016d7f829561ab7af084b7efc6600518d2df79b8d95f3f4c3a550f54f8f7ec7d2b805781565b61016d7f18ad4415ef4a621ce1a136395c51ab6c3712bb2e24b79d526059925cea58dcb881565b61016d7f8086da5becff4dfac91a3105821b361078d2d4abba0ccc2401b974cf0dcf05c181565b61016d7fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747381565b61016d7fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6081565b61016d7f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc81565b61016d7f7c1150f0e1a39ff55552d52764f97e6c387e2a247e1df344369f122c4254be2f8156fea26469706673582212208e85eb98251b350efa0ef420d149d10a734f1d6332cbf74fab8178a917ce65ef64736f6c63430008060033"; -var EnvConstants_contract = web3.eth.contract([{"inputs":[],"name":"BALLOT_DURATION_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_FEE_MAX_CHANGE_RATE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKS_PER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_CREATION_TIME_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_GASLIMIT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_AMOUNT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_MAINTANANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_METHOD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GASLIMIT_AND_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAS_TARGET_PERCENTAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_IDLE_BLOCK_INTERVAL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRIORITY_FEE_PER_GAS_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]); - -function EnvConstants_new() { - return EnvConstants_contract.new( - { - from: web3.eth.accounts[0], - data: EnvConstants_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function EnvConstants_load(addr) { - return EnvConstants_contract.at(addr); -} - -function IBallotStorage_new() { - return IBallotStorage_contract.new( - { - from: web3.eth.accounts[0], - data: IBallotStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IBallotStorage_load(addr) { - return IBallotStorage_contract.at(addr); -} - -function IEnvStorage_new() { - return IEnvStorage_contract.new( - { - from: web3.eth.accounts[0], - data: IEnvStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IEnvStorage_load(addr) { - return IEnvStorage_contract.at(addr); -} - -function IGov_new() { - return IGov_contract.new( - { - from: web3.eth.accounts[0], - data: IGov_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IGov_load(addr) { - return IGov_contract.at(addr); -} - -function INCPStaking_new() { - return INCPStaking_contract.new( - { - from: web3.eth.accounts[0], - data: INCPStaking_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function INCPStaking_load(addr) { - return INCPStaking_contract.at(addr); -} - -function IRegistry_new() { - return IRegistry_contract.new( - { - from: web3.eth.accounts[0], - data: IRegistry_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IRegistry_load(addr) { - return IRegistry_contract.at(addr); -} - -function IStaking_new() { - return IStaking_contract.new( - { - from: web3.eth.accounts[0], - data: IStaking_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IStaking_load(addr) { - return IStaking_contract.at(addr); -} -var BallotStorage_data = "0x60806040526000606d553480156200001657600080fd5b50604051620039cf380380620039cf8339810160408190526200003991620001b6565b620000443362000056565b6200004f81620000a8565b50620001e8565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620000b262000158565b6001600160a01b0381166200010e5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064015b60405180910390fd5b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b6033546001600160a01b03163314620001b45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000105565b565b600060208284031215620001c957600080fd5b81516001600160a01b0381168114620001e157600080fd5b9392505050565b6137d780620001f86000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80636c78d2cf1161013b578063a91e59ba116100b8578063c0b6f1861161007c578063c0b6f186146105a6578063ce04b9d4146105b9578063daacbb95146105c1578063f2fde38b146105d4578063f680e555146105e757600080fd5b8063a91e59ba14610554578063a91ee0dc14610567578063b23c676c1461057a578063b47414951461058b578063bce0dbc11461059357600080fd5b80637bf46530116100ff5780637bf46530146104d95780637efa9ae3146104ed5780638da5cb5b1461051957806396462b9c1461052a5780639986e4b91461053d57600080fd5b80636c78d2cf1461044f578063715018a61461046b57806372d0ec9214610473578063738fdd1a1461048657806373df4e01146104b157600080fd5b806334125c84116101c95780635a55c1f01161018d5780635a55c1f01461038f5780635a731cca146103dd578063656bc633146103f4578063688ca5b2146104075780636c57f5a91461043757600080fd5b806334125c841461033b5780634a57823e1461034e5780634bd1ed7614610361578063557ed1ba1461037657806356ba988e1461037c57600080fd5b80631c150171116102105780631c150171146102d95780631d940da2146102e15780631e0cba0d146103035780632a74f38c146103145780632f40992e1461032757600080fd5b806302b385fb1461024257806309970688146102755780630a3a63fe146102a3578063155ca224146102c4575b600080fd5b61025561025036600461306d565b61062b565b60405161026c9b9a999897969594939291906136a6565b60405180910390f35b61028861028336600461306d565b6107f6565b6040805193845260208401929092529082015260600161026c565b6102b66102b136600461317d565b610956565b60405190815260200161026c565b6102d76102d236600461306d565b610a6e565b005b6102b6610bcf565b6102f46102ef36600461306d565b610c4e565b60405161026c9392919061347e565b6102b6665374616b696e6760c81b81565b6102d761032236600461302c565b610d06565b6102b66914995dd85c99141bdbdb60b21b81565b6102b66845636f73797374656d60b81b81565b6102b661035c3660046132ed565b610da0565b6102b66a4d61696e74656e616e636560a81b81565b426102b6565b61028861038a36600461306d565b610ea7565b6103a261039d36600461306d565b610ff8565b6040805196875260208701959095526001600160a01b03909316938501939093526060840152608083019190915260a082015260c00161026c565b6102b66c14dd185ada5b99d4995dd85c99609a1b81565b6102d76104023660046130e6565b6110c6565b61041a61041536600461306d565b6112d9565b60408051938452602084019290925215159082015260600161026c565b61043f61142f565b604051901515815260200161026c565b6102b67111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b6102d7611453565b6102d76104813660046130e6565b611467565b606554610499906001600160a01b031681565b6040516001600160a01b03909116815260200161026c565b6104c46104bf36600461306d565b611601565b60405161026c999897969594939291906133ff565b6102b669456e7653746f7261676560b01b81565b6104996104fb36600461306d565b6000908152606860205260409020600101546001600160a01b031690565b6033546001600160a01b0316610499565b6102d7610538366004613108565b61180e565b6102b66c42616c6c6f7453746f7261676560981b81565b6102d76105623660046130e6565b611af9565b6102d761057536600461302c565b611c77565b606c546001600160a01b0316610499565b606d546102b6565b6102d76105a136600461309f565b611d1f565b6102d76105b4366004613151565b611e64565b6102b6612044565b6102d76105cf3660046131d3565b612086565b6102d76105e236600461302c565b612396565b61043f6105f536600461336d565b66ffffffffffffff82166000908152606b602090815260408083206001600160a01b038516845290915290205460ff1692915050565b60008060008060606000806000806000806000606660008e815260200190815260200160002060405180610180016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016005820180546106c49061373b565b80601f01602080910402602001604051908101604052809291908181526020018280546106f09061373b565b801561073d5780601f106107125761010080835404028352916020019161073d565b820191906000526020600020905b81548152906001019060200180831161072057829003601f168201915b5050505050815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16151515158152602001600b82015481525050905080602001519b5080604001519a5080606001519950806080015198508060a0015197508060c0015196508060e00151955080610100015194508061012001519350806101400151925080610160015191505091939597999b90929496989a50565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a08401916108679061373b565b80601f01602080910402602001604051908101604052809291908181526020018280546108939061373b565b80156108e05780601f106108b5576101008083540402835291602001916108e0565b820191906000526020600020905b8154815290600101906020018083116108c357829003601f168201915b5050505050815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a900460ff16151515158152602001600b82015481525050905080602001519350806040015192508061016001519150509193909250565b60003361096161240f565b6001600160a01b0316146109905760405162461bcd60e51b815260040161098790613509565b60405180910390fd5b61099861242f565b6001600160a01b0316306001600160a01b0316146109c85760405162461bcd60e51b81526004016109879061361f565b600485146109e85760405162461bcd60e51b815260040161098790613567565b6001600160a01b038216610a0e5760405162461bcd60e51b815260040161098790613644565b610a1a8686868661244a565b506040805180820182528681526001600160a01b0392831660208083019182526000898152606890915292909220905181559051600190910180546001600160a01b03191691909216179055509192915050565b8033610a7861240f565b6001600160a01b03161480610aa657506000818152606660205260409020600401546001600160a01b031633145b610ac25760405162461bcd60e51b815260040161098790613509565b610aca61242f565b6001600160a01b0316306001600160a01b031614610afa5760405162461bcd60e51b81526004016109879061361f565b6000828152606660205260409020548214610b275760405162461bcd60e51b8152600401610987906134a6565b6000828152606660205260409020600a015460ff1615610b595760405162461bcd60e51b815260040161098790613594565b600160008381526066602052604090206009015414610b8a5760405162461bcd60e51b8152600401610987906135f6565b60008281526066602052604090206005600982015560405183907fd5e541d004c50564e5e05fcbc6be2916c68d817507693dc3774c69dde4ce13dc90600090a2505050565b6000610bd9612705565b6001600160a01b03166333be496e6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1157600080fd5b505afa158015610c25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c499190613086565b905090565b600081815260696020526040902060018101546002820154600383018054929391926060929190610c7e9061373b565b80601f0160208091040260200160405190810160405280929190818152602001828054610caa9061373b565b8015610cf75780601f10610ccc57610100808354040283529160200191610cf7565b820191906000526020600020905b815481529060010190602001808311610cda57829003601f168201915b50505050509150509193909250565b610d0e61271d565b6001600160a01b038116610d565760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610987565b606c80546001600160a01b0319166001600160a01b0383169081179091556040517f3d809312b6e303291a93b307c7ddbd0960c094f5f0fb4e3ba0758775013edeb390600090a250565b600033610dab61240f565b6001600160a01b031614610dd15760405162461bcd60e51b815260040161098790613509565b610dd961242f565b6001600160a01b0316306001600160a01b031614610e095760405162461bcd60e51b81526004016109879061361f565b610e14878584612777565b610e305760405162461bcd60e51b815260040161098790613644565b610e3c8888888861244a565b6040805160808101825289815260208082018781528284018781526060840187815260008e81526069855295909520845181559151600183015551600282015592518051929384939092610e97926003850192910190612ef6565b50999a9950505050505050505050565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a0840191610f189061373b565b80601f0160208091040260200160405190810160405280929190818152602001828054610f449061373b565b8015610f915780601f10610f6657610100808354040283529160200191610f91565b820191906000526020600020905b815481529060010190602001808311610f7457829003601f168201915b505050918352505060068201546020820152600782015460408201526008820154606082015260098201546080820152600a82015460ff16151560a0820152600b9091015460c09182015281015160e0820151610100909201519097919650945092505050565b6000818152606a60205260408120548190819081908190819087146110545760405162461bcd60e51b81526020600482015260126024820152711b9bdd08195e1a5cdd1959081d9bdd19525960721b6044820152606401610987565b50505060009384525050606a6020908152604092839020835160c0810185528154808252600183015493820184905260028301546001600160a01b031695820186905260038301546060830181905260048401546080840181905260059094015460a090930183905290969395945092565b81336110d061240f565b6001600160a01b031614806110fe57506000818152606660205260409020600401546001600160a01b031633145b61111a5760405162461bcd60e51b815260040161098790613509565b61112261242f565b6001600160a01b0316306001600160a01b0316146111525760405162461bcd60e51b81526004016109879061361f565b818061115c610bcf565b11156111aa5760405162461bcd60e51b815260206004820152601c60248201527f556e646572206d696e2076616c7565206f6620206475726174696f6e000000006044820152606401610987565b6111b2612044565b8111156112015760405162461bcd60e51b815260206004820152601a60248201527f4f766572206d61782076616c7565206f66206475726174696f6e0000000000006044820152606401610987565b600084815260666020526040902054841461122e5760405162461bcd60e51b8152600401610987906134a6565b6000848152606660205260409020600a015460ff16156112605760405162461bcd60e51b815260040161098790613594565b6001600085815260666020526040902060090154146112915760405162461bcd60e51b8152600401610987906135f6565b600084815260666020526040808220600b810186905590519091339187917ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a91a35050505050565b6000818152606660209081526040808320815161018081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546001600160a01b031660808301526005810180548493849384939192909160a084019161134a9061373b565b80601f01602080910402602001604051908101604052809291908181526020018280546113769061373b565b80156113c35780601f10611398576101008083540402835291602001916113c3565b820191906000526020600020905b8154815290600101906020018083116113a657829003601f168201915b50505091835250506006820154602082015260078201546040820152600882015460608083019190915260098301546080830152600a83015460ff16151560a0830152600b9092015460c090910152810151610120820151610140909201519097919650945092505050565b600061143961242f565b6001600160a01b0316306001600160a01b03161415905090565b61145b61271d565b6114656000612856565b565b3361147061240f565b6001600160a01b0316146114965760405162461bcd60e51b815260040161098790613509565b61149e61242f565b6001600160a01b0316306001600160a01b0316146114ce5760405162461bcd60e51b81526004016109879061361f565b60008281526066602052604090205482146114fb5760405162461bcd60e51b8152600401610987906134a6565b60008281526067602052604090205482146115585760405162461bcd60e51b815260206004820152601860248201527f6e6f7420657869737465642042616c6c6f744d656d62657200000000000000006044820152606401610987565b6000828152606660205260409020600a015460ff161561158a5760405162461bcd60e51b815260040161098790613594565b6001600083815260666020526040902060090154146115bb5760405162461bcd60e51b8152600401610987906135f6565b6000828152606760205260408082206009810184905590519091339185917ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a91a3505050565b600081815260676020526040812060018101546002820154600383015460048401546005850180546001600160a01b0395861697948616969386169590921693606093849384938392916116549061373b565b80601f01602080910402602001604051908101604052809291908181526020018280546116809061373b565b80156116cd5780601f106116a2576101008083540402835291602001916116cd565b820191906000526020600020905b8154815290600101906020018083116116b057829003601f168201915b505050505095508060060180546116e39061373b565b80601f016020809104026020016040519081016040528092919081815260200182805461170f9061373b565b801561175c5780601f106117315761010080835404028352916020019161175c565b820191906000526020600020905b81548152906001019060200180831161173f57829003601f168201915b505050505094508060070180546117729061373b565b80601f016020809104026020016040519081016040528092919081815260200182805461179e9061373b565b80156117eb5780601f106117c0576101008083540402835291602001916117eb565b820191906000526020600020905b8154815290600101906020018083116117ce57829003601f168201915b505050505093508060080154925080600901549150509193959799909294969850565b3361181761240f565b6001600160a01b03161461183d5760405162461bcd60e51b815260040161098790613509565b61184561242f565b6001600160a01b0316306001600160a01b0316146118755760405162461bcd60e51b81526004016109879061361f565b60018214806118845750600282145b6118c35760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103232b1b4b9b4b7b760811b6044820152606401610987565b60008481526066602052604090205484146118f05760405162461bcd60e51b8152600401610987906134a6565b6000858152606a60205260409020548514156119475760405162461bcd60e51b8152602060048201526016602482015275185b1c9958591e48195e1a5cdd1959081d9bdd19525960521b6044820152606401610987565b6000848152606b602090815260408083206001600160a01b038716845290915290205460ff16156119aa5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610987565b600260008581526066602052604090206009015414611a025760405162461bcd60e51b81526020600482015260146024820152734e6f7420496e50726f677265737320537461746560601b6044820152606401610987565b6040518060c00160405280868152602001858152602001846001600160a01b03168152602001838152602001828152602001611a3b4290565b90526000868152606a602090815260409182902083518155908301516001820155908201516002820180546001600160a01b0319166001600160a01b03909216919091179055606082015160038201556080820151600482015560a090910151600590910155611aad848484846128a8565b826001600160a01b031684867f41df84b3b467b06744e40c92613c666324e7c640ce0a41ec06efdf602d36760685604051611aea91815260200190565b60405180910390a45050505050565b33611b0261240f565b6001600160a01b031614611b285760405162461bcd60e51b815260040161098790613509565b611b3061242f565b6001600160a01b0316306001600160a01b031614611b605760405162461bcd60e51b81526004016109879061361f565b6000828152606660205260409020548214611b8d5760405162461bcd60e51b8152600401610987906134a6565b6000828152606660205260409020600a015460ff1615611bbf5760405162461bcd60e51b815260040161098790613594565b6003811480611bce5750600481145b611c115760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642042616c6c6f7420537461746560601b6044820152606401610987565b6000828152606660205260409081902060098101839055600a8101805460ff19166001179055905183907fdc921f027328d7238b58d77649ebcbd0c8b1c494c66ba53dfe53e0de65f6dd9f90611c6a9085815260200190565b60405180910390a2505050565b611c7f61271d565b6001600160a01b038116611cd55760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f0000000000006044820152606401610987565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b8133611d2961240f565b6001600160a01b03161480611d5757506000818152606660205260409020600401546001600160a01b031633145b611d735760405162461bcd60e51b815260040161098790613509565b611d7b61242f565b6001600160a01b0316306001600160a01b031614611dab5760405162461bcd60e51b81526004016109879061361f565b6000838152606660205260409020548314611dd85760405162461bcd60e51b8152600401610987906134a6565b6000838152606660205260409020600a015460ff1615611e0a5760405162461bcd60e51b815260040161098790613594565b600083815260666020908152604090912083519091611e30916005840191860190612ef6565b50604051339085907ff0855c0e0ad9b8a162b87f2e4e07d4b2a3f0a45126b15ff4a78b217ad19a901a90600090a350505050565b33611e6d61240f565b6001600160a01b031614611e935760405162461bcd60e51b815260040161098790613509565b611e9b61242f565b6001600160a01b0316306001600160a01b031614611ecb5760405162461bcd60e51b81526004016109879061361f565b8181600082118015611edd5750600081115b611f1d5760405162461bcd60e51b815260206004820152601160248201527007374617274206f7220656e64206973203607c1b6044820152606401610987565b818111611f5b5760405162461bcd60e51b815260206004820152600c60248201526b1cdd185c9d080f8f48195b9960a21b6044820152606401610987565b6000858152606660205260409020548514611f885760405162461bcd60e51b8152600401610987906134a6565b6000858152606660205260409020600a015460ff1615611fba5760405162461bcd60e51b815260040161098790613594565b600160008681526066602052604090206009015414611feb5760405162461bcd60e51b8152600401610987906135f6565b600085815260666020526040902060018101859055600280820185905560098201556040518490869088907fd9938a514dab5cdce149a77493f694bd70c24a4833a278fd4d86fbdf859099c590600090a4505050505050565b600061204e612705565b6001600160a01b0316631b27e01b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1157600080fd5b3361208f61240f565b6001600160a01b0316146120b55760405162461bcd60e51b815260040161098790613509565b6120bd61242f565b6001600160a01b0316306001600160a01b0316146120ed5760405162461bcd60e51b81526004016109879061361f565b6120fe8b8989898989898989612a11565b61211a5760405162461bcd60e51b815260040161098790613644565b6121268c8c8c8c61244a565b6121a06040518061014001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160008152602001600081525090565b8c8160000181815250508881602001906001600160a01b031690816001600160a01b0316815250508781604001906001600160a01b031690816001600160a01b0316815250508681606001906001600160a01b031690816001600160a01b0316815250508581608001906001600160a01b031690816001600160a01b031681525050848160a00181905250838160c00181905250828160e00181905250818161010001818152505080606760008f81526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160030160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a0820151816005019080519060200190612336929190612ef6565b5060c08201518051612352916006840191602090910190612ef6565b5060e0820151805161236e916007840191602090910190612ef6565b5061010082015160088201556101209091015160099091015550505050505050505050505050565b61239e61271d565b6001600160a01b0381166124035760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610987565b61240c81612856565b50565b6000610c497111dbdd995c9b985b98d950dbdb9d1c9858dd60721b612e73565b6000610c496c42616c6c6f7453746f7261676560981b612e73565b8180612454610bcf565b11156124a25760405162461bcd60e51b815260206004820152601c60248201527f556e646572206d696e2076616c7565206f6620206475726174696f6e000000006044820152606401610987565b6124aa612044565b8111156124f95760405162461bcd60e51b815260206004820152601a60248201527f4f766572206d61782076616c7565206f66206475726174696f6e0000000000006044820152606401610987565b6000858152606660205260409020548514156125505760405162461bcd60e51b8152602060048201526016602482015275105b1c9958591e48195e1a5cdd19590818985b1b1bdd60521b6044820152606401610987565b6125bf6040518061018001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016060815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081525090565b858152606081018590526001600160a01b0383166080820152600161012082015260006101408201819052610160820185905286815260666020908152604091829020835181558184015160018201559183015160028301556060830151600383015560808301516004830180546001600160a01b0319166001600160a01b0390921691909117905560a08301518051849392612663926005850192910190612ef6565b5060c0820151600682015560e0820151600782015561010082015160088201556101208201516009820155610140820151600a8201805460ff191691151591909117905561016090910151600b90910155606d546126c2906001613715565b606d556040516001600160a01b03841690869088907fd1ba591c76ef71222e2d30b8277758713cc6eef1de29efaf98a716744ac2420b90600090a4505050505050565b6000610c4969456e7653746f7261676560b01b612e73565b6033546001600160a01b031633146114655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610987565b6000600584146127995760405162461bcd60e51b815260040161098790613567565b826127f05760405162461bcd60e51b815260206004820152602160248201527f496e76616c696420656e7669726f6e6d656e74207661726961626c65206e616d6044820152606560f81b6064820152608401610987565b600082511161284c5760405162461bcd60e51b815260206004820152602260248201527f496e76616c696420656e7669726f6e6d656e74207661726961626c652076616c604482015261756560f01b6064820152608401610987565b5060019392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60018214806128b75750600282145b6128f65760405162461bcd60e51b815260206004820152601060248201526f24b73b30b634b2103232b1b4b9b4b7b760811b6044820152606401610987565b60008481526066602052604090205484146129235760405162461bcd60e51b8152600401610987906134a6565b6000848152606b602090815260408083206001600160a01b038716845290915290205460ff16156129865760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481d9bdd1959609a1b6044820152606401610987565b6000848152606660209081526040808320606b83528184206001600160a01b0388168552909252909120805460ff1916600190811790915560068201546129cc91613715565b600682015560018314156129f4578181600701546129ea9190613715565b6007820155612a0a565b818160080154612a049190613715565b60088201555b5050505050565b600060018a10158015612a25575060038a11155b612a415760405162461bcd60e51b815260040161098790613567565b60028a1415612c01576001600160a01b038916612a705760405162461bcd60e51b8152600401610987906135bf565b6001600160a01b03881615612a975760405162461bcd60e51b815260040161098790613530565b6001600160a01b03871615612abe5760405162461bcd60e51b81526004016109879061366f565b6001600160a01b03861615612ae55760405162461bcd60e51b8152600401610987906134d2565b845115612b2c5760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964206e6577206e6f6465206e616d6560581b6044820152606401610987565b835115612b715760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b995dc81b9bd919481a59606a1b6044820152606401610987565b825115612bb65760405162461bcd60e51b81526020600482015260136024820152720496e76616c6964206e6577206e6f646520495606c1b6044820152606401610987565b8115612bfc5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b995dc81b9bd91948141bdc9d605a1b6044820152606401610987565b612e63565b6000855111612c4a5760405162461bcd60e51b8152602060048201526015602482015274496e76616c6964206e6577206e6f6465206e616d6560581b6044820152606401610987565b8351604014612c915760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b995dc81b9bd919481a59606a1b6044820152606401610987565b6000835111612cd85760405162461bcd60e51b81526020600482015260136024820152720496e76616c6964206e6577206e6f646520495606c1b6044820152606401610987565b60008211612d205760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081b995dc81b9bd91948141bdc9d605a1b6044820152606401610987565b60018a1415612dc2576001600160a01b03891615612d505760405162461bcd60e51b8152600401610987906135bf565b6001600160a01b038816612d765760405162461bcd60e51b815260040161098790613530565b6001600160a01b038716612d9c5760405162461bcd60e51b81526004016109879061366f565b6001600160a01b038616612bfc5760405162461bcd60e51b8152600401610987906134d2565b60038a1415612e63576001600160a01b038916612df15760405162461bcd60e51b8152600401610987906135bf565b6001600160a01b038816612e175760405162461bcd60e51b815260040161098790613530565b6001600160a01b038716612e3d5760405162461bcd60e51b81526004016109879061366f565b6001600160a01b038616612e635760405162461bcd60e51b8152600401610987906134d2565b5060019998505050505050505050565b606554604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd9060240160206040518083038186803b158015612eb857600080fd5b505afa158015612ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ef09190613050565b92915050565b828054612f029061373b565b90600052602060002090601f016020900481019282612f245760008555612f6a565b82601f10612f3d57805160ff1916838001178555612f6a565b82800160010185558215612f6a579182015b82811115612f6a578251825591602001919060010190612f4f565b50612f76929150612f7a565b5090565b5b80821115612f765760008155600101612f7b565b8035612f9a8161378c565b919050565b600082601f830112612fb057600080fd5b813567ffffffffffffffff80821115612fcb57612fcb613776565b604051601f8301601f19908116603f01168101908282118183101715612ff357612ff3613776565b8160405283815286602085880101111561300c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561303e57600080fd5b81356130498161378c565b9392505050565b60006020828403121561306257600080fd5b81516130498161378c565b60006020828403121561307f57600080fd5b5035919050565b60006020828403121561309857600080fd5b5051919050565b600080604083850312156130b257600080fd5b82359150602083013567ffffffffffffffff8111156130d057600080fd5b6130dc85828601612f9f565b9150509250929050565b600080604083850312156130f957600080fd5b50508035926020909101359150565b600080600080600060a0868803121561312057600080fd5b853594506020860135935060408601356131398161378c565b94979396509394606081013594506080013592915050565b60008060006060848603121561316657600080fd5b505081359360208301359350604090920135919050565b600080600080600060a0868803121561319557600080fd5b85359450602086013593506040860135925060608601356131b58161378c565b915060808601356131c58161378c565b809150509295509295909350565b6000806000806000806000806000806000806101808d8f0312156131f657600080fd5b8c359b5060208d01359a5060408d0135995061321460608e01612f8f565b985061322260808e01612f8f565b975061323060a08e01612f8f565b965061323e60c08e01612f8f565b955061324c60e08e01612f8f565b945067ffffffffffffffff6101008e0135111561326857600080fd5b6132798e6101008f01358f01612f9f565b935067ffffffffffffffff6101208e0135111561329557600080fd5b6132a68e6101208f01358f01612f9f565b925067ffffffffffffffff6101408e013511156132c257600080fd5b6132d38e6101408f01358f01612f9f565b91506101608d013590509295989b509295989b509295989b565b600080600080600080600060e0888a03121561330857600080fd5b87359650602088013595506040880135945060608801356133288161378c565b93506080880135925060a0880135915060c088013567ffffffffffffffff81111561335257600080fd5b61335e8a828b01612f9f565b91505092959891949750929550565b6000806040838503121561338057600080fd5b823566ffffffffffffff8116811461339757600080fd5b915060208301356133a78161378c565b809150509250929050565b6000815180845260005b818110156133d8576020818501810151868301820152016133bc565b818111156133ea576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b038a8116825289811660208301528881166040830152871660608201526101206080820181905260009061343c838201896133b2565b905082810360a084015261345081886133b2565b905082810360c084015261346481876133b2565b60e084019590955250506101000152979650505050505050565b83815282602082015260606040820152600061349d60608301846133b2565b95945050505050565b6020808252601290820152711b9bdd08195e1a5cdd19590810985b1b1bdd60721b604082015260600190565b6020808252601a908201527f496e76616c6964206e6577207265776172642061646472657373000000000000604082015260600190565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b6020808252601a908201527f496e76616c6964206e6577207374616b65722061646472657373000000000000604082015260600190565b602080825260139082015272496e76616c69642042616c6c6f74205479706560681b604082015260600190565b602080825260119082015270185b1c9958591e48199a5b985b1a5e9959607a1b604082015260600190565b6020808252601a908201527f496e76616c6964206f6c64207374616b65722061646472657373000000000000604082015260600190565b6020808252600f908201526e4e6f7420526561647920537461746560881b604082015260600190565b6020808252600b908201526a125cc8111a5cd8589b195960aa1b604082015260600190565b60208082526011908201527024b73b30b634b2102830b930b6b2ba32b960791b604082015260600190565b60208082526019908201527f496e76616c6964206e657720766f746572206164647265737300000000000000604082015260600190565b60006101608d83528c60208401528b604084015260018060a01b038b1660608401528060808401526136da8184018b6133b2565b60a0840199909952505060c081019590955260e085019390935261010084019190915215156101208301526101409091015295945050505050565b6000821982111561373657634e487b7160e01b600052601160045260246000fd5b500190565b600181811c9082168061374f57607f821691505b6020821081141561377057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461240c57600080fdfea264697066735822122093b350b4e7739704fca6953d73448f06b7d3a325e6ae0e376a14d07e6cb03c8c64736f6c63430008060033"; -var BallotStorage_contract = web3.eth.contract([{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"}],"name":"BallotCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"ballotType","type":"uint256"},{"indexed":true,"internalType":"address","name":"creator","type":"address"}],"name":"BallotCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"state","type":"uint256"}],"name":"BallotFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"BallotStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":true,"internalType":"address","name":"updatedBy","type":"address"}],"name":"BallotUpdated","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":"previous","type":"address"}],"name":"SetPrevBallotStorage","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"voteid","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"ballotId","type":"uint256"},{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"decision","type":"uint256"}],"name":"Voted","type":"event"},{"inputs":[],"name":"BALLOT_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ENV_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTENANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_POOL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"}],"name":"cancelBallot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_ballotType","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_newGovernanceAddress","type":"address"}],"name":"createBallotForAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_ballotType","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"address","name":"_oldStakerAddress","type":"address"},{"internalType":"address","name":"_newStakerAddress","type":"address"},{"internalType":"address","name":"_newVoterAddress","type":"address"},{"internalType":"address","name":"_newRewardAddress","type":"address"},{"internalType":"bytes","name":"_newNodeName","type":"bytes"},{"internalType":"bytes","name":"_newNodeId","type":"bytes"},{"internalType":"bytes","name":"_newNodeIp","type":"bytes"},{"internalType":"uint256","name":"_newNodePort","type":"uint256"}],"name":"createBallotForMember","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_ballotType","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"address","name":"_creator","type":"address"},{"internalType":"bytes32","name":"_envVariableName","type":"bytes32"},{"internalType":"uint256","name":"_envVariableType","type":"uint256"},{"internalType":"bytes","name":"_envVariableValue","type":"bytes"}],"name":"createBallotForVariable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteId","type":"uint256"},{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"uint256","name":"_decision","type":"uint256"},{"internalType":"uint256","name":"_power","type":"uint256"}],"name":"createVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"uint256","name":"_ballotState","type":"uint256"}],"name":"finalizeBallot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotAddress","outputs":[{"internalType":"address","name":"newGovernanceAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotBasic","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"ballotType","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"bytes","name":"memo","type":"bytes"},{"internalType":"uint256","name":"totalVoters","type":"uint256"},{"internalType":"uint256","name":"powerOfAccepts","type":"uint256"},{"internalType":"uint256","name":"powerOfRejects","type":"uint256"},{"internalType":"uint256","name":"state","type":"uint256"},{"internalType":"bool","name":"isFinalized","type":"bool"},{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBallotCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotMember","outputs":[{"internalType":"address","name":"oldStakerAddress","type":"address"},{"internalType":"address","name":"newStakerAddress","type":"address"},{"internalType":"address","name":"newVoterAddress","type":"address"},{"internalType":"address","name":"newRewardAddress","type":"address"},{"internalType":"bytes","name":"newNodeName","type":"bytes"},{"internalType":"bytes","name":"newNodeId","type":"bytes"},{"internalType":"bytes","name":"newNodeIp","type":"bytes"},{"internalType":"uint256","name":"newNodePort","type":"uint256"},{"internalType":"uint256","name":"lockAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotPeriod","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotState","outputs":[{"internalType":"uint256","name":"ballotType","type":"uint256"},{"internalType":"uint256","name":"state","type":"uint256"},{"internalType":"bool","name":"isFinalized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotVariable","outputs":[{"internalType":"bytes32","name":"envVariableName","type":"bytes32"},{"internalType":"uint256","name":"envVariableType","type":"uint256"},{"internalType":"bytes","name":"envVariableValue","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getBallotVotingInfo","outputs":[{"internalType":"uint256","name":"totalVoters","type":"uint256"},{"internalType":"uint256","name":"powerOfAccepts","type":"uint256"},{"internalType":"uint256","name":"powerOfRejects","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxVotingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinVotingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPreviousBallotStorage","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteId","type":"uint256"}],"name":"getVote","outputs":[{"internalType":"uint256","name":"voteId","type":"uint256"},{"internalType":"uint256","name":"ballotId","type":"uint256"},{"internalType":"address","name":"voter","type":"address"},{"internalType":"uint256","name":"decision","type":"uint256"},{"internalType":"uint256","name":"power","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint56","name":"_ballotId","type":"uint56"},{"internalType":"address","name":"_voter","type":"address"}],"name":"hasAlreadyVoted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reg","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setPreviousBallotStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"startBallot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"updateBallotDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"uint256","name":"_lockAmount","type":"uint256"}],"name":"updateBallotMemberLockAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ballotId","type":"uint256"},{"internalType":"bytes","name":"_memo","type":"bytes"}],"name":"updateBallotMemo","outputs":[],"stateMutability":"nonpayable","type":"function"}]); - -function BallotStorage_new() { - return BallotStorage_contract.new( - { - from: web3.eth.accounts[0], - data: BallotStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function BallotStorage_load(addr) { - return BallotStorage_contract.at(addr); -} -var EnvStorage_data = "0x608060405234801561001057600080fd5b506040516106fc3803806106fc83398101604081905261002f91610301565b80604051806020016040528060008152506100528282600061005a60201b60201c565b5050506103a5565b61006383610090565b6000825111806100705750805b1561008b5761008983836100d060201b61008b1760201c565b505b505050565b610099816100fc565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100f583836040518060600160405280602781526020016106d5602791396101ce565b9392505050565b61010f8161024760201b6100b71760201c565b6101765760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101ad7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61025660201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101eb919061032a565b600060405180830381855af49150503d8060008114610226576040519150601f19603f3d011682016040523d82523d6000602084013e61022b565b606091505b50909250905061023d86838387610259565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102c55782516102be576001600160a01b0385163b6102be5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161016d565b50816102cf565b6102cf83836102d7565b949350505050565b8151156102e75781518083602001fd5b8060405162461bcd60e51b815260040161016d9190610346565b60006020828403121561031357600080fd5b81516001600160a01b03811681146100f557600080fd5b6000825161033c818460208701610379565b9190910192915050565b6020815260008251806020840152610365816040850160208701610379565b601f01601f19169190910160400192915050565b60005b8381101561039457818101518382015260200161037c565b838111156100895750506000910152565b610321806103b46000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102c560279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161013d9190610245565b600060405180830381855af49150503d8060008114610178576040519150601f19603f3d011682016040523d82523d6000602084013e61017d565b606091505b509150915061018e86838387610198565b9695505050505050565b60608315610209578251610202576001600160a01b0385163b6102025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610213565b610213838361021b565b949350505050565b81511561022b5781518083602001fd5b8060405162461bcd60e51b81526004016101f99190610261565b60008251610257818460208701610294565b9190910192915050565b6020815260008251806020840152610280816040850160208701610294565b601f01601f19169190910160400192915050565b60005b838110156102af578181015183820152602001610297565b838111156102be576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220a65c62f31a2c1fba0806287df9b2b67e8061271bff228f6d5e0129a412464b0764736f6c63430008060033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564"; -var EnvStorage_contract = web3.eth.contract([{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]); - -function EnvStorage_new() { - return EnvStorage_contract.new( - { - from: web3.eth.accounts[0], - data: EnvStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function EnvStorage_load(addr) { - return EnvStorage_contract.at(addr); -} -var EnvStorageImp_data = "0x60a06040523060601b6080523480156200001857600080fd5b506200002362000029565b620000ea565b603854610100900460ff1615620000965760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60385460ff90811614620000e8576038805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160601c61369c6200011760003960008181611a1f01528181611aa40152611b7c015261369c6000f3fe6080604052600436106104e05760003560e01c80636fde207a11610281578063a6ed563e1161015a578063c42a0abc116100cc578063e078869f11610085578063e078869f146113d0578063ec3df879146113f0578063f2fde38b14611410578063f38ecf4714611430578063f6fd712914611452578063f82145911461147257600080fd5b8063c42a0abc146112a7578063c6713baf146112db578063c7d3da341461130f578063c95437be14611343578063cdb9f6431461138e578063dc97d962146113a357600080fd5b8063b4d6bd3b1161011e578063b4d6bd3b146111d6578063bd02d0f5146111f6578063be33732a14611223578063c00ace6c14611243578063c031a18014611265578063c0b4fe151461128557600080fd5b8063a6ed563e1461111b578063a91ee0dc14611148578063a9b629b214611168578063aba01fee1461118a578063b128f880146111b457600080fd5b80638c8b887e116101f35780639801bff9116101b75780639801bff914611036578063986e791a146110565780639986e4b914611083578063a36f259b146110a7578063a5d6a581146110c7578063a6868b7d146110e757600080fd5b80638c8b887e14610ee45780638d5cdd7e14610f045780638da5cb5b14610f245780638f6fe72514610f42578063918f86741461102057600080fd5b8063738fdd1a11610245578063738fdd1a14610e0f57806379e8585914610e2f5780637b2bfb0114610e4f5780637bf4653014610e83578063852cf38f14610ea457806388c2801914610ec457600080fd5b80636fde207a14610d4d5780636fe1317714610d6f578063715018a614610d8f57806371c6960d14610da4578063737c59b814610dc457600080fd5b806334125c84116103be5780634bd1ed76116103305780635dba8c4a116102e95780635dba8c4a14610b985780636167eb4514610be3578063656e305214610c1757806367d1a2e014610c4b5780636c78d2cf14610d025780636d583ca714610d2b57600080fd5b80634bd1ed7614610ad65780634d273e2814610af85780634f1ef28614610b2c57806352d1902d14610b3f578063539927be14610b545780635a731cca14610b7457600080fd5b80633d4c65f3116103825780633d4c65f314610a145780633e8daafe14610a345780633f35c8fe14610a54578063408d79cf14610a7657806344b8991414610a9657806345b5ec2914610ab657600080fd5b806334125c84146109275780633659cfe6146109475780633690057a1461096757806338294419146109b25780633848207a146109d457600080fd5b806321f8a721116104575780632eccd8321161041b5780632eccd832146108105780632ed19cd5146108305780632f40992e146108505780633305508e1461087157806333be496e1461089157806333e31184146108dc57600080fd5b806321f8a721146106ef578063238737b61461073d578063278bb12a146107715780632b2eaa92146107a55780632eb57c65146107f057600080fd5b80630fc238bf116104a95780630fc238bf146105db5780630fca11d2146105fb578063124cea371461061b578063185582f11461063b5780631b27e01b146106865780631e0cba0d146106d157600080fd5b806215a73b146104e5578063076cd77f1461051a5780630add66dd146105655780630b1d39b8146105875780630b90a39a146105bb575b600080fd5b3480156104f157600080fd5b5061050760008051602061354083398151915281565b6040519081526020015b60405180910390f35b34801561052657600080fd5b506000805160206135a083398151915260005260026020527fd7a437163435b79030132855d9146a10e26570f1767311219983e0c430cfa69054610507565b34801561057157600080fd5b50610585610580366004613264565b611497565b005b34801561059357600080fd5b506105077fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d81565b3480156105c757600080fd5b506105856105d63660046131e9565b6115ed565b3480156105e757600080fd5b506105856105f63660046131e9565b61162d565b34801561060757600080fd5b50610585610616366004613264565b61166a565b34801561062757600080fd5b506105856106363660046131e9565b61172f565b34801561064757600080fd5b5060008051602061350083398151915260005260026020527fbc779bbce8d4fef90926dc39b56d9135e8e3795964b3adae769767961d4a94d854610507565b34801561069257600080fd5b5060008051602061354083398151915260005260026020527f5a1993193b8890c75d83157b2c2c12b144545357ab60021d7429856434de051b54610507565b3480156106dd57600080fd5b50610507665374616b696e6760c81b81565b3480156106fb57600080fd5b5061072561070a366004613186565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610511565b34801561074957600080fd5b506105077f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27881565b34801561077d57600080fd5b506105077f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2281565b3480156107b157600080fd5b5060008051602061358083398151915260005260026020527f270fb31b28afd06ad35288bc3cb901686a4c5a15239e966fd9b64269abd226c354610507565b3480156107fc57600080fd5b5061058561080b366004613186565b61176c565b34801561081c57600080fd5b5061058561082b3660046131e9565b6117b3565b34801561083c57600080fd5b5061058561084b366004613186565b6117f0565b34801561085c57600080fd5b506105076914995dd85c99141bdbdb60b21b81565b34801561087d57600080fd5b5061058561088c366004613186565b611837565b34801561089d57600080fd5b5060008051602061362783398151915260005260026020527f8e8c0bef3b4557d74ba01e0433728c574990153e35cacae69cb26f23a8a4017554610507565b3480156108e857600080fd5b5060008051602061352083398151915260005260026020527ff3497fe1496bfc19eaef6d253f75ec2e9cfe1b4f6080c29192641567c6fc5d8754610507565b34801561093357600080fd5b506105076845636f73797374656d60b81b81565b34801561095357600080fd5b50610585610962366004613028565b61187e565b34801561097357600080fd5b5060008051602061360783398151915260005260026020527f14e650c949c7cc3fca2efe79b3711fc734b4df488cc27c4137f35bd0adaae7fa54610507565b3480156109be57600080fd5b5061050760008051602061358083398151915281565b3480156109e057600080fd5b50610a046109ef366004613186565b60009081526020819052604090205460ff1690565b6040519015158152602001610511565b348015610a2057600080fd5b50610585610a2f3660046131e9565b6118d8565b348015610a4057600080fd5b50610585610a4f3660046131e9565b611915565b348015610a6057600080fd5b5061050760008051602061360783398151915281565b348015610a8257600080fd5b50610585610a913660046131e9565b611952565b348015610aa257600080fd5b50610585610ab13660046131e9565b61198f565b348015610ac257600080fd5b50610585610ad13660046131e9565b6119cc565b348015610ae257600080fd5b506105076a4d61696e74656e616e636560a81b81565b348015610b0457600080fd5b506105077f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088881565b610585610b3a366004613136565b611a14565b348015610b4b57600080fd5b50610507611b6f565b348015610b6057600080fd5b50610585610b6f366004613062565b611c22565b348015610b8057600080fd5b506105076c14dd185ada5b99d4995dd85c99609a1b81565b348015610ba457600080fd5b5060008051602061356083398151915260005260026020527f38eb620cc1355554391bc9d0c224a726d66edf7c3eb2d67af166d6e81fe4456254610507565b348015610bef57600080fd5b506105077f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505081565b348015610c2357600080fd5b506105077fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e781565b348015610c5757600080fd5b5060026020527fc77500645c8acbf6137a0e04460f85359483e3b08db30285cca2957db0c90904547fca55256fa8d248a334a7cb4ca72d9aec97700e81b3784b43c388b9a8d0e2b8e3547f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df08886000527fba5524e01c8da4a46e6f70a8f29f4dc63d299ad01d2f01ccae9666cb85f6f7c05460408051938452602084019290925290820152606001610511565b348015610d0e57600080fd5b506105077111dbdd995c9b985b98d950dbdb9d1c9858dd60721b81565b348015610d3757600080fd5b5061050760008051602061362783398151915281565b348015610d5957600080fd5b506105076000805160206135a083398151915281565b348015610d7b57600080fd5b50610585610d8a366004613186565b611eba565b348015610d9b57600080fd5b50610585611f01565b348015610db057600080fd5b50610585610dbf3660046131e9565b611f15565b348015610dd057600080fd5b506000805160206134e083398151915260005260026020527f673c817b54d53459fa437d6b11ba6445e517d8dc789e6b815675ff10e6aeeb5d54610507565b348015610e1b57600080fd5b50609d54610725906001600160a01b031681565b348015610e3b57600080fd5b50610585610e4a366004613186565b611f52565b348015610e5b57600080fd5b506105077f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa81565b348015610e8f57600080fd5b5061050769456e7653746f7261676560b01b81565b348015610eb057600080fd5b50610585610ebf366004613186565b611f99565b348015610ed057600080fd5b50610585610edf3660046131b8565b611fe0565b348015610ef057600080fd5b50610585610eff3660046131e9565b61215e565b348015610f1057600080fd5b50610585610f1f36600461321e565b6121b4565b348015610f3057600080fd5b50606b546001600160a01b0316610725565b348015610f4e57600080fd5b5060026020527fe6679752544e0074a1c9bec26775117fd40d133ce43cc443fb5f2512ebd7c2af547f89fc1b873e9ef0767cf41719c69200c3f894c43d73c49eb537ca60ec0a2d14bc547fa04c555f883d07b5c5fe85061c632b6bfec696b67afa8ad5e9773b89249984b2547fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d6000527f286a480438fb7eb9f5465ec436e6de865b71284ceb2be7ff1cea98f38c26308254604080519485526020850193909352918301526060820152608001610511565b34801561102c57600080fd5b5061050761271081565b34801561104257600080fd5b50610a046110513660046131b8565b612289565b34801561106257600080fd5b50611076611071366004613186565b6123ea565b6040516105119190613314565b34801561108f57600080fd5b506105076c42616c6c6f7453746f7261676560981b81565b3480156110b357600080fd5b506105856110c2366004613186565b61248c565b3480156110d357600080fd5b506105856110e23660046131e9565b6124d3565b3480156110f357600080fd5b506105077f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b81565b34801561112757600080fd5b50610507611136366004613186565b60009081526006602052604090205490565b34801561115457600080fd5b50610585611163366004613028565b612510565b34801561117457600080fd5b5061050760008051602061356083398151915281565b34801561119657600080fd5b5061119f6125b8565b60408051928352602083019190915201610511565b3480156111c057600080fd5b5061050760008051602061350083398151915281565b3480156111e257600080fd5b506105856111f136600461321e565b612622565b34801561120257600080fd5b50610507611211366004613186565b60009081526002602052604090205490565b34801561122f57600080fd5b5061058561123e3660046131e9565b6126f9565b34801561124f57600080fd5b506105076000805160206134e083398151915281565b34801561127157600080fd5b50611076611280366004613186565b612748565b34801561129157600080fd5b5061050760008051602061352083398151915281565b3480156112b357600080fd5b506105077fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747381565b3480156112e757600080fd5b506105077fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6081565b34801561131b57600080fd5b506105077f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc81565b34801561134f57600080fd5b5060008051602061364783398151915260005260026020527f38ddebd16170f2328156b72e009b30efe6e74a1b9fc4389d05f50efa2a42c6f854610507565b34801561139a57600080fd5b5061119f612765565b3480156113af57600080fd5b506105076113be366004613186565b60009081526001602052604090205490565b3480156113dc57600080fd5b506105856113eb3660046131e9565b6127cb565b3480156113fc57600080fd5b5061058561140b366004613186565b61280e565b34801561141c57600080fd5b5061058561142b366004613028565b612855565b34801561143c57600080fd5b5061050760008051602061364783398151915281565b34801561145e57600080fd5b5061058561146d366004613186565b6128cb565b34801561147e57600080fd5b5061058561148d366004613186565b612912565b905090565b336114a0612959565b6001600160a01b0316146114cf5760405162461bcd60e51b81526004016114c690613327565b60405180910390fd5b61271081836114de86886133ee565b6114e891906133ee565b6114f291906133ee565b1461153f5760405162461bcd60e51b815260206004820152601e60248201527f57726f6e6720726577617264206469737472756274696f6e20726174696f000060448201526064016114c6565b6115697fc9e15e34073efbcd0328740feaf503caac9124b55b38c73d1a97b53da80a2f6085612979565b6115937f9f1de481f899d76889aa8a2b44cc7b604d42691aa93d4ba618a1a1fd439f505084612979565b6115bd7f9346226931826838eedd13d9677fa33551e7c81f604b171ef3fac355458da9aa83612979565b6115e77fdd5a41a7fc01f5c6d30816b17f638d6531625f1e1eaa599673ab2f6079f2dd9d82612979565b50505050565b336115f6612959565b6001600160a01b03161461161c5760405162461bcd60e51b81526004016114c690613327565b61162a61146d826020015190565b50565b33611636612959565b6001600160a01b03161461165c5760405162461bcd60e51b81526004016114c690613327565b61162a61140b826020015190565b33611673612959565b6001600160a01b0316146116995760405162461bcd60e51b81526004016114c690613327565b6116c37f1d36f8ce53f59e624857e1d8dc7932d19981a2ea1b8faa4eb8ff843fc3e5a27885612979565b6116ed7fb38b2c133e931937bd95337c65c8aefa7040ed64bbed732e3e29a4944c65747384612979565b6117177f77884798208df1e64f70968be41ef2d3211ec53613397ca59313416813df088883612979565b6115e760008051602061364783398151915282612979565b33611738612959565b6001600160a01b03161461175e5760405162461bcd60e51b81526004016114c690613327565b61162a6110c2826020015190565b33611775612959565b6001600160a01b03161461179b5760405162461bcd60e51b81526004016114c690613327565b61162a6000805160206135a083398151915282612979565b336117bc612959565b6001600160a01b0316146117e25760405162461bcd60e51b81526004016114c690613327565b61162a61148d826020015190565b336117f9612959565b6001600160a01b03161461181f5760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061356083398151915282612979565b33611840612959565b6001600160a01b0316146118665760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061352083398151915282612979565b6118866129c8565b6118a181604051806020016040528060008152506000612a22565b6040516001600160a01b038216907f2a74bbaf99cf25202925743012bb137262ab3432c821e1ba94ddbecac2ea970890600090a250565b336118e1612959565b6001600160a01b0316146119075760405162461bcd60e51b81526004016114c690613327565b61162a61084b826020015190565b3361191e612959565b6001600160a01b0316146119445760405162461bcd60e51b81526004016114c690613327565b61162a610e4a826020015190565b3361195b612959565b6001600160a01b0316146119815760405162461bcd60e51b81526004016114c690613327565b61162a610d8a826020015190565b33611998612959565b6001600160a01b0316146119be5760405162461bcd60e51b81526004016114c690613327565b61162a61088c826020015190565b336119d5612959565b6001600160a01b0316146119fb5760405162461bcd60e51b81526004016114c690613327565b60208101516040820151611a0f8282612622565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415611aa25760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b60648201526084016114c6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611aeb6000805160206135c0833981519152546001600160a01b031690565b6001600160a01b031614611b565760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b60648201526084016114c6565b611b5f82612b9c565b611b6b82826001612a22565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611c0f5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016114c6565b506000805160206135c083398151915290565b603854610100900460ff1615808015611c425750603854600160ff909116105b80611c5c5750303b158015611c5c575060385460ff166001145b611cbf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016114c6565b6038805460ff191660011790558015611ce2576038805461ff0019166101001790555b6000805160206135c0833981519152546001600160a01b0385811691161415611d635760405162461bcd60e51b815260206004820152602d60248201527f72656769737472792073686f756c64206e6f742062652073616d65206173206960448201526c36b83632b6b2b73a30ba34b7b760991b60648201526084016114c6565b611d6b612bcb565b611d7484612510565b60005b8251811015611e6e576000611db1858381518110611d9757611d9761349e565b602002602001015160009081526002602052604090205490565b9050838281518110611dc557611dc561349e565b60200260200101516000141580611ddb57508015155b611e1a5760405162461bcd60e51b815260206004820152601060248201526f696e76616c6964207661726961626c6560801b60448201526064016114c6565b80611e5b57611e5b858381518110611e3457611e3461349e565b6020026020010151858481518110611e4e57611e4e61349e565b6020026020010151612979565b5080611e668161346d565b915050611d77565b5080156115e7576038805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b33611ec3612959565b6001600160a01b031614611ee95760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061364783398151915282612979565b611f096129c8565b611f136000612bfa565b565b33611f1e612959565b6001600160a01b031614611f445760405162461bcd60e51b81526004016114c690613327565b61162a61080b826020015190565b33611f5b612959565b6001600160a01b031614611f815760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061360783398151915282612979565b33611fa2612959565b6001600160a01b031614611fc85760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061354083398151915282612979565b600080516020613607833981519152821415611fff57611b6b81611915565b7fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e782141561203057611b6b816119cc565b7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b82141561206157611b6b816127cb565b60008051602061350083398151915282141561208057611b6b816115ed565b60008051602061352083398151915282141561209f57611b6b8161198f565b6000805160206135608339815191528214156120be57611b6b816118d8565b6000805160206135808339815191528214156120dd57611b6b8161162d565b7f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2282141561210e57611b6b8161215e565b7f04f7b94450bbcad85f37ea47cd1062728f884bb2040e357738f8fd53056134bc82141561213f57611b6b816126f9565b600080516020613647833981519152821415611b6b57611b6b81611952565b33612167612959565b6001600160a01b03161461218d5760405162461bcd60e51b81526004016114c690613327565b60208101516040820151606083015160808401516121ad84848484611497565b5050505050565b336121bd612959565b6001600160a01b0316146121e35760405162461bcd60e51b81526004016114c690613327565b808211156122595760405162461bcd60e51b815260206004820152603e60248201527f4d696e696d756d207374616b696e67206d75737420626520736d616c6c65722060448201527f616e6420657175616c207468616e206d6178696d756d207374616b696e67000060648201526084016114c6565b6122716000805160206135a083398151915283612979565b611b6b6000805160206134e083398151915282612979565b60007f9b2e0c7fdae148f225bae7deb92d7e7bd24bb77edb12956e8fa7204900dd8a2283141561231557600080600080858060200190518101906122cd9190613296565b9350935093509350612710818385876122e691906133ee565b6122f091906133ee565b6122fa91906133ee565b1461230c5760009450505050506123e4565b505050506123e0565b7f6c6f69f426081752a5d3e73746599acd2a4cb145d5de4203ca1e3473b281680b83148061236257507fe10074dceffb75f13bf0ce50145afd35182d63796823f1280ce40e01c19109e783145b1561239c576000808380602001905181019061237e9190613240565b9150915080821115612395576000925050506123e4565b50506123e0565b6000805160206135208339815191528314156123e0576000828060200190518101906123c8919061319f565b90506103e88110156123de5760009150506123e4565b505b5060015b92915050565b600081815260036020526040902080546060919061240790613432565b80601f016020809104026020016040519081016040528092919081815260200182805461243390613432565b80156124805780601f1061245557610100808354040283529160200191612480565b820191906000526020600020905b81548152906001019060200180831161246357829003601f168201915b50505050509050919050565b33612495612959565b6001600160a01b0316146124bb5760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061362783398151915282612979565b336124dc612959565b6001600160a01b0316146125025760405162461bcd60e51b81526004016114c690613327565b61162a610ebf826020015190565b6125186129c8565b6001600160a01b03811661256e5760405162461bcd60e51b815260206004820152601a60248201527f416464726573732073686f756c64206265206e6f6e2d7a65726f00000000000060448201526064016114c6565b609d80546001600160a01b0319166001600160a01b0383169081179091556040517f278c70ced5f3e0e5eeb385b5ff9cb735748ba00a625147e66065ed48fc1562cd90600090a250565b60026020527fd7a437163435b79030132855d9146a10e26570f1767311219983e0c430cfa690546000805160206134e083398151915260009081527f673c817b54d53459fa437d6b11ba6445e517d8dc789e6b815675ff10e6aeeb5d54909182915b915091509091565b3361262b612959565b6001600160a01b0316146126515760405162461bcd60e51b81526004016114c690613327565b808211156126c9576040805162461bcd60e51b81526020600482015260248101919091527f4d696e696d756d206475726174696f6e206d75737420626520736d616c6c657260448201527f20616e6420657175616c207468616e206d6178696d756d206475726174696f6e60648201526084016114c6565b6126e160008051602061362783398151915283612979565b611b6b60008051602061354083398151915282612979565b33612702612959565b6001600160a01b0316146127285760405162461bcd60e51b81526004016114c690613327565b60208101516040820151606083015160808401516121ad8484848461166a565b600081815260056020526040902080546060919061240790613432565b60026020527f8e8c0bef3b4557d74ba01e0433728c574990153e35cacae69cb26f23a8a401755460008051602061354083398151915260009081527f5a1993193b8890c75d83157b2c2c12b144545357ab60021d7429856434de051b549091829161261a565b336127d4612959565b6001600160a01b0316146127fa5760405162461bcd60e51b81526004016114c690613327565b60208101516040820151611a0f82826121b4565b33612817612959565b6001600160a01b03161461283d5760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061358083398151915282612979565b61285d6129c8565b6001600160a01b0381166128c25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016114c6565b61162a81612bfa565b336128d4612959565b6001600160a01b0316146128fa5760405162461bcd60e51b81526004016114c690613327565b61162a60008051602061350083398151915282612979565b3361291b612959565b6001600160a01b0316146129415760405162461bcd60e51b81526004016114c690613327565b61162a6000805160206134e083398151915282612979565b60006114927111dbdd995c9b985b98d950dbdb9d1c9858dd60721b612c4c565b6000828152600260205260409020819055817f58d7c10adfd5778016889c15d422d57f2975b9292415b54fe5d8cd4241200612826040516129bc91815260200190565b60405180910390a25050565b606b546001600160a01b03163314611f135760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016114c6565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615612a5557611a0f83612cc9565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a8e57600080fd5b505afa925050508015612abe575060408051601f3d908101601f19168201909252612abb9181019061319f565b60015b612b215760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016114c6565b6000805160206135c08339815191528114612b905760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016114c6565b50611a0f838383612d65565b33612ba5612959565b6001600160a01b03161461162a5760405162461bcd60e51b81526004016114c690613327565b603854610100900460ff16612bf25760405162461bcd60e51b81526004016114c69061334e565b611f13612d8a565b606b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b609d54604051630d2020dd60e01b8152600481018390526000916001600160a01b031690630d2020dd9060240160206040518083038186803b158015612c9157600080fd5b505afa158015612ca5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e49190613045565b6001600160a01b0381163b612d365760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016114c6565b6000805160206135c083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d6e83612dba565b600082511180612d7b5750805b15611a0f576115e78383612dfa565b603854610100900460ff16612db15760405162461bcd60e51b81526004016114c69061334e565b611f1333612bfa565b612dc381612cc9565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060612e1f83836040518060600160405280602781526020016135e060279139612e26565b9392505050565b6060600080856001600160a01b031685604051612e4391906132f8565b600060405180830381855af49150503d8060008114612e7e576040519150601f19603f3d011682016040523d82523d6000602084013e612e83565b606091505b5091509150612e9486838387612e9e565b9695505050505050565b60608315612f0a578251612f03576001600160a01b0385163b612f035760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016114c6565b5081612f14565b612f148383612f1c565b949350505050565b815115612f2c5781518083602001fd5b8060405162461bcd60e51b81526004016114c69190613314565b600082601f830112612f5757600080fd5b81356020612f6c612f67836133ca565b613399565b80838252828201915082860187848660051b8901011115612f8c57600080fd5b60005b85811015612fab57813584529284019290840190600101612f8f565b5090979650505050505050565b600082601f830112612fc957600080fd5b813567ffffffffffffffff811115612fe357612fe36134b4565b612ff6601f8201601f1916602001613399565b81815284602083860101111561300b57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561303a57600080fd5b8135612e1f816134ca565b60006020828403121561305757600080fd5b8151612e1f816134ca565b60008060006060848603121561307757600080fd5b8335613082816134ca565b925060208481013567ffffffffffffffff808211156130a057600080fd5b818701915087601f8301126130b457600080fd5b81356130c2612f67826133ca565b8082825285820191508585018b878560051b88010111156130e257600080fd5b600095505b838610156131055780358352600195909501949186019186016130e7565b5096505050604087013592508083111561311e57600080fd5b505061312c86828701612f46565b9150509250925092565b6000806040838503121561314957600080fd5b8235613154816134ca565b9150602083013567ffffffffffffffff81111561317057600080fd5b61317c85828601612fb8565b9150509250929050565b60006020828403121561319857600080fd5b5035919050565b6000602082840312156131b157600080fd5b5051919050565b600080604083850312156131cb57600080fd5b82359150602083013567ffffffffffffffff81111561317057600080fd5b6000602082840312156131fb57600080fd5b813567ffffffffffffffff81111561321257600080fd5b612f1484828501612fb8565b6000806040838503121561323157600080fd5b50508035926020909101359150565b6000806040838503121561325357600080fd5b505080516020909101519092909150565b6000806000806080858703121561327a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080608085870312156132ac57600080fd5b505082516020840151604085015160609095015191969095509092509050565b600081518084526132e4816020860160208601613406565b601f01601f19169290920160200192915050565b6000825161330a818460208701613406565b9190910192915050565b602081526000612e1f60208301846132cc565b6020808252600d908201526c2737902832b936b4b9b9b4b7b760991b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff811182821017156133c2576133c26134b4565b604052919050565b600067ffffffffffffffff8211156133e4576133e46134b4565b5060051b60200190565b6000821982111561340157613401613488565b500190565b60005b83811015613421578181015183820152602001613409565b838111156115e75750506000910152565b600181811c9082168061344657607f821691505b6020821081141561346757634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561348157613481613488565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461162a57600080fdfe18ad4415ef4a621ce1a136395c51ab6c3712bb2e24b79d526059925cea58dcb8829561ab7af084b7efc6600518d2df79b8d95f3f4c3a550f54f8f7ec7d2b80578086da5becff4dfac91a3105821b361078d2d4abba0ccc2401b974cf0dcf05c10c4fbe9dc9de15dd7c0d064975ee1a2f2f9b954fa0e65d4f6cddba94884bdc3e89dd490ecaf395283ed4ff2fd9557ca767fc425dce063451a9b0da6d72f600c3be90e461bbdb9a95a694f7796912ea04244caf7f5b60ad7ded17e16821d3e44c0b09c9badbbeb6c813a598ee910770a39ccda797a1940439bb6e47fc6c87548b360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65642a268972a70c8c688b62366bdfdd9bb09cf19d3e5b6e7e7bb158e671ffdcedd2c69fc6b7d0efc934fd5a3581c7253a7107a952526bb6dbcd814ef8d8dae1f44a7c1150f0e1a39ff55552d52764f97e6c387e2a247e1df344369f122c4254be2fa26469706673582212203d0d7c516c225a1e9e44eb3f1a97e1ac44225723acf753cea15775b46f46d18d64736f6c63430008060033"; -var EnvStorageImp_contract = web3.eth.contract([{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"_value","type":"address"}],"name":"AddressVarableChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"_value","type":"bytes32"}],"name":"Bytes32VarableChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"_value","type":"bytes"}],"name":"BytesVarableChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"int256","name":"_value","type":"int256"}],"name":"IntVarableChanged","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":"addr","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"string","name":"_value","type":"string"}],"name":"StringVarableChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"UintVarableChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"UpgradeImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"_name","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"_type","type":"uint256"},{"indexed":false,"internalType":"string","name":"_value","type":"string"}],"name":"VarableChanged","type":"event"},{"inputs":[],"name":"BALLOT_DURATION_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_DURATION_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALLOT_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_FEE_MAX_CHANGE_RATE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKS_PER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_CREATION_TIME_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_GASLIMIT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_AMOUNT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_MAINTANANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_METHOD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ECOSYSTEM_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ENV_STORAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GASLIMIT_AND_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAS_TARGET_PERCENTAGE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAINTENANCE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BASE_FEE_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_IDLE_BLOCK_INTERVAL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRIORITY_FEE_PER_GAS_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_POOL_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_MAX_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_MIN_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_REWARD_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"envKey","type":"bytes32"},{"internalType":"bytes","name":"envVal","type":"bytes"}],"name":"checkVariableCondition","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBallotDurationMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBallotDurationMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBallotDurationMinMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockCreationTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockRewardDistributionMethod","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlocksPer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBoolean","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBytes32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasLimitAndBaseFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getInt","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxBaseFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxIdleBlockInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxPriorityFeePerGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingMinMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"},{"internalType":"bytes32[]","name":"names","type":"bytes32[]"},{"internalType":"uint256[]","name":"infos","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reg","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setBallotDurationMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBallotDurationMaxByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setBallotDurationMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBallotDurationMinByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setBallotDurationMinMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBallotDurationMinMaxByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setBlockCreationTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBlockCreationTimeByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setBlockRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBlockRewardAmountByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block_producer","type":"uint256"},{"internalType":"uint256","name":"_staking_reward","type":"uint256"},{"internalType":"uint256","name":"_ecofund","type":"uint256"},{"internalType":"uint256","name":"_maintanance","type":"uint256"}],"name":"setBlockRewardDistributionMethod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBlockRewardDistributionMethodByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setBlocksPer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setBlocksPerByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_block_GasLimit","type":"uint256"},{"internalType":"uint256","name":"_baseFeeMaxChangeRate","type":"uint256"},{"internalType":"uint256","name":"_gasTargetPercentage","type":"uint256"},{"internalType":"uint256","name":"_maxBaseFee","type":"uint256"}],"name":"setGasLimitAndBaseFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setGasLimitAndBaseFeeByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setMaxBaseFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setMaxBaseFeeByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setMaxIdleBlockInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setMaxIdleBlockIntervalByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setMaxPriorityFeePerGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setMaxPriorityFeePerGasByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setStakingMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setStakingMaxByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setStakingMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setStakingMinByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setStakingMinMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"setStakingMinMaxByBytes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"envKey","type":"bytes32"},{"internalType":"bytes","name":"envVal","type":"bytes"}],"name":"setVariable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]); - -function EnvStorageImp_new() { - return EnvStorageImp_contract.new( - { - from: web3.eth.accounts[0], - data: EnvStorageImp_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function EnvStorageImp_load(addr) { - return EnvStorageImp_contract.at(addr); -} -var EternalStorage_data = "0x608060405234801561001057600080fd5b5061034c806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a6ed563e1161005b578063a6ed563e1461011b578063bd02d0f514610149578063c031a18014610169578063dc97d9621461017c57600080fd5b806321f8a721146100825780633848207a146100c8578063986e791a146100fb575b600080fd5b6100ab61009036600461025b565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b0390911681526020015b60405180910390f35b6100eb6100d636600461025b565b60009081526020819052604090205460ff1690565b60405190151581526020016100bf565b61010e61010936600461025b565b61019c565b6040516100bf91906102c1565b61013b61012936600461025b565b60009081526006602052604090205490565b6040519081526020016100bf565b61013b61015736600461025b565b60009081526002602052604090205490565b61010e61017736600461025b565b61023e565b61013b61018a36600461025b565b60009081526001602052604090205490565b60008181526003602052604090208054606091906101b9906102db565b80601f01602080910402602001604051908101604052809291908181526020018280546101e5906102db565b80156102325780601f1061020757610100808354040283529160200191610232565b820191906000526020600020905b81548152906001019060200180831161021557829003601f168201915b50505050509050919050565b60008181526005602052604090208054606091906101b9906102db565b60006020828403121561026d57600080fd5b5035919050565b6000815180845260005b8181101561029a5760208185018101518683018201520161027e565b818111156102ac576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006102d46020830184610274565b9392505050565b600181811c908216806102ef57607f821691505b6020821081141561031057634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220440136bece647be28d2bce0900fbe7356621290d66623223b7b40d7694324e0e64736f6c63430008060033"; -var EternalStorage_contract = web3.eth.contract([{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBoolean","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBytes","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getBytes32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getInt","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getString","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"h","type":"bytes32"}],"name":"getUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]); - -function EternalStorage_new() { - return EternalStorage_contract.new( - { - from: web3.eth.accounts[0], - data: EternalStorage_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function EternalStorage_load(addr) { - return EternalStorage_contract.at(addr); -} -var Staking_data = "0x608060405234801561001057600080fd5b506040516106fc3803806106fc83398101604081905261002f91610301565b80604051806020016040528060008152506100528282600061005a60201b60201c565b5050506103a5565b61006383610090565b6000825111806100705750805b1561008b5761008983836100d060201b61008b1760201c565b505b505050565b610099816100fc565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100f583836040518060600160405280602781526020016106d5602791396101ce565b9392505050565b61010f8161024760201b6100b71760201c565b6101765760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101ad7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61025660201b6100c61760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101eb919061032a565b600060405180830381855af49150503d8060008114610226576040519150601f19603f3d011682016040523d82523d6000602084013e61022b565b606091505b50909250905061023d86838387610259565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102c55782516102be576001600160a01b0385163b6102be5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161016d565b50816102cf565b6102cf83836102d7565b949350505050565b8151156102e75781518083602001fd5b8060405162461bcd60e51b815260040161016d9190610346565b60006020828403121561031357600080fd5b81516001600160a01b03811681146100f557600080fd5b6000825161033c818460208701610379565b9190910192915050565b6020815260008251806020840152610365816040850160208701610379565b601f01601f19169190910160400192915050565b60005b8381101561039457818101518382015260200161037c565b838111156100895750506000910152565b610321806103b46000396000f3fe6080604052600436106100225760003560e01c80635c60da1b1461003957610031565b366100315761002f61006a565b005b61002f61006a565b34801561004557600080fd5b5061004e61007c565b6040516001600160a01b03909116815260200160405180910390f35b61007a6100756100c9565b6100fc565b565b60006100866100c9565b905090565b60606100b083836040518060600160405280602781526020016102c560279139610120565b9392505050565b6001600160a01b03163b151590565b90565b60006100867f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561011b573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161013d9190610245565b600060405180830381855af49150503d8060008114610178576040519150601f19603f3d011682016040523d82523d6000602084013e61017d565b606091505b509150915061018e86838387610198565b9695505050505050565b60608315610209578251610202576001600160a01b0385163b6102025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610213565b610213838361021b565b949350505050565b81511561022b5781518083602001fd5b8060405162461bcd60e51b81526004016101f99190610261565b60008251610257818460208701610294565b9190910192915050565b6020815260008251806020840152610280816040850160208701610294565b601f01601f19169190910160400192915050565b60005b838110156102af578181015183820152602001610297565b838111156102be576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220a10fea0462338333c31ae085361141c74f28d2520a5fd6c61060049c7943e3e964736f6c63430008060033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564"; -var Staking_contract = web3.eth.contract([{"inputs":[{"internalType":"address","name":"_imp","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]); - -function Staking_new() { - return Staking_contract.new( - { - from: web3.eth.accounts[0], - data: Staking_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Staking_load(addr) { - return Staking_contract.at(addr); -} - -function OwnableUpgradeable_new() { - return OwnableUpgradeable_contract.new( - { - from: web3.eth.accounts[0], - data: OwnableUpgradeable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function OwnableUpgradeable_load(addr) { - return OwnableUpgradeable_contract.at(addr); -} - -function Initializable_new() { - return Initializable_contract.new( - { - from: web3.eth.accounts[0], - data: Initializable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Initializable_load(addr) { - return Initializable_contract.at(addr); -} - -function ReentrancyGuardUpgradeable_new() { - return ReentrancyGuardUpgradeable_contract.new( - { - from: web3.eth.accounts[0], - data: ReentrancyGuardUpgradeable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function ReentrancyGuardUpgradeable_load(addr) { - return ReentrancyGuardUpgradeable_contract.at(addr); -} -var AddressUpgradeable_data = "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206b0e847059a4b7001b5ef6863728e46fc58585bdf365408604101487b61cca1e64736f6c63430008060033"; -var AddressUpgradeable_contract = web3.eth.contract([]); - -function AddressUpgradeable_new() { - return AddressUpgradeable_contract.new( - { - from: web3.eth.accounts[0], - data: AddressUpgradeable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function AddressUpgradeable_load(addr) { - return AddressUpgradeable_contract.at(addr); -} - -function ContextUpgradeable_new() { - return ContextUpgradeable_contract.new( - { - from: web3.eth.accounts[0], - data: ContextUpgradeable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function ContextUpgradeable_load(addr) { - return ContextUpgradeable_contract.at(addr); -} - -function Ownable_new() { - return Ownable_contract.new( - { - from: web3.eth.accounts[0], - data: Ownable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Ownable_load(addr) { - return Ownable_contract.at(addr); -} - -function IERC1967_new() { - return IERC1967_contract.new( - { - from: web3.eth.accounts[0], - data: IERC1967_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IERC1967_load(addr) { - return IERC1967_contract.at(addr); -} - -function IERC1822Proxiable_new() { - return IERC1822Proxiable_contract.new( - { - from: web3.eth.accounts[0], - data: IERC1822Proxiable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IERC1822Proxiable_load(addr) { - return IERC1822Proxiable_contract.at(addr); -} -var ERC1967Proxy_data = "0x6080604052604051610735380380610735833981016040819052610022916102dc565b61002e82826000610035565b505061043b565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161070e602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103aa565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a0578251610299576001600160a01b0385163b6102995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102aa565b6102aa83836102b2565b949350505050565b8151156102c25781518083602001fd5b8060405162461bcd60e51b815260040161014891906103c6565b600080604083850312156102ef57600080fd5b82516001600160a01b038116811461030657600080fd5b60208401519092506001600160401b038082111561032357600080fd5b818501915085601f83011261033757600080fd5b81518181111561034957610349610425565b604051601f8201601f19908116603f0116810190838211818310171561037157610371610425565b8160405282815288602084870101111561038a57600080fd5b61039b8360208301602088016103f9565b80955050505050509250929050565b600082516103bc8184602087016103f9565b9190910192915050565b60208152600082518060208401526103e58160408501602087016103f9565b601f01601f19169190910160400192915050565b60005b838110156104145781810151838201526020016103fc565b838111156100645750506000910152565b634e487b7160e01b600052604160045260246000fd5b6102c48061044a6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e8383604051806060016040528060278152602001610268602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e091906101e8565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101ac5782516101a5576001600160a01b0385163b6101a55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b6565b6101b683836101be565b949350505050565b8151156101ce5781518083602001fd5b8060405162461bcd60e51b815260040161019c9190610204565b600082516101fa818460208701610237565b9190910192915050565b6020815260008251806020840152610223816040850160208701610237565b601f01601f19169190910160400192915050565b60005b8381101561025257818101518382015260200161023a565b83811115610261576000848401525b5050505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220059e761847875d75f9b210b6a55352ed3ac6fce44250ccd75e0a325e9c521e5b64736f6c63430008060033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564"; -var ERC1967Proxy_contract = web3.eth.contract([{"inputs":[{"internalType":"address","name":"_logic","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]); - -function ERC1967Proxy_new() { - return ERC1967Proxy_contract.new( - { - from: web3.eth.accounts[0], - data: ERC1967Proxy_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function ERC1967Proxy_load(addr) { - return ERC1967Proxy_contract.at(addr); -} - -function ERC1967Upgrade_new() { - return ERC1967Upgrade_contract.new( - { - from: web3.eth.accounts[0], - data: ERC1967Upgrade_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function ERC1967Upgrade_load(addr) { - return ERC1967Upgrade_contract.at(addr); -} - -function Proxy_new() { - return Proxy_contract.new( - { - from: web3.eth.accounts[0], - data: Proxy_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Proxy_load(addr) { - return Proxy_contract.at(addr); -} - -function IBeacon_new() { - return IBeacon_contract.new( - { - from: web3.eth.accounts[0], - data: IBeacon_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function IBeacon_load(addr) { - return IBeacon_contract.at(addr); -} - -function UUPSUpgradeable_new() { - return UUPSUpgradeable_contract.new( - { - from: web3.eth.accounts[0], - data: UUPSUpgradeable_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function UUPSUpgradeable_load(addr) { - return UUPSUpgradeable_contract.at(addr); -} -var Address_data = "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212205e565b57bed130b3bed4a551be507c539301534f97d7962e91f5e757bee7fc1e64736f6c63430008060033"; -var Address_contract = web3.eth.contract([]); - -function Address_new() { - return Address_contract.new( - { - from: web3.eth.accounts[0], - data: Address_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Address_load(addr) { - return Address_contract.at(addr); -} - -function Context_new() { - return Context_contract.new( - { - from: web3.eth.accounts[0], - data: Context_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function Context_load(addr) { - return Context_contract.at(addr); -} -var StorageSlot_data = "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209e7827207547a9bdd54a3dd6af4c0a39be8d39aedafd620acaa1cc7da83c8e7864736f6c63430008060033"; -var StorageSlot_contract = web3.eth.contract([]); - -function StorageSlot_new() { - return StorageSlot_contract.new( - { - from: web3.eth.accounts[0], - data: StorageSlot_data, - gas: "0x10000000" - }, function (e, contract) { - if (typeof contract.address !== "undefined") { - console.log("Contract mined! address: " + contract.address + " transactionHash: " + contract.transactionHash); - } - }); -} - -function StorageSlot_load(addr) { - return StorageSlot_contract.at(addr); -} diff --git a/wemix/governance-contract/compiler.go b/wemix/governance-contract/compiler.go new file mode 100644 index 000000000000..86e227af18bc --- /dev/null +++ b/wemix/governance-contract/compiler.go @@ -0,0 +1,160 @@ +package compile + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/crypto" + "github.com/fabelx/go-solc-select/pkg/config" + "github.com/fabelx/go-solc-select/pkg/installer" + "github.com/fabelx/go-solc-select/pkg/versions" + "github.com/pkg/errors" +) + +var ( + solcVersion string = "0.8.14" + solcCmd string = fmt.Sprintf("solc-%s", solcVersion) +) + +func Compile(root string, sourceFiles ...string) (compiledTy, error) { + if err := installSolc(); err != nil { + return nil, err + } + if root == "" { + root = "../contracts" + } + args := []string{ + "--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes", + "--optimize", // code optimizer switched on + "--allow-paths", ".,./,../", //default to support relative path: ./ ../ . + fmt.Sprintf("@openzeppelin/contracts/=%s/openzeppelin/contracts/contracts/", root), + fmt.Sprintf("@openzeppelin/contracts-upgradeable/=%s/openzeppelin/contracts-upgradeable/contracts/", root), + "--", + } + // ~/.gsolc-select/artifacts/solc-0.8.14/0.8.14 + cmd := exec.Command(filepath.Join(config.SolcArtifacts, solcCmd, solcCmd), append(args, sourceFiles...)...) + + var stderr, stdout bytes.Buffer + cmd.Stderr, cmd.Stdout = &stderr, &stdout + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("solc: %v\n%s", err, stderr.Bytes()) + } + + // compiler version + var compilerVersion = struct { + Version string + }{} + + if err := json.Unmarshal(stdout.Bytes(), &compilerVersion); err != nil { + return nil, err + } else if contracts, err := compiler.ParseCombinedJSON(stdout.Bytes(), "", "", compilerVersion.Version, strings.Join(args, " ")); err != nil { + return nil, err + } else { + out := make(compiledTy) + for name, v := range contracts { + n := strings.Split(name, ":")[1] + if _, ok := out[n]; ok { + return nil, fmt.Errorf("duplicated contract name: %s", name) + } else { + out[n] = v + } + } + return out, nil + } +} + +func installSolc() error { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + // check already installed + installedVersions := versions.GetInstalled() + if installedVersions[solcVersion] != "" { + return nil + } + + // install solc-0.8.14 + installed, _, err := installer.InstallSolcs(ctx, []string{solcVersion}) + if err != nil { + return err + } + + for _, v := range installed { + if v == solcVersion { + return nil + } + } + return fmt.Errorf("failed to install version %s", solcVersion) +} + +type compiledTy map[string]*compiler.Contract + +func (compiled compiledTy) BindContracts(pkg, filename string, contracts ...string) error { + var ( + length = len(contracts) + types = make([]string, length) + abis = make([]string, length) + bytecodes = make([]string, length) + sigs = make([]map[string]string, length) + ) + + var err error + for i, name := range contracts { + contract, ok := compiled[name] + if !ok { + return fmt.Errorf("not found contract : %v", name) + } + types[i] = name + if abis[i], err = abiToString(contract); err != nil { + return errors.Wrap(err, name) + } + bytecodes[i] = contract.Code + sigs[i] = contract.Hashes + } + + str, err := bind.Bind(types, abis, bytecodes, sigs, pkg, bind.LangGo, nil, nil) + if err != nil { + return err + } + + filedata := []byte(str) + if read, err := os.ReadFile(filename); err == nil { + // if out file is already exists, compare the file contents + if crypto.Keccak256Hash(read) == crypto.Keccak256Hash(filedata) { + return nil + } + } else { + // check dir is exist + outDir := filepath.Dir(filename) + if _, err := os.Stat(outDir); err != nil { + if !os.IsNotExist(err) { + return err + } + if err = os.MkdirAll(outDir, 0755); err != nil { + return err + } + } + } + + return os.WriteFile(filename, filedata, 0644) +} + +func abiToString(contract *compiler.Contract) (abi string, err error) { + switch v := contract.Info.AbiDefinition.(type) { + case string: + abi = v + default: + var bytes []byte + if bytes, err = json.Marshal(v); err == nil { + abi = string(bytes) + } + } + return +} diff --git a/wemix/governance-contract/contracts/Gov.sol b/wemix/governance-contract/contracts/Gov.sol new file mode 100644 index 000000000000..a8ed6e7b97a6 --- /dev/null +++ b/wemix/governance-contract/contracts/Gov.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +contract Gov is ERC1967Proxy, IBeacon { + constructor(address _imp) ERC1967Proxy(_imp, "") {} + + function implementation() external view override returns (address) { + return _implementation(); + } +} diff --git a/wemix/governance-contract/contracts/GovChecker.sol b/wemix/governance-contract/contracts/GovChecker.sol new file mode 100644 index 000000000000..44d4720e9cc0 --- /dev/null +++ b/wemix/governance-contract/contracts/GovChecker.sol @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import "./interface/IRegistry.sol"; +import "./interface/IGov.sol"; + +/** + * @title GovChecker + * @dev GovChecker Contract that uses Registry contract + */ +contract GovChecker is OwnableUpgradeable { + IRegistry public reg; + + bytes32 public constant GOV_NAME = "GovernanceContract"; + bytes32 public constant STAKING_NAME = "Staking"; + bytes32 public constant BALLOT_STORAGE_NAME = "BallotStorage"; + bytes32 public constant ENV_STORAGE_NAME = "EnvStorage"; + bytes32 public constant REWARD_POOL_NAME = "RewardPool"; + bytes32 public constant MAINTENANCE_NAME = "Maintenance"; + bytes32 public constant ECOSYSTEM_NAME = "Ecosystem"; + bytes32 public constant STAKING_REWARD_NAME = "StakingReward"; + + /* + * @dev Function to set registry address. Contract that wants to use registry should setRegistry first. + * @param _addr address of registry + * @return A boolean that indicates if the operation was successful. + */ + event SetRegistry(address indexed addr); + + function setRegistry(address _addr) public onlyOwner { + require(_addr != address(0), "Address should be non-zero"); + reg = IRegistry(_addr); + emit SetRegistry(_addr); + } + + modifier onlyGov() { + require(getGovAddress() == msg.sender, "No Permission"); + _; + } + + modifier onlyGovMem() { + require(IGov(getGovAddress()).isMember(msg.sender), "No Permission"); + _; + } + + modifier onlyGovStaker() { + require(IGov(getGovAddress()).isStaker(msg.sender), "No Permission"); + _; + } + + modifier anyGov() { + require(getGovAddress() == msg.sender || IGov(getGovAddress()).isMember(msg.sender), "No Permission"); + _; + } + + function getContractAddress(bytes32 name) internal view returns (address) { + return reg.getContractAddress(name); + } + + function getGovAddress() internal view returns (address) { + return getContractAddress(GOV_NAME); + } + + function getStakingAddress() internal view returns (address) { + return getContractAddress(STAKING_NAME); + } + + function getBallotStorageAddress() internal view returns (address) { + return getContractAddress(BALLOT_STORAGE_NAME); + } + + function getEnvStorageAddress() internal view returns (address) { + return getContractAddress(ENV_STORAGE_NAME); + } + + function getRewardPoolAddress() internal view returns (address) { + return getContractAddress(REWARD_POOL_NAME); + } + + function getEcosystemAddress() internal view returns (address) { + return getContractAddress(ECOSYSTEM_NAME); + } + + function getStakingRewardAddress() internal view returns (address) { + return getContractAddress(STAKING_REWARD_NAME); + } + + function getMaintenanceAddress() internal view returns (address) { + return getContractAddress(MAINTENANCE_NAME); + } +} diff --git a/wemix/governance-contract/contracts/GovImp.sol b/wemix/governance-contract/contracts/GovImp.sol new file mode 100644 index 000000000000..0529c5b0ca92 --- /dev/null +++ b/wemix/governance-contract/contracts/GovImp.sol @@ -0,0 +1,1383 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "./abstract/BallotEnums.sol"; +import "./abstract/EnvConstants.sol"; +import "./abstract/AGov.sol"; + +import "./interface/IBallotStorage.sol"; +import "./interface/IEnvStorage.sol"; +import "./interface/IStaking.sol"; + +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; + +contract GovImp is + AGov, + ReentrancyGuardUpgradeable, + BallotEnums, + EnvConstants, + UUPSUpgradeable +{ + enum VariableTypes { + Invalid, + Int, + Uint, + Uint2, + Uint3, + Uint4, + Address, + Bytes32, + Bytes, + String + } + + address constant ZERO = address(0); + + event MemberAdded(address indexed addr, address indexed voter); + event MemberRemoved(address indexed addr, address indexed voter); + event MemberChanged( + address indexed oldAddr, + address indexed newAddr, + address indexed newVoter + ); + event EnvChanged(bytes32 envName, uint256 envType, bytes envVal); + event MemberUpdated(address indexed addr, address indexed voter); + // added for case that ballot's result could not be applicable. + event NotApplicable(uint256 indexed ballotId, string reason); + + event SetProposalTimePeriod(uint256 newPeriod); + // added for announced that migration gov data + event GovDataMigrated(address indexed from); + + struct MemberInfo { + address staker; + address voter; // voter + address reward; + bytes name; + bytes enode; + bytes ip; + uint256 port; + uint256 lockAmount; + bytes memo; + uint256 duration; + } + + modifier checkLockedAmount() { + address staker = getStakerAddr(_msgSender()); + require( + lockedBalanceOf(staker) <= getMaxStaking() && + lockedBalanceOf(staker) >= getMinStaking(), + "Invalid staking balance" + ); + _; + } + + modifier checkTimePeriod() { + address staker = getStakerAddr(_msgSender()); + require( + (block.timestamp - lastAddProposalTime[staker]) >= + proposal_time_period, + "Cannot add proposal too early" + ); + _; + lastAddProposalTime[staker] = block.timestamp; + } + + modifier checkMemberInfo(MemberInfo memory info) { + require(info.voter != ZERO, "Invalid voter"); + require(info.name.length > 0, "Invalid node name"); + require(info.ip.length > 0, "Invalid node IP"); + require(info.port > 0, "Invalid node port"); + require(info.enode.length > 0, "Invalid node enode"); + require(info.memo.length > 0, "Invalid memo"); + require(info.duration > 0, "Invalid duration"); + require( + info.lockAmount >= getMinStaking() && + info.lockAmount <= getMaxStaking(), + "Invalid lock Amount" + ); + _; + } + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + function init( + address registry, + uint256 lockAmount, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port + ) public initializer { + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + require( + lockAmount >= getMinStaking() && getMaxStaking() >= lockAmount, + "Invalid lock amount" + ); + + // Lock + IStaking staking = IStaking(getStakingAddress()); + require( + staking.availableBalanceOf(msg.sender) >= lockAmount, + "Insufficient staking" + ); + staking.lock(msg.sender, lockAmount); + + // Add voting member + memberLength = 1; + voters[memberLength] = msg.sender; + voterIdx[msg.sender] = memberLength; + + // Add reward member + rewards[memberLength] = msg.sender; + rewardIdx[msg.sender] = memberLength; + + stakers[memberLength] = msg.sender; + stakerIdx[msg.sender] = memberLength; + + // Add node + nodeLength = 1; + Node storage node = nodes[nodeLength]; + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeIdxFromMember[msg.sender] = nodeLength; + nodeToMember[nodeLength] = msg.sender; + + modifiedBlock = block.number; + emit MemberAdded(msg.sender, msg.sender); + } + + function initOnce( + address registry, + uint256 lockAmount, + bytes memory data + ) public initializer { + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + // _initialized = true; + modifiedBlock = block.number; + + // Lock + IStaking staking = IStaking(getStakingAddress()); + + require( + lockAmount >= getMinStaking() && getMaxStaking() >= lockAmount, + "Invalid lock amount" + ); + + // []{uint staker, uint voter, uint reward, bytes name, bytes enode, bytes ip, uint port} + // 32 bytes, 32 bytes, 32 bytes, [32 bytes, ] * 3, 32 bytes + address staker; + address voter; + address reward; + bytes memory name; + bytes memory enode; + bytes memory ip; + uint port; + uint idx = 0; + + uint ix; + uint eix; + assembly { + ix := add(data, 0x20) + } + eix = ix + data.length; + while (ix < eix) { + assembly { + staker := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + voter := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + reward := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + name := ix + } + ix += 0x20 + name.length; + require(ix < eix); + + assembly { + enode := ix + } + ix += 0x20 + enode.length; + require(ix < eix); + + assembly { + ip := ix + } + ix += 0x20 + ip.length; + require(ix < eix); + + assembly { + port := mload(ix) + } + ix += 0x20; + + idx += 1; + require( + !isMember(staker) && !isMember(voter) && !isReward(reward), + "Already member" + ); + voters[idx] = voter; + voterIdx[voter] = idx; + rewards[idx] = reward; + rewardIdx[reward] = idx; + stakers[idx] = staker; + stakerIdx[staker] = idx; + emit MemberAdded(staker, voter); // staker, voter + + require( + staking.availableBalanceOf(staker) >= lockAmount, + "Insufficient staking" + ); + + require( + checkNodeInfoAdd(name, enode, ip, port), + "Duplicated node info" + ); + + lock(staker, lockAmount); + + Node storage node = nodes[idx]; + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeToMember[idx] = staker; + nodeIdxFromMember[staker] = idx; + } + memberLength = idx; + nodeLength = idx; + } + + //Add member address = staker address = voter address + function addProposalToAddMember( + MemberInfo memory info + ) + external + onlyGovMem + checkTimePeriod + checkLockedAmount + checkMemberInfo(info) + returns (uint256 ballotIdx) + { + require( + !isMember(info.staker) && !isReward(info.staker), + "Already member" + ); + require( + info.staker == info.voter && info.staker == info.reward, + "Staker is not voter" + ); + require( + checkNodeInfoAdd(info.name, info.enode, info.ip, info.port), + "Duplicated node info" + ); + ballotIdx = ballotLength + 1; + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberAdd), // ballot type + msg.sender, // creator + ZERO, // old staker address + info + ); + updateBallotLock(ballotIdx, info.lockAmount); + updateBallotMemo(ballotIdx, info.memo); + ballotLength = ballotIdx; + } + + function addProposalToRemoveMember( + address staker, + uint256 lockAmount, + bytes memory memo, + uint256 duration, + uint256 unlockAmount, + uint256 slashing + ) + external + onlyGovMem + checkTimePeriod + checkLockedAmount + returns (uint256 ballotIdx) + { + require(staker != ZERO, "Invalid address"); + require(isMember(staker), "Non-member"); + require(getMemberLength() > 1, "Cannot remove a sole member"); + require( + lockedBalanceOf(staker) >= lockAmount, + "Insufficient balance that can be unlocked." + ); + ballotIdx = ballotLength + 1; + + MemberInfo memory info = MemberInfo( + ZERO, // new staker address + ZERO, + ZERO, + new bytes(0), // new name + new bytes(0), // new enode + new bytes(0), // new ip + 0, // new port + lockAmount, + memo, + duration + ); + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberRemoval), // ballot type + msg.sender, + staker, + info + ); + updateBallotLock(ballotIdx, lockAmount); + updateBallotMemo(ballotIdx, memo); + createBallotForExit(ballotIdx, unlockAmount, slashing); + ballotLength = ballotIdx; + } + + // voter A, staker A -> voter B, staker B Ok with voting + // voter A, staker B -> voter C, staker C Ok with voting + // voter A, staker B -> voter A, staker A Ok with voting + // voter A call : voter A, staker A -> voter A, staker B X + // staker A call : voter A, staker A-> voter B, staker A Ok without voting + // only staker A call : voter B, staker A, reward C -> voter B, staker A, reward D Ok without voting only (voter can not change reward) + // staker only change own info + // voter can propose and vote anything + function addProposalToChangeMember( + MemberInfo memory newInfo, + address oldStaker, + uint256 unlockAmount, + uint256 slashing + ) + external + onlyGovMem + checkTimePeriod + checkLockedAmount + checkMemberInfo(newInfo) + returns (uint256 ballotIdx) + { + require(oldStaker != ZERO, "Invalid old Address"); + require(isMember(oldStaker), "Non-member"); + + require( + (voters[stakerIdx[oldStaker]] == newInfo.voter || + newInfo.voter == oldStaker || + ((!isMember(newInfo.voter)) && !isReward(newInfo.voter))) && + (rewards[stakerIdx[oldStaker]] == newInfo.reward || + newInfo.reward == oldStaker || + ((!isMember(newInfo.reward)) && !isReward(newInfo.reward))), + "Already a member" + ); + // For exit + if (msg.sender == oldStaker && oldStaker == newInfo.staker) { + // Change member enviroment, finalized + require(unlockAmount == 0 && slashing == 0, "Invalid proposal"); + } else if ( + oldStaker != newInfo.staker /* && msg.sender != oldStaker */ + ) { + // Propose Change or Exit member by other. + require( + unlockAmount + slashing <= getMinStaking(), + "Invalid amount: (unlockAmount + slashing) must be equal or low to minStaking" + ); + } + + ballotIdx = ballotLength + 1; + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberChange), // ballot type + msg.sender, // creator + oldStaker, // old staker address + newInfo + ); + updateBallotLock(ballotIdx, newInfo.lockAmount); + updateBallotMemo(ballotIdx, newInfo.memo); + createBallotForExit(ballotIdx, unlockAmount, slashing); + ballotLength = ballotIdx; + // 요청자 == 변경할 voting 주소 + if (msg.sender == oldStaker && oldStaker == newInfo.staker) { + (, , uint256 duration) = getBallotPeriod(ballotIdx); + startBallot(ballotIdx, block.timestamp, block.timestamp + duration); + finalizeVote( + ballotIdx, + uint256(BallotTypes.MemberChange), + true, + true + ); + } + } + + function addProposalToChangeGov( + address newGovAddr, + bytes memory memo, + uint256 duration + ) + external + onlyGovMem + checkTimePeriod + checkLockedAmount + returns (uint256 ballotIdx) + { + require(newGovAddr != ZERO, "Implementation cannot be zero"); + require(newGovAddr != _getImplementation(), "Same contract address"); + //check newGov has proxiableUUID + try IERC1822Proxiable(newGovAddr).proxiableUUID() returns ( + bytes32 slot + ) { + require( + slot == _IMPLEMENTATION_SLOT, + "ERC1967Upgrade: unsupported proxiableUUID" + ); + } catch { + revert("ERC1967Upgrade: new implementation is not UUPS"); + } + ballotIdx = ballotLength + 1; + IBallotStorage(getBallotStorageAddress()).createBallotForAddress( + ballotLength + 1, // ballot id + uint256(BallotTypes.GovernanceChange), // ballot type + duration, + msg.sender, // creator + newGovAddr // new governance address + ); + updateBallotMemo(ballotIdx, memo); + ballotLength = ballotIdx; + } + + function addProposalToChangeEnv( + bytes32 envName, + uint256 envType, + bytes memory envVal, + bytes memory memo, + uint256 duration + ) + external + onlyGovMem + checkTimePeriod + checkLockedAmount + returns (uint256 ballotIdx) + { + // require(envName != 0, "Invalid name"); + require( + uint256(VariableTypes.Int) <= envType && + envType <= uint256(VariableTypes.String), + "Invalid type" + ); + require(checkVariableCondition(envName, envVal), "Invalid value"); + + ballotIdx = ballotLength + 1; + IBallotStorage(getBallotStorageAddress()).createBallotForVariable( + ballotIdx, // ballot id + uint256(BallotTypes.EnvValChange), // ballot type + duration, + msg.sender, // creator + envName, // env name + envType, // env type + envVal // env value + ); + updateBallotMemo(ballotIdx, memo); + ballotLength = ballotIdx; + } + + function vote( + uint256 ballotIdx, + bool approval + ) external nonReentrant onlyGovMem checkLockedAmount { + // Check if some ballot is in progress + require(checkUnfinalized(), "Expired"); + + // Check if the ballot can be voted + uint256 ballotType = checkVotable(ballotIdx); + // Vote + createVote(ballotIdx, approval); + // Finalize + (, uint256 accept, uint256 reject) = getBallotVotingInfo(ballotIdx); + uint256 threshold = getThreshold(); + if ( + accept >= threshold || + reject >= threshold || + (accept + reject) == 10000 + ) { + finalizeVote(ballotIdx, ballotType, accept > reject, false); + } + } + + function getMinStaking() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getStakingMin(); + } + + function getMaxStaking() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getStakingMax(); + } + + function getMinVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMin(); + } + + function getMaxVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMax(); + } + + function getThreshold() public pure returns (uint256) { + return 5001; + } // 50.01% from 5001 of 10000 + + function checkUnfinalized() public view returns (bool) { + if (ballotInVoting != 0) { + (, uint256 state, ) = getBallotState(ballotInVoting); + (, uint256 endTime, ) = getBallotPeriod(ballotInVoting); + if (state == uint256(BallotStates.InProgress)) { + if (endTime < block.timestamp) return false; + // require(endTime > block.timestamp, "Expired"); + // require(ballotIdx == ballotInVoting, "Now in voting with different ballot"); + // if (endTime < block.timestamp) { + + // finalizeBallot(ballotInVoting, uint256(BallotStates.Rejected)); + // ballotInVoting = 0; + // // console.log("vote is finalized %s", ballotInVoting); + // } else if (ballotIdx != ballotInVoting) { + // revert("Now in voting with different ballot"); + // } + } + } + return true; + } + + function finalizeEndedVote() public onlyGovMem { + require(!checkUnfinalized(), "Voting is not ended"); + finalizeBallot(ballotInVoting, uint256(BallotStates.Rejected)); + ballotInVoting = 0; + } + + function checkVotable(uint256 ballotIdx) private returns (uint256) { + (uint256 ballotType, uint256 state, ) = getBallotState(ballotIdx); + if (state == uint256(BallotStates.Ready)) { + require(ballotInVoting == 0, "Now in voting with different ballot"); + (, , uint256 duration) = getBallotPeriod(ballotIdx); + if (duration < getMinVotingDuration()) { + startBallot( + ballotIdx, + block.timestamp, + block.timestamp + getMinVotingDuration() + ); + } else if (getMaxVotingDuration() < duration) { + startBallot( + ballotIdx, + block.timestamp, + block.timestamp + getMaxVotingDuration() + ); + } else { + startBallot( + ballotIdx, + block.timestamp, + block.timestamp + duration + ); + } + ballotInVoting = ballotIdx; + } else if (state == uint256(BallotStates.InProgress)) { + // Nothing to do + require( + ballotIdx == ballotInVoting, + "Now in voting with different ballot" + ); + } else { + // canceled + revert("Expired"); + } + return ballotType; + } + + function createVote(uint256 ballotIdx, bool approval) private { + uint256 voteIdx = voteLength + 1; + address staker = getStakerAddr(msg.sender); + uint256 weight = 10000 / getMemberLength(); //IStaking(getStakingAddress()).calcVotingWeightWithScaleFactor(staker, 10000); + uint256 decision = approval + ? uint256(DecisionTypes.Accept) + : uint256(DecisionTypes.Reject); + IBallotStorage(getBallotStorageAddress()).createVote( + voteIdx, + ballotIdx, + staker, + decision, + weight + ); + voteLength = voteIdx; + } + + function finalizeVote( + uint256 ballotIdx, + uint256 ballotType, + bool isAccepted, + bool self + ) private { + uint256 ballotState = uint256(BallotStates.Rejected); + if (isAccepted) { + ballotState = uint256(BallotStates.Accepted); + + if (ballotType == uint256(BallotTypes.MemberAdd)) { + if (!addMember(ballotIdx)) { + ballotState = uint256(BallotStates.Rejected); + } + } else if (ballotType == uint256(BallotTypes.MemberRemoval)) { + removeMember(ballotIdx); + } else if (ballotType == uint256(BallotTypes.MemberChange)) { + if (!changeMember(ballotIdx, self)) { + ballotState = uint256(BallotStates.Rejected); + } + } else if (ballotType == uint256(BallotTypes.GovernanceChange)) { + changeGov(ballotIdx); + } else if (ballotType == uint256(BallotTypes.EnvValChange)) { + applyEnv(ballotIdx); + } + } + finalizeBallot(ballotIdx, ballotState); + if (!self) ballotInVoting = 0; + } + + function fromValidBallot( + uint256 ballotIdx, + uint256 targetType + ) private view { + (uint256 ballotType, uint256 state, ) = getBallotState(ballotIdx); + require(ballotType == targetType, "Invalid voting type"); + require(state == uint(BallotStates.InProgress), "Invalid voting state"); + (, uint256 accept, uint256 reject) = getBallotVotingInfo(ballotIdx); + require( + accept >= getThreshold() || + reject >= getThreshold() || + (accept + reject) == 10000, + "Not yet finalized" + ); + } + + function addMember(uint256 ballotIdx) private returns (bool) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberAdd)); + + ( + , + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + uint256 lockAmount + ) = getBallotMember(ballotIdx); + if (isMember(newStaker)) { + // new staker is already a member or a voter/ + emit NotApplicable(ballotIdx, "Already a member"); + return false; + } + if (isReward(newReward)) { + // new staker is already a member or a voter/ + emit NotApplicable(ballotIdx, "Already a rewarder"); + return false; + } + + // Lock + if (lockAmount < getMinStaking() || getMaxStaking() < lockAmount) { + emit NotApplicable(ballotIdx, "Invalid lock amount"); + return false; + } + + if (availableBalanceOf(newStaker) < lockAmount) { + emit NotApplicable( + ballotIdx, + "Insufficient balance that can be locked" + ); + return false; + } + + if (newStaker != newVoter && newStaker != newReward) { + emit NotApplicable(ballotIdx, "Invalid member address"); + return false; + } + + lock(newStaker, lockAmount); + + // Add voting and reward member + uint256 nMemIdx = memberLength + 1; + voters[nMemIdx] = newVoter; + voterIdx[newVoter] = nMemIdx; + rewards[nMemIdx] = newReward; + rewardIdx[newReward] = nMemIdx; + stakers[nMemIdx] = newStaker; + stakerIdx[newStaker] = nMemIdx; + + // Add node + uint256 nNodeIdx = nodeLength + 1; + Node storage node = nodes[nNodeIdx]; + + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeToMember[nNodeIdx] = newStaker; + nodeIdxFromMember[newStaker] = nNodeIdx; + memberLength = nMemIdx; + nodeLength = nNodeIdx; + modifiedBlock = block.number; + emit MemberAdded(newStaker, newVoter); + return true; + } + + function removeMember(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberRemoval)); + + ( + address oldStaker, // newStakerAddress + // newVoterAddress + , + , + , + , + , + , + , + + ) = // newRewardAddress + // newNodeName + // newNodeId + // newNodeIp + // newNodePort + getBallotMember(ballotIdx); + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Not already a member"); + return; // Non-member. it is abnormal case, but passed + } + + // Remove voting and reward member + uint256 removeIdx = stakerIdx[oldStaker]; + address endAddr = stakers[memberLength]; + address oldVoter = voters[removeIdx]; + address oldReward = rewards[removeIdx]; + + if (stakerIdx[oldStaker] != memberLength) { + ( + stakers[removeIdx], + stakers[memberLength], + stakerIdx[oldStaker], + stakerIdx[endAddr] + ) = (stakers[memberLength], ZERO, 0, stakerIdx[oldStaker]); + removeIdx = rewardIdx[oldStaker]; + endAddr = rewards[memberLength]; + ( + rewards[removeIdx], + rewards[memberLength], + rewardIdx[oldReward], + rewardIdx[endAddr] + ) = (rewards[memberLength], ZERO, 0, rewardIdx[oldReward]); + removeIdx = voterIdx[oldStaker]; + endAddr = voters[memberLength]; + ( + voters[removeIdx], + voters[memberLength], + voterIdx[oldVoter], + voterIdx[endAddr] + ) = (voters[memberLength], ZERO, 0, voterIdx[oldVoter]); + } else { + stakers[memberLength] = ZERO; + stakerIdx[oldStaker] = 0; + rewards[memberLength] = ZERO; + rewardIdx[oldReward] = 0; + voters[memberLength] = ZERO; + voterIdx[oldVoter] = 0; + } + memberLength = memberLength - 1; + // Remove node + + Node storage node = nodes[removeIdx]; + checkNodeEnode[node.enode] = false; + checkNodeName[node.name] = false; + checkNodeIpPort[ + keccak256(abi.encodePacked(node.ip, node.port)) + ] = false; + if (nodeIdxFromMember[oldStaker] != nodeLength) { + removeIdx = nodeIdxFromMember[oldStaker]; + endAddr = nodeToMember[nodeLength]; + + node.name = nodes[nodeLength].name; + node.enode = nodes[nodeLength].enode; + node.ip = nodes[nodeLength].ip; + node.port = nodes[nodeLength].port; + + nodeToMember[removeIdx] = endAddr; + nodeIdxFromMember[endAddr] = removeIdx; + } + nodeToMember[nodeLength] = ZERO; + nodeIdxFromMember[oldStaker] = 0; + delete nodes[nodeLength]; + nodeLength = nodeLength - 1; + modifiedBlock = block.number; + // Unlock and transfer remained to governance + transferLockedAndUnlock(ballotIdx, oldStaker); + + emit MemberRemoved(oldStaker, oldVoter); + } + + function checkChangeMember( + uint256 ballotIdx, + bool self, + address oldStaker, + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint256 port, + uint256 lockAmount + ) private returns (bool) { + if (!self) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberChange)); + } + + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Old address is not a member"); + return false; // Non-member. it is abnormal case. + } + + //old staker + uint256 memberIdx = stakerIdx[oldStaker]; + if (oldStaker != newStaker) { + if (isMember(newStaker)) { + emit NotApplicable( + ballotIdx, + "new address is already a member" + ); + return false; // already member. it is abnormal case. + } + if (newStaker != newVoter && newStaker != newReward) { + emit NotApplicable(ballotIdx, "Invalid voter address"); + return false; + } + // Lock + if (lockAmount < getMinStaking() || getMaxStaking() < lockAmount) { + emit NotApplicable(ballotIdx, "Invalid lock amount"); + return false; + } + if (availableBalanceOf(newStaker) < lockAmount) { + emit NotApplicable( + ballotIdx, + "Insufficient balance that can be locked" + ); + return false; + } + } + // Change node + uint256 nodeIdx = nodeIdxFromMember[oldStaker]; + { + Node memory node = nodes[nodeIdx]; + + if ( + //if node info is not same + // node info can not duplicate + !checkNodeInfoChange(name, enode, ip, port, node) + ) { + emit NotApplicable(ballotIdx, "Duplicated node info"); + return false; + } + } + + { + address oldReward = rewards[memberIdx]; + if ( + (oldStaker != newReward) && + (oldReward != newReward) && + (isMember(newReward) || isReward(newReward)) + ) { + emit NotApplicable(ballotIdx, "Invalid reward address"); + return false; + } + } + { + address oldVoter = voters[memberIdx]; + if ( + (oldStaker != newVoter) && + (oldVoter != newVoter) && + (isMember(newVoter) || isReward(newVoter)) + ) { + emit NotApplicable(ballotIdx, "Invalid voters address"); + return false; + } + } + return true; + } + + // isMember=> isStaker and isVoter + // vote => onlyVoter, staker can change voter without voting, default = staker == voter + // voter can change staker with voting.(changeMember) + function changeMember(uint256 ballotIdx, bool self) private returns (bool) { + if (!self) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberChange)); + } + + ( + address oldStaker, + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + uint256 lockAmount + ) = getBallotMember(ballotIdx); + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Old address is not a member"); + return false; // Non-member. it is abnormal case. + } + + if ( + !checkChangeMember( + ballotIdx, + self, + oldStaker, + newStaker, + newVoter, + newReward, + name, + enode, + ip, + port, + lockAmount + ) + ) return false; + + //old staker + uint256 memberIdx = stakerIdx[oldStaker]; + if (oldStaker != newStaker) { + // Change member + stakers[memberIdx] = newStaker; + stakerIdx[newStaker] = memberIdx; + stakerIdx[oldStaker] = 0; + + lock(newStaker, lockAmount); + } + // Change node + uint256 nodeIdx = nodeIdxFromMember[oldStaker]; + { + Node storage node = nodes[nodeIdx]; + + checkNodeName[node.name] = false; + checkNodeEnode[node.enode] = false; + checkNodeIpPort[ + keccak256(abi.encodePacked(node.ip, node.port)) + ] = false; + + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + modifiedBlock = block.number; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + } + + { + address oldReward = rewards[memberIdx]; + if (oldReward != newReward) { + rewards[memberIdx] = newReward; + rewardIdx[newReward] = memberIdx; + rewardIdx[oldReward] = 0; + } + } + { + address oldVoter = voters[memberIdx]; + if (oldVoter != newVoter) { + voters[memberIdx] = newVoter; + voterIdx[newVoter] = memberIdx; + voterIdx[oldVoter] = 0; + } + } + + if (oldStaker != newStaker) { + nodeToMember[nodeIdx] = newStaker; + nodeIdxFromMember[newStaker] = nodeIdx; + nodeIdxFromMember[oldStaker] = 0; + + // Unlock and transfer remained to governance + transferLockedAndUnlock(ballotIdx, oldStaker); + + emit MemberChanged(oldStaker, newStaker, newVoter); + } else { + emit MemberUpdated(oldStaker, newStaker); + } + return true; + } + + function changeGov(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.GovernanceChange)); + + address newImp = IBallotStorage(getBallotStorageAddress()) + .getBallotAddress(ballotIdx); + if (newImp != ZERO) { + _authorizeUpgrade(newImp); + _upgradeToAndCallUUPS(newImp, new bytes(0), false); + modifiedBlock = block.number; + } + } + + function applyEnv(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.EnvValChange)); + + (bytes32 envKey, uint256 envType, bytes memory envVal) = IBallotStorage( + getBallotStorageAddress() + ).getBallotVariable(ballotIdx); + + IEnvStorage envStorage = IEnvStorage(getEnvStorageAddress()); + envStorage.setVariable(envKey, envVal); + modifiedBlock = block.number; + + emit EnvChanged(envKey, envType, envVal); + } + + //------------------ Code reduction for creation gas + function createBallotForMember( + uint256 id, + uint256 bType, + address creator, + address oAddr, + MemberInfo memory info + ) private { + IBallotStorage(getBallotStorageAddress()).createBallotForMember( + id, // ballot id + bType, // ballot type + info.duration, + creator, // creator + oAddr, // old member address + info.staker, // new member address + info.voter, // old staker address + info.reward, // new staker address + info.name, // new name + info.enode, // new enode + info.ip, // new ip + info.port // new port + ); + } + + function updateBallotLock(uint256 id, uint256 amount) private { + IBallotStorage(getBallotStorageAddress()).updateBallotMemberLockAmount( + id, + amount + ); + } + + function updateBallotMemo(uint256 id, bytes memory memo) private { + IBallotStorage(getBallotStorageAddress()).updateBallotMemo(id, memo); + } + + function createBallotForExit( + uint256 id, + uint256 unlockAmount, + uint256 slashing + ) private { + IBallotStorage(getBallotStorageAddress()).createBallotForExit( + id, + unlockAmount, + slashing + ); + } + + function startBallot(uint256 id, uint256 s, uint256 e) private { + IBallotStorage(getBallotStorageAddress()).startBallot(id, s, e); + } + + function finalizeBallot(uint256 id, uint256 state) private { + IBallotStorage(getBallotStorageAddress()).finalizeBallot(id, state); + } + + function getBallotState( + uint256 id + ) private view returns (uint256, uint256, bool) { + return IBallotStorage(getBallotStorageAddress()).getBallotState(id); + } + + function getBallotPeriod( + uint256 id + ) private view returns (uint256, uint256, uint256) { + return IBallotStorage(getBallotStorageAddress()).getBallotPeriod(id); + } + + function getBallotVotingInfo( + uint256 id + ) private view returns (uint256, uint256, uint256) { + return + IBallotStorage(getBallotStorageAddress()).getBallotVotingInfo(id); + } + + function getBallotMember( + uint256 id + ) + private + view + returns ( + address, + address, + address, + address, + bytes memory, + bytes memory, + bytes memory, + uint256, + uint256 + ) + { + return IBallotStorage(getBallotStorageAddress()).getBallotMember(id); + } + function getBallotForExit( + uint256 id + ) private view returns (uint256, uint256) { + return IBallotStorage(getBallotStorageAddress()).getBallotForExit(id); + } + + function lock(address addr, uint256 amount) private { + IStaking(getStakingAddress()).lock(addr, amount); + } + + function unlock(address addr, uint256 amount) private { + IStaking(getStakingAddress()).unlock(addr, amount); + } + + function transferLockedAndUnlock(uint256 ballotIdx, address addr) private { + (uint256 unlockAmount, uint256 slashing) = getBallotForExit(ballotIdx); + + require( + unlockAmount + slashing <= getMinStaking(), + "minStaking value must be greater than or equal to the sum of unlockAmount, slashing" + ); + + IStaking staking = IStaking(getStakingAddress()); + uint256 locked = staking.lockedBalanceOf(addr); + uint256 ext = locked - getMinStaking(); + + if (locked > unlockAmount) { + unlock(addr, unlockAmount); + staking.transferLocked(addr, slashing, ext); + } else { + unlock(addr, locked); + } + } + + function lockedBalanceOf(address addr) private view returns (uint256) { + // IStaking staking = IStaking(getStakingAddress()).lockedBalanceOf(addr); + return IStaking(getStakingAddress()).lockedBalanceOf(addr); + } + + function availableBalanceOf(address addr) private view returns (uint256) { + return IStaking(getStakingAddress()).availableBalanceOf(addr); + } + + //------------------ Code reduction end + + //====NXTMeta=====/ + + function _authorizeUpgrade( + address newImplementation + ) internal override onlyGovMem {} + + function checkVariableCondition( + bytes32 envKey, + bytes memory envVal + ) internal view returns (bool) { + return + IEnvStorage(getEnvStorageAddress()).checkVariableCondition( + envKey, + envVal + ); + } + + function getStakerAddr(address _addr) public view returns (address staker) { + if (isStaker(_addr)) staker = _addr; + else if (isVoter(_addr)) staker = stakers[voterIdx[_addr]]; + } + + function setProposalTimePeriod(uint256 newPeriod) external onlyOwner { + require(newPeriod < 1 hours, "newPeriod is too long"); + proposal_time_period = newPeriod; + emit SetProposalTimePeriod(newPeriod); + } + + function checkNodeInfoAdd( + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port + ) internal view returns (bool check) { + //Enode can not be duplicated + //IP:port can not be duplicated + //Name can not be duplicated + check = true; + if (checkNodeEnode[enode]) check = false; + if (checkNodeName[name]) check = false; + + bytes32 hvalue = keccak256(abi.encodePacked(ip, port)); + if (checkNodeIpPort[hvalue]) check = false; + } + + function checkNodeInfoChange( + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + Node memory nodeInfo + ) internal view returns (bool check) { + //Enode can not be duplicated + //IP:port can not be duplicated + //Name can not be duplicated + check = true; + if ( + (keccak256(nodeInfo.enode) != keccak256(enode) && + checkNodeEnode[enode]) + ) check = false; + if ( + (keccak256(nodeInfo.name) != keccak256(name) && checkNodeName[name]) + ) check = false; + + bytes32 hvalue = keccak256(abi.encodePacked(ip, port)); + if ( + (keccak256(abi.encodePacked(nodeInfo.ip, nodeInfo.port)) != + hvalue && + checkNodeIpPort[hvalue]) + ) check = false; + } + + uint256 public proposal_time_period; + mapping(address => uint256) public lastAddProposalTime; + + // //For a node duplicate check + // // testnet value is here + // // mapping(bytes32=>bool) internal checkNodeInfo; + // mapping(bytes=>bool) internal checkNodeName; + // mapping(bytes=>bool) internal checkNodeEnode; + // mapping(bytes32=>bool) internal checkNodeIpPort; + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[46] private __gap; + + function reInit() external reinitializer(2) onlyOwner { + unchecked { + for (uint256 i = 0; i < getMemberLength(); i++) { + Node memory node = nodes[i]; + checkNodeName[node.name] = true; + checkNodeEnode[node.enode] = true; + checkNodeIpPort[ + keccak256(abi.encodePacked(node.ip, node.port)) + ] = true; + } + } + } + + function initMigration( + address registry, + uint256 oldModifiedBlock, + address oldOwner + ) external override initializer { + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + modifiedBlock = oldModifiedBlock; + transferOwnership(oldOwner); + emit GovDataMigrated(msg.sender); + } + + function migrateFromLegacy( + address oldGov + ) external initializer returns (int256) { + __ReentrancyGuard_init(); + __Ownable_init(); + + GovImp ogov = GovImp(oldGov); + setRegistry(address(ogov.reg())); + modifiedBlock = block.number; + transferOwnership(ogov.owner()); + + unchecked { + for (uint256 i = 1; i <= ogov.getMemberLength(); i++) { + stakers[i] = ogov.getMember(i); + stakerIdx[stakers[i]] = i; + voters[i] = ogov.getVoter(i); + voterIdx[voters[i]] = i; + rewards[i] = ogov.getReward(i); + rewardIdx[rewards[i]] = i; + memberLength = i; + + Node memory node; + (node.name, node.enode, node.ip, node.port) = ogov.getNode(i); + require( + checkNodeInfoChange( + node.name, + node.enode, + node.ip, + node.port, + node + ), + "node info is duplicated" + ); + checkNodeName[node.name] = true; + checkNodeEnode[node.enode] = true; + checkNodeIpPort[ + keccak256(abi.encodePacked(node.ip, node.port)) + ] = true; + nodes[i] = node; + nodeIdxFromMember[stakers[i]] = i; + nodeToMember[i] = stakers[i]; + nodeLength = i; + lastAddProposalTime[stakers[i]] = ogov.lastAddProposalTime( + stakers[i] + ); + } + } + + proposal_time_period = ogov.proposal_time_period(); + + ballotLength = ogov.ballotLength(); + voteLength = ogov.voteLength(); + ballotInVoting = ogov.getBallotInVoting(); + + return 0; + } +} diff --git a/wemix/governance-contract/contracts/NCPExit.sol b/wemix/governance-contract/contracts/NCPExit.sol new file mode 100644 index 000000000000..46bf150c2800 --- /dev/null +++ b/wemix/governance-contract/contracts/NCPExit.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +contract NCPExit is ERC1967Proxy, IBeacon { + constructor(address _imp) ERC1967Proxy(_imp, "") {} + + function implementation() external view override returns (address) { + return _implementation(); + } +} diff --git a/wemix/governance-contract/contracts/NCPExitImp.sol b/wemix/governance-contract/contracts/NCPExitImp.sol new file mode 100644 index 000000000000..5e43460178b7 --- /dev/null +++ b/wemix/governance-contract/contracts/NCPExitImp.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import "./interface/INCPStaking.sol"; +import "./interface/INCPExit.sol"; +import "./interface/IGovStaking.sol"; +import "./GovChecker.sol"; +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; + +contract NCPExitImp is GovChecker, INCPExit, UUPSUpgradeable, ReentrancyGuardUpgradeable { + /* =========== STATE VARIABLES ===========*/ + using AddressUpgradeable for address payable; + + address private _administrator; + address private _administratorSetter; + + mapping(address /* ncp address */ => /* user + a */ uint256) private _receivedTotalAmount; + mapping(address /* ncp address */ => /* user */ uint256) private _lockedUserBalanceToNCPTotal; + + /* =========== MODIFIERES ===========*/ + modifier onlyGovStaking() { + require(msg.sender == getStakingAddress(), "Only governance staking contract can call this function."); + _; + } + + modifier onlyNcpStaking() { + require(msg.sender == IGovStaking(getStakingAddress()).ncpStaking(), "Only NcpStaking can call this function."); + _; + } + + modifier onlyAdministrator() { + require(msg.sender == _administrator, "Only Administrator can call this function."); + _; + } + + modifier onlyAdministratorSetter() { + require(msg.sender == _administratorSetter, "Caller is not AdministratorSetter."); + _; + } + + receive() external payable {} + + /* =========== FUNCTIONS ===========*/ + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + function initialize(address _registry) external initializer { + __Ownable_init(); + __ReentrancyGuard_init(); + setRegistry(_registry); + _administrator = owner(); + _administratorSetter = owner(); + } + + function setAdministrator(address _newAdministrator) external override onlyAdministratorSetter { + require(_newAdministrator != address(0), "Address should be non-zero"); + _administrator = _newAdministrator; + } + + function setAdministratorSetter(address _newAdministratorSetter) external override onlyAdministratorSetter { + require(_newAdministratorSetter != address(0), "Address should be non-zero"); + _administratorSetter = _newAdministratorSetter; + } + + function depositExitAmount( + address exitNcp, + uint256 totalAmount, + uint256 lockedUserBalanceToNCPTotal + ) external payable override nonReentrant onlyGovStaking { + require(totalAmount == msg.value); + _receivedTotalAmount[exitNcp] = totalAmount; + + // administrator + _lockedUserBalanceToNCPTotal[exitNcp] = lockedUserBalanceToNCPTotal; + } + + function withdrawForUser(address exitNcp, address exitUser, uint256 amount) external override nonReentrant onlyNcpStaking { + require(_lockedUserBalanceToNCPTotal[exitNcp] >= amount, "_lockedUserBalanceToNCPTotal[exitNcp] >= amount"); + + _receivedTotalAmount[exitNcp] = _receivedTotalAmount[exitNcp] - amount; + _lockedUserBalanceToNCPTotal[exitNcp] = _lockedUserBalanceToNCPTotal[exitNcp] - amount; + + payable(exitUser).sendValue(amount); + } + + function withdrawForAdministrator(address exitNcp, uint256 amount, address to) external override nonReentrant onlyAdministrator { + // For admin + require(_receivedTotalAmount[exitNcp] - _lockedUserBalanceToNCPTotal[exitNcp] >= amount); + _receivedTotalAmount[exitNcp] = _receivedTotalAmount[exitNcp] - amount; + + payable(to).sendValue(amount); + } + + function getAvailableAmountForAdministrator(address exitNcp) external view override onlyAdministrator returns (uint256) { + // For admin + return _receivedTotalAmount[exitNcp] - _lockedUserBalanceToNCPTotal[exitNcp]; + } + + function upgradeNCPExit(address newImp) external onlyOwner { + if (newImp != address(0)) { + _authorizeUpgrade(newImp); + _upgradeToAndCallUUPS(newImp, new bytes(0), false); + } + } + + function getLockedUserBalanceToNCPTotal(address exitNcp) external view override returns (uint256) { + return _lockedUserBalanceToNCPTotal[exitNcp]; + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} +} diff --git a/wemix/governance-contract/contracts/Registry.sol b/wemix/governance-contract/contracts/Registry.sol new file mode 100644 index 000000000000..703e550b7f00 --- /dev/null +++ b/wemix/governance-contract/contracts/Registry.sol @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "./interface/IRegistry.sol"; + +/** + * @title Registry + * @dev Registry Contract used to set domain and permission + * The contracts used by the permissioned user in ShowMe references permission in this contract. + * Not only contract address but also general address can be set in this contract. + * Owner should set domain and permission. + */ +contract Registry is Ownable, IRegistry { + // "Wemix Registry" + uint public magic = 0x57656d6978205265676973747279; + uint public modifiedBlock; + + mapping(bytes32 => address) public contracts; + mapping(bytes32 => mapping(address => bool)) public permissions; + + event SetContractDomain(address setter, bytes32 indexed name, address indexed addr); + event SetPermission(bytes32 indexed _contract, address indexed granted, bool status); + + constructor() Ownable() {} + + /* + * @dev Function to set contract(can be general address) domain + * Only owner can use this function + * @param _name name + * @param _addr address + * @return A boolean that indicates if the operation was successful. + */ + function setContractDomain(bytes32 _name, address _addr) public onlyOwner returns (bool success) { + require(_addr != address(0x0), "address should be non-zero"); + contracts[_name] = _addr; + modifiedBlock = block.number; + + emit SetContractDomain(msg.sender, _name, _addr); + return true; + } + + /* + * @dev Function to get contract(can be general address) address + * Anyone can use this function + * @param _name _name + * @return An address of the _name + */ + function getContractAddress(bytes32 _name) public view override returns (address addr) { + require(contracts[_name] != address(0x0), "address should be non-zero"); + return contracts[_name]; + } + + /* + * @dev Function to set permission on contract + * using modifier 'permissioned' references mapping variable 'permissions' + * Only owner can use this function + * @param _contract contract name + * @param _granted granted address + * @param _status true = can use, false = cannot use. default is false + * @return A boolean that indicates if the operation was successful. + */ + function setPermission(bytes32 _contract, address _granted, bool _status) public onlyOwner returns (bool success) { + require(_granted != address(0x0), "address should be non-zero"); + permissions[_contract][_granted] = _status; + modifiedBlock = block.number; + + emit SetPermission(_contract, _granted, _status); + return true; + } + + /* + * @dev Function to get permission on contract + * using modifier 'permissioned' references mapping variable 'permissions' + * @param _contract contract name + * @param _granted granted address + * @return permission result + */ + function getPermission(bytes32 _contract, address _granted) public view returns (bool found) { + return permissions[_contract][_granted]; + } +} diff --git a/wemix/governance-contract/contracts/Staking.sol b/wemix/governance-contract/contracts/Staking.sol new file mode 100644 index 000000000000..03c109c5ae8a --- /dev/null +++ b/wemix/governance-contract/contracts/Staking.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +contract Staking is ERC1967Proxy, IBeacon { + constructor(address _imp) ERC1967Proxy(_imp, "") {} + + function implementation() external view override returns (address) { + return _implementation(); + } +} diff --git a/wemix/governance-contract/contracts/StakingImp.sol b/wemix/governance-contract/contracts/StakingImp.sol new file mode 100644 index 000000000000..1b99f0209dd9 --- /dev/null +++ b/wemix/governance-contract/contracts/StakingImp.sol @@ -0,0 +1,385 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +// import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; + +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "./GovChecker.sol"; +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +import "./interface/IEnvStorage.sol"; +import "./interface/IStaking.sol"; +import "./interface/INCPStaking.sol"; +import "./interface/INCPExit.sol"; + +contract StakingImp is GovChecker, UUPSUpgradeable, ReentrancyGuardUpgradeable, IStaking { + //balance of each NCP + mapping(address => uint256) private _balance; + mapping(address => uint256) private _lockedBalance; + uint256 private _totalLockedBalance; + bool private revoked; + + //====NXTMeta====// + event Staked(address indexed payee, uint256 amount, uint256 total, uint256 available); + event Unstaked(address indexed payee, uint256 amount, uint256 total, uint256 available); + event Locked(address indexed payee, uint256 amount, uint256 total, uint256 available); + event Unlocked(address indexed payee, uint256 amount, uint256 total, uint256 available); + event TransferLocked(address indexed payee, uint256 amount, uint256 total, uint256 available); + event Revoked(address indexed owner, uint256 amount); + + //====Phase2-Staking====// + event DelegateStaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked); + event DelegateUnstaked(address indexed payee, uint256 amount, address indexed ncp, uint256 ncpTotalLocked, uint256 userTotalLocked); + event NCPAddrChanged(address indexed ncp); + + constructor() { + _disableInitializers(); + } + + function init(address registry, bytes memory data) external initializer { + _totalLockedBalance = 0; + revoked = false; + // _transferOwnership(_msgSender()); + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + // data is only for test purpose + if (data.length == 0) return; + + // []{address, amount} + address addr; + uint amount; + uint ix; + uint eix; + assembly { + ix := add(data, 0x20) + } + eix = ix + data.length; + while (ix < eix) { + assembly { + addr := mload(ix) + } + ix += 0x20; + require(ix < eix); + assembly { + amount := mload(ix) + } + ix += 0x20; + + _balance[addr] = amount; + } + } + + receive() external payable { + revert(); + } + + /** + * @dev Deposit from a sender. + */ + function deposit() external payable override nonReentrant notRevoked { + require(msg.value > 0, "Deposit amount should be greater than zero"); + + _balance[msg.sender] = _balance[msg.sender] + msg.value; + + if (IGov(getGovAddress()).isMember(msg.sender)) { + uint256 minimum_staking = IEnvStorage(getEnvStorageAddress()).getStakingMin(); + //if minimum lock is going higher than current locked value, lock more + if (minimum_staking > _lockedBalance[msg.sender] && availableBalanceOf(msg.sender) >= (minimum_staking - _lockedBalance[msg.sender])) { + if (ncpStaking != address(0)) { + uint256 pid = INCPStaking(ncpStaking).ncpToIdx(msg.sender); + if (INCPStaking(ncpStaking).getUserInfo(pid, msg.sender).lastRewardClaimed != 0) { + INCPStaking(ncpStaking).ncpDeposit(minimum_staking - _lockedBalance[msg.sender], payable(msg.sender)); + } + } + _lock(msg.sender, minimum_staking - _lockedBalance[msg.sender]); + } + } + + emit Staked(msg.sender, msg.value, _balance[msg.sender], availableBalanceOf(msg.sender)); + } + + /** + * @dev Withdraw for a sender. + * @param amount The amount of funds will be withdrawn and transferred to. + */ + function withdraw(uint256 amount) external override nonReentrant notRevoked { + require(amount > 0, "Amount should be bigger than zero"); + + //if minimum is changed unlock staked value + uint256 minimum_staking = IEnvStorage(getEnvStorageAddress()).getStakingMin(); + + bool unlockBalance = false; + if (lockedBalanceOf(msg.sender) - _lockedUserBalanceToNCPTotal[msg.sender] >= minimum_staking + amount) { + _unlock(msg.sender, amount); + unlockBalance = true; + } + + require(amount <= availableBalanceOf(msg.sender), "Withdraw amount should be equal or less than balance"); + + _balance[msg.sender] = _balance[msg.sender] - amount; + + if (ncpStaking != address(0) && unlockBalance) { + (bool succ, ) = payable(ncpStaking).call{ value: amount }(""); + require(succ, "Transfer to NCP staking failed"); + INCPStaking(ncpStaking).ncpWithdraw(amount, payable(msg.sender)); + } else { + //payable(msg.sender).transfer(amount); + (bool succ, ) = payable(msg.sender).call{ value: amount }(""); + require(succ, "Transfer to sender failed"); + } + + emit Unstaked(msg.sender, amount, _balance[msg.sender], availableBalanceOf(msg.sender)); + } + + /** + * @dev Lock fund + * @param payee The address whose funds will be locked. + * @param lockAmount The amount of funds will be locked. + */ + function lock(address payee, uint256 lockAmount) external override onlyGov { + _lock(payee, lockAmount); + } + + function lockMore(uint256 lockAmount) external onlyGovStaker { + _lock(msg.sender, lockAmount); + + if (ncpStaking != address(0)) { + uint256 pid = INCPStaking(ncpStaking).ncpToIdx(msg.sender); + if (INCPStaking(ncpStaking).getUserInfo(pid, msg.sender).lastRewardClaimed != 0) { + INCPStaking(ncpStaking).ncpDeposit(lockAmount, payable(msg.sender)); + } + } + } + + function _lock(address payee, uint256 lockAmount) internal { + if (lockAmount == 0) return; + require(_balance[payee] >= lockAmount, "Lock amount should be equal or less than balance"); + require(availableBalanceOf(payee) >= lockAmount, "Insufficient balance that can be locked"); + uint256 maximum = IEnvStorage(getEnvStorageAddress()).getStakingMax(); + + _lockedBalance[payee] = _lockedBalance[payee] + lockAmount; + require(_lockedBalance[payee] <= maximum, "Locked balance is larger than max"); + + _totalLockedBalance = _totalLockedBalance + lockAmount; + + emit Locked(payee, lockAmount, _balance[payee], availableBalanceOf(payee)); + } + + /** + * @dev Transfer locked value(slashing, ncpLockMore, ncpUserTotal) to Ecosystem, NCPExit + * @param from The address whose funds will be transfered. + * @param slashing The amount of funds will be transfered. + * @param ext ncpLockMore + ncpUserTotal + */ + function transferLocked(address from, uint256 slashing, uint256 ext) external override onlyGov { + INCPExit ncpExit = INCPExit(getContractAddress(bytes32("NCPExit"))); + + // Ecosystem + unlock(from, slashing); + _balance[from] = _balance[from] - slashing; + address ecosystem = getEcosystemAddress(); + _balance[ecosystem] = _balance[ecosystem] + slashing; + + // NCPLockMore + uint256 ncpLockMore = ext - _lockedUserBalanceToNCPTotal[from]; + unlock(from, ncpLockMore); + + // To NCPExit + uint256 transferedBalance = lockedBalanceOf(from); + require( + transferedBalance >= _lockedUserBalanceToNCPTotal[from], + "transferedBalance must be greater than or equal to _lockedUserBalanceToNCPTotal." + ); + + unlock(from, transferedBalance); + _balance[from] = _balance[from] - transferedBalance; + ncpExit.depositExitAmount{ value: transferedBalance }(from, transferedBalance, _lockedUserBalanceToNCPTotal[from]); + if (ncpStaking != address(0)) { + _lockedUserBalanceToNCPTotal[from] = 0; + _lockedUserBalanceToNCP[from][ncpStaking] = 0; + } + emit TransferLocked(from, slashing + transferedBalance, _balance[from], availableBalanceOf(from)); + } + + /** + * @dev Unlock fund + * @param payee The address whose funds will be unlocked. + * @param unlockAmount The amount of funds will be unlocked. + */ + function unlock(address payee, uint256 unlockAmount) public override onlyGov { + _unlock(payee, unlockAmount); + } + + function _unlock(address payee, uint256 unlockAmount) internal { + if (unlockAmount == 0) return; + require(_lockedBalance[payee] >= unlockAmount, "Unlock amount should be equal or less than balance locked"); + _lockedBalance[payee] = _lockedBalance[payee] - unlockAmount; + _totalLockedBalance = _totalLockedBalance - unlockAmount; + + emit Unlocked(payee, unlockAmount, _balance[payee], availableBalanceOf(payee)); + } + + function balanceOf(address payee) public view override returns (uint256) { + return _balance[payee]; + } + + function lockedBalanceOf(address payee) public view override returns (uint256) { + return _lockedBalance[payee]; + } + + function availableBalanceOf(address payee) public view override returns (uint256) { + return _balance[payee] - _lockedBalance[payee]; + } + + /** + * @dev Calculate voting weight which range between 0 and 100. + * @param payee The address whose funds were locked. + */ + function calcVotingWeight(address payee) public view override returns (uint256) { + return calcVotingWeightWithScaleFactor(payee, 1e2); + } + + /** + * @dev Calculate voting weight with a scale factor. + * @param payee The address whose funds were locked. + * @param factor The scale factor for weight. For instance: + * if 1e1, result range is between 0 ~ 10 + * if 1e2, result range is between 0 ~ 100 + * if 1e3, result range is between 0 ~ 1000 + */ + function calcVotingWeightWithScaleFactor(address payee, uint32 factor) public view override returns (uint256) { + if (_lockedBalance[payee] == 0 || factor == 0) return 0; + return (_lockedBalance[payee] * factor) / _totalLockedBalance; + } + + function isRevoked() public view returns (bool) { + return revoked; + } + + modifier notRevoked() { + require(!revoked, "Is revoked"); + _; + } + + /** + * @dev Allows the owner to revoke the staking. Funds already staked are returned to the owner + */ + function revoke() public onlyOwner notRevoked { + address contractOwner = owner(); + uint256 balance = address(this).balance; + + require(balance > 0, "balance = 0"); + + payable(contractOwner).transfer(balance); + revoked = true; + + emit Revoked(contractOwner, balance); + } + + function upgradeStaking(address newImp) external onlyOwner { + if (newImp != address(0)) { + _authorizeUpgrade(newImp); + _upgradeToAndCallUUPS(newImp, new bytes(0), false); + } + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[49] private __gap; + + //Phase2 - Staking + mapping(address /* NCP */ => mapping(address /* user */ => uint256 /* amount */)) private _lockedUserBalanceToNCP; + mapping(address /* NCP */ => uint256 /* amount */) private _lockedUserBalanceToNCPTotal; + + address public ncpStaking; + + modifier onlyNCPStaking() { + require(msg.sender == ncpStaking, "Only NCPStaking contract can call this function"); + _; + } + + function userBalanceOf(address ncp, address user) external view override returns (uint256) { + return _lockedUserBalanceToNCP[ncp][user]; + } + + function userTotalBalanceOf(address ncp) external view override returns (uint256) { + return _lockedUserBalanceToNCPTotal[ncp]; + } + + function getRatioOfUserBalance(address ncp) external view override returns (uint256) { + uint256 user = _lockedUserBalanceToNCPTotal[ncp]; + uint256 locked = _lockedBalance[ncp]; + if (user == 0 || locked == 0) return 0; + return (user * 1e2) / locked; + } + + function setNCPStaking(address _ncpStaking) external onlyOwner { + require(_ncpStaking != address(0), "NCPStaking is the zero address"); + ncpStaking = _ncpStaking; + emit NCPAddrChanged(_ncpStaking); + } + + /** + * @dev Deposit from a user for delegate staking. + */ + function delegateDepositAndLockMore(address ncp) external payable override nonReentrant notRevoked onlyNCPStaking { + require(msg.value > 0, "Deposit amount should be greater than zero"); + require(IGov(getGovAddress()).isMember(ncp), "NCP should be a member"); + + // console.log("delegateDepositAndLockMore: msg.value: %s",ncp); + + uint256 userDepositValue = msg.value; + //added value to ncp balance + _balance[ncp] = _balance[ncp] + userDepositValue; + + uint256 minimum_staking = IEnvStorage(getEnvStorageAddress()).getStakingMin(); + uint256 maximum_staking = IEnvStorage(getEnvStorageAddress()).getStakingMax(); + require( + minimum_staking <= _lockedBalance[ncp] && (_lockedBalance[ncp] + userDepositValue) <= maximum_staking, + "user should be in staking range" + ); + _lock(ncp, userDepositValue); + + _lockedUserBalanceToNCP[ncp][msg.sender] = _lockedUserBalanceToNCP[ncp][msg.sender] + userDepositValue; + _lockedUserBalanceToNCPTotal[ncp] = _lockedUserBalanceToNCPTotal[ncp] + userDepositValue; + + emit DelegateStaked(msg.sender, userDepositValue, ncp, _lockedUserBalanceToNCPTotal[ncp], _lockedUserBalanceToNCP[ncp][msg.sender]); + } + + /** + * @dev Withdraw for a user. + * @param amount The amount of funds will be unlocked, withdrawn and transferred to. + */ + function delegateUnlockAndWithdraw(address ncp, uint256 amount) external override nonReentrant notRevoked onlyNCPStaking { + require(amount > 0, "Amount should be bigger than zero"); + require(IGov(getGovAddress()).isMember(ncp), "NCP should be a member"); + + uint256 userWithdrawValue = amount; + uint256 minimum_staking = IEnvStorage(getEnvStorageAddress()).getStakingMin(); + require( + userWithdrawValue <= _lockedUserBalanceToNCP[ncp][msg.sender] && lockedBalanceOf(ncp) - userWithdrawValue >= minimum_staking, + "Withdraw amount should be equal or less than balance" + ); + _unlock(ncp, userWithdrawValue); + + _balance[ncp] = _balance[ncp] - userWithdrawValue; + _lockedUserBalanceToNCP[ncp][msg.sender] = _lockedUserBalanceToNCP[ncp][msg.sender] - userWithdrawValue; + _lockedUserBalanceToNCPTotal[ncp] = _lockedUserBalanceToNCPTotal[ncp] - userWithdrawValue; + + // payable(ncpStaking).transfer(userWithdrawValue); + (bool succ, ) = payable(ncpStaking).call{ value: userWithdrawValue }(""); + require(succ, "Transfer to NCP staking failed"); + + emit DelegateUnstaked(msg.sender, userWithdrawValue, ncp, _lockedUserBalanceToNCPTotal[ncp], _lockedUserBalanceToNCP[ncp][msg.sender]); + } + + function getTotalLockedBalance() external view override returns (uint256) { + return _totalLockedBalance; + } +} diff --git a/wemix/governance-contract/contracts/TestnetGovImp.sol b/wemix/governance-contract/contracts/TestnetGovImp.sol new file mode 100644 index 000000000000..2d93d42d8816 --- /dev/null +++ b/wemix/governance-contract/contracts/TestnetGovImp.sol @@ -0,0 +1,1031 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "./abstract/BallotEnums.sol"; +import "./abstract/EnvConstants.sol"; +import "./abstract/TestnetAGov.sol"; + +import "./interface/IBallotStorage.sol"; +import "./interface/IEnvStorage.sol"; +import "./interface/IStaking.sol"; + +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; + +contract TestnetGovImp is TestnetAGov, ReentrancyGuardUpgradeable, BallotEnums, EnvConstants, UUPSUpgradeable { + enum VariableTypes { + Invalid, + Int, + Uint, + Uint2, + Uint3, + Uint4, + Address, + Bytes32, + Bytes, + String + } + + address constant ZERO = address(0); + + event MemberAdded(address indexed addr, address indexed voter); + event MemberRemoved(address indexed addr, address indexed voter); + event MemberChanged(address indexed oldAddr, address indexed newAddr, address indexed newVoter); + event EnvChanged(bytes32 envName, uint256 envType, bytes envVal); + event MemberUpdated(address indexed addr, address indexed voter); + // added for case that ballot's result could not be applicable. + event NotApplicable(uint256 indexed ballotId, string reason); + + event SetProposalTimePeriod(uint256 newPeriod); + + struct MemberInfo { + address staker; + address voter; // voter + address reward; + bytes name; + bytes enode; + bytes ip; + uint256 port; + uint256 lockAmount; + bytes memo; + uint256 duration; + } + + modifier checkLockedAmount() { + address staker = getStakerAddr(_msgSender()); + require(lockedBalanceOf(staker) <= getMaxStaking() && lockedBalanceOf(staker) >= getMinStaking(), "Invalid staking balance"); + _; + } + + modifier checkTimePeriod() { + address staker = getStakerAddr(_msgSender()); + require((block.timestamp - lastAddProposalTime[staker]) >= proposal_time_period, "Cannot add proposal too early"); + _; + lastAddProposalTime[staker] = block.timestamp; + } + + modifier checkMemberInfo(MemberInfo memory info) { + require(info.voter != ZERO, "Invalid voter"); + require(info.name.length > 0, "Invalid node name"); + require(info.ip.length > 0, "Invalid node IP"); + require(info.port > 0, "Invalid node port"); + require(info.lockAmount >= getMinStaking() && info.lockAmount <= getMaxStaking(), "Invalid lock Amount"); + _; + } + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + function init(address registry, uint256 lockAmount, bytes memory name, bytes memory enode, bytes memory ip, uint port) public initializer { + require(lockAmount > 0, "lockAmount should be more then zero"); + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + // Lock + IStaking staking = IStaking(getStakingAddress()); + require(staking.availableBalanceOf(msg.sender) >= lockAmount, "Insufficient staking"); + staking.lock(msg.sender, lockAmount); + + // Add voting member + memberLength = 1; + voters[memberLength] = msg.sender; + voterIdx[msg.sender] = memberLength; + + // Add reward member + rewards[memberLength] = msg.sender; + rewardIdx[msg.sender] = memberLength; + + stakers[memberLength] = msg.sender; + stakerIdx[msg.sender] = memberLength; + + // Add node + nodeLength = 1; + Node storage node = nodes[nodeLength]; + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeIdxFromMember[msg.sender] = nodeLength; + nodeToMember[nodeLength] = msg.sender; + + modifiedBlock = block.number; + } + + function initOnce(address registry, uint256 lockAmount, bytes memory data) public initializer { + __ReentrancyGuard_init(); + __Ownable_init(); + setRegistry(registry); + + // _initialized = true; + modifiedBlock = block.number; + + // Lock + IStaking staking = IStaking(getStakingAddress()); + + require(lockAmount >= getMinStaking() && getMaxStaking() >= lockAmount, "Invalid lock amount"); + + // []{uint staker, uint voter, uint reward, bytes name, bytes enode, bytes ip, uint port} + // 32 bytes, 32 bytes, 32 bytes, [32 bytes, ] * 3, 32 bytes + address staker; + address voter; + address reward; + bytes memory name; + bytes memory enode; + bytes memory ip; + uint port; + uint idx = 0; + + uint ix; + uint eix; + assembly { + ix := add(data, 0x20) + } + eix = ix + data.length; + while (ix < eix) { + assembly { + staker := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + voter := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + reward := mload(ix) + } + ix += 0x20; + require(ix < eix); + + assembly { + name := ix + } + ix += 0x20 + name.length; + require(ix < eix); + + assembly { + enode := ix + } + ix += 0x20 + enode.length; + require(ix < eix); + + assembly { + ip := ix + } + ix += 0x20 + ip.length; + require(ix < eix); + + assembly { + port := mload(ix) + } + ix += 0x20; + + idx += 1; + require(!isMember(staker) && !isMember(voter) && !isReward(reward), "Already member"); + voters[idx] = voter; + voterIdx[voter] = idx; + rewards[idx] = reward; + rewardIdx[reward] = idx; + stakers[idx] = staker; + stakerIdx[staker] = idx; + + require(staking.availableBalanceOf(staker) >= lockAmount, "Insufficient staking"); + + require(checkNodeInfoAdd(name, enode, ip, port), "Duplicated node info"); + + lock(staker, lockAmount); + + Node storage node = nodes[idx]; + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeToMember[idx] = staker; + nodeIdxFromMember[staker] = idx; + } + memberLength = idx; + nodeLength = idx; + } + + //Add member address = staker address = voter address + function addProposalToAddMember( + MemberInfo memory info + ) external onlyGovMem checkTimePeriod checkLockedAmount checkMemberInfo(info) returns (uint256 ballotIdx) { + require(!isMember(info.staker) && !isReward(info.staker), "Already member"); + require(info.staker == info.voter && info.staker == info.reward, "Staker is not voter"); + require(checkNodeInfoAdd(info.name, info.enode, info.ip, info.port), "Duplicated node info"); + ballotIdx = ballotLength + 1; + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberAdd), // ballot type + msg.sender, // creator + ZERO, // old staker address + info + ); + updateBallotLock(ballotIdx, info.lockAmount); + updateBallotMemo(ballotIdx, info.memo); + ballotLength = ballotIdx; + } + + function addProposalToRemoveMember( + address staker, + uint256 lockAmount, + bytes memory memo, + uint256 duration + ) external onlyGovMem checkTimePeriod checkLockedAmount returns (uint256 ballotIdx) { + require(staker != ZERO, "Invalid address"); + require(isMember(staker), "Non-member"); + require(getMemberLength() > 1, "Cannot remove a sole member"); + require(lockedBalanceOf(staker) >= lockAmount, "Insufficient balance that can be unlocked."); + ballotIdx = ballotLength + 1; + + MemberInfo memory info = MemberInfo( + ZERO, // new staker address + ZERO, + ZERO, + new bytes(0), // new name + new bytes(0), // new enode + new bytes(0), // new ip + 0, // new port + lockAmount, + memo, + duration + ); + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberRemoval), // ballot type + msg.sender, + staker, + info + ); + updateBallotLock(ballotIdx, lockAmount); + updateBallotMemo(ballotIdx, memo); + ballotLength = ballotIdx; + } + + // voter A, staker A -> voter B, staker B Ok with voting + // voter A, staker B -> voter C, staker C Ok with voting + // voter A, staker B -> voter A, staker A Ok with voting + // voter A call : voter A, staker A -> voter A, staker B X + // staker A call : voter A, staker A-> voter B, staker A Ok without voting + // only staker A call : voter B, staker A, reward C -> voter B, staker A, reward D Ok without voting only (voter can not change reward) + // staker only change own info + // voter can propose and vote anything + function addProposalToChangeMember( + MemberInfo memory newInfo, + address oldStaker + ) external onlyGovMem checkTimePeriod checkLockedAmount checkMemberInfo(newInfo) returns (uint256 ballotIdx) { + require(oldStaker != ZERO, "Invalid old Address"); + require(isMember(oldStaker), "Non-member"); + + require( + (voters[stakerIdx[oldStaker]] == newInfo.voter || + newInfo.voter == oldStaker || + ((!isMember(newInfo.voter)) && !isReward(newInfo.voter))) && + (rewards[stakerIdx[oldStaker]] == newInfo.reward || + newInfo.reward == oldStaker || + ((!isMember(newInfo.reward)) && !isReward(newInfo.reward))), + "Already a member" + ); + + ballotIdx = ballotLength + 1; + createBallotForMember( + ballotIdx, // ballot id + uint256(BallotTypes.MemberChange), // ballot type + msg.sender, // creator + oldStaker, // old staker address + newInfo + ); + updateBallotLock(ballotIdx, newInfo.lockAmount); + updateBallotMemo(ballotIdx, newInfo.memo); + ballotLength = ballotIdx; + // 요청자 == 변경할 voting 주소 + if (msg.sender == oldStaker && oldStaker == newInfo.staker) { + (, , uint256 duration) = getBallotPeriod(ballotIdx); + startBallot(ballotIdx, block.timestamp, block.timestamp + duration); + finalizeVote(ballotIdx, uint256(BallotTypes.MemberChange), true, true); + } + } + + function addProposalToChangeGov( + address newGovAddr, + bytes memory memo, + uint256 duration + ) external onlyGovMem checkLockedAmount returns (uint256 ballotIdx) { + require(newGovAddr != ZERO, "Implementation cannot be zero"); + require(newGovAddr != _getImplementation(), "Same contract address"); + //check newGov has proxiableUUID + try IERC1822Proxiable(newGovAddr).proxiableUUID() returns (bytes32 slot) { + require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); + } catch { + revert("ERC1967Upgrade: new implementation is not UUPS"); + } + ballotIdx = ballotLength + 1; + IBallotStorage(getBallotStorageAddress()).createBallotForAddress( + ballotLength + 1, // ballot id + uint256(BallotTypes.GovernanceChange), // ballot type + duration, + msg.sender, // creator + newGovAddr // new governance address + ); + updateBallotMemo(ballotIdx, memo); + ballotLength = ballotIdx; + } + + function addProposalToChangeEnv( + bytes32 envName, + uint256 envType, + bytes memory envVal, + bytes memory memo, + uint256 duration + ) external onlyGovMem checkTimePeriod checkLockedAmount returns (uint256 ballotIdx) { + // require(envName != 0, "Invalid name"); + require(uint256(VariableTypes.Int) <= envType && envType <= uint256(VariableTypes.String), "Invalid type"); + require(checkVariableCondition(envName, envVal), "Invalid value"); + + ballotIdx = ballotLength + 1; + IBallotStorage(getBallotStorageAddress()).createBallotForVariable( + ballotIdx, // ballot id + uint256(BallotTypes.EnvValChange), // ballot type + duration, + msg.sender, // creator + envName, // env name + envType, // env type + envVal // env value + ); + updateBallotMemo(ballotIdx, memo); + ballotLength = ballotIdx; + } + + function vote(uint256 ballotIdx, bool approval) external onlyGovMem nonReentrant checkLockedAmount { + // Check if some ballot is in progress + require(checkUnfinalized(), "Expired"); + + // Check if the ballot can be voted + uint256 ballotType = checkVotable(ballotIdx); + // Vote + createVote(ballotIdx, approval); + // Finalize + (, uint256 accept, uint256 reject) = getBallotVotingInfo(ballotIdx); + uint256 threshold = getThreshold(); + if (accept >= threshold || reject >= threshold || (accept + reject) == 10000) { + finalizeVote(ballotIdx, ballotType, accept > reject, false); + } + } + + function getMinStaking() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getStakingMin(); + } + + function getMaxStaking() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getStakingMax(); + } + + function getMinVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMin(); + } + + function getMaxVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMax(); + } + + function getThreshold() public pure returns (uint256) { + return 5001; + } // 50.01% from 5001 of 10000 + + function checkUnfinalized() public view returns (bool) { + if (ballotInVoting != 0) { + (, uint256 state, ) = getBallotState(ballotInVoting); + (, uint256 endTime, ) = getBallotPeriod(ballotInVoting); + if (state == uint256(BallotStates.InProgress)) { + if (endTime < block.timestamp) return false; + // require(endTime > block.timestamp, "Expired"); + // require(ballotIdx == ballotInVoting, "Now in voting with different ballot"); + // if (endTime < block.timestamp) { + + // finalizeBallot(ballotInVoting, uint256(BallotStates.Rejected)); + // ballotInVoting = 0; + // // console.log("vote is finalized %s", ballotInVoting); + // } else if (ballotIdx != ballotInVoting) { + // revert("Now in voting with different ballot"); + // } + } + } + return true; + } + + function finalizeEndedVote() public onlyGovMem { + require(!checkUnfinalized(), "Voting is not ended"); + finalizeBallot(ballotInVoting, uint256(BallotStates.Rejected)); + ballotInVoting = 0; + } + + function checkVotable(uint256 ballotIdx) private returns (uint256) { + (uint256 ballotType, uint256 state, ) = getBallotState(ballotIdx); + if (state == uint256(BallotStates.Ready)) { + require(ballotInVoting == 0, "Now in voting with different ballot"); + (, , uint256 duration) = getBallotPeriod(ballotIdx); + if (duration < getMinVotingDuration()) { + startBallot(ballotIdx, block.timestamp, block.timestamp + getMinVotingDuration()); + } else if (getMaxVotingDuration() < duration) { + startBallot(ballotIdx, block.timestamp, block.timestamp + getMaxVotingDuration()); + } else { + startBallot(ballotIdx, block.timestamp, block.timestamp + duration); + } + ballotInVoting = ballotIdx; + } else if (state == uint256(BallotStates.InProgress)) { + // Nothing to do + require(ballotIdx == ballotInVoting, "Now in voting with different ballot"); + } else { + // canceled + revert("Expired"); + } + return ballotType; + } + + function createVote(uint256 ballotIdx, bool approval) private { + uint256 voteIdx = voteLength + 1; + address staker = getStakerAddr(msg.sender); + uint256 weight = 10000 / getMemberLength(); //IStaking(getStakingAddress()).calcVotingWeightWithScaleFactor(staker, 10000); + uint256 decision = approval ? uint256(DecisionTypes.Accept) : uint256(DecisionTypes.Reject); + IBallotStorage(getBallotStorageAddress()).createVote(voteIdx, ballotIdx, staker, decision, weight); + voteLength = voteIdx; + } + + function finalizeVote(uint256 ballotIdx, uint256 ballotType, bool isAccepted, bool self) private { + uint256 ballotState = uint256(BallotStates.Rejected); + if (isAccepted) { + ballotState = uint256(BallotStates.Accepted); + + if (ballotType == uint256(BallotTypes.MemberAdd)) { + if (!addMember(ballotIdx)) { + ballotState = uint256(BallotStates.Rejected); + } + } else if (ballotType == uint256(BallotTypes.MemberRemoval)) { + removeMember(ballotIdx); + } else if (ballotType == uint256(BallotTypes.MemberChange)) { + if (!changeMember(ballotIdx, self)) { + ballotState = uint256(BallotStates.Rejected); + } + } else if (ballotType == uint256(BallotTypes.GovernanceChange)) { + changeGov(ballotIdx); + } else if (ballotType == uint256(BallotTypes.EnvValChange)) { + applyEnv(ballotIdx); + } + } + finalizeBallot(ballotIdx, ballotState); + if (!self) ballotInVoting = 0; + } + + function fromValidBallot(uint256 ballotIdx, uint256 targetType) private view { + (uint256 ballotType, uint256 state, ) = getBallotState(ballotIdx); + require(ballotType == targetType, "Invalid voting type"); + require(state == uint(BallotStates.InProgress), "Invalid voting state"); + (, uint256 accept, uint256 reject) = getBallotVotingInfo(ballotIdx); + require(accept >= getThreshold() || reject >= getThreshold(), "Not yet finalized"); + } + + function addMember(uint256 ballotIdx) private returns (bool) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberAdd)); + + ( + , + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + uint256 lockAmount + ) = getBallotMember(ballotIdx); + if (isMember(newStaker)) { + // new staker is already a member or a voter/ + emit NotApplicable(ballotIdx, "Already a member"); + return false; + } + if (isReward(newReward)) { + // new staker is already a member or a voter/ + emit NotApplicable(ballotIdx, "Already a rewarder"); + return false; + } + + // Lock + if (lockAmount < getMinStaking() || getMaxStaking() < lockAmount) { + emit NotApplicable(ballotIdx, "Invalid lock amount"); + return false; + } + + if (availableBalanceOf(newStaker) < lockAmount) { + emit NotApplicable(ballotIdx, "Insufficient balance that can be locked"); + return false; + } + + if (newStaker != newVoter && newStaker != newReward) { + emit NotApplicable(ballotIdx, "Invalid member address"); + return false; + } + + lock(newStaker, lockAmount); + + // Add voting and reward member + uint256 nMemIdx = memberLength + 1; + voters[nMemIdx] = newVoter; + voterIdx[newVoter] = nMemIdx; + rewards[nMemIdx] = newReward; + rewardIdx[newReward] = nMemIdx; + stakers[nMemIdx] = newStaker; + stakerIdx[newStaker] = nMemIdx; + + // Add node + uint256 nNodeIdx = nodeLength + 1; + Node storage node = nodes[nNodeIdx]; + + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + + nodeToMember[nNodeIdx] = newStaker; + nodeIdxFromMember[newStaker] = nNodeIdx; + node.name = name; + memberLength = nMemIdx; + nodeLength = nNodeIdx; + modifiedBlock = block.number; + emit MemberAdded(newStaker, newVoter); + return true; + } + + function removeMember(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberRemoval)); + + (address oldStaker, , , , , , , , uint256 unlockAmount) = getBallotMember(ballotIdx); + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Not already a member"); + return; // Non-member. it is abnormal case, but passed + } + + // Remove voting and reward member + uint256 removeIdx = stakerIdx[oldStaker]; + address endAddr = stakers[memberLength]; + address oldVoter = voters[removeIdx]; + address oldReward = rewards[removeIdx]; + + if (stakerIdx[oldStaker] != memberLength) { + (stakers[removeIdx], stakers[memberLength], stakerIdx[oldStaker], stakerIdx[endAddr]) = ( + stakers[memberLength], + ZERO, + 0, + stakerIdx[oldStaker] + ); + removeIdx = rewardIdx[oldStaker]; + endAddr = rewards[memberLength]; + (rewards[removeIdx], rewards[memberLength], rewardIdx[oldReward], rewardIdx[endAddr]) = ( + rewards[memberLength], + ZERO, + 0, + rewardIdx[oldReward] + ); + removeIdx = voterIdx[oldStaker]; + endAddr = voters[memberLength]; + (voters[removeIdx], voters[memberLength], voterIdx[oldVoter], voterIdx[endAddr]) = (voters[memberLength], ZERO, 0, voterIdx[oldVoter]); + } else { + stakers[memberLength] = ZERO; + stakerIdx[oldStaker] = 0; + rewards[memberLength] = ZERO; + rewardIdx[oldReward] = 0; + voters[memberLength] = ZERO; + voterIdx[oldVoter] = 0; + } + memberLength = memberLength - 1; + // Remove node + + Node storage node = nodes[removeIdx]; + checkNodeEnode[node.enode] = false; + checkNodeName[node.name] = false; + checkNodeIpPort[keccak256(abi.encodePacked(node.ip, node.port))] = false; + if (nodeIdxFromMember[oldStaker] != nodeLength) { + removeIdx = nodeIdxFromMember[oldStaker]; + endAddr = nodeToMember[nodeLength]; + + node.name = nodes[nodeLength].name; + node.enode = nodes[nodeLength].enode; + node.ip = nodes[nodeLength].ip; + node.port = nodes[nodeLength].port; + + nodeToMember[removeIdx] = endAddr; + nodeIdxFromMember[endAddr] = removeIdx; + } + nodeToMember[nodeLength] = ZERO; + nodeIdxFromMember[oldStaker] = 0; + delete nodes[nodeLength]; + nodeLength = nodeLength - 1; + modifiedBlock = block.number; + // Unlock and transfer remained to governance + transferLockedAndUnlock(oldStaker, unlockAmount); + + emit MemberRemoved(oldStaker, oldVoter); + } + + function checkChangeMember( + uint256 ballotIdx, + bool self, + address oldStaker, + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint256 port, + uint256 lockAmount + ) private returns (bool) { + if (!self) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberChange)); + } + + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Old address is not a member"); + return false; // Non-member. it is abnormal case. + } + + //old staker + uint256 memberIdx = stakerIdx[oldStaker]; + if (oldStaker != newStaker) { + if (isMember(newStaker)) { + emit NotApplicable(ballotIdx, "new address is already a member"); + return false; // already member. it is abnormal case. + } + if (newStaker != newVoter && newStaker != newReward) { + emit NotApplicable(ballotIdx, "Invalid voter address"); + return false; + } + // Lock + if (lockAmount < getMinStaking() || getMaxStaking() < lockAmount) { + emit NotApplicable(ballotIdx, "Invalid lock amount"); + return false; + } + if (availableBalanceOf(newStaker) < lockAmount) { + emit NotApplicable(ballotIdx, "Insufficient balance that can be locked"); + return false; + } + } + // Change node + uint256 nodeIdx = nodeIdxFromMember[oldStaker]; + { + Node memory node = nodes[nodeIdx]; + + if ( + //if node info is not same + // node info can not duplicate + !checkNodeInfoChange(name, enode, ip, port, node) + ) { + emit NotApplicable(ballotIdx, "Duplicated node info"); + return false; + } + } + + { + address oldReward = rewards[memberIdx]; + if ((oldStaker != newReward) && (oldReward != newReward) && (isMember(newReward) || isReward(newReward))) { + emit NotApplicable(ballotIdx, "Invalid reward address"); + return false; + } + } + { + address oldVoter = voters[memberIdx]; + if ((oldStaker != newVoter) && (oldVoter != newVoter) && (isMember(newVoter) || isReward(newVoter))) { + emit NotApplicable(ballotIdx, "Invalid voters address"); + return false; + } + } + return true; + } + + // isMember=> isStaker and isVoter + // vote => onlyVoter, staker can change voter without voting, default = staker == voter + // voter can change staker with voting.(changeMember) + function changeMember(uint256 ballotIdx, bool self) private returns (bool) { + if (!self) { + fromValidBallot(ballotIdx, uint256(BallotTypes.MemberChange)); + } + + ( + address oldStaker, + address newStaker, + address newVoter, + address newReward, + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + uint256 lockAmount + ) = getBallotMember(ballotIdx); + if (!isMember(oldStaker)) { + emit NotApplicable(ballotIdx, "Old address is not a member"); + return false; // Non-member. it is abnormal case. + } + + if (!checkChangeMember(ballotIdx, self, oldStaker, newStaker, newVoter, newReward, name, enode, ip, port, lockAmount)) return false; + + //old staker + uint256 memberIdx = stakerIdx[oldStaker]; + if (oldStaker != newStaker) { + // Change member + stakers[memberIdx] = newStaker; + stakerIdx[newStaker] = memberIdx; + stakerIdx[oldStaker] = 0; + + lock(newStaker, lockAmount); + } + // Change node + uint256 nodeIdx = nodeIdxFromMember[oldStaker]; + { + Node storage node = nodes[nodeIdx]; + + checkNodeName[node.name] = false; + checkNodeEnode[node.enode] = false; + checkNodeIpPort[keccak256(abi.encodePacked(node.ip, node.port))] = false; + + node.name = name; + node.enode = enode; + node.ip = ip; + node.port = port; + modifiedBlock = block.number; + // checkNodeInfo[getNodeInfoHash(enode, ip, port)] = true; + checkNodeName[name] = true; + checkNodeEnode[enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(ip, port))] = true; + } + + { + address oldReward = rewards[memberIdx]; + if (oldReward != newReward) { + rewards[memberIdx] = newReward; + rewardIdx[newReward] = memberIdx; + rewardIdx[oldReward] = 0; + } + } + { + address oldVoter = voters[memberIdx]; + if (oldVoter != newVoter) { + voters[memberIdx] = newVoter; + voterIdx[newVoter] = memberIdx; + voterIdx[oldVoter] = 0; + } + } + + if (oldStaker != newStaker) { + nodeToMember[nodeIdx] = newStaker; + nodeIdxFromMember[newStaker] = nodeIdx; + nodeIdxFromMember[oldStaker] = 0; + + // Unlock and transfer remained to governance + transferLockedAndUnlock(oldStaker, lockAmount); + + emit MemberChanged(oldStaker, newStaker, newVoter); + } else { + emit MemberUpdated(oldStaker, newStaker); + } + return true; + } + + function changeGov(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.GovernanceChange)); + + address newImp = IBallotStorage(getBallotStorageAddress()).getBallotAddress(ballotIdx); + if (newImp != ZERO) { + _authorizeUpgrade(newImp); + _upgradeToAndCallUUPS(newImp, new bytes(0), false); + modifiedBlock = block.number; + } + } + + function applyEnv(uint256 ballotIdx) private { + fromValidBallot(ballotIdx, uint256(BallotTypes.EnvValChange)); + + (bytes32 envKey, uint256 envType, bytes memory envVal) = IBallotStorage(getBallotStorageAddress()).getBallotVariable(ballotIdx); + + IEnvStorage envStorage = IEnvStorage(getEnvStorageAddress()); + envStorage.setVariable(envKey, envVal); + modifiedBlock = block.number; + + emit EnvChanged(envKey, envType, envVal); + } + + //------------------ Code reduction for creation gas + function createBallotForMember(uint256 id, uint256 bType, address creator, address oAddr, MemberInfo memory info) private { + IBallotStorage(getBallotStorageAddress()).createBallotForMember( + id, // ballot id + bType, // ballot type + info.duration, + creator, // creator + oAddr, // old member address + info.staker, // new member address + info.voter, // old staker address + info.reward, // new staker address + info.name, // new name + info.enode, // new enode + info.ip, // new ip + info.port // new port + ); + } + + function updateBallotLock(uint256 id, uint256 amount) private { + IBallotStorage(getBallotStorageAddress()).updateBallotMemberLockAmount(id, amount); + } + + function updateBallotMemo(uint256 id, bytes memory memo) private { + IBallotStorage(getBallotStorageAddress()).updateBallotMemo(id, memo); + } + + function startBallot(uint256 id, uint256 s, uint256 e) private { + IBallotStorage(getBallotStorageAddress()).startBallot(id, s, e); + } + + function finalizeBallot(uint256 id, uint256 state) private { + IBallotStorage(getBallotStorageAddress()).finalizeBallot(id, state); + } + + function getBallotState(uint256 id) private view returns (uint256, uint256, bool) { + return IBallotStorage(getBallotStorageAddress()).getBallotState(id); + } + + function getBallotPeriod(uint256 id) private view returns (uint256, uint256, uint256) { + return IBallotStorage(getBallotStorageAddress()).getBallotPeriod(id); + } + + function getBallotVotingInfo(uint256 id) private view returns (uint256, uint256, uint256) { + return IBallotStorage(getBallotStorageAddress()).getBallotVotingInfo(id); + } + + function getBallotMember( + uint256 id + ) private view returns (address, address, address, address, bytes memory, bytes memory, bytes memory, uint256, uint256) { + return IBallotStorage(getBallotStorageAddress()).getBallotMember(id); + } + + function lock(address addr, uint256 amount) private { + IStaking(getStakingAddress()).lock(addr, amount); + } + + function unlock(address addr, uint256 amount) private { + IStaking(getStakingAddress()).unlock(addr, amount); + } + + function transferLockedAndUnlock(address addr, uint256 unlockAmount) private { + IStaking staking = IStaking(getStakingAddress()); + uint256 locked = staking.lockedBalanceOf(addr); + if (locked > unlockAmount) { + staking.transferLocked(addr, locked - unlockAmount); + unlock(addr, unlockAmount); + } else { + unlock(addr, locked); + } + } + + function lockedBalanceOf(address addr) private view returns (uint256) { + // IStaking staking = IStaking(getStakingAddress()).lockedBalanceOf(addr); + return IStaking(getStakingAddress()).lockedBalanceOf(addr); + } + + function availableBalanceOf(address addr) private view returns (uint256) { + return IStaking(getStakingAddress()).availableBalanceOf(addr); + } + + //------------------ Code reduction end + + //====NXTMeta=====/ + + function _authorizeUpgrade(address newImplementation) internal override onlyGovMem {} + + function checkVariableCondition(bytes32 envKey, bytes memory envVal) internal view returns (bool) { + return IEnvStorage(getEnvStorageAddress()).checkVariableCondition(envKey, envVal); + } + + function getStakerAddr(address _addr) public view returns (address staker) { + if (isStaker(_addr)) staker = _addr; + else if (isVoter(_addr)) staker = stakers[voterIdx[_addr]]; + } + + function setProposalTimePeriod(uint256 newPeriod) external onlyOwner { + require(newPeriod < 1 hours, "newPeriod is too long"); + proposal_time_period = newPeriod; + emit SetProposalTimePeriod(newPeriod); + } + + function checkNodeInfoAdd(bytes memory name, bytes memory enode, bytes memory ip, uint port) internal view returns (bool check) { + //Enode can not be duplicated + //IP:port can not be duplicated + //Name can not be duplicated + check = true; + if (checkNodeEnode[enode]) check = false; + if (checkNodeName[name]) check = false; + + bytes32 hvalue = keccak256(abi.encodePacked(ip, port)); + if (checkNodeIpPort[hvalue]) check = false; + } + + function checkNodeInfoChange( + bytes memory name, + bytes memory enode, + bytes memory ip, + uint port, + Node memory nodeInfo + ) internal view returns (bool check) { + //Enode can not be duplicated + //IP:port can not be duplicated + //Name can not be duplicated + check = true; + if ((keccak256(nodeInfo.enode) != keccak256(enode) && checkNodeEnode[enode])) check = false; + if ((keccak256(nodeInfo.name) != keccak256(name) && checkNodeName[name])) check = false; + + bytes32 hvalue = keccak256(abi.encodePacked(ip, port)); + if ((keccak256(abi.encodePacked(nodeInfo.ip, nodeInfo.port)) != hvalue && checkNodeIpPort[hvalue])) check = false; + } + + uint256 public proposal_time_period; + mapping(address => uint256) public lastAddProposalTime; + + //For a node duplicate check + // testnet value is here + // mapping(bytes32=>bool) internal checkNodeInfo; + mapping(bytes => bool) internal checkNodeName; + mapping(bytes => bool) internal checkNodeEnode; + mapping(bytes32 => bool) internal checkNodeIpPort; + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[46] private __gap; + + function reInit() external reinitializer(2) onlyOwner { + unchecked { + for (uint256 i = 0; i < getMemberLength(); i++) { + Node memory node = nodes[i]; + checkNodeName[node.name] = true; + checkNodeEnode[node.enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(node.ip, node.port))] = true; + } + } + } + + function reInitV3(uint256[] memory indices, address[] memory newRewards) external reinitializer(3) onlyOwner { + unchecked { + for (uint256 i = 0; i < indices.length; i++) { + address oldReward = rewards[i]; + address newReward = newRewards[i - 1]; + rewards[i] = newReward; + rewardIdx[newReward] = i; + rewardIdx[oldReward] = 0; + } + } + //for the testnet + checkNodeName[nodes[40].name] = true; + checkNodeEnode[nodes[40].enode] = true; + checkNodeIpPort[keccak256(abi.encodePacked(nodes[40].ip, nodes[40].port))] = true; + } + + function maigration(address newGov) external onlyOwner { + IGov(newGov).initMigration(address(reg), modifiedBlock, owner()); + unchecked { + for (uint256 i = 1; i < getMemberLength() + 1; i++) { + IGov(newGov).setMembersForMigration( + i, + stakers[i], + voters[i], + rewards[i], + lastAddProposalTime[stakers[i]], + nodes[i].name, + nodes[i].enode, + nodes[i].ip, + nodes[i].port + ); + } + } + IGov(newGov).setBallotForMigration(ballotLength, voteLength, ballotInVoting); + IGov(newGov).setProposalTimePeriodForMigration(proposal_time_period); + } +} diff --git a/wemix/governance-contract/contracts/abigen.go b/wemix/governance-contract/contracts/abigen.go new file mode 100644 index 000000000000..f968434ae0f1 --- /dev/null +++ b/wemix/governance-contract/contracts/abigen.go @@ -0,0 +1,51 @@ +package main + +import ( + "flag" + "fmt" + "path/filepath" + + gov "github.com/ethereum/go-ethereum/wemix/bind" + compile "github.com/ethereum/go-ethereum/wemix/governance-contract" +) + +const pkg string = "gov" + +var ( + rootFlag = flag.String("root", "../contracts", "") +) + +func main() { + flag.Parse() + root := *rootFlag + outDir := filepath.Join(root, "../../bind") + if contracts, err := compile.Compile(root, + filepath.Join(root, "Registry.sol"), + filepath.Join(root, "Gov.sol"), + filepath.Join(root, "GovImp.sol"), + filepath.Join(root, "NCPExit.sol"), + filepath.Join(root, "NCPExitImp.sol"), + filepath.Join(root, "Staking.sol"), + filepath.Join(root, "StakingImp.sol"), + filepath.Join(root, "storage", "BallotStorage.sol"), + filepath.Join(root, "storage", "BallotStorageImp.sol"), + filepath.Join(root, "storage", "EnvStorage.sol"), + filepath.Join(root, "storage", "EnvStorageImp.sol"), + ); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_registry_abi.go"), gov.REGISTRY); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_gov_abi.go"), gov.GOV, gov.GOV_IMP); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_ncpExit_abi.go"), gov.NCPEXIT, gov.NCPEXIT_IMP); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_staking_abi.go"), gov.STAKING, gov.STAKING_IMP); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_ballotStorage_abi.go"), gov.BALLOTSTORAGE, gov.BALLOTSTORAGE_IMP); err != nil { + panic(err) + } else if err := contracts.BindContracts(pkg, filepath.Join(outDir, "gen_envStorage_abi.go"), gov.ENVSTORAGE, gov.ENVSTORAGE_IMP); err != nil { + panic(err) + } else { + fmt.Println("success!") + } +} diff --git a/wemix/governance-contract/contracts/abstract/AEnvStorage.sol b/wemix/governance-contract/contracts/abstract/AEnvStorage.sol new file mode 100644 index 000000000000..2d238c6884e2 --- /dev/null +++ b/wemix/governance-contract/contracts/abstract/AEnvStorage.sol @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../GovChecker.sol"; +import "../storage/EternalStorage.sol"; + +abstract contract AEnvStorage is EternalStorage, GovChecker { + event StringVarableChanged(bytes32 indexed _name, string _value); + + event UintVarableChanged(bytes32 indexed _name, uint _value); + + event IntVarableChanged(bytes32 indexed _name, int _value); + + event AddressVarableChanged(bytes32 indexed _name, address _value); + + event Bytes32VarableChanged(bytes32 indexed _name, bytes32 _value); + + event BytesVarableChanged(bytes32 indexed _name, bytes _value); + + event VarableChanged(bytes32 indexed _name, uint256 indexed _type, string _value); + + /** + * @dev Allows the owner to set a value for a int variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setInt(bytes32 h, int256 v) internal { + _setInt(h, v); + emit IntVarableChanged(h, v); + } + + /** + * @dev Allows the owner to set a value for a boolean variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setUint(bytes32 h, uint256 v) internal { + _setUint(h, v); + emit UintVarableChanged(h, v); + } + + /** + * @dev Allows the owner to set a value for a address variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setAddress(bytes32 h, address v) internal { + _setAddress(h, v); + emit AddressVarableChanged(h, v); + } + + /** + * @dev Allows the owner to set a value for a string variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setString(bytes32 h, string memory v) internal { + _setString(h, v); + emit StringVarableChanged(h, v); + } + + /** + * @dev Allows the owner to set a value for a bytes variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setBytes(bytes32 h, bytes memory v) internal { + _setBytes(h, v); + emit BytesVarableChanged(h, v); + } + + /** + * @dev Allows the owner to set a value for a bytes32 variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function setBytes32(bytes32 h, bytes32 v) internal { + _setBytes32(h, v); + emit Bytes32VarableChanged(h, v); + } + + // mapping(bytes32 => Variable) internal s; + + // /** + // * @dev Add a new variable . + // * @param _h The keccak256 hash of the variable name + // * @param _t The type of value + // * @param _v The value to be stored + // */ + // function _add(bytes32 _h, uint256 _t, string _v) internal { + // require(s[_h]._name == "","not found"); + // s[_h] = Variable(_h,_t,_v); + // emit VarableAdded(_h,_t,_v); + // } + // /** + // * @dev Update a new variable . + // * @param _h The keccak256 hash of the variable name + // * @param _t The type of value + // * @param _v The value to be stored + // */ + // function _change(bytes32 _h, uint256 _t, string _v) internal { + // require(s[_h]._name == _h,"not found"); + // Variable storage v = s[_h]; + // v._name = _h; + // v._type = _t; + // v._value = _v; + // emit VarableChanged(_h,_t,_v); + + // } + // /** + // * @dev Get the type & value stored of a string variable by the hash name + // * @param _h The keccak256 hash of the variable name + // */ + // function get(bytes32 _h) public view returns (uint256 varType, string varVal){ + // //require(s[_h]._name == _h,"not found"); + // return (s[_h]._type, s[_h]._value); + // } + // /** + // * @dev Get the type stored of a string variable by the hash name + // * @param _h The keccak256 hash of the variable name + // */ + // function getType(bytes32 _h) public view returns (uint256){ + // require(s[_h]._name == _h,"not found"); + // return s[_h]._type; + // } + // /** + // * @dev Get the value stored of a string variable by the hash name + // * @param _h The keccak256 hash of the variable name + // */ + // function getValue(bytes32 _h) public view returns (string){ + // require(s[_h]._name == _h,"not found"); + // return s[_h]._value; + // } +} diff --git a/wemix/governance-contract/contracts/abstract/AGov.sol b/wemix/governance-contract/contracts/abstract/AGov.sol new file mode 100644 index 000000000000..765e5f1c480b --- /dev/null +++ b/wemix/governance-contract/contracts/abstract/AGov.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../interface/IStaking.sol"; +import "../interface/IGov.sol"; +import "../GovChecker.sol"; + +abstract contract AGov is GovChecker, IGov { + uint public modifiedBlock; + + // For voting member + mapping(uint256 => address) internal voters; + mapping(address => uint256) public voterIdx; + uint256 internal memberLength; + + // For reward member + mapping(uint256 => address) internal rewards; + mapping(address => uint256) public rewardIdx; + + //For staking member + mapping(uint256 => address) internal stakers; + mapping(address => uint256) public stakerIdx; + + //For a node duplicate check + // mainnet value is here + // mapping(bytes32=>bool) internal checkNodeInfo; + mapping(bytes => bool) internal checkNodeName; + mapping(bytes => bool) internal checkNodeEnode; + mapping(bytes32 => bool) internal checkNodeIpPort; + + // For enode + struct Node { + bytes name; + bytes enode; + bytes ip; + uint port; + } + + mapping(uint256 => Node) internal nodes; + mapping(address => uint256) internal nodeIdxFromMember; + mapping(uint256 => address) internal nodeToMember; + uint256 internal nodeLength; + + // For ballot + uint256 public ballotLength; + uint256 public voteLength; + uint256 internal ballotInVoting; + + function isReward(address addr) public view override returns (bool) { + return (rewardIdx[addr] != 0); + } + function isVoter(address addr) public view override returns (bool) { + return (voterIdx[addr] != 0); + } + function isStaker(address addr) public view override returns (bool) { + return (stakerIdx[addr] != 0); + } + function isMember(address addr) public view override returns (bool) { + return (isStaker(addr) || isVoter(addr)); + } + function getMember(uint256 idx) public view override returns (address) { + return stakers[idx]; + } + function getMemberLength() public view override returns (uint256) { + return memberLength; + } + function getReward(uint256 idx) public view override returns (address) { + return rewards[idx]; + } + function getNodeIdxFromMember(address addr) public view override returns (uint256) { + return nodeIdxFromMember[addr]; + } + function getMemberFromNodeIdx(uint256 idx) public view override returns (address) { + return nodeToMember[idx]; + } + function getNodeLength() public view override returns (uint256) { + return nodeLength; + } + //====NxtMeta=====/ + function getVoter(uint256 idx) public view override returns (address) { + return voters[idx]; + } + + function getNode(uint256 idx) public view override returns (bytes memory name, bytes memory enode, bytes memory ip, uint port) { + return (nodes[idx].name, nodes[idx].enode, nodes[idx].ip, nodes[idx].port); + } + + function getBallotInVoting() public view override returns (uint256) { + return ballotInVoting; + } +} diff --git a/wemix/governance-contract/contracts/abstract/BallotEnums.sol b/wemix/governance-contract/contracts/abstract/BallotEnums.sol new file mode 100644 index 000000000000..6cabd9c33957 --- /dev/null +++ b/wemix/governance-contract/contracts/abstract/BallotEnums.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract BallotEnums { + enum BallotStates { + Invalid, + Ready, + InProgress, + Accepted, + Rejected, + Canceled + } + + enum DecisionTypes { + Invalid, + Accept, + Reject + } + + enum BallotTypes { + Invalid, + MemberAdd, // new Member Address, new Node id, new Node ip, new Node port + MemberRemoval, // old Member Address + MemberChange, // Old Member Address, New Member Address, new Node id, New Node ip, new Node port + GovernanceChange, // new Governace Impl Address + EnvValChange // Env variable name, type , value + } +} diff --git a/wemix/governance-contract/contracts/abstract/EnvConstants.sol b/wemix/governance-contract/contracts/abstract/EnvConstants.sol new file mode 100644 index 000000000000..db5026caa1cb --- /dev/null +++ b/wemix/governance-contract/contracts/abstract/EnvConstants.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract EnvConstants { + bytes32 public constant BLOCKS_PER_NAME = keccak256("blocksPer"); + + bytes32 public constant BALLOT_DURATION_MIN_NAME = + keccak256("ballotDurationMin"); + + bytes32 public constant BALLOT_DURATION_MAX_NAME = + keccak256("ballotDurationMax"); + + bytes32 public constant STAKING_MIN_NAME = keccak256("stakingMin"); + + bytes32 public constant STAKING_MAX_NAME = keccak256("stakingMax"); + + bytes32 public constant MAX_IDLE_BLOCK_INTERVAL_NAME = + keccak256("MaxIdleBlockInterval"); + + //=======NXTMeta========/ + + bytes32 public constant BALLOT_DURATION_MIN_MAX_NAME = + keccak256("ballotDurationMinMax"); + bytes32 public constant STAKING_MIN_MAX_NAME = keccak256("stakingMinMax"); + + bytes32 public constant BLOCK_CREATION_TIME_NAME = + keccak256("blockCreationTime"); + bytes32 public constant BLOCK_REWARD_AMOUNT_NAME = + keccak256("blockRewardAmount"); + // unit = gwei + bytes32 public constant MAX_PRIORITY_FEE_PER_GAS_NAME = + keccak256("maxPriorityFeePerGas"); + + bytes32 public constant BLOCK_REWARD_DISTRIBUTION_METHOD_NAME = + keccak256("blockRewardDistribution"); + bytes32 public constant BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME = + keccak256("blockRewardDistributionBlockProducer"); + bytes32 public constant BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME = + keccak256("blockRewardDistributionStakingReward"); + bytes32 public constant BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME = + keccak256("blockRewardDistributionEcosystem"); + bytes32 public constant BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME = + keccak256("blockRewardDistributionMaintenance"); + + bytes32 public constant GASLIMIT_AND_BASE_FEE_NAME = + keccak256("gasLimitAndBaseFee"); + bytes32 public constant BLOCK_GASLIMIT_NAME = keccak256("blockGasLimit"); + bytes32 public constant BASE_FEE_MAX_CHANGE_RATE_NAME = + keccak256("baseFeeMaxChangeRate"); + bytes32 public constant GAS_TARGET_PERCENTAGE_NAME = + keccak256("gasTargetPercentage"); + + bytes32 public constant MAX_BASE_FEE_NAME = keccak256("maxBaseFee"); + + uint256 public constant DENOMINATOR = 10000; +} diff --git a/wemix/governance-contract/contracts/abstract/TestnetAGov.sol b/wemix/governance-contract/contracts/abstract/TestnetAGov.sol new file mode 100644 index 000000000000..22344f55ce5f --- /dev/null +++ b/wemix/governance-contract/contracts/abstract/TestnetAGov.sol @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../interface/IStaking.sol"; +import "../interface/ITestnetGov.sol"; +import "../GovChecker.sol"; + +abstract contract TestnetAGov is GovChecker, ITestnetGov { + uint public modifiedBlock; + + // For voting member + mapping(uint256 => address) internal voters; + mapping(address => uint256) public voterIdx; + uint256 internal memberLength; + + // For reward member + mapping(uint256 => address) internal rewards; + mapping(address => uint256) public rewardIdx; + + //For staking member + mapping(uint256 => address) internal stakers; + mapping(address => uint256) public stakerIdx; + + //For a node duplicate check + // mainnet value is here + // mapping(bytes32=>bool) internal checkNodeInfo; + // mapping(bytes=>bool) internal checkNodeName; + // mapping(bytes=>bool) internal checkNodeEnode; + // mapping(bytes32=>bool) internal checkNodeIpPort; + + // For enode + struct Node { + bytes name; + bytes enode; + bytes ip; + uint port; + } + + mapping(uint256 => Node) internal nodes; + mapping(address => uint256) internal nodeIdxFromMember; + mapping(uint256 => address) internal nodeToMember; + uint256 internal nodeLength; + + // For ballot + uint256 public ballotLength; + uint256 public voteLength; + uint256 internal ballotInVoting; + + function isReward(address addr) public view override returns (bool) { + return (rewardIdx[addr] != 0); + } + function isVoter(address addr) public view override returns (bool) { + return (voterIdx[addr] != 0); + } + function isStaker(address addr) public view override returns (bool) { + return (stakerIdx[addr] != 0); + } + function isMember(address addr) public view override returns (bool) { + return (isStaker(addr) || isVoter(addr)); + } + function getMember(uint256 idx) public view override returns (address) { + return stakers[idx]; + } + function getMemberLength() public view override returns (uint256) { + return memberLength; + } + function getReward(uint256 idx) public view override returns (address) { + return rewards[idx]; + } + function getNodeIdxFromMember(address addr) public view override returns (uint256) { + return nodeIdxFromMember[addr]; + } + function getMemberFromNodeIdx(uint256 idx) public view override returns (address) { + return nodeToMember[idx]; + } + function getNodeLength() public view override returns (uint256) { + return nodeLength; + } + //====NxtMeta=====/ + function getVoter(uint256 idx) public view override returns (address) { + return voters[idx]; + } + + function getNode(uint256 idx) public view override returns (bytes memory name, bytes memory enode, bytes memory ip, uint port) { + return (nodes[idx].name, nodes[idx].enode, nodes[idx].ip, nodes[idx].port); + } + + function getBallotInVoting() public view override returns (uint256) { + return ballotInVoting; + } +} diff --git a/wemix/governance-contract/contracts/interface/IBallotStorage.sol b/wemix/governance-contract/contracts/interface/IBallotStorage.sol new file mode 100644 index 000000000000..3636f6b1c9cb --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IBallotStorage.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IBallotStorage { + function createBallotForMember( + uint256, + uint256, + uint256, + address, + address, + address, + address, + address, + bytes memory, + bytes memory, + bytes memory, + uint + ) external; + + function createBallotForAddress(uint256, uint256, uint256, address, address) external returns (uint256); + function createBallotForVariable(uint256, uint256, uint256, address, bytes32, uint256, bytes memory) external returns (uint256); + function createBallotForExit(uint256, uint256, uint256) external; + function createVote(uint256, uint256, address, uint256, uint256) external; + function finalizeBallot(uint256, uint256) external; + function startBallot(uint256, uint256, uint256) external; + function updateBallotMemo(uint256, bytes memory) external; + function updateBallotDuration(uint256, uint256) external; + function updateBallotMemberLockAmount(uint256, uint256) external; + + function getBallotPeriod(uint256) external view returns (uint256, uint256, uint256); + function getBallotVotingInfo(uint256) external view returns (uint256, uint256, uint256); + function getBallotState(uint256) external view returns (uint256, uint256, bool); + + function getBallotBasic( + uint256 + ) external view returns (uint256, uint256, uint256, address, bytes memory, uint256, uint256, uint256, uint256, bool, uint256); + + function getBallotMember( + uint256 + ) external view returns (address, address, address, address, bytes memory, bytes memory, bytes memory, uint256, uint256); + function getBallotAddress(uint256) external view returns (address); + function getBallotVariable(uint256) external view returns (bytes32, uint256, bytes memory); + function getBallotForExit(uint256) external view returns (uint256, uint256); +} diff --git a/wemix/governance-contract/contracts/interface/IEnvStorage.sol b/wemix/governance-contract/contracts/interface/IEnvStorage.sol new file mode 100644 index 000000000000..b7e5aa8fb8a1 --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IEnvStorage.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IEnvStorage { + function setBlocksPerByBytes(bytes memory) external; + function setBallotDurationMinByBytes(bytes memory) external; + function setBallotDurationMaxByBytes(bytes memory) external; + function setStakingMinByBytes(bytes memory) external; + function setStakingMaxByBytes(bytes memory) external; + function setMaxIdleBlockIntervalByBytes(bytes memory) external; + function setBlockCreationTimeByBytes(bytes memory _value) external; + function setBlockRewardAmountByBytes(bytes memory _value) external; + function setMaxPriorityFeePerGasByBytes(bytes memory _value) external; + function setBallotDurationMinMax(uint256 _min, uint256 _max) external; + function setBlockRewardDistributionMethodByBytes(bytes memory _value) external; + function setGasLimitAndBaseFeeByBytes(bytes memory _value) external; + function setMaxBaseFeeByBytes(bytes memory _value) external; + function setBallotDurationMinMaxByBytes(bytes memory _value) external; + function setStakingMinMaxByBytes(bytes memory _value) external; + function getBlockCreationTime() external view returns (uint256); + function getBlockRewardAmount() external view returns (uint256); + function getMaxPriorityFeePerGas() external view returns (uint256); + function getStakingMinMax() external view returns (uint256, uint256); + function getBlockRewardDistributionMethod() external view returns (uint256, uint256, uint256, uint256); + function getGasLimitAndBaseFee() external view returns (uint256, uint256, uint256); + function getMaxBaseFee() external view returns (uint256); + function getBlocksPer() external view returns (uint256); + function getStakingMin() external view returns (uint256); + function getStakingMax() external view returns (uint256); + function getBallotDurationMin() external view returns (uint256); + function getBallotDurationMax() external view returns (uint256); + function getBallotDurationMinMax() external view returns (uint256, uint256); + function getMaxIdleBlockInterval() external view returns (uint256); + function checkVariableCondition(bytes32 envKey, bytes memory envVal) external pure returns (bool); + function setVariable(bytes32 envKey, bytes memory envVal) external; +} diff --git a/wemix/governance-contract/contracts/interface/IGov.sol b/wemix/governance-contract/contracts/interface/IGov.sol new file mode 100644 index 000000000000..c223e232a592 --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IGov.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IGov { + function isReward(address addr) external view returns (bool); + function isVoter(address addr) external view returns (bool); + function isStaker(address addr) external view returns (bool); + function isMember(address) external view returns (bool); + function getMember(uint256) external view returns (address); + function getMemberLength() external view returns (uint256); + function getReward(uint256) external view returns (address); + function getNodeIdxFromMember(address) external view returns (uint256); + function getMemberFromNodeIdx(uint256) external view returns (address); + function getNodeLength() external view returns (uint256); + function getNode(uint256) external view returns (bytes memory, bytes memory, bytes memory, uint); + function getBallotInVoting() external view returns (uint256); + function getVoter(uint256 idx) external view returns (address); + function initMigration(address registry, uint256 oldModifiedBlock, address oldOwner) external; +} diff --git a/wemix/governance-contract/contracts/interface/IGovStaking.sol b/wemix/governance-contract/contracts/interface/IGovStaking.sol new file mode 100644 index 000000000000..3fe18f9e663d --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IGovStaking.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IGovStaking { + function ncpStaking() external view returns (address); +} diff --git a/wemix/governance-contract/contracts/interface/INCPExit.sol b/wemix/governance-contract/contracts/interface/INCPExit.sol new file mode 100644 index 000000000000..0c1c99e36d6a --- /dev/null +++ b/wemix/governance-contract/contracts/interface/INCPExit.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +interface INCPExit { + /** + * @dev Sets a new administrator. + * @param _newAdministrator Address of the new administrator. + */ + function setAdministrator(address _newAdministrator) external; + + /** + * @dev Sets a new administrator setter. + * @param _newAdministratorSetter Address of the new administrator setter. + */ + function setAdministratorSetter(address _newAdministratorSetter) external; + + /** + * @dev Exits from the contract. + * @param exitNcp Address of the NCP to exit. + * @param totalAmount Total amount of ether to exit with. + * @param lockedUserBalanceToNCPTotal Total locked user balance to NCP. + */ + function depositExitAmount(address exitNcp, uint256 totalAmount, uint256 lockedUserBalanceToNCPTotal) external payable; + + /** + * @dev Withdraws amount for a user. + * @param exitNcp Address of the ncp + * @param exitUser Address of the user to withdraw for. + * @param amount Amount to withdraw. + */ + function withdrawForUser(address exitNcp, address exitUser, uint256 amount) external; + + /** + * @dev Withdraws amount for the administrator. + * @param exitNcp Address of the NCP to withdraw from. + */ + function withdrawForAdministrator(address exitNcp, uint256 amount, address to) external; + + function getAvailableAmountForAdministrator(address exitNcp) external view returns (uint256); + + function getLockedUserBalanceToNCPTotal(address exitNcp) external view returns (uint256); +} diff --git a/wemix/governance-contract/contracts/interface/INCPStaking.sol b/wemix/governance-contract/contracts/interface/INCPStaking.sol new file mode 100644 index 000000000000..fb34f900beff --- /dev/null +++ b/wemix/governance-contract/contracts/interface/INCPStaking.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +/// @author @seunghwalee +interface INCPStaking { + struct UserInfo { + uint256 amount; + uint256 rewardDebt; + uint256 pendingReward; + uint256 pendingAmountReward; + uint256 lastRewardClaimed; + } + function ncpDeposit(uint256 amount, address payable to) external payable; + function ncpWithdraw(uint256 amount, address payable to) external payable; + function getUserInfo(uint256 pid, address account) external view returns (UserInfo memory info); + function ncpToIdx(address ncp) external view returns (uint256); +} diff --git a/wemix/governance-contract/contracts/interface/IRegistry.sol b/wemix/governance-contract/contracts/interface/IRegistry.sol new file mode 100644 index 000000000000..db0d31479ef8 --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IRegistry.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IRegistry { + function getContractAddress(bytes32) external view returns (address); +} diff --git a/wemix/governance-contract/contracts/interface/IStaking.sol b/wemix/governance-contract/contracts/interface/IStaking.sol new file mode 100644 index 000000000000..a59cd54216d0 --- /dev/null +++ b/wemix/governance-contract/contracts/interface/IStaking.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IStaking { + function deposit() external payable; + function withdraw(uint256) external; + function lock(address, uint256) external; + function unlock(address, uint256) external; + function transferLocked(address, uint256, uint256) external; + function balanceOf(address) external view returns (uint256); + function lockedBalanceOf(address) external view returns (uint256); + function availableBalanceOf(address) external view returns (uint256); + function calcVotingWeight(address) external view returns (uint256); + function calcVotingWeightWithScaleFactor(address, uint32) external view returns (uint256); + // function isAllowed(address voter, address staker) external view returns(bool); + function userBalanceOf(address ncp, address user) external view returns (uint256); + function userTotalBalanceOf(address ncp) external view returns (uint256); + function getRatioOfUserBalance(address ncp) external view returns (uint256); + function delegateDepositAndLockMore(address ncp) external payable; + function delegateUnlockAndWithdraw(address ncp, uint256 amount) external; + function getTotalLockedBalance() external view returns (uint256); +} diff --git a/wemix/governance-contract/contracts/interface/ITestnetGov.sol b/wemix/governance-contract/contracts/interface/ITestnetGov.sol new file mode 100644 index 000000000000..b5cc0a502705 --- /dev/null +++ b/wemix/governance-contract/contracts/interface/ITestnetGov.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface ITestnetGov { + function isReward(address addr) external view returns (bool); + function isVoter(address addr) external view returns (bool); + function isStaker(address addr) external view returns (bool); + function isMember(address) external view returns (bool); + function getMember(uint256) external view returns (address); + function getMemberLength() external view returns (uint256); + function getReward(uint256) external view returns (address); + function getNodeIdxFromMember(address) external view returns (uint256); + function getMemberFromNodeIdx(uint256) external view returns (address); + function getNodeLength() external view returns (uint256); + function getNode(uint256) external view returns (bytes memory, bytes memory, bytes memory, uint); + function getBallotInVoting() external view returns (uint256); + function getVoter(uint256 idx) external view returns (address); +} diff --git a/wemix/governance-contract/contracts/openzeppelin/contracts b/wemix/governance-contract/contracts/openzeppelin/contracts new file mode 160000 index 000000000000..d4fb3a89f9d0 --- /dev/null +++ b/wemix/governance-contract/contracts/openzeppelin/contracts @@ -0,0 +1 @@ +Subproject commit d4fb3a89f9d0a39c7ee6f2601d33ffbf30085322 diff --git a/wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable b/wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable new file mode 160000 index 000000000000..6b9807b0639e --- /dev/null +++ b/wemix/governance-contract/contracts/openzeppelin/contracts-upgradeable @@ -0,0 +1 @@ +Subproject commit 6b9807b0639e1dd75e07fa062e9432eb3f35dd8c diff --git a/wemix/governance-contract/contracts/storage/BallotStorage.sol b/wemix/governance-contract/contracts/storage/BallotStorage.sol new file mode 100644 index 000000000000..825d2434b757 --- /dev/null +++ b/wemix/governance-contract/contracts/storage/BallotStorage.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +contract BallotStorage is ERC1967Proxy, IBeacon { + constructor(address _imp) ERC1967Proxy(_imp, "") {} + + function implementation() external view override returns (address) { + return _implementation(); + } +} diff --git a/wemix/governance-contract/contracts/storage/BallotStorageImp.sol b/wemix/governance-contract/contracts/storage/BallotStorageImp.sol new file mode 100644 index 000000000000..9c82e476d381 --- /dev/null +++ b/wemix/governance-contract/contracts/storage/BallotStorageImp.sol @@ -0,0 +1,570 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "../abstract/BallotEnums.sol"; +import "../GovChecker.sol"; +import "../interface/IEnvStorage.sol"; +import "../interface/IBallotStorage.sol"; +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; + +contract BallotStorageImp is GovChecker, BallotEnums, IBallotStorage, UUPSUpgradeable { + struct BallotBasic { + //Ballot ID + uint256 id; + //시작 시간 + uint256 startTime; + //종료 시간 + uint256 endTime; + // 투표 종류 + uint256 ballotType; + // 제안자 + address creator; + // 투표 내용 + bytes memo; + //총 투표자수 + uint256 totalVoters; + // 진행상태 + uint256 powerOfAccepts; + // 진행상태 + uint256 powerOfRejects; + // 상태 + uint256 state; + // 완료유무 + bool isFinalized; + // 투표 기간 + uint256 duration; + } + + //For MemberAdding/MemberRemoval/MemberSwap + struct BallotMember { + uint256 id; + address oldStakerAddress; + address newStakerAddress; + address newVoterAddress; + address newRewardAddress; + bytes newNodeName; // name + bytes newNodeId; // admin.nodeInfo.id is 512 bit public key + bytes newNodeIp; + uint256 newNodePort; + uint256 lockAmount; + } + + //For GovernanceChange + struct BallotAddress { + uint256 id; + address newGovernanceAddress; + } + + //For EnvValChange + struct BallotVariable { + //Ballot ID + uint256 id; + bytes32 envVariableName; + uint256 envVariableType; + bytes envVariableValue; + } + + struct BallotExit { + // For exit + uint256 unlockAmount; + uint256 slashing; + } + + struct Vote { + uint256 voteId; + uint256 ballotId; + address voter; + uint256 decision; + uint256 power; + uint256 time; + } + + event BallotCreated(uint256 indexed ballotId, uint256 indexed ballotType, address indexed creator); + + event BallotStarted(uint256 indexed ballotId, uint256 indexed startTime, uint256 indexed endTime); + + event Voted(uint256 indexed voteid, uint256 indexed ballotId, address indexed voter, uint256 decision); + + event BallotFinalized(uint256 indexed ballotId, uint256 state); + + event BallotCanceled(uint256 indexed ballotId); + + event BallotUpdated(uint256 indexed ballotId, address indexed updatedBy); + + event SetPrevBallotStorage(address indexed previous); + + mapping(uint => BallotBasic) internal ballotBasicMap; + mapping(uint => BallotMember) internal ballotMemberMap; + mapping(uint => BallotAddress) internal ballotAddressMap; + mapping(uint => BallotVariable) internal ballotVariableMap; + + mapping(uint => Vote) internal voteMap; + mapping(uint => mapping(address => bool)) internal hasVotedMap; + + address internal previousBallotStorage; + + uint256 internal ballotCount; + + // For exit + mapping(uint => BallotExit) internal ballotExitMap; + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + function initialize(address _registry) external initializer { + __Ownable_init(); + setRegistry(_registry); + } + + modifier onlyValidTime(uint256 _startTime, uint256 _endTime) { + require(_startTime > 0 && _endTime > 0, "start or end is 0"); + require(_endTime > _startTime, "start >= end"); // && _startTime > getTime() + //uint256 diffTime = _endTime.sub(_startTime); + // require(diffTime > minBallotDuration()); + // require(diffTime <= maxBallotDuration()); + _; + } + + modifier onlyValidDuration(uint256 _duration) { + require(getMinVotingDuration() <= _duration, "Under min value of duration"); + require(_duration <= getMaxVotingDuration(), "Over max value of duration"); + _; + } + + modifier onlyGovOrCreator(uint256 _ballotId) { + require((getGovAddress() == msg.sender) || (ballotBasicMap[_ballotId].creator == msg.sender), "No Permission"); + _; + } + + modifier notDisabled() { + require(address(this) == getBallotStorageAddress(), "Is Disabled"); + _; + } + + function getMinVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMin(); + } + + function getMaxVotingDuration() public view returns (uint256) { + return IEnvStorage(getEnvStorageAddress()).getBallotDurationMax(); + } + + function getTime() public view returns (uint256) { + return block.timestamp; + } + + function getPreviousBallotStorage() public view returns (address) { + return previousBallotStorage; + } + + function isDisabled() public view returns (bool) { + return (address(this) != getBallotStorageAddress()); + } + + function getBallotCount() public view returns (uint256) { + return ballotCount; + } + + function getBallotBasic( + uint256 _id + ) + public + view + override + returns ( + uint256 startTime, + uint256 endTime, + uint256 ballotType, + address creator, + bytes memory memo, + uint256 totalVoters, + uint256 powerOfAccepts, + uint256 powerOfRejects, + uint256 state, + bool isFinalized, + uint256 duration + ) + { + BallotBasic memory tBallot = ballotBasicMap[_id]; + startTime = tBallot.startTime; + endTime = tBallot.endTime; + ballotType = tBallot.ballotType; + creator = tBallot.creator; + memo = tBallot.memo; + totalVoters = tBallot.totalVoters; + powerOfAccepts = tBallot.powerOfAccepts; + powerOfRejects = tBallot.powerOfRejects; + state = tBallot.state; + isFinalized = tBallot.isFinalized; + duration = tBallot.duration; + } + + function getBallotMember( + uint256 _id + ) + public + view + override + returns ( + address oldStakerAddress, + address newStakerAddress, + address newVoterAddress, + address newRewardAddress, + bytes memory newNodeName, // name + bytes memory newNodeId, // admin.nodeInfo.id is 512 bit public key + bytes memory newNodeIp, + uint256 newNodePort, + uint256 lockAmount + ) + { + BallotMember storage tBallot = ballotMemberMap[_id]; + oldStakerAddress = tBallot.oldStakerAddress; + newStakerAddress = tBallot.newStakerAddress; + newVoterAddress = tBallot.newVoterAddress; + newRewardAddress = tBallot.newRewardAddress; + newNodeName = tBallot.newNodeName; + newNodeId = tBallot.newNodeId; + newNodeIp = tBallot.newNodeIp; + newNodePort = tBallot.newNodePort; + lockAmount = tBallot.lockAmount; + } + + function getBallotAddress(uint256 _id) public view override returns (address newGovernanceAddress) { + BallotAddress storage tBallot = ballotAddressMap[_id]; + newGovernanceAddress = tBallot.newGovernanceAddress; + } + + function getBallotVariable( + uint256 _id + ) public view override returns (bytes32 envVariableName, uint256 envVariableType, bytes memory envVariableValue) { + BallotVariable storage tBallot = ballotVariableMap[_id]; + envVariableName = tBallot.envVariableName; + envVariableType = tBallot.envVariableType; + envVariableValue = tBallot.envVariableValue; + } + + function setPreviousBallotStorage(address _address) public onlyOwner { + require(_address != address(0), "Invalid address"); + previousBallotStorage = _address; + emit SetPrevBallotStorage(_address); + } + + //For MemberAdding/MemberRemoval/MemberSwap + function createBallotForMember( + uint256 _id, + uint256 _ballotType, + uint256 _duration, + address _creator, + address _oldStakerAddress, + address _newStakerAddress, + address _newVoterAddress, + address _newRewardAddress, + bytes memory _newNodeName, // name + bytes memory _newNodeId, // admin.nodeInfo.id is 512 bit public key + bytes memory _newNodeIp, + uint _newNodePort + ) public override onlyGov notDisabled { + require( + _areMemberBallotParamValid( + _ballotType, + _oldStakerAddress, + _newStakerAddress, + _newVoterAddress, + _newRewardAddress, + _newNodeName, + _newNodeId, + _newNodeIp, + _newNodePort + ), + "Invalid Parameter" + ); + _createBallot(_id, _ballotType, _duration, _creator); + BallotMember memory newBallot; + newBallot.id = _id; + newBallot.oldStakerAddress = _oldStakerAddress; + newBallot.newStakerAddress = _newStakerAddress; + newBallot.newVoterAddress = _newVoterAddress; + newBallot.newRewardAddress = _newRewardAddress; + newBallot.newNodeName = _newNodeName; + newBallot.newNodeId = _newNodeId; + newBallot.newNodeIp = _newNodeIp; + newBallot.newNodePort = _newNodePort; + + ballotMemberMap[_id] = newBallot; + } + + function createBallotForExit(uint256 _id, uint256 _unlockAmount, uint256 _slashing) public override onlyGov notDisabled { + ballotExitMap[_id].unlockAmount = _unlockAmount; + ballotExitMap[_id].slashing = _slashing; + } + function getBallotForExit(uint256 _id) public view override returns (uint256 unlockAmount, uint256 slashing) { + unlockAmount = ballotExitMap[_id].unlockAmount; + slashing = ballotExitMap[_id].slashing; + } + + function createBallotForAddress( + uint256 _id, + uint256 _ballotType, + uint256 _duration, + address _creator, + address _newGovernanceAddress + ) public override onlyGov notDisabled returns (uint256) { + require(_ballotType == uint256(BallotTypes.GovernanceChange), "Invalid Ballot Type"); + require(_newGovernanceAddress != address(0), "Invalid Parameter"); + _createBallot(_id, _ballotType, _duration, _creator); + BallotAddress memory newBallot; + newBallot.id = _id; + newBallot.newGovernanceAddress = _newGovernanceAddress; + ballotAddressMap[_id] = newBallot; + return _id; + } + + function createBallotForVariable( + uint256 _id, + uint256 _ballotType, + uint256 _duration, + address _creator, + bytes32 _envVariableName, + uint256 _envVariableType, + bytes memory _envVariableValue + ) public override onlyGov notDisabled returns (uint256) { + require(_areVariableBallotParamValid(_ballotType, _envVariableName, _envVariableValue), "Invalid Parameter"); + _createBallot(_id, _ballotType, _duration, _creator); + BallotVariable memory newBallot; + newBallot.id = _id; + newBallot.envVariableName = _envVariableName; + newBallot.envVariableType = _envVariableType; + newBallot.envVariableValue = _envVariableValue; + ballotVariableMap[_id] = newBallot; + return _id; + } + + function createVote(uint256 _voteId, uint256 _ballotId, address _voter, uint256 _decision, uint256 _power) public override onlyGov notDisabled { + // Check decision type + require((_decision == uint256(DecisionTypes.Accept)) || (_decision == uint256(DecisionTypes.Reject)), "Invalid decision"); + // Check if ballot exists + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + // Check if vote exists + require(voteMap[_voteId].voteId != _voteId, "already existed voteId"); + // Check if voted + require(!hasVotedMap[_ballotId][_voter], "already voted"); + require(ballotBasicMap[_ballotId].state == uint256(BallotStates.InProgress), "Not InProgress State"); + + voteMap[_voteId] = Vote(_voteId, _ballotId, _voter, _decision, _power, getTime()); + _updateBallotForVote(_ballotId, _voter, _decision, _power); + + emit Voted(_voteId, _ballotId, _voter, _decision); + } + + function startBallot( + uint256 _ballotId, + uint256 _startTime, + uint256 _endTime + ) public override onlyGov notDisabled onlyValidTime(_startTime, _endTime) { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + require(ballotBasicMap[_ballotId].state == uint256(BallotStates.Ready), "Not Ready State"); + + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + _ballot.startTime = _startTime; + _ballot.endTime = _endTime; + _ballot.state = uint256(BallotStates.InProgress); + emit BallotStarted(_ballotId, _startTime, _endTime); + } + + function updateBallotMemo(uint256 _ballotId, bytes memory _memo) public override onlyGovOrCreator(_ballotId) notDisabled { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + _ballot.memo = _memo; + emit BallotUpdated(_ballotId, msg.sender); + } + + function updateBallotDuration( + uint256 _ballotId, + uint256 _duration + ) public override onlyGovOrCreator(_ballotId) notDisabled onlyValidDuration(_duration) { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + require(ballotBasicMap[_ballotId].state == uint256(BallotStates.Ready), "Not Ready State"); + + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + _ballot.duration = _duration; + emit BallotUpdated(_ballotId, msg.sender); + } + + function updateBallotMemberLockAmount(uint256 _ballotId, uint256 _lockAmount) public override onlyGov notDisabled { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotMemberMap[_ballotId].id == _ballotId, "not existed BallotMember"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + require(ballotBasicMap[_ballotId].state == uint256(BallotStates.Ready), "Not Ready State"); + BallotMember storage _ballot = ballotMemberMap[_ballotId]; + _ballot.lockAmount = _lockAmount; + emit BallotUpdated(_ballotId, msg.sender); + } + + // cancel ballot info + function cancelBallot(uint256 _ballotId) public onlyGovOrCreator(_ballotId) notDisabled { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + + require(ballotBasicMap[_ballotId].state == uint256(BallotStates.Ready), "Not Ready State"); + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + _ballot.state = uint256(BallotStates.Canceled); + emit BallotCanceled(_ballotId); + } + + // finalize ballot info + function finalizeBallot(uint256 _ballotId, uint256 _ballotState) public override onlyGov notDisabled { + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + require(ballotBasicMap[_ballotId].isFinalized == false, "already finalized"); + require((_ballotState == uint256(BallotStates.Accepted)) || (_ballotState == uint256(BallotStates.Rejected)), "Invalid Ballot State"); + + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + _ballot.state = _ballotState; + _ballot.isFinalized = true; + emit BallotFinalized(_ballotId, _ballotState); + } + + function hasAlreadyVoted(uint56 _ballotId, address _voter) public view returns (bool) { + return hasVotedMap[_ballotId][_voter]; + } + + function getVote( + uint256 _voteId + ) public view returns (uint256 voteId, uint256 ballotId, address voter, uint256 decision, uint256 power, uint256 time) { + require(voteMap[_voteId].voteId == _voteId, "not existed voteId"); + Vote memory _vote = voteMap[_voteId]; + voteId = _vote.voteId; + ballotId = _vote.ballotId; + voter = _vote.voter; + decision = _vote.decision; + power = _vote.power; + time = _vote.time; + } + + function getBallotPeriod(uint256 _id) public view override returns (uint256 startTime, uint256 endTime, uint256 duration) { + BallotBasic memory tBallot = ballotBasicMap[_id]; + startTime = tBallot.startTime; + endTime = tBallot.endTime; + duration = tBallot.duration; + } + + function getBallotVotingInfo(uint256 _id) public view override returns (uint256 totalVoters, uint256 powerOfAccepts, uint256 powerOfRejects) { + BallotBasic memory tBallot = ballotBasicMap[_id]; + totalVoters = tBallot.totalVoters; + powerOfAccepts = tBallot.powerOfAccepts; + powerOfRejects = tBallot.powerOfRejects; + } + + function getBallotState(uint256 _id) public view override returns (uint256 ballotType, uint256 state, bool isFinalized) { + BallotBasic memory tBallot = ballotBasicMap[_id]; + ballotType = tBallot.ballotType; + state = tBallot.state; + isFinalized = tBallot.isFinalized; + } + + function _createBallot(uint256 _id, uint256 _ballotType, uint256 _duration, address _creator) internal onlyValidDuration(_duration) { + require(ballotBasicMap[_id].id != _id, "Already existed ballot"); + + BallotBasic memory newBallot; + newBallot.id = _id; + newBallot.ballotType = _ballotType; + newBallot.creator = _creator; + // newBallot.memo = _memo; + newBallot.state = uint256(BallotStates.Ready); + newBallot.isFinalized = false; + newBallot.duration = _duration; + ballotBasicMap[_id] = newBallot; + ballotCount = ballotCount + 1; + emit BallotCreated(_id, _ballotType, _creator); + } + + function _areMemberBallotParamValid( + uint256 _ballotType, + address _oldStakerAddress, + address _newStakerAddress, + address _newVoterAddress, + address _newRewardAddress, + bytes memory _newName, + bytes memory _newNodeId, // admin.nodeInfo.id is 512 bit public key + bytes memory _newNodeIp, + uint _newNodePort + ) internal pure returns (bool) { + require((_ballotType >= uint256(BallotTypes.MemberAdd)) && (_ballotType <= uint256(BallotTypes.MemberChange)), "Invalid Ballot Type"); + + if (_ballotType == uint256(BallotTypes.MemberRemoval)) { + require(_oldStakerAddress != address(0), "Invalid old staker address"); + require(_newStakerAddress == address(0), "Invalid new staker address"); + require(_newVoterAddress == address(0), "Invalid new voter address"); + require(_newRewardAddress == address(0), "Invalid new reward address"); + require(_newName.length == 0, "Invalid new node name"); + require(_newNodeId.length == 0, "Invalid new node id"); + require(_newNodeIp.length == 0, "Invalid new node IP"); + require(_newNodePort == 0, "Invalid new node Port"); + } else { + require(_newName.length > 0, "Invalid new node name"); + require(_newNodeId.length == 64, "Invalid new node id"); + require(_newNodeIp.length > 0, "Invalid new node IP"); + require(_newNodePort > 0, "Invalid new node Port"); + if (_ballotType == uint256(BallotTypes.MemberAdd)) { + require(_oldStakerAddress == address(0), "Invalid old staker address"); + require(_newStakerAddress != address(0), "Invalid new staker address"); + require(_newVoterAddress != address(0), "Invalid new voter address"); + require(_newRewardAddress != address(0), "Invalid new reward address"); + } else if (_ballotType == uint256(BallotTypes.MemberChange)) { + require(_oldStakerAddress != address(0), "Invalid old staker address"); + require(_newStakerAddress != address(0), "Invalid new staker address"); + require(_newVoterAddress != address(0), "Invalid new voter address"); + require(_newRewardAddress != address(0), "Invalid new reward address"); + } + } + + return true; + } + + function _areVariableBallotParamValid( + uint256 _ballotType, + bytes32 _envVariableName, + bytes memory _envVariableValue + ) internal pure returns (bool) { + require(_ballotType == uint256(BallotTypes.EnvValChange), "Invalid Ballot Type"); + require(_envVariableName > 0, "Invalid environment variable name"); + require(_envVariableValue.length > 0, "Invalid environment variable value"); + + return true; + } + + // update ballot + function _updateBallotForVote(uint256 _ballotId, address _voter, uint256 _decision, uint256 _power) internal { + // c1. actionType 범위 + require((_decision == uint256(DecisionTypes.Accept)) || (_decision == uint256(DecisionTypes.Reject)), "Invalid decision"); + // c2. ballotId 존재 하는지 확인 + require(ballotBasicMap[_ballotId].id == _ballotId, "not existed Ballot"); + // c3. 이미 vote 했는지 확인 + require(hasVotedMap[_ballotId][_voter] == false, "already voted"); + + //1.get ballotBasic + BallotBasic storage _ballot = ballotBasicMap[_ballotId]; + //2. 투표 여부 등록 + hasVotedMap[_ballotId][_voter] = true; + //3. update totalVoters + _ballot.totalVoters = _ballot.totalVoters + 1; + //4. Update power of accept/reject + if (_decision == uint256(DecisionTypes.Accept)) { + _ballot.powerOfAccepts = _ballot.powerOfAccepts + _power; + } else { + _ballot.powerOfRejects = _ballot.powerOfRejects + _power; + } + } + + function upgradeBallotStorage(address newImp) external onlyOwner { + if (newImp != address(0)) { + _authorizeUpgrade(newImp); + _upgradeToAndCallUUPS(newImp, new bytes(0), false); + } + } + + function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} +} diff --git a/wemix/governance-contract/contracts/storage/EnvStorage.sol b/wemix/governance-contract/contracts/storage/EnvStorage.sol new file mode 100644 index 000000000000..82a3f7ce6882 --- /dev/null +++ b/wemix/governance-contract/contracts/storage/EnvStorage.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; + +contract EnvStorage is ERC1967Proxy, IBeacon { + constructor(address _implementation) ERC1967Proxy(_implementation, "") {} + + function implementation() external view override returns (address) { + return _implementation(); + } +} diff --git a/wemix/governance-contract/contracts/storage/EnvStorageImp.sol b/wemix/governance-contract/contracts/storage/EnvStorageImp.sol new file mode 100644 index 000000000000..391e744e3fcb --- /dev/null +++ b/wemix/governance-contract/contracts/storage/EnvStorageImp.sol @@ -0,0 +1,495 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +// pragma abicod + +import "../abstract/EnvConstants.sol"; +import "../abstract/AEnvStorage.sol"; +import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +import "../interface/IEnvStorage.sol"; + +contract EnvStorageImp is + AEnvStorage, + EnvConstants, + UUPSUpgradeable, + IEnvStorage +{ + event UpgradeImplementation(address indexed implementation); + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + function initialize( + address _registry, + bytes32[] memory names, + uint256[] memory infos + ) public initializer { + require( + _registry != _getImplementation(), + "registry should not be same as implementation" + ); + __Ownable_init(); + setRegistry(_registry); + + for (uint i = 0; i < infos.length; i++) { + uint256 temp = getUint(names[i]); + require(infos[i] != 0 || temp != 0, "invalid variable"); + if (temp == 0) { + setUint(names[i], infos[i]); + } + } + } + function upgradeTo(address newImplementation) public override onlyOwner { + _upgradeToAndCallUUPS(newImplementation, "", false); + emit UpgradeImplementation(newImplementation); + } + + function getBlocksPer() public view override returns (uint256) { + return getUint(BLOCKS_PER_NAME); + } + + function getBallotDurationMin() public view override returns (uint256) { + return getUint(BALLOT_DURATION_MIN_NAME); + } + + function getBallotDurationMax() public view override returns (uint256) { + return getUint(BALLOT_DURATION_MAX_NAME); + } + + function getStakingMin() public view override returns (uint256) { + return getUint(STAKING_MIN_NAME); + } + + function getStakingMax() public view override returns (uint256) { + return getUint(STAKING_MAX_NAME); + } + + // function getGasPrice() public override view returns (uint256) { + // return getUint(GAS_PRICE_NAME); + // } + + function getMaxIdleBlockInterval() public view override returns (uint256) { + return getUint(MAX_IDLE_BLOCK_INTERVAL_NAME); + } + + function _authorizeUpgrade( + address newImplementation + ) internal override onlyGov {} + + function setBlocksPer(uint256 _value) public onlyGov { + setUint(BLOCKS_PER_NAME, _value); + } + + function setBallotDurationMin(uint256 _value) public onlyGov { + setUint(BALLOT_DURATION_MIN_NAME, _value); + } + + function setBallotDurationMax(uint256 _value) public onlyGov { + setUint(BALLOT_DURATION_MAX_NAME, _value); + } + + function setStakingMin(uint256 _value) public onlyGov { + setUint(STAKING_MIN_NAME, _value); + } + + function setStakingMax(uint256 _value) public onlyGov { + setUint(STAKING_MAX_NAME, _value); + } + + // function setGasPrice(uint256 _value) public override onlyGov { + // setUint(GAS_PRICE_NAME, _value); + // } + + function setMaxIdleBlockInterval(uint256 _value) public onlyGov { + setUint(MAX_IDLE_BLOCK_INTERVAL_NAME, _value); + } + + function setBlocksPerByBytes(bytes memory _value) public override onlyGov { + setBlocksPer(toUint(_value)); + } + + function setBallotDurationMinByBytes( + bytes memory _value + ) public override onlyGov { + setBallotDurationMin(toUint(_value)); + } + + function setBallotDurationMaxByBytes( + bytes memory _value + ) public override onlyGov { + setBallotDurationMax(toUint(_value)); + } + + function setStakingMinByBytes(bytes memory _value) public override onlyGov { + setStakingMin(toUint(_value)); + } + + function setStakingMaxByBytes(bytes memory _value) public override onlyGov { + setStakingMax(toUint(_value)); + } + + // function setGasPriceByBytes(bytes memory _value ) public override onlyGov { + // setGasPrice(toUint(_value)); + // } + + function setMaxIdleBlockIntervalByBytes( + bytes memory _value + ) public override onlyGov { + setMaxIdleBlockInterval(toUint(_value)); + } + + //=======NXTMeta=======/ + + function getBallotDurationMinMax() + public + view + override + returns (uint256, uint256) + { + return ( + getUint(BALLOT_DURATION_MIN_NAME), + getUint(BALLOT_DURATION_MAX_NAME) + ); + } + + function getStakingMinMax() + public + view + override + returns (uint256, uint256) + { + return (getUint(STAKING_MIN_NAME), getUint(STAKING_MAX_NAME)); + } + + function getBlockCreationTime() public view override returns (uint256) { + return getUint(BLOCK_CREATION_TIME_NAME); + } + + function getBlockRewardAmount() public view override returns (uint256) { + return getUint(BLOCK_REWARD_AMOUNT_NAME); + } + + function getMaxPriorityFeePerGas() public view override returns (uint256) { + return getUint(MAX_PRIORITY_FEE_PER_GAS_NAME); + } + + function getMaxBaseFee() public view override returns (uint256) { + return getUint(MAX_BASE_FEE_NAME); + } + + function getBlockRewardDistributionMethod() + public + view + override + returns (uint256, uint256, uint256, uint256) + { + return ( + getUint(BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME), + getUint(BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME), + getUint(BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME), + getUint(BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME) + ); + } + + function getGasLimitAndBaseFee() + public + view + override + returns (uint256, uint256, uint256) + { + return ( + getUint(BLOCK_GASLIMIT_NAME), + getUint(BASE_FEE_MAX_CHANGE_RATE_NAME), + getUint(GAS_TARGET_PERCENTAGE_NAME) + ); + } + + // function getStakingRewardAddress() public override view returns(address){ + // return getAddress(STAKING_REWARD_ADDRESS_NAME); + // } + + // function getEcofundAddress() public override view returns(address){ + // return getAddress(ECOFUND_ADDRESS_NAME); + // } + + // function getMaintenanceAddress() public override view returns(address){ + // return getAddress(MAINTENANCE_ADDRESS_NAME); + // } + + function setBallotDurationMinMax( + uint256 _min, + uint256 _max + ) public override onlyGov { + require( + _min <= _max, + "Minimum duration must be smaller and equal than maximum duration" + ); + setUint(BALLOT_DURATION_MIN_NAME, _min); + setUint(BALLOT_DURATION_MAX_NAME, _max); + } + + function setStakingMinMax(uint256 _min, uint256 _max) public onlyGov { + require( + _min <= _max, + "Minimum staking must be smaller and equal than maximum staking" + ); + setUint(STAKING_MIN_NAME, _min); + setUint(STAKING_MAX_NAME, _max); + } + + function setBlockCreationTime(uint256 _value) public onlyGov { + setUint(BLOCK_CREATION_TIME_NAME, _value); + } + + function setBlockRewardAmount(uint256 _value) public onlyGov { + setUint(BLOCK_REWARD_AMOUNT_NAME, _value); + } + + function setMaxPriorityFeePerGas(uint256 _value) public onlyGov { + setUint(MAX_PRIORITY_FEE_PER_GAS_NAME, _value); + } + + function setMaxBaseFee(uint256 _value) public onlyGov { + setUint(MAX_BASE_FEE_NAME, _value); + } + + function setBlockRewardDistributionMethod( + uint256 _block_producer, + uint256 _staking_reward, + uint256 _ecofund, + uint256 _maintenance + ) public onlyGov { + require( + (_block_producer + _staking_reward + _ecofund + _maintenance) == + DENOMINATOR, + "Wrong reward distrubtion ratio" + ); + setUint(BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER_NAME, _block_producer); + setUint(BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD_NAME, _staking_reward); + setUint(BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM_NAME, _ecofund); + setUint(BLOCK_REWARD_DISTRIBUTION_MAINTENANCE_NAME, _maintenance); + } + + function setGasLimitAndBaseFee( + uint256 _block_GasLimit, + uint256 _baseFeeMaxChangeRate, + uint256 _gasTargetPercentage, + uint256 _maxBaseFee + ) public onlyGov { + setUint(BLOCK_GASLIMIT_NAME, _block_GasLimit); + setUint(BASE_FEE_MAX_CHANGE_RATE_NAME, _baseFeeMaxChangeRate); + setUint(GAS_TARGET_PERCENTAGE_NAME, _gasTargetPercentage); + setUint(MAX_BASE_FEE_NAME, _maxBaseFee); + } + + function setBallotDurationMinMaxByBytes( + bytes memory _value + ) public override onlyGov { + (uint256 _min, uint256 _max) = to2Uint(_value); + setBallotDurationMinMax(_min, _max); + } + + function setStakingMinMaxByBytes( + bytes memory _value + ) public override onlyGov { + (uint256 _min, uint256 _max) = to2Uint(_value); + setStakingMinMax(_min, _max); + } + + function setBlockCreationTimeByBytes( + bytes memory _value + ) public override onlyGov { + setBlockCreationTime(toUint(_value)); + } + + function setBlockRewardAmountByBytes( + bytes memory _value + ) public override onlyGov { + setBlockRewardAmount(toUint(_value)); + } + + function setMaxPriorityFeePerGasByBytes( + bytes memory _value + ) public override onlyGov { + setMaxPriorityFeePerGas(toUint(_value)); + } + + function setMaxBaseFeeByBytes(bytes memory _value) public override onlyGov { + setMaxBaseFee(toUint(_value)); + } + + function setBlockRewardDistributionMethodByBytes( + bytes memory _value + ) public override onlyGov { + ( + uint256 _block_producer, + uint256 _staking_reward, + uint256 _ecosystem, + uint256 _maintenance + ) = to4Uint(_value); + setBlockRewardDistributionMethod( + _block_producer, + _staking_reward, + _ecosystem, + _maintenance + ); + } + + function setGasLimitAndBaseFeeByBytes( + bytes memory _value + ) public override onlyGov { + ( + uint256 _block_GasLimit, + uint256 _baseFeeMaxChangeRate, + uint256 _gasTargetPercentage, + uint256 _maxBaseFee + ) = to4Uint(_value); + setGasLimitAndBaseFee( + _block_GasLimit, + _baseFeeMaxChangeRate, + _gasTargetPercentage, + _maxBaseFee + ); + } + + function checkVariableCondition( + bytes32 envKey, + bytes memory envVal + ) external pure override returns (bool) { + if (envKey == BLOCK_REWARD_DISTRIBUTION_METHOD_NAME) { + ( + uint256 _block_producer, + uint256 _staking_reward, + uint256 _ecofund, + uint256 _maintenance + ) = abi.decode(envVal, (uint256, uint256, uint256, uint256)); + if ( + (_block_producer + _staking_reward + _ecofund + _maintenance) != + DENOMINATOR + ) return false; + } else if ( + envKey == STAKING_MIN_MAX_NAME || + envKey == BALLOT_DURATION_MIN_MAX_NAME + ) { + (uint256 min, uint256 max) = abi.decode(envVal, (uint256, uint256)); + if (min > max) return false; + } else if (envKey == BLOCK_CREATION_TIME_NAME) { + uint256 time = abi.decode(envVal, (uint256)); + if (time < 1000) return false; + } + return true; + } + + function setVariable( + bytes32 envKey, + bytes memory envVal + ) external override { + if (envKey == BLOCKS_PER_NAME) { + setBlocksPerByBytes(envVal); + } else if (envKey == BALLOT_DURATION_MIN_MAX_NAME) { + setBallotDurationMinMaxByBytes(envVal); + } else if (envKey == STAKING_MIN_MAX_NAME) { + setStakingMinMaxByBytes(envVal); + } + // else if (envKey == GAS_PRICE_NAME) { + // setGasPriceByBytes(envVal); + // } + else if (envKey == MAX_IDLE_BLOCK_INTERVAL_NAME) { + setMaxIdleBlockIntervalByBytes(envVal); + } else if (envKey == BLOCK_CREATION_TIME_NAME) { + setBlockCreationTimeByBytes(envVal); + } else if (envKey == BLOCK_REWARD_AMOUNT_NAME) { + setBlockRewardAmountByBytes(envVal); + } else if (envKey == MAX_PRIORITY_FEE_PER_GAS_NAME) { + setMaxPriorityFeePerGasByBytes(envVal); + } else if (envKey == BLOCK_REWARD_DISTRIBUTION_METHOD_NAME) { + setBlockRewardDistributionMethodByBytes(envVal); + } else if (envKey == GASLIMIT_AND_BASE_FEE_NAME) { + setGasLimitAndBaseFeeByBytes(envVal); + } else if (envKey == MAX_BASE_FEE_NAME) { + setMaxBaseFeeByBytes(envVal); + } + } + + function toBytes32( + bytes memory _input + ) internal pure returns (bytes32 _output) { + assembly { + _output := mload(add(_input, 32)) + } + } + + function toInt(bytes memory _input) internal pure returns (int256 _output) { + assembly { + _output := mload(add(_input, 32)) + } + } + + function toUint( + bytes memory _input + ) internal pure returns (uint256 _output) { + assembly { + _output := mload(add(_input, 32)) + } + } + + function to2Uint( + bytes memory _input + ) internal pure returns (uint256 _output0, uint256 _output1) { + assembly { + _output0 := mload(add(_input, 32)) + _output1 := mload(add(_input, 64)) + } + } + + function to3Uint( + bytes memory _input + ) + internal + pure + returns (uint256 _output0, uint256 _output1, uint256 _output2) + { + assembly { + _output0 := mload(add(_input, 32)) + _output1 := mload(add(_input, 64)) + _output2 := mload(add(_input, 96)) + } + } + + function to4Uint( + bytes memory _input + ) + internal + pure + returns ( + uint256 _output0, + uint256 _output1, + uint256 _output2, + uint256 _output3 + ) + { + assembly { + _output0 := mload(add(_input, 32)) + _output1 := mload(add(_input, 64)) + _output2 := mload(add(_input, 96)) + _output3 := mload(add(_input, 128)) + } + } + + function toAddress( + bytes memory _input + ) internal pure returns (address _output) { + _output = abi.decode(_input, (address)); + // assembly { + // _output := mload(add(_input, 20)) + // } + } + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[49] private __gap; +} diff --git a/wemix/governance-contract/contracts/storage/EternalStorage.sol b/wemix/governance-contract/contracts/storage/EternalStorage.sol new file mode 100644 index 000000000000..d92448656902 --- /dev/null +++ b/wemix/governance-contract/contracts/storage/EternalStorage.sol @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/** + * @title EternalStorage + * @dev An ownable contract that can be used as a storage where the variables + * are stored in a set of mappings indexed by hash names. + */ +contract EternalStorage { + struct Storage { + mapping(bytes32 => bool) _bool; + mapping(bytes32 => int256) _int; + mapping(bytes32 => uint256) _uint; + mapping(bytes32 => string) _string; + mapping(bytes32 => address) _address; + mapping(bytes32 => bytes) _bytes; + mapping(bytes32 => bytes32) _bytes32; + } + + Storage internal s; + + /** + * @dev Get the value stored of a boolean variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getBoolean(bytes32 h) public view returns (bool) { + return s._bool[h]; + } + + /** + * @dev Get the value stored of a int variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getInt(bytes32 h) public view returns (int) { + return s._int[h]; + } + + /** + * @dev Get the value stored of a uint variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getUint(bytes32 h) public view returns (uint256) { + return s._uint[h]; + } + + /** + * @dev Get the value stored of a address variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getAddress(bytes32 h) public view returns (address) { + return s._address[h]; + } + + /** + * @dev Get the value stored of a string variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getString(bytes32 h) public view returns (string memory) { + return s._string[h]; + } + + /** + * @dev Get the value stored of a bytes variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getBytes(bytes32 h) public view returns (bytes memory) { + return s._bytes[h]; + } + + /** + * @dev Get the value stored of a bytes variable by the hash name + * @param h The keccak256 hash of the variable name + */ + function getBytes32(bytes32 h) public view returns (bytes32) { + return s._bytes32[h]; + } + + /** + * @dev Allows the owner to set a value for a boolean variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setBoolean(bytes32 h, bool v) internal { + s._bool[h] = v; + } + + /** + * @dev Allows the owner to set a value for a int variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setInt(bytes32 h, int256 v) internal { + s._int[h] = v; + } + + /** + * @dev Allows the owner to set a value for a boolean variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setUint(bytes32 h, uint256 v) internal { + s._uint[h] = v; + } + + /** + * @dev Allows the owner to set a value for a address variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setAddress(bytes32 h, address v) internal { + s._address[h] = v; + } + + /** + * @dev Allows the owner to set a value for a string variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setString(bytes32 h, string memory v) internal { + s._string[h] = v; + } + + /** + * @dev Allows the owner to set a value for a bytes variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setBytes(bytes32 h, bytes memory v) internal { + s._bytes[h] = v; + } + + /** + * @dev Allows the owner to set a value for a bytes32 variable + * @param h The keccak256 hash of the variable name + * @param v The value to be stored + */ + function _setBytes32(bytes32 h, bytes32 v) internal { + s._bytes32[h] = v; + } + + /** + * @dev This empty reserved space is put in place to allow future versions to add new + * variables without shifting down storage in the inheritance chain. + * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps + */ + uint256[49] private __gap; +} diff --git a/wemix/governance-contract/remappings.txt b/wemix/governance-contract/remappings.txt new file mode 100644 index 000000000000..7d85088bfd88 --- /dev/null +++ b/wemix/governance-contract/remappings.txt @@ -0,0 +1,2 @@ +@openzeppelin/contracts/=contracts/openzeppelin/contracts/contracts/ +@openzeppelin/contracts-upgradeable/=contracts/openzeppelin/contracts-upgradeable/contracts/ \ No newline at end of file diff --git a/wemix/governance-contract/test/const.go b/wemix/governance-contract/test/const.go new file mode 100644 index 000000000000..d824be4521e6 --- /dev/null +++ b/wemix/governance-contract/test/const.go @@ -0,0 +1,110 @@ +package test + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" +) + +func towei(x int64) *big.Int { + return new(big.Int).Mul(big.NewInt(x), big.NewInt(params.Ether)) +} + +func toGwei(x int64) *big.Int { + return new(big.Int).Mul(big.NewInt(x), big.NewInt(params.GWei)) +} + +var ( + LOCK_AMOUNT *big.Int = towei(1500000) +) + +var EnvConstants = struct { + BLOCKS_PER env + BALLOT_DURATION_MIN env + BALLOT_DURATION_MAX env + STAKING_MIN env + STAKING_MAX env + MAX_IDLE_BLOCK_INTERVAL env + BLOCK_CREATION_TIME env + BLOCK_REWARD_AMOUNT env + MAX_PRIORITY_FEE_PER_GAS env + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER env + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD env + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM env + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE env + MAX_BASE_FEE env + BLOCK_GASLIMIT env + BASE_FEE_MAX_CHANGE_RATE env + GAS_TARGET_PERCENTAGE env +}{ + BLOCKS_PER: newEnvInt64("blocksPer", 1), + BALLOT_DURATION_MIN: newEnvInt64("ballotDurationMin", 86400), + BALLOT_DURATION_MAX: newEnvInt64("ballotDurationMax", 604800), + STAKING_MIN: newEnvBig("stakingMin", towei(1500000)), + STAKING_MAX: newEnvBig("stakingMax", towei(1500000)), + MAX_IDLE_BLOCK_INTERVAL: newEnvInt64("MaxIdleBlockInterval", 5), + BLOCK_CREATION_TIME: newEnvInt64("blockCreationTime", 1000), + BLOCK_REWARD_AMOUNT: newEnvBig("blockRewardAmount", towei(1)), + MAX_PRIORITY_FEE_PER_GAS: newEnvBig("maxPriorityFeePerGas", toGwei(100)), + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER: newEnvInt64("blockRewardDistributionBlockProducer", 4000), + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD: newEnvInt64("blockRewardDistributionStakingReward", 1000), + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM: newEnvInt64("blockRewardDistributionEcosystem", 2500), + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE: newEnvInt64("blockRewardDistributionMaintenance", 2500), + MAX_BASE_FEE: newEnvBig("maxBaseFee", toGwei(5000)), + BLOCK_GASLIMIT: newEnvInt64("blockGasLimit", 1050000000), + BASE_FEE_MAX_CHANGE_RATE: newEnvInt64("baseFeeMaxChangeRate", 46), + GAS_TARGET_PERCENTAGE: newEnvInt64("gasTargetPercentage", 30), +} + +type env struct { + Name [32]byte + Value *big.Int +} + +func newEnvInt64(name string, value int64) env { + return env{ + Name: crypto.Keccak256Hash([]byte(name)), + Value: big.NewInt(value), + } +} + +func newEnvBig(name string, value *big.Int) env { + if value == nil { + value = common.Big0 + } + return env{ + Name: crypto.Keccak256Hash([]byte(name)), + Value: value, + } +} + +func makeEnvParams(envs ...env) (names [][32]byte, values []*big.Int) { + length := len(envs) + names = make([][32]byte, length) + values = make([]*big.Int, length) + for i, e := range envs { + names[i] = e.Name + values[i] = e.Value + } + return +} + +var EnvTypes = struct { + Invalid *big.Int + Int *big.Int + Uint *big.Int + Address *big.Int + Bytes32 *big.Int + Bytes *big.Int + String *big.Int +}{big.NewInt(0), big.NewInt(1), big.NewInt(2), big.NewInt(3), big.NewInt(4), big.NewInt(5), big.NewInt(6)} + +var BallotStates = struct { + Invalid *big.Int + Ready *big.Int + InProgress *big.Int + Accepted *big.Int + Rejected *big.Int +}{big.NewInt(0), big.NewInt(1), big.NewInt(2), big.NewInt(3), big.NewInt(4)} diff --git a/wemix/governance-contract/test/contracts.go b/wemix/governance-contract/test/contracts.go new file mode 100644 index 000000000000..9112f1038a11 --- /dev/null +++ b/wemix/governance-contract/test/contracts.go @@ -0,0 +1,304 @@ +package test + +import ( + "context" + "encoding/json" + "math/big" + "path/filepath" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" + compile "github.com/ethereum/go-ethereum/wemix/governance-contract" + "github.com/pkg/errors" + "github.com/stretchr/testify/require" +) + +type Governance struct { + backend *backends.SimulatedBackend + owner *bind.TransactOpts + nodeInfos []nodeInfo + + registry common.Address + Registry, + Gov, GovImp, + NCPExit, NCPExitImp, + Staking, StakingImp, + BallotStorage, BallotStorageImp, + EnvStorage, EnvStorageImp *bind.BoundContract +} + +type nodeInfo struct { + name []byte + enode []byte + ip []byte + port *big.Int +} + +func NewGovernance(t *testing.T) *Governance { + owner := getTxOpt(t, "owner") + backend := backends.NewSimulatedBackend(core.GenesisAlloc{ + owner.From: {Balance: new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 128), common.Big1)}, + }, params.MaxGasLimit) + + return &Governance{ + backend: backend, + owner: owner, + nodeInfos: []nodeInfo{{ + []byte("name"), + hexutil.MustDecode("0x6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0"), + []byte("127.0.0.1"), + big.NewInt(8542), + }}, + } +} + +func (g *Governance) DeployContracts(t *testing.T) *Governance { + // deploy registry + registry, Registry, err := g.Deploy(compiled.Registry.Deploy(g.backend, g.owner)) + require.NoError(t, err) + // deploy impls + govImp, _, err := g.Deploy(compiled.GovImp.Deploy(g.backend, g.owner)) + require.NoError(t, err) + ncpExitImp, _, err := g.Deploy(compiled.NCPExitImp.Deploy(g.backend, g.owner)) + require.NoError(t, err) + stakingImp, _, err := g.Deploy(compiled.StakingImp.Deploy(g.backend, g.owner)) + require.NoError(t, err) + ballotStorageImp, _, err := g.Deploy(compiled.BallotStorageImp.Deploy(g.backend, g.owner)) + require.NoError(t, err) + envStorageImp, _, err := g.Deploy(compiled.EnvStorageImp.Deploy(g.backend, g.owner)) + require.NoError(t, err) + + // deploy proxies + gov, Gov, err := g.Deploy(compiled.Gov.Deploy(g.backend, g.owner, govImp)) + require.NoError(t, err) + ncpExit, NCPExit, err := g.Deploy(compiled.NCPExit.Deploy(g.backend, g.owner, ncpExitImp)) + require.NoError(t, err) + staking, Staking, err := g.Deploy(compiled.Staking.Deploy(g.backend, g.owner, stakingImp)) + require.NoError(t, err) + ballotStorage, BallotStorage, err := g.Deploy(compiled.BallotStorage.Deploy(g.backend, g.owner, ballotStorageImp)) + require.NoError(t, err) + envStorage, EnvStorage, err := g.Deploy(compiled.EnvStorage.Deploy(g.backend, g.owner, envStorageImp)) + require.NoError(t, err) + + // set up g + g.registry = registry + g.Registry = Registry + g.Gov = Gov + g.NCPExit = NCPExit + g.Staking = Staking + g.BallotStorage = BallotStorage + g.EnvStorage = EnvStorage + + g.GovImp = compiled.GovImp.New(g.backend, gov) + g.NCPExitImp = compiled.NCPExitImp.New(g.backend, ncpExit) + g.StakingImp = compiled.StakingImp.New(g.backend, staking) + g.BallotStorageImp = compiled.BallotStorageImp.New(g.backend, ballotStorage) + g.EnvStorageImp = compiled.EnvStorageImp.New(g.backend, envStorage) + + // set Domains + require.NoError(t, g.ExpectedOk(g.Registry.Transact(g.owner, "setContractDomain", ToBytes32("GovernanceContract"), gov))) + require.NoError(t, g.ExpectedOk(g.Registry.Transact(g.owner, "setContractDomain", ToBytes32("Staking"), staking))) + require.NoError(t, g.ExpectedOk(g.Registry.Transact(g.owner, "setContractDomain", ToBytes32("EnvStorage"), envStorage))) + require.NoError(t, g.ExpectedOk(g.Registry.Transact(g.owner, "setContractDomain", ToBytes32("BallotStorage"), ballotStorage))) + + // initialize + require.NoError(t, g.ExpectedOk(g.NCPExitImp.Transact(g.owner, "initialize", registry))) + require.NoError(t, g.ExpectedOk(g.StakingImp.Transact(g.owner, "init", registry, []byte{}))) + require.NoError(t, g.ExpectedOk(g.BallotStorageImp.Transact(g.owner, "initialize", registry))) + envNames, envValues := makeEnvParams( + EnvConstants.BLOCKS_PER, + EnvConstants.BALLOT_DURATION_MIN, + EnvConstants.BALLOT_DURATION_MAX, + EnvConstants.STAKING_MIN, + EnvConstants.STAKING_MAX, + EnvConstants.MAX_IDLE_BLOCK_INTERVAL, + EnvConstants.BLOCK_CREATION_TIME, + EnvConstants.BLOCK_REWARD_AMOUNT, + EnvConstants.MAX_PRIORITY_FEE_PER_GAS, + EnvConstants.BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER, + EnvConstants.BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD, + EnvConstants.BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM, + EnvConstants.BLOCK_REWARD_DISTRIBUTION_MAINTENANCE, + EnvConstants.MAX_BASE_FEE, + EnvConstants.BLOCK_GASLIMIT, + EnvConstants.BASE_FEE_MAX_CHANGE_RATE, + EnvConstants.GAS_TARGET_PERCENTAGE, + ) + require.NoError(t, g.ExpectedOk(g.EnvStorageImp.Transact(g.owner, "initialize", registry, envNames, envValues))) + + // staking + { + g.owner.Value = LOCK_AMOUNT + require.NoError(t, g.ExpectedOk(g.StakingImp.Transact(g.owner, "deposit"))) + g.owner.Value = nil + } + node := g.nodeInfos[0] + require.NoError(t, g.ExpectedOk(g.GovImp.Transact(g.owner, "init", registry, LOCK_AMOUNT, node.name, node.enode, node.ip, node.port))) + + return g +} + +func (r *Governance) Deploy(address common.Address, tx *types.Transaction, contract *bind.BoundContract, err error) (common.Address, *bind.BoundContract, error) { + if err != nil { + return common.Address{}, nil, err + } + return address, contract, r.ExpectedOk(tx, err) +} + +func (r *Governance) ExpectedOk(tx *types.Transaction, err error) error { + r.backend.Commit() + if err != nil { + return err + } else if receipt, err := bind.WaitMined(context.TODO(), r.backend, tx); err != nil { + return err + } else if receipt.Status != types.ReceiptStatusSuccessful { + panic(vm.ErrExecutionReverted) + } else { + return nil + } +} + +func (r *Governance) ExpectedFail(tx *types.Transaction, err error) error { + r.backend.Commit() + if err != nil { + return err + } else if receipt, err := bind.WaitMined(context.TODO(), r.backend, tx); err != nil { + return err + } else if receipt.Status == types.ReceiptStatusSuccessful { + panic("execution not reverted") + } else { + return vm.ErrExecutionReverted + } +} + +type MemberInfo struct { + Staker common.Address `json:"staker"` + Voter common.Address `json:"voter"` + Reward common.Address `json:"reward"` + Name []byte `json:"name"` + Enode []byte `json:"enode"` + Ip []byte `json:"ip"` + Port *big.Int `json:"port"` + LockAmount *big.Int `json:"lockAmount"` + Memo []byte `json:"memo"` + Duration *big.Int `json:"duration"` +} + +type bindBackend interface { + bind.ContractBackend + bind.DeployBackend +} + +type bindContract struct { + Bin []byte + Abi abi.ABI +} + +func newBindContract(contract *compiler.Contract) (*bindContract, error) { + if contract == nil { + return nil, errors.New("nil contracts") + } + + if parsedAbi, err := parseABI(contract.Info.AbiDefinition); err != nil { + return nil, err + } else { + code := contract.Code + if !strings.HasPrefix(code, "0x") { + code = "0x" + code + } + return &bindContract{Bin: hexutil.MustDecode(code), Abi: *parsedAbi}, err + } +} + +func (bc *bindContract) New(backend bindBackend, address common.Address) *bind.BoundContract { + return bind.NewBoundContract(address, bc.Abi, backend, backend, backend) +} + +func (bc *bindContract) Deploy(backend bindBackend, opts *bind.TransactOpts, args ...interface{}) (common.Address, *types.Transaction, *bind.BoundContract, error) { + return bind.DeployContract(opts, bc.Abi, bc.Bin, backend, args...) +} + +var ( + compiled compiledContract +) + +func init() { + compiled.Compile("../contracts") +} + +type compiledContract struct { + Registry, + Gov, GovImp, + NCPExit, NCPExitImp, + Staking, StakingImp, + BallotStorage, BallotStorageImp, + EnvStorage, EnvStorageImp *bindContract +} + +func (c *compiledContract) Compile(root string) { + if contracts, err := compile.Compile("", + filepath.Join(root, "Registry.sol"), + filepath.Join(root, "Gov.sol"), + filepath.Join(root, "GovImp.sol"), + filepath.Join(root, "NCPExit.sol"), + filepath.Join(root, "NCPExitImp.sol"), + filepath.Join(root, "Staking.sol"), + filepath.Join(root, "StakingImp.sol"), + filepath.Join(root, "storage", "BallotStorage.sol"), + filepath.Join(root, "storage", "BallotStorageImp.sol"), + filepath.Join(root, "storage", "EnvStorage.sol"), + filepath.Join(root, "storage", "EnvStorageImp.sol"), + ); err != nil { + panic(err) + } else { + if c.Registry, err = newBindContract(contracts["Registry"]); err != nil { + panic(err) + } else if c.Gov, err = newBindContract(contracts["Gov"]); err != nil { + panic(err) + } else if c.GovImp, err = newBindContract(contracts["GovImp"]); err != nil { + panic(err) + } else if c.NCPExit, err = newBindContract(contracts["NCPExit"]); err != nil { + panic(err) + } else if c.NCPExitImp, err = newBindContract(contracts["NCPExitImp"]); err != nil { + panic(err) + } else if c.Staking, err = newBindContract(contracts["Staking"]); err != nil { + panic(err) + } else if c.StakingImp, err = newBindContract(contracts["StakingImp"]); err != nil { + panic(err) + } else if c.BallotStorage, err = newBindContract(contracts["BallotStorage"]); err != nil { + panic(err) + } else if c.BallotStorageImp, err = newBindContract(contracts["BallotStorageImp"]); err != nil { + panic(err) + } else if c.EnvStorage, err = newBindContract(contracts["EnvStorage"]); err != nil { + panic(err) + } else if c.EnvStorageImp, err = newBindContract(contracts["EnvStorageImp"]); err != nil { + panic(err) + } + } +} + +func parseABI(abiDefinition interface{}) (*abi.ABI, error) { + s, ok := abiDefinition.(string) + if !ok { + if bytes, err := json.Marshal(abiDefinition); err != nil { + return nil, err + } else { + s = string(bytes) + } + } + if abi, err := abi.JSON(strings.NewReader(s)); err != nil { + return nil, err + } else { + return &abi, nil + } +} diff --git a/wemix/governance-contract/test/gov_bind_test.go b/wemix/governance-contract/test/gov_bind_test.go new file mode 100644 index 000000000000..1315edafc18b --- /dev/null +++ b/wemix/governance-contract/test/gov_bind_test.go @@ -0,0 +1,114 @@ +package test + +import ( + "context" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + gov "github.com/ethereum/go-ethereum/wemix/bind" + "github.com/stretchr/testify/require" +) + +func TestDeploy(t *testing.T) { + client, opts := func() (*backends.SimulatedBackend, *bind.TransactOpts) { + g := NewGovernance(t) + return g.backend, g.owner + }() + go func() { + for { + time.Sleep(1e9) + client.Commit() + } + }() + contracts, err := gov.DeployGovContracts(opts, client, nil) + require.NoError(t, err) + lockAmount := gov.DefaultInitEnvStorage.STAKING_MIN + gov.ExecuteInitialize(contracts, opts, client, lockAmount, gov.DefaultInitEnvStorage, gov.InitMembers{ + { + Staker: opts.From, + Voter: opts.From, + Reward: opts.From, + Name: "name", + Enode: "0x6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0", + Ip: "127.0.0.1", + Port: 8542, + Deposit: lockAmount, + }, + }) + + checkMainnetEnvStorageValues(t, new(bind.CallOpts), contracts.EnvStorageImp) +} + +func TestCheckMainnetEnvStorageValues(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + client, err := ethclient.DialContext(ctx, "https://api.wemix.com/") + require.NoError(t, err) + + block, err := client.BlockByNumber(ctx, common.Big0) + require.NoError(t, err) + + callOpts := &bind.CallOpts{Context: ctx} + contracts, err := gov.GetGovContractsByOwner(callOpts, client, block.Coinbase()) + require.NoError(t, err) + + checkMainnetEnvStorageValues(t, callOpts, contracts.EnvStorageImp) +} + +func checkMainnetEnvStorageValues(t *testing.T, callOpts *bind.CallOpts, envStorage *gov.EnvStorageImp) { + BLOCKS_PER, _ := envStorage.GetBlocksPer(callOpts) + t.Log("BLOCKS_PER:", BLOCKS_PER) + + BALLOT_DURATION_MIN, _ := envStorage.GetBallotDurationMin(callOpts) + t.Log("BALLOT_DURATION_MIN:", BALLOT_DURATION_MIN) + + BALLOT_DURATION_MAX, _ := envStorage.GetBallotDurationMax(callOpts) + t.Log("BALLOT_DURATION_MAX:", BALLOT_DURATION_MAX) + + STAKING_MIN, _ := envStorage.GetStakingMin(callOpts) + t.Log("STAKING_MIN:", STAKING_MIN) + + STAKING_MAX, _ := envStorage.GetStakingMax(callOpts) + t.Log("STAKING_MAX:", STAKING_MAX) + + MAX_IDLE_BLOCK_INTERVAL, _ := envStorage.GetMaxIdleBlockInterval(callOpts) + t.Log("MAX_IDLE_BLOCK_INTERVAL:", MAX_IDLE_BLOCK_INTERVAL) + + BLOCK_CREATION_TIME, _ := envStorage.GetBlockCreationTime(callOpts) + t.Log("BLOCK_CREATION_TIME:", BLOCK_CREATION_TIME) + + BLOCK_REWARD_AMOUNT, _ := envStorage.GetBlockRewardAmount(callOpts) + t.Log("BLOCK_REWARD_AMOUNT:", BLOCK_REWARD_AMOUNT) + + MAX_PRIORITY_FEE_PER_GAS, _ := envStorage.GetMaxPriorityFeePerGas(callOpts) + t.Log("MAX_PRIORITY_FEE_PER_GAS:", MAX_PRIORITY_FEE_PER_GAS) + + BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("blockRewardDistributionBlockProducer"))) + t.Log("BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER:", BLOCK_REWARD_DISTRIBUTION_BLOCK_PRODUCER) + + BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("blockRewardDistributionStakingReward"))) + t.Log("BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD:", BLOCK_REWARD_DISTRIBUTION_STAKING_REWARD) + + BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("blockRewardDistributionEcosystem"))) + t.Log("BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM:", BLOCK_REWARD_DISTRIBUTION_ECOSYSTEM) + + BLOCK_REWARD_DISTRIBUTION_MAINTENANCE, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("blockRewardDistributionMaintenance"))) + t.Log("BLOCK_REWARD_DISTRIBUTION_MAINTENANCE:", BLOCK_REWARD_DISTRIBUTION_MAINTENANCE) + + MAX_BASE_FEE, _ := envStorage.GetMaxBaseFee(callOpts) + t.Log("MAX_BASE_FEE:", MAX_BASE_FEE) + + BLOCK_GASLIMIT, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("blockGasLimit"))) + t.Log("BLOCK_GASLIMIT:", BLOCK_GASLIMIT) + + BASE_FEE_MAX_CHANGE_RATE, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("baseFeeMaxChangeRate"))) + t.Log("BASE_FEE_MAX_CHANGE_RATE:", BASE_FEE_MAX_CHANGE_RATE) + + GAS_TARGET_PERCENTAGE, _ := envStorage.GetUint(callOpts, crypto.Keccak256Hash([]byte("gasTargetPercentage"))) + t.Log("GAS_TARGET_PERCENTAGE:", GAS_TARGET_PERCENTAGE) +} diff --git a/wemix/governance-contract/test/gov_test.go b/wemix/governance-contract/test/gov_test.go new file mode 100644 index 000000000000..f960ab2e7ba3 --- /dev/null +++ b/wemix/governance-contract/test/gov_test.go @@ -0,0 +1,3137 @@ +package test + +import ( + "context" + "math/big" + "os" + "testing" + "time" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/require" +) + +func TestGov(t *testing.T) { + // for mute chain log + log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(0), log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) + callOpts := new(bind.CallOpts) + + node1 := nodeInfo{ + name: []byte("name1"), + enode: hexutil.MustDecode("0x777777777711c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0"), + ip: []byte("127.0.0.2"), + port: big.NewInt(8542), + } + + node2 := nodeInfo{ + name: []byte("name2"), + enode: hexutil.MustDecode("0x888777777711c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a1"), + ip: []byte("127.0.0.3"), + port: big.NewInt(8542), + } + + t.Run("Staker is voter", func(t *testing.T) { + t.Run("has enode and locked staking", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + locked *big.Int + idx *big.Int + name, enode, ip []uint8 + port *big.Int + ) + + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&locked}, "lockedBalanceOf", gov.owner.From)) + require.Equal(t, LOCK_AMOUNT, locked) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&idx}, "getNodeIdxFromMember", gov.owner.From)) + require.True(t, idx.Sign() != 0) + result := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &result, "getNode", idx)) + name, enode, ip, port = result[0].([]byte), result[1].([]byte), result[2].([]byte), result[3].(*big.Int) + nodeinfo := gov.nodeInfos[0] + require.Equal(t, nodeinfo.name, name) + require.Equal(t, nodeinfo.enode, enode) + require.Equal(t, nodeinfo.ip, ip) + require.Equal(t, nodeinfo.port, port) + }) + t.Run("cannot init twice", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + node := gov.nodeInfos[0] + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "init", gov.registry, LOCK_AMOUNT, node.name, node.enode, node.ip, node.port)), + "Initializable: contract is already initialized", + ) + }) + t.Run("cannot addProposal to add member self", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("cannot addProposal to add member with different voter", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + member := gov.owner.From + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: member, + Voter: common.Address{1}, + Reward: member, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("cannot addProposal to add member with different reward", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + member := gov.owner.From + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: member, + Voter: member, + Reward: common.Address{1}, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("can addProposal to add member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1 := getTxOpt(t, "govMem1") + // staking first + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + // proposal + node1 := nodeInfo{ + name: []byte("name1"), + enode: hexutil.MustDecode("0x777777777711c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0"), + ip: []byte("127.0.0.2"), + port: big.NewInt(8542), + } + gov.nodeInfos = append(gov.nodeInfos, node1) + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + // check proposal + var ( + length *big.Int + creator common.Address + memo []byte + newStakerAddress common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + + ballot, ballotDetail := []interface{}{}, []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &ballot, "getBallotBasic", length)) + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &ballotDetail, "getBallotMember", length)) + creator, memo = ballot[3].(common.Address), ballot[4].([]byte) + newStakerAddress = ballotDetail[1].(common.Address) + require.Equal(t, gov.owner.From, creator) + require.Equal(t, []byte("memo1"), memo) + require.Equal(t, govMem1.From, newStakerAddress) + + // govMem1 is not member yet + info.Memo = []byte("memo2") + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + }) + t.Run("cannot addProposal to remove non-member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1 := getTxOpt(t, "govMem1").From + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", govMem1, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))), + "Non-member", + ) + }) + t.Run("cannot addProposal to remove a sole member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", gov.owner.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))), + "Cannot remove a sole member", + ) + }) + t.Run("can addProposal to change member's other addresses self without voting", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + oldMember, oldVoter, oldReward common.Address + length *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + + require.Equal(t, gov.owner.From, oldReward) + node := gov.nodeInfos[0] + voter1 := getTxOpt(t, "voter1") + user1 := getTxOpt(t, "user1") + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: voter1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + }) + t.Run("can addProposal to change member's other addresses self without voting twice about node name", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + oldMember, oldVoter, oldReward common.Address + length *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + + require.Equal(t, gov.owner.From, oldMember) + require.Equal(t, gov.owner.From, oldVoter) + require.Equal(t, gov.owner.From, oldReward) + node := gov.nodeInfos[0] + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: []byte("name1"), // change + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + newMember, newVoter, newReward common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + + info.Name = node.name + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + }) + t.Run("can addProposal to change member's other addresses self without voting twice about enode", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + oldMember, oldVoter, oldReward common.Address + length *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + + require.Equal(t, gov.owner.From, oldMember) + require.Equal(t, gov.owner.From, oldVoter) + require.Equal(t, gov.owner.From, oldReward) + node := gov.nodeInfos[0] + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: []byte("name1"), + Enode: node1.enode, // change + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + newMember, newVoter, newReward common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + + info.Enode = node.enode + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + }) + t.Run("can addProposal to change member's other addresses self without voting twice about ipport", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + oldMember, oldVoter, oldReward common.Address + length *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + + require.Equal(t, gov.owner.From, oldMember) + require.Equal(t, gov.owner.From, oldVoter) + require.Equal(t, gov.owner.From, oldReward) + node := gov.nodeInfos[0] + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: []byte("name1"), + Enode: node.enode, + Ip: node1.ip, // change + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + newMember, newVoter, newReward common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + + info.Ip = node.ip + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + }) + t.Run("can addProposal to change member's other addresses self without voting twice about import2", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + oldMember, oldVoter, oldReward common.Address + length *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + + require.Equal(t, gov.owner.From, oldMember) + require.Equal(t, gov.owner.From, oldVoter) + require.Equal(t, gov.owner.From, oldReward) + node := gov.nodeInfos[0] + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: []byte("name1"), + Enode: node.enode, + Ip: node.ip, + Port: node1.port, // change + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + newMember, newVoter, newReward common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + + info.Port = node.port + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, gov.owner.From, newVoter) + require.Equal(t, gov.owner.From, newReward) + }) + t.Run("cannot addProposal to change non-member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1, govMem2 := getTxOpt(t, "govMem1"), getTxOpt(t, "govMem2") + node := gov.nodeInfos[0] + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, govMem2.From, common.Big0, common.Big0)), + "Non-member", + ) + }) + t.Run("can addProposal to change governance", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + newGovImp, _, err := gov.Deploy(compiled.GovImp.Deploy(gov.backend, gov.owner)) + require.NoError(t, err) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", newGovImp, []byte("memo"), big.NewInt(86400))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + }) + t.Run("can not addProposal to change governance using EOA", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", getTxOpt(t, "govMem1").From, []byte("memo"), big.NewInt(86400))), + "", + ) + }) + t.Run("can not addProposal to change governance using non-UUPS", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", gov.registry, []byte("memo"), big.NewInt(86400))), + "ERC1967Upgrade: new implementation is not UUPS", + ) + }) + t.Run("cannot addProposal to change governance with same address", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var govImp common.Address + require.NoError(t, gov.Gov.Call(callOpts, &[]interface{}{&govImp}, "implementation")) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", govImp, []byte("memo"), big.NewInt(86400))), + "Same contract address", + ) + }) + t.Run("cannot addProposal to change governance with zero address", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", common.Address{}, []byte("memo"), big.NewInt(86400))), + "Implementation cannot be zero", + ) + }) + t.Run("can addProposal to change environment", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Bytes32, []byte("value"), []byte("memo"), big.NewInt(86400))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big1, length) + }) + t.Run("cannot addProposal to change environment with wrong type", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Invalid, []byte("value"), []byte("memo"), big.NewInt(86400))), + "Invalid type", + ) + }) + t.Run("can vote approval to add member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen, lock *big.Int + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, common.Big2, memberLen) + require.Equal(t, memberLen, nodeLen) + require.Equal(t, LOCK_AMOUNT, lock) + require.Equal(t, govMem1.From, newMember) + require.Equal(t, govMem1.From, newVoter) + require.Equal(t, govMem1.From, newReward) + }) + t.Run("cannot vote approval to add member with insufficient staking", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = new(big.Int).Div(LOCK_AMOUNT, common.Big2) + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + memberLen *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + }) + t.Run("can vote disapproval to deny adding member", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, false)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + memberLen *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, common.Big1, length) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + }) + t.Run("can vote approval to change member totally", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, common.Big1, length) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + var ( + preDeployerAvail, preGovmem1Avail *big.Int + ) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preDeployerAvail}, "availableBalanceOf", govMem1.From)) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preGovmem1Avail}, "availableBalanceOf", govMem2.From)) + + info = MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo2"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, govMem1.From, LOCK_AMOUNT, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big2, true)) + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", common.Big2, true)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, big.NewInt(3), length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen *big.Int + memberAddr common.Address + name, enode, ip []byte + port *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberAddr}, "getMember", common.Big2)) + getNode := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &getNode, "getNode", common.Big2)) + require.Equal(t, common.Big2, memberLen) + require.Equal(t, govMem2.From, memberAddr) + name, enode, ip, port = getNode[0].([]byte), getNode[1].([]byte), getNode[2].([]byte), getNode[3].(*big.Int) + require.Equal(t, node1.name, name) + require.Equal(t, node1.enode, enode) + require.Equal(t, node1.ip, ip) + require.Equal(t, node1.port, port) + + var ( + nodeIdxFromDeployer, nodeIdxFromGovMem1 *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdxFromDeployer}, "getNodeIdxFromMember", govMem1.From)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdxFromGovMem1}, "getNodeIdxFromMember", govMem2.From)) + require.True(t, nodeIdxFromDeployer.Sign() == 0) + require.Equal(t, common.Big2, nodeIdxFromGovMem1) + + var ( + postDeployerAvail, postGovmem1Avail *big.Int + ) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postDeployerAvail}, "availableBalanceOf", govMem1.From)) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postGovmem1Avail}, "availableBalanceOf", govMem2.From)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(postDeployerAvail, preDeployerAvail)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(preGovmem1Avail, postGovmem1Avail)) + }) + t.Run("can vote approval to change enode only without voting", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.True(t, length.Sign() == 0) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen *big.Int + memberAddr common.Address + name, enode, ip []byte + port *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberAddr}, "getMember", common.Big1)) + getNode := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &getNode, "getNode", common.Big1)) + require.Equal(t, common.Big1, memberLen) + require.Equal(t, gov.owner.From, memberAddr) + name, enode, ip, port = getNode[0].([]byte), getNode[1].([]byte), getNode[2].([]byte), getNode[3].(*big.Int) + require.Equal(t, node1.name, name) + require.Equal(t, node1.enode, enode) + require.Equal(t, node1.ip, ip) + require.Equal(t, node1.port, port) + }) + t.Run("cannot vote approval to change member with insufficient staking", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + }) + t.Run("can vote approval to change governance", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + var ( + getGasLimitAndBaseFee []interface{} + MBF *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &getGasLimitAndBaseFee, "getGasLimitAndBaseFee")) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&MBF}, "getMaxBaseFee")) + + newGovImp, _, err := gov.Deploy(compiled.GovImp.Deploy(gov.backend, gov.owner)) + require.NoError(t, err) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeGov", newGovImp, []byte("memo"), big.NewInt(86400))) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var imp common.Address + require.NoError(t, gov.Gov.Call(callOpts, &[]interface{}{&imp}, "implementation")) + require.Equal(t, newGovImp, imp) + + var ( + newGetGasLimitAndBaseFee []interface{} + NEW_MBF *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &newGetGasLimitAndBaseFee, "getGasLimitAndBaseFee")) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&NEW_MBF}, "getMaxBaseFee")) + require.Equal(t, getGasLimitAndBaseFee[0], newGetGasLimitAndBaseFee[0]) + require.Equal(t, getGasLimitAndBaseFee[1], newGetGasLimitAndBaseFee[1]) + require.Equal(t, getGasLimitAndBaseFee[2], newGetGasLimitAndBaseFee[2]) + require.Equal(t, MBF, NEW_MBF) + }) + t.Run("can vote approval to change environment", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + var ( + blocksPer *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&blocksPer}, "getBlocksPer")) + require.NotEqual(t, big.NewInt(100), blocksPer) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&blocksPer}, "getBlocksPer")) + require.Equal(t, big.NewInt(100), blocksPer) + }) + t.Run("cannot vote for a ballot already done", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)), + "Expired", + ) + }) + t.Run("cannot add proposal during period time", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "setProposalTimePeriod", big.NewInt(60))) + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )), "Cannot add proposal too early", + ) + }) + t.Run("cannot addProposal to add member which is already reward", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + gov.nodeInfos = append(gov.nodeInfos, node1) + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + var ( + ballotLength *big.Int + memberLength *big.Int + ) + gov.GovImp.Call(callOpts, &[]interface{}{&ballotLength}, "ballotLength") + require.Equal(t, common.Big1, ballotLength) + + gov.GovImp.Call(callOpts, &[]interface{}{&memberLength}, "getMemberLength") + node := gov.nodeInfos[0] + info = MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + gov.GovImp.Call(callOpts, &[]interface{}{&ballotLength}, "ballotLength") + require.Equal(t, common.Big2, ballotLength) + + var ( + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLength)) + require.Equal(t, gov.owner.From, newMember) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLength)) + require.Equal(t, gov.owner.From, newVoter) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLength)) + require.Equal(t, govMem1.From, newReward) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, common.Big1, memberLen) + require.Equal(t, memberLen, nodeLen) + + var ( + lock, bal *big.Int + ) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.True(t, lock.Sign() == 0) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&bal}, "balanceOf", govMem1.From)) + require.Equal(t, LOCK_AMOUNT, bal) + }) + t.Run("cannot addProposal to change member which is already reward", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var memberLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + info = MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var ( + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.Equal(t, gov.owner.From, newMember) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.Equal(t, gov.owner.From, newVoter) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, govMem1.From, newReward) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + + var ( + /* memberLen */ nodeLen, lock, bal *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, memberLen, nodeLen) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.True(t, lock.Sign() == 0) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&bal}, "balanceOf", govMem1.From)) + require.Equal(t, LOCK_AMOUNT, bal) + }) + }) + t.Run("Staker is not a voter", func(t *testing.T) { + deployGovernance := func(t *testing.T) (gov *Governance, voter *bind.TransactOpts) { + gov = NewGovernance(t).DeployContracts(t) + voter = getTxOpt(t, "voter") + user1 := getTxOpt(t, "user1") + balance, err := gov.backend.BalanceAt(context.TODO(), gov.owner.From, nil) + require.NoError(t, err) + + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Div(balance, common.Big2), &voter.From)) + + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: gov.owner.From, + Voter: voter.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + return + } + t.Run("cannot addProposal to add member self", func(t *testing.T) { + gov, voter := deployGovernance(t) + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("cannot addProposal to add member with different voter", func(t *testing.T) { + gov, voter := deployGovernance(t) + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: gov.owner.From, + Voter: voter.From, + Reward: gov.owner.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("cannot addProposal to add member with same voter", func(t *testing.T) { + gov, voter := deployGovernance(t) + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: voter.From, + Voter: voter.From, + Reward: voter.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("cannot addProposal to add member with same reward", func(t *testing.T) { + gov, voter := deployGovernance(t) + user1 := getTxOpt(t, "user1") + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: user1.From, + Voter: user1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToAddMember", info)), + "Already member", + ) + }) + t.Run("can addProposal to add member", func(t *testing.T) { + gov, voter := deployGovernance(t) + govMem1 := getTxOpt(t, "govMem1") + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + + var ( + length *big.Int + creator common.Address + memo []byte + newStakerAddress common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + ballot, ballotDetail := []interface{}{}, []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &ballot, "getBallotBasic", length)) + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &ballotDetail, "getBallotMember", length)) + creator, memo, newStakerAddress = ballot[3].(common.Address), ballot[4].([]byte), ballotDetail[1].(common.Address) + require.Equal(t, voter.From, creator) + require.Equal(t, []byte("memo"), memo) + require.Equal(t, govMem1.From, newStakerAddress) + + info = MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, big.NewInt(3), length) + }) + t.Run("cannot addProposal to remove non-member", func(t *testing.T) { + gov, voter := deployGovernance(t) + govMem1 := getTxOpt(t, "govMem1") + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))), + "Non-member", + ) + }) + t.Run("cannot addProposal to remove a sole member", func(t *testing.T) { + gov, voter := deployGovernance(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToRemoveMember", gov.owner.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))), + "Cannot remove a sole member", + ) + }) + t.Run("can addProposal to change member's other addresses self without voting", func(t *testing.T) { + gov, voter := deployGovernance(t) + + voter1 := getTxOpt(t, "voter1") + user1 := getTxOpt(t, "user1") + var ( + oldMember, oldVoter, oldReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&oldReward}, "getReward", common.Big1)) + require.Equal(t, user1.From, oldReward) + + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: gov.owner.From, + Voter: voter1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + newMember, newVoter, newReward common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", common.Big1)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, newMember) + require.Equal(t, voter1.From, newVoter) + require.Equal(t, user1.From, newReward) + }) + t.Run("cannot addProposal to change member's other addresses which is already member", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen, lock *big.Int + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, govMem1.From, newMember) + require.Equal(t, govMem1.From, newVoter) + require.Equal(t, govMem1.From, newReward) + + node := gov.nodeInfos[0] + info = MemberInfo{ + Staker: gov.owner.From, + Voter: govMem1.From, + Reward: getTxOpt(t, "user1").From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)), + "Already a member", + ) + }) + t.Run("cannot addProposal to add member which is already voter", func(t *testing.T) { + gov, voter := deployGovernance(t) + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + var memberLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + + node := gov.nodeInfos[0] + user1 := getTxOpt(t, "user1") + info = MemberInfo{ + Staker: gov.owner.From, + Voter: govMem1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var ( + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.Equal(t, gov.owner.From, newMember) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.Equal(t, govMem1.From, newVoter) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, user1.From, newReward) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big1)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + /*memberLen*/ nodeLen, lock, bal *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, memberLen, nodeLen) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.True(t, lock.Sign() == 0) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&bal}, "balanceOf", govMem1.From)) + require.Equal(t, LOCK_AMOUNT, bal) + }) + t.Run("cannot addProposal to change member which is already voter", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var memberLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + + user1 := getTxOpt(t, "user1") + info = MemberInfo{ + Staker: gov.owner.From, + Voter: govMem1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + + var ( + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.Equal(t, gov.owner.From, newMember) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.Equal(t, govMem1.From, newVoter) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, user1.From, newReward) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + + var ( + /*memberLen*/ nodeLen, lock, bal *big.Int + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, memberLen, nodeLen) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.True(t, lock.Sign() == 0) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&bal}, "balanceOf", govMem1.From)) + require.Equal(t, LOCK_AMOUNT, bal) + }) + t.Run("cannot addProposal to change non-member", func(t *testing.T) { + gov, voter := deployGovernance(t) + govMem1, govMem2 := getTxOpt(t, "govMem1"), getTxOpt(t, "govMem2") + + node := gov.nodeInfos[0] + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, govMem2.From, common.Big0, common.Big0)), + "Non-member", + ) + }) + t.Run("can addProposal to change governance", func(t *testing.T) { + gov, voter := deployGovernance(t) + newGovImp, _, err := gov.Deploy(compiled.GovImp.Deploy(gov.backend, gov.owner)) + require.NoError(t, err) + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeGov", newGovImp, []byte("memo"), big.NewInt(86400))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + }) + t.Run("can not addProposal to change governance using EOA", func(t *testing.T) { + gov, voter := deployGovernance(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeGov", getTxOpt(t, "govMem1").From, []byte("memo"), big.NewInt(86400))), + "", + ) + }) + t.Run("can not addProposal to change governance using non-UUPS", func(t *testing.T) { + gov, voter := deployGovernance(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeGov", gov.registry, []byte("memo"), big.NewInt(86400))), + "ERC1967Upgrade: new implementation is not UUPS", + ) + }) + t.Run("cannot addProposal to change governance with same address", func(t *testing.T) { + gov, voter := deployGovernance(t) + var govImp common.Address + require.NoError(t, gov.Gov.Call(callOpts, &[]interface{}{&govImp}, "implementation")) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeGov", govImp, []byte("memo"), big.NewInt(86400))), + "Same contract address", + ) + }) + t.Run("cannot addProposal to change governance with zero address", func(t *testing.T) { + gov, voter := deployGovernance(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeGov", common.Address{}, []byte("memo"), big.NewInt(86400))), + "Implementation cannot be zero", + ) + }) + t.Run("can addProposal to change environment", func(t *testing.T) { + gov, voter := deployGovernance(t) + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Bytes32, []byte("value"), []byte("memo"), big.NewInt(86400))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + }) + t.Run("cannot addProposal to change environment with wrong type", func(t *testing.T) { + gov, voter := deployGovernance(t) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Invalid, []byte("value"), []byte("memo"), big.NewInt(86400))), + "Invalid type", + ) + }) + t.Run("can vote approval to add member", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen, lock *big.Int + newMember, newVoter, newReward common.Address + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&lock}, "lockedBalanceOf", govMem1.From)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newMember}, "getMember", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newVoter}, "getVoter", memberLen)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&newReward}, "getReward", memberLen)) + require.Equal(t, common.Big2, memberLen) + require.Equal(t, memberLen, nodeLen) + require.Equal(t, LOCK_AMOUNT, lock) + require.Equal(t, govMem1.From, newMember) + require.Equal(t, govMem1.From, newVoter) + require.Equal(t, govMem1.From, newReward) + }) + t.Run("cannot vote approval to add member with insufficient staking", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = new(big.Int).Div(LOCK_AMOUNT, common.Big2) + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + + memberLen *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + }) + t.Run("can vote disapproval to deny adding member", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, false)) + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + }) + t.Run("can vote approval to change member totally", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, common.Big1, length) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + var ( + preDeployerAvail, preGovmem1Avail *big.Int + ) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preDeployerAvail}, "availableBalanceOf", govMem1.From)) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preGovmem1Avail}, "availableBalanceOf", govMem2.From)) + + info = MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo2"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, govMem1.From, LOCK_AMOUNT, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big3, true)) + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", common.Big3, true)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, big.NewInt(3), length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big3)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen *big.Int + memberAddr common.Address + name, enode, ip []byte + port *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberAddr}, "getMember", common.Big2)) + getNode := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &getNode, "getNode", common.Big2)) + require.Equal(t, common.Big2, memberLen) + require.Equal(t, govMem2.From, memberAddr) + name, enode, ip, port = getNode[0].([]byte), getNode[1].([]byte), getNode[2].([]byte), getNode[3].(*big.Int) + require.Equal(t, node1.name, name) + require.Equal(t, node1.enode, enode) + require.Equal(t, node1.ip, ip) + require.Equal(t, node1.port, port) + + var ( + nodeIdxFromDeployer, nodeIdxFromGovMem1 *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdxFromDeployer}, "getNodeIdxFromMember", govMem1.From)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdxFromGovMem1}, "getNodeIdxFromMember", govMem2.From)) + require.True(t, nodeIdxFromDeployer.Sign() == 0) + require.Equal(t, common.Big2, nodeIdxFromGovMem1) + + var ( + postDeployerAvail, postGovmem1Avail *big.Int + ) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postDeployerAvail}, "availableBalanceOf", govMem1.From)) + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postGovmem1Avail}, "availableBalanceOf", govMem2.From)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(postDeployerAvail, preDeployerAvail)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(preGovmem1Avail, postGovmem1Avail)) + }) + t.Run("can vote approval to change enode only without voting", func(t *testing.T) { + gov, voter := deployGovernance(t) + + info := MemberInfo{ + Staker: gov.owner.From, + Voter: gov.owner.From, + Reward: gov.owner.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen *big.Int + memberAddr common.Address + name, enode, ip []byte + port *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberAddr}, "getMember", common.Big1)) + getNode := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &getNode, "getNode", common.Big1)) + require.Equal(t, common.Big1, memberLen) + require.Equal(t, gov.owner.From, memberAddr) + name, enode, ip, port = getNode[0].([]byte), getNode[1].([]byte), getNode[2].([]byte), getNode[3].(*big.Int) + require.Equal(t, node1.name, name) + require.Equal(t, node1.enode, enode) + require.Equal(t, node1.ip, ip) + require.Equal(t, node1.port, port) + }) + t.Run("cannot vote approval to change member with insufficient staking", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + }) + t.Run("can vote approval to change governance", func(t *testing.T) { + gov, voter := deployGovernance(t) + + var ( + getGasLimitAndBaseFee []interface{} + MBF *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &getGasLimitAndBaseFee, "getGasLimitAndBaseFee")) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&MBF}, "getMaxBaseFee")) + + newGovImp, _, err := gov.Deploy(compiled.GovImp.Deploy(gov.backend, gov.owner)) + require.NoError(t, err) + + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeGov", newGovImp, []byte("memo"), big.NewInt(86400))) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var imp common.Address + require.NoError(t, gov.Gov.Call(callOpts, &[]interface{}{&imp}, "implementation")) + require.Equal(t, newGovImp, imp) + + var ( + newGetGasLimitAndBaseFee []interface{} + NEW_MBF *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &newGetGasLimitAndBaseFee, "getGasLimitAndBaseFee")) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&NEW_MBF}, "getMaxBaseFee")) + require.Equal(t, getGasLimitAndBaseFee[0], newGetGasLimitAndBaseFee[0]) + require.Equal(t, getGasLimitAndBaseFee[1], newGetGasLimitAndBaseFee[1]) + require.Equal(t, getGasLimitAndBaseFee[2], newGetGasLimitAndBaseFee[2]) + require.Equal(t, MBF, NEW_MBF) + }) + t.Run("can vote approval to change environment", func(t *testing.T) { + gov, voter := deployGovernance(t) + var ( + blocksPer *big.Int + ) + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&blocksPer}, "getBlocksPer")) + require.NotEqual(t, big.NewInt(100), blocksPer) + + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + + var ( + length *big.Int + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + require.NoError(t, gov.EnvStorageImp.Call(callOpts, &[]interface{}{&blocksPer}, "getBlocksPer")) + require.Equal(t, big.NewInt(100), blocksPer) + }) + t.Run("cannot vote for a ballot already done", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "vote", common.Big2, true)), + "Expired", + ) + }) + t.Run("cannot vote for a ballot already staker done", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big2, true)) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "vote", common.Big2, true)), + "Expired", + ) + }) + t.Run("cannot vote for a ballot already voter done", func(t *testing.T) { + gov, voter := deployGovernance(t) + + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = new(big.Int).Sub(LOCK_AMOUNT, big.NewInt(1000000000)) + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeMember", info, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", common.Big2, true)) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "vote", common.Big2, true)), + "Expired", + ) + }) + t.Run("cannot add proposal during period time", func(t *testing.T) { + gov, voter := deployGovernance(t) + + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + + gov.ExpectedOk(gov.GovImp.Transact(voter, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "setProposalTimePeriod", big.NewInt(60))) + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + big.NewInt(86400), + )), "Cannot add proposal too early", + ) + }) + }) + t.Run("Two Member", func(t *testing.T) { + deployGovernance := func(t *testing.T) (gov *Governance, govMem1 *bind.TransactOpts) { + gov = NewGovernance(t).DeployContracts(t) + govMem1 = getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem1, "deposit")) + govMem1.Value = nil + + info := MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + } + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", info)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var memberLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big2, memberLen) + + gov.nodeInfos = append(gov.nodeInfos, node1) + return + } + t.Run("cannot vote with changed voter address", func(t *testing.T) { + gov, _ := deployGovernance(t) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Bytes32, []byte("value"), []byte("memo"), big.NewInt(86400))) + var ( + ballotIdx *big.Int + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&ballotIdx}, "ballotLength")) + + node := gov.nodeInfos[0] + voter, voter1, user1 := getTxOpt(t, "voter"), getTxOpt(t, "voter1"), getTxOpt(t, "user1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &voter.From)) + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &voter1.From)) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", MemberInfo{ + Staker: gov.owner.From, + Voter: voter.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + }, gov.owner.From, common.Big0, common.Big0)) + gov.ExpectedOk(gov.GovImp.Transact(voter, "vote", ballotIdx, true)) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", MemberInfo{ + Staker: gov.owner.From, + Voter: voter1.From, + Reward: user1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + }, gov.owner.From, common.Big0, common.Big0)) + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(voter1, "vote", ballotIdx, true)), + "already voted", + ) + }) + t.Run("cannot addProposal to add member self", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + node := gov.nodeInfos[0] + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToAddMember", + MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + }, + )), "Already member", + ) + }) + t.Run("can addProposal to remove member", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + }) + t.Run("can addProposal to add member where info is the removed member's with same govMem", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + }) + t.Run("can addProposal to add member where info is the removed member's", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + t.Log("member removed") + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + node1 := gov.nodeInfos[1] + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + }) + t.Run("can vote to add member", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node2.name, + Enode: node2.enode, + Ip: node2.ip, + Port: node2.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + }) + t.Run("can vote to deny adding member", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node2.name, + Enode: node2.enode, + Ip: node2.ip, + Port: node2.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, false)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, false)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + }) + t.Run("can vote to remove first member", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + var preAvail, postAvail *big.Int + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preAvail}, "availableBalanceOf", gov.owner.From)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", gov.owner.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen, nodeIdx, nodeIdx2 *big.Int + isMem bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&isMem}, "isMember", gov.owner.From)) + require.False(t, isMem) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, common.Big1, nodeLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdx}, "getNodeIdxFromMember", gov.owner.From)) + require.True(t, nodeIdx.Sign() == 0) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdx2}, "getNodeIdxFromMember", govMem1.From)) + require.Equal(t, common.Big1, nodeIdx2) + + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postAvail}, "availableBalanceOf", gov.owner.From)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(postAvail, preAvail)) + }) + t.Run("can vote to remove last member", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + var preAvail, postAvail *big.Int + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&preAvail}, "availableBalanceOf", gov.owner.From)) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, true)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Accepted, state) + require.True(t, isFinalized) + + var ( + memberLen, nodeLen, nodeIdx, nodeIdx2 *big.Int + isMem bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big1, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&isMem}, "isMember", govMem1.From)) + require.False(t, isMem) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeLen}, "getNodeLength")) + require.Equal(t, common.Big1, nodeLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdx}, "getNodeIdxFromMember", govMem1.From)) + require.True(t, nodeIdx.Sign() == 0) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&nodeIdx2}, "getNodeIdxFromMember", gov.owner.From)) + require.Equal(t, common.Big1, nodeIdx2) + + require.NoError(t, gov.StakingImp.Call(callOpts, &[]interface{}{&postAvail}, "availableBalanceOf", govMem1.From)) + require.Equal(t, LOCK_AMOUNT, new(big.Int).Sub(postAvail, preAvail)) + }) + t.Run("cannot vote simultaneously", func(t *testing.T) { + gov, _ := deployGovernance(t) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node2.name, + Enode: node2.enode, + Ip: node2.ip, + Port: node2.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + govMem3 := getTxOpt(t, "govMem3") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem3.From)) + govMem3.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem3, "deposit")) + govMem3.Value = nil + + node3 := nodeInfo{ + name: []byte("name3"), + enode: hexutil.MustDecode("0x999777777711c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a1"), + ip: []byte("127.0.0.4"), + port: big.NewInt(8542), + } + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem3.From, + Voter: govMem3.From, + Reward: govMem3.From, + Name: node3.name, + Enode: node3.enode, + Ip: node3.ip, + Port: node3.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", new(big.Int).Sub(length, common.Big1), true)) + var inVoting *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "vote", length, true)), + "Now in voting with different ballot", + ) + }) + t.Run("vote is ended when the sum of voting power is max", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + govMem2 := getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Mul(LOCK_AMOUNT, common.Big2), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(govMem2, "deposit")) + govMem2.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node2.name, + Enode: node2.enode, + Ip: node2.ip, + Port: node2.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "ballotLength")) + require.Equal(t, common.Big2, length) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", length, true)) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.ExpectedOk(gov.GovImp.Transact(govMem1, "vote", length, false)) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0, inVoting) + getBallotState = []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.Rejected, state) + require.True(t, isFinalized) + }) + t.Run("cannot vote approval when the voting is ended", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + delay_time := big.NewInt(86400) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + delay_time, + )) + var ballotLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&ballotLen}, "ballotLength")) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", ballotLen, true)) + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big2, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.backend.AdjustTime(time.Second * time.Duration(new(big.Int).Mul(delay_time, big.NewInt(2000)).Int64())) + gov.backend.Commit() + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "vote", ballotLen, false)), + "Expired", + ) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "finalizeEndedVote")) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + }) + t.Run("Non member cannot end voting", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + + delay_time := big.NewInt(86400) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToChangeEnv", + crypto.Keccak256Hash([]byte("blocksPer")), + EnvTypes.Uint, + hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000064"), // 32bytes, 100 + []byte("memo"), + delay_time, + )) + var ballotLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&ballotLen}, "ballotLength")) + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", ballotLen, true)) + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big2, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, length, inVoting) + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", length)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.Equal(t, BallotStates.InProgress, state) + require.False(t, isFinalized) + + gov.backend.AdjustTime(time.Second * time.Duration(new(big.Int).Mul(delay_time, big.NewInt(2000)).Int64())) + gov.backend.Commit() + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "vote", ballotLen, false)), + "Expired", + ) + govMem3 := getTxOpt(t, "getMem3") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &govMem3.From)) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem3, "finalizeEndedVote")), + "No Permission", + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.Equal(t, ballotLen, inVoting) + }) + t.Run("reject proposal without voting about changing voter address if voter is already registered", func(t *testing.T) { + gov, govMem1 := deployGovernance(t) + node := gov.nodeInfos[0] + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(gov.owner, "addProposalToChangeMember", MemberInfo{ + Staker: gov.owner.From, + Voter: govMem1.From, + Reward: gov.owner.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo1"), + Duration: big.NewInt(86400), + }, gov.owner.From, common.Big0, common.Big0)), + "Already a member", + ) + var length *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&length}, "voteLength")) + require.Equal(t, common.Big1, length) + + var ( + inVoting *big.Int + state *big.Int + isFinalized bool + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&inVoting}, "getBallotInVoting")) + require.True(t, inVoting.Sign() == 0) + + getBallotState := []interface{}{} + require.NoError(t, gov.BallotStorageImp.Call(callOpts, &getBallotState, "getBallotState", common.Big2)) + state, isFinalized = getBallotState[1].(*big.Int), getBallotState[2].(bool) + require.True(t, state.Sign() == 0) + require.False(t, isFinalized) + + var ( + memberLen *big.Int + memberAddr, voterAddr, rewardAddr common.Address + ) + + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big2, memberLen) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberAddr}, "getMember", common.Big1)) + require.Equal(t, gov.owner.From, memberAddr) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&voterAddr}, "getVoter", common.Big1)) + require.Equal(t, gov.owner.From, voterAddr) + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&rewardAddr}, "getReward", common.Big1)) + require.Equal(t, gov.owner.From, rewardAddr) + + var ( + name, enode, ip []byte + port *big.Int + ) + getNode := []interface{}{} + require.NoError(t, gov.GovImp.Call(callOpts, &getNode, "getNode", common.Big1)) + name, enode, ip, port = getNode[0].([]byte), getNode[1].([]byte), getNode[2].([]byte), getNode[3].(*big.Int) + require.Equal(t, node.name, name) + require.Equal(t, node.enode, enode) + require.Equal(t, node.ip, ip) + require.Equal(t, node.port, port) + }) + }) + t.Run("Others", func(t *testing.T) { + t.Run("cannot init", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1 := getTxOpt(t, "govMem1") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "vote", common.Big1, true)) + + var memberLen *big.Int + require.NoError(t, gov.GovImp.Call(callOpts, &[]interface{}{&memberLen}, "getMemberLength")) + require.Equal(t, common.Big2, memberLen) + + node := gov.nodeInfos[0] + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "init", gov.registry, LOCK_AMOUNT, node.name, node.enode, node.ip, node.port)), + "Initializable: contract is already initialized", + ) + }) + t.Run("cannot addProposal", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1, govMem2 := getTxOpt(t, "govMem1"), getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &govMem1.From)) + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &govMem2.From)) + + node := gov.nodeInfos[0] + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToAddMember", MemberInfo{ + Staker: govMem1.From, + Voter: govMem1.From, + Reward: govMem1.From, + Name: node.name, + Enode: node.enode, + Ip: node.ip, + Port: node.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })), + "No Permission", + ) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToRemoveMember", govMem1.From, LOCK_AMOUNT, []byte("memo1"), big.NewInt(86400), LOCK_AMOUNT, new(big.Int))), + "No Permission", + ) + + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem1.From)) + govMem1.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem1"), "deposit")) + govMem1.Value = nil + + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToChangeMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node1.name, + Enode: node1.enode, + Ip: node1.ip, + Port: node1.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + }, govMem1.From, common.Big0, common.Big0)), + "No Permission", + ) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToChangeGov", govMem1.From, []byte("memo"), big.NewInt(86400))), + "No Permission", + ) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "addProposalToChangeEnv", ToBytes32("key"), EnvTypes.Bytes32, []byte("value"), []byte("memo"), big.NewInt(86400))), + "No Permission", + ) + }) + t.Run("cannot vote", func(t *testing.T) { + gov := NewGovernance(t).DeployContracts(t) + govMem1, govMem2 := getTxOpt(t, "govMem1"), getTxOpt(t, "govMem2") + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, towei(1), &govMem1.From)) + gov.ExpectedOk(TransferCoin(gov.backend, gov.owner, new(big.Int).Add(LOCK_AMOUNT, towei(1)), &govMem2.From)) + govMem2.Value = LOCK_AMOUNT + gov.ExpectedOk(gov.StakingImp.Transact(getTxOpt(t, "govMem2"), "deposit")) + govMem2.Value = nil + + gov.ExpectedOk(gov.GovImp.Transact(gov.owner, "addProposalToAddMember", MemberInfo{ + Staker: govMem2.From, + Voter: govMem2.From, + Reward: govMem2.From, + Name: node2.name, + Enode: node2.enode, + Ip: node2.ip, + Port: node2.port, + LockAmount: LOCK_AMOUNT, + Memo: []byte("memo"), + Duration: big.NewInt(86400), + })) + ExpectedRevert(t, + gov.ExpectedFail(gov.GovImp.Transact(govMem1, "vote", common.Big1, true)), + "No Permission", + ) + }) + }) +} diff --git a/wemix/governance-contract/test/utils.go b/wemix/governance-contract/test/utils.go new file mode 100644 index 000000000000..db02f6532450 --- /dev/null +++ b/wemix/governance-contract/test/utils.go @@ -0,0 +1,236 @@ +package test + +import ( + "context" + "fmt" + "math/big" + "strings" + "sync" + "testing" + + "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/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +type allErrorsType map[[4]byte]abi.Error + +var ( + allErrorsLock = sync.RWMutex{} + allErrors = allErrorsType{} // eventID => abi.Event +) + +func collectErrors(errors map[string]abi.Error) error { + for _, e := range errors { + func() { + allErrorsLock.Lock() + defer allErrorsLock.Unlock() + sig := [4]byte{} + copy(sig[:], e.ID[:4]) + if _, ok := allErrors[sig]; !ok { + allErrors[sig] = e + } + }() + } + return nil +} + +type RevertError struct { + ABI abi.Error + Output interface{} +} + +func (r *RevertError) Error() string { + return fmt.Sprintf("%s: %s %v", vm.ErrExecutionReverted, r.ABI.Sig, r.Output) +} + +func UnpackError(err error) error { + if err == nil { + return nil + } + + var result []byte + if revert, ok := err.(interface { + ErrorData() interface{} + }); !ok { + return err + } else if data, ok := revert.ErrorData().(string); !ok { + return err + } else if bytes, decodeErr := hexutil.Decode(data); decodeErr != nil { + return err + } else { + result = bytes + } + + sig := [4]byte{} + copy(sig[:], result[:4]) + if errABI, ok := allErrors[sig]; !ok { + return err + } else if output, unpackErr := errABI.Unpack(result); unpackErr != nil { + return err + } else { + return &RevertError{errABI, output} + } +} + +func ExpectedRevert(t *testing.T, err error, args ...interface{}) { + require.Error(t, err) + length := len(args) + if revert, ok := err.(*RevertError); ok { + if length > 0 { + name, ok := args[0].(string) + require.True(t, ok) + require.Equal(t, revert.ABI.Name, name) + } + if length > 1 { + output, ok := revert.Output.([]interface{}) + require.True(t, ok) + for i := 1; i < length; i++ { + arg := args[i] + if arg != nil { + require.Equal(t, args[i], output[i-1]) + } + } + } + } else { + if length > 0 { + errStr := strings.TrimLeft(err.Error(), vm.ErrExecutionReverted.Error()+":") + message, ok := args[0].(string) + require.True(t, ok) + require.Equal(t, strings.TrimSpace(message), strings.TrimSpace(errStr)) + } + } +} + +func ToBytes32(str string) [32]byte { + bytes := []byte(str) + if len(bytes) > 32 { + bytes = bytes[:32] + } + var copied = [32]byte{} + copy(copied[:], bytes) + return copied +} + +var eoas = make(map[string]*bind.TransactOpts) + +func getTxOpt(t *testing.T, alias string) *bind.TransactOpts { + if eoa, ok := eoas[alias]; ok { + return eoa + } else { + pk, err := crypto.GenerateKey() + require.NoError(t, err) + opts, err := bind.NewKeyedTransactorWithChainID(pk, params.AllEthashProtocolChanges.ChainID) + require.NoError(t, err) + eoas[alias] = opts + return opts + } +} + +type IBackend interface { + bind.ContractBackend + bind.DeployBackend + SuggestGasTipCap(context.Context) (*big.Int, error) +} + +func CreateDynamicTx(backend IBackend, opts *bind.TransactOpts, to *common.Address, input []byte) (*types.Transaction, error) { + // Normalize value + value := opts.Value + if value == nil { + value = new(big.Int) + } + // Estimate TipCap + gasTipCap := opts.GasTipCap + if gasTipCap == nil { + tip, err := backend.SuggestGasTipCap(ensureContext(opts.Context)) + if err != nil { + return nil, err + } + gasTipCap = tip + } + // Estimate FeeCap + gasFeeCap := opts.GasFeeCap + if gasFeeCap == nil { + gasFeeCap = new(big.Int).Add(gasTipCap, big.NewInt(1e9)) // 101gwei is recommended for maxFeeCap + } + if gasFeeCap.Cmp(gasTipCap) < 0 { + return nil, fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", gasFeeCap, gasTipCap) + } + // Estimate GasLimit + gasLimit := opts.GasLimit + if opts.GasLimit == 0 { + var err error + gasLimit, err = estimateGasLimit(backend, opts, to, input, nil, gasTipCap, gasFeeCap, value) + if err != nil { + return nil, err + } + } + // create the transaction + nonce, err := getNonce(backend, opts) + if err != nil { + return nil, err + } + + baseTx := &types.DynamicFeeTx{ + To: to, + Nonce: nonce, + GasFeeCap: gasFeeCap, + GasTipCap: gasTipCap, + Gas: gasLimit, + Value: value, + Data: input, + } + + return opts.Signer(opts.From, types.NewTx(baseTx)) +} + +func TransferCoin(backend IBackend, opts *bind.TransactOpts, value *big.Int, to *common.Address) (*types.Transaction, error) { + opts.Value = value + defer func() { opts.Value = nil }() + if tx, err := CreateDynamicTx(backend, opts, to, []byte{}); err != nil { + return nil, err + } else { + return tx, backend.SendTransaction(ensureContext(opts.Context), tx) + } +} + +// ensureContext is a helper method to ensure a context is not nil, even if the +// user specified it as such. +func ensureContext(ctx context.Context) context.Context { + if ctx == nil { + return context.Background() + } + return ctx +} + +func estimateGasLimit(backend interface { + EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) +}, opts *bind.TransactOpts, to *common.Address, input []byte, gasPrice, gasTipCap, gasFeeCap, value *big.Int) (uint64, error) { + msg := ethereum.CallMsg{ + From: opts.From, + To: to, + GasPrice: gasPrice, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Value: value, + Data: input, + } + return backend.EstimateGas(ensureContext(opts.Context), msg) +} + +func getNonce(backend interface { + PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) +}, opts *bind.TransactOpts) (uint64, error) { + if opts.Nonce == nil { + return backend.PendingNonceAt(ensureContext(opts.Context), opts.From) + } else { + return opts.Nonce.Uint64(), nil + } +} diff --git a/wemix/metclient/util.go b/wemix/metclient/util.go index 52227ab78b77..bf3154fa3412 100644 --- a/wemix/metclient/util.go +++ b/wemix/metclient/util.go @@ -95,7 +95,7 @@ func LoadJsonContract(r io.Reader) (*ContractData, error) { } if data.ContractName == "" || len(data.Abi) == 0 { - return nil, fmt.Errorf("Invalid contract json file") + return nil, fmt.Errorf("invalid contract json file") } name = data.ContractName @@ -204,20 +204,6 @@ func LoadContract(fn string, name string) (*ContractData, error) { } } -// packNum packs the given number (using the reflect value) and will cast it to appropriate number representation -func PackNum(value reflect.Value) []byte { - switch kind := value.Kind(); kind { - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return math.U256Bytes(new(big.Int).SetUint64(value.Uint())) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return math.U256Bytes(big.NewInt(value.Int())) - case reflect.Ptr: - return math.U256Bytes(new(big.Int).Set(value.Interface().(*big.Int))) - default: - panic("abi: fatal error") - } -} - func getReceipt(ctx context.Context, cli *ethclient.Client, hash common.Hash, isContract bool, msinterval, count int) (receipt *types.Receipt, err error) { d := time.Millisecond * time.Duration(msinterval) nilAddr := common.Address{} @@ -231,7 +217,7 @@ func getReceipt(ctx context.Context, cli *ethclient.Client, hash common.Hash, is } time.Sleep(d) } - err = fmt.Errorf("Timed out") + err = fmt.Errorf("timed out") return } @@ -336,13 +322,13 @@ func CallContract(ctx context.Context, contract *RemoteContract, if !IsArray(output) { if output == nil { - return fmt.Errorf("Output is nil") + return fmt.Errorf("output is nil") } else { err = contract.Abi.UnpackIntoInterface(output, method, out) } } else { if len(output.([]interface{})) == 0 { - return fmt.Errorf("Output is empty array") + return fmt.Errorf("output is empty array") } else { err = contract.Abi.UnpackIntoInterface(output.([]interface{}), method, out) } @@ -431,9 +417,22 @@ func ToBytes32(b string) [32]byte { if len(b) > len(b32) { b = b[len(b)-len(b32):] } - //copy(b32[32-len(b):], []byte(b)) copy(b32[:], []byte(b)) return b32 } +// packNum packs the given number (using the reflect value) and will cast it to appropriate number representation +func PackNum(value reflect.Value) []byte { + switch value.Kind() { + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return math.U256Bytes(new(big.Int).SetUint64(value.Uint())) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return math.U256Bytes(big.NewInt(value.Int())) + case reflect.Ptr: + return math.U256Bytes(new(big.Int).Set(value.Interface().(*big.Int))) + default: + panic("abi: fatal error") + } +} + // EOF diff --git a/wemix/miner_limit.go b/wemix/miner_limit.go index d1283152ea3b..25e91b1222a6 100644 --- a/wemix/miner_limit.go +++ b/wemix/miner_limit.go @@ -11,26 +11,26 @@ import ( "time" "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/log" wemixapi "github.com/ethereum/go-ethereum/wemix/api" - "github.com/ethereum/go-ethereum/wemix/metclient" + gov "github.com/ethereum/go-ethereum/wemix/bind" wemixminer "github.com/ethereum/go-ethereum/wemix/miner" ) // collect mining peers states func (ma *wemixAdmin) collectMinerStates(height *big.Int) []*wemixapi.WemixMinerStatus { - var ( - ctx context.Context - gov *metclient.RemoteContract - err error - ) - ctx = context.Background() - if _, gov, _, _, err = ma.getRegGovEnvContracts(ctx, height); err != nil { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + contracts, err := ma.getRegGovEnvContracts(ctx, height) + if err != nil { return nil } - e, err := getCoinbaseEnodeCache(ctx, height, gov) + + e, err := getCoinbaseEnodeCache(ctx, height, contracts.GovImp) if err != nil { return nil } @@ -47,40 +47,46 @@ func (ma *wemixAdmin) collectMinerStates(height *big.Int) []*wemixapi.WemixMiner } // get governance nodes at modifiedBlock at height -func getCoinbaseEnodeCache(ctx context.Context, height *big.Int, gov *metclient.RemoteContract) (*coinbaseEnodeEntry, error) { - var modifiedBlock *big.Int - if err := metclient.CallContract(ctx, gov, "modifiedBlock", nil, &modifiedBlock, height); err != nil { +func getCoinbaseEnodeCache(ctx context.Context, height *big.Int, gov *gov.GovImp) (*coinbaseEnodeEntry, error) { + opts := &bind.CallOpts{Context: ctx, BlockNumber: height} + modifiedBlock, err := gov.ModifiedBlock(opts) + if err != nil { return nil, err - } else if modifiedBlock.Int64() == 0 { + } + if modifiedBlock.Sign() == 0 { return nil, wemixminer.ErrNotInitialized } + // if found in cache, use it if e, ok := coinbaseEnodeCache.Load(modifiedBlock.Int64()); ok { return e.(*coinbaseEnodeEntry), nil } // otherwise, load it from the governance var ( - count, port *big.Int - addr common.Address - name, enode, ip []byte - output = []interface{}{&name, &enode, &ip, &port} - e = &coinbaseEnodeEntry{ + count *big.Int + addr common.Address + name, enode []byte + e = &coinbaseEnodeEntry{ modifiedBlock: modifiedBlock, coinbase2enode: map[string][]byte{}, enode2index: map[string]int{}, } ) - if err := metclient.CallContract(ctx, gov, "getNodeLength", nil, &count, height); err != nil { + if count, err = gov.GetNodeLength(opts); err != nil { return nil, err } for i := int64(1); i <= count.Int64(); i++ { ix := big.NewInt(i) - if err := metclient.CallContract(ctx, gov, "getReward", &ix, &addr, height); err != nil { + if addr, err = gov.GetReward(opts, ix); err != nil { return nil, err } - if err := metclient.CallContract(ctx, gov, "getNode", &ix, &output, height); err != nil { + + if output, err := gov.GetNode(opts, ix); err != nil { return nil, err + } else { + name, enode = output.Name, output.Enode } + idv4, _ := toIdv4(hex.EncodeToString(enode)) e.nodes = append(e.nodes, &wemixNode{ Name: string(name), @@ -96,7 +102,7 @@ func getCoinbaseEnodeCache(ctx context.Context, height *big.Int, gov *metclient. } // returns coinbase's enode if exists in governance at given height - 1 -func coinbaseExists(ctx context.Context, height *big.Int, gov *metclient.RemoteContract, coinbase *common.Address) ([]byte, error) { +func coinbaseExists(ctx context.Context, height *big.Int, gov *gov.GovImp, coinbase *common.Address) ([]byte, error) { e, err := getCoinbaseEnodeCache(ctx, new(big.Int).Sub(height, common.Big1), gov) if err != nil { return nil, err @@ -109,7 +115,7 @@ func coinbaseExists(ctx context.Context, height *big.Int, gov *metclient.RemoteC } // returns true if enode exists in governance at given height-1 -func enodeExists(ctx context.Context, height *big.Int, gov *metclient.RemoteContract, enode []byte) (common.Address, error) { +func enodeExists(ctx context.Context, height *big.Int, gov *gov.GovImp, enode []byte) (common.Address, error) { e, err := getCoinbaseEnodeCache(ctx, new(big.Int).Sub(height, common.Big1), gov) if err != nil { return common.Address{}, err @@ -124,9 +130,9 @@ func enodeExists(ctx context.Context, height *big.Int, gov *metclient.RemoteCont // returns wemix nodes at given height func getNodesAt(height *big.Int) ([]*wemixNode, error) { ctx := context.Background() - if _, gov, _, _, err := admin.getRegGovEnvContracts(ctx, height); err != nil { + if contracts, err := admin.getRegGovEnvContracts(ctx, height); err != nil { return nil, wemixminer.ErrNotInitialized - } else if e, err := getCoinbaseEnodeCache(ctx, height, gov); err != nil { + } else if e, err := getCoinbaseEnodeCache(ctx, height, contracts.GovImp); err != nil { return nil, err } else { return e.nodes, nil @@ -163,7 +169,7 @@ func getBlockMiner(ctx context.Context, cli *ethclient.Client, entry *coinbaseEn // It's reset when governance gets updated, i.e. search doesn't go back // beyond modifiedBlock + 1. // Not enforced if member count <= 2. -func (ma *wemixAdmin) verifyMinerLimit(ctx context.Context, height *big.Int, gov *metclient.RemoteContract, coinbase *common.Address, enode []byte) (bool, error) { +func (ma *wemixAdmin) verifyMinerLimit(ctx context.Context, height *big.Int, gov *gov.GovImp, coinbase *common.Address, enode []byte) (bool, error) { // parent block number prev := new(big.Int).Sub(height, common.Big1) e, err := getCoinbaseEnodeCache(ctx, prev, gov) @@ -203,34 +209,37 @@ func (ma *wemixAdmin) verifyMinerLimit(ctx context.Context, height *big.Int, gov // check if self is eligible to mine height block at height-1 func (ma *wemixAdmin) isEligibleMiner(height *big.Int) (bool, error) { - var ( - ctx context.Context - enode []byte - gov *metclient.RemoteContract - err error - ) - ctx = context.Background() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + prev := new(big.Int).Sub(height, common.Big1) - enode, err = hex.DecodeString(ma.self.Enode) + enode, err := hex.DecodeString(ma.self.Enode) if err != nil { return false, wemixminer.ErrNotInitialized } - if _, gov, _, _, err = ma.getRegGovEnvContracts(ctx, prev); err != nil { + var gov *gov.GovImp + if contracts, err := ma.getRegGovEnvContracts(ctx, prev); err != nil { return false, wemixminer.ErrNotInitialized + } else { + gov = contracts.GovImp } + e, err := getCoinbaseEnodeCache(ctx, prev, gov) if err != nil { return false, err } + // if count <= 2, not enforced if len(e.nodes) <= 2 { return true, nil } + // the enode should not appear within the last (member count / 2) blocks limit := len(e.nodes) / 2 if limit > int(height.Int64()-e.modifiedBlock.Int64()-1) { limit = int(height.Int64() - e.modifiedBlock.Int64() - 1) } + for h := new(big.Int).Set(prev); limit > 0; h, limit = h.Sub(h, common.Big1), limit-1 { blockMinerEnode, err := getBlockMiner(ctx, ma.cli, e, h) if err != nil { @@ -247,19 +256,21 @@ func (ma *wemixAdmin) isEligibleMiner(height *big.Int) (bool, error) { // beyond modifiedBlock + 1. // Not enforced if member count <= 2. func (ma *wemixAdmin) nextMinerCandidates(height *big.Int) ([]*wemixNode, error) { - var ( - ctx context.Context - gov *metclient.RemoteContract - err error - ) - ctx = context.Background() - if _, gov, _, _, err = ma.getRegGovEnvContracts(ctx, height); err != nil { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + var gov *gov.GovImp + if contracts, err := ma.getRegGovEnvContracts(ctx, height); err != nil { return nil, wemixminer.ErrNotInitialized + } else { + gov = contracts.GovImp } + e, err := getCoinbaseEnodeCache(ctx, height, gov) if err != nil { return nil, err } + m := map[string]float64{} dix := (int(height.Int64()) + 1) % len(e.nodes) // default miner = height % member count for i, n := range e.nodes { diff --git a/wemix/rewards_test.go b/wemix/rewards_test.go index dcafac7732e8..50049d3af19f 100644 --- a/wemix/rewards_test.go +++ b/wemix/rewards_test.go @@ -3,7 +3,6 @@ package wemix import ( - "bytes" "crypto/ecdsa" "encoding/json" "math/big" @@ -203,10 +202,7 @@ func verifyBlockSigForTest(height *big.Int, coinbase common.Address, nodeId []by return false } signer := crypto.PubkeyToAddress(*pubKey) - if err != nil || !bytes.Equal(coinbase.Bytes(), signer.Bytes()) { - return false - } - return true + return coinbase == signer } func TestRewardValidation(t *testing.T) { diff --git a/wemix/scripts/deploy-governance.js b/wemix/scripts/deploy-governance.js deleted file mode 100644 index 70ef961acc2f..000000000000 --- a/wemix/scripts/deploy-governance.js +++ /dev/null @@ -1,400 +0,0 @@ -// deploy-governance.js - -// uses offline wallet -var GovernanceDeployer = new function() { - this.wallet = null - this.from = null - this.gas = 21000 * 1400 - this.gasPrice = eth.gasPrice - this._nonce = 0 - this.receiptCheckParams = { "interval": 100, "count": 300 } - - // bool log(var args...) - this.log = function() { - var msg = "" - for (var i in arguments) { - if (msg.length > 0) - msg += " " - msg += arguments[i] - } - console.log(msg) - return true - } - - // void verifyCfg(json data) - // verifies config data, and normalize addresses - // throws exception on failure - this.verifyCfg = function(data) { - if (data.accounts.length == 0 || data.members.length == 0) - throw "At least one account and node are required" - var bootnodeExists = false - for (var i in data.members) { - var m = data.members[i] - if (!web3.isAddress(m.addr)) - throw "Invalid address 1 " + m.addr - data.members[i].addr = web3.toChecksumAddress(m.addr) - if (m.bootnode) - bootnodeExists = true - } - if (!bootnodeExists) - throw "Bootnode is not designated" - for (var i in data.accounts) { - var a = data.accounts[i] - if (!web3.isAddress(a.addr)) - throw "Invalid address " + a.addr - data.accounts[i].addr = web3.toChecksumAddress(a.addr) - } - if (data.staker) { - if (!web3.isAddress(data.staker)) - throw "Invalid staker address " + data.staker - data.staker = web3.toChecksumAddress(data.staker) - } - if (data.ecosystem) { - if (!web3.isAddress(data.ecosystem)) - throw "Invalid ecosystem address " + data.ecosystem - data.ecosystem = web3.toChecksumAddress(data.ecosystem) - } - if (data.maintenance) { - if (!web3.isAddress(data.maintenance)) - throw "Invalid maintenance address " + data.maintenance - data.maintenance = web3.toChecksumAddress(data.maintenance) - } - if (data.feecollector) { - if (!web3.isAddress(data.feecollector)) - throw "Invalid feecollector address " + data.feecollector - data.feecollector = web3.toChecksumAddress(data.feecollector) - } - } - - // bytes packNum(int num) - // pack a number into 256 bit bytes - this.packNum = function(num) { - return web3.padLeft(web3.toHex(num).substr(2), 64, "0") - } - - // { "nodes": string, "stakes": string, "staker": address, - // "ecosystem": address, "maintenance": address, "feecollector": address, - // "env": { env variables } } - // getInitialGovernanceMembersAndNodes(json data) - this.getInitialGovernanceMembersAndNodes = function(data) { - var nodes = "0x", stakes = "0x" - - for (var i = 0, l = data.members.length; i < l; i++) { - var m = data.members[i], id - if (m.id.length != 128 && m.id.length != 130) - throw "Invalid enode id " + m.id - id = m.id.length == 128 ? m.id : m.id.substr(2) - if (m.addr) { - if (m.addr.indexOf("0x") == 0) - m.addr = m.addr.substr(2) - if (!m.staker) - m.staker = m.addr - if (!m.voter) - m.voter = m.addr - if (!m.reward) - m.reward = m.addr - } - if (m.staker) { - if (m.staker.indexOf("0x") == 0) - m.staker = m.staker.substr(2) - if (!m.addr) - m.addr = m.staker - if (!m.voter) - m.voter = m.staker - if (!m.reward) - m.reward = m.staker - } - if (!m.addr && !m.staker) - throw "Address & staker are missing" - nodes += web3.padLeft(m.staker, 64, "0") + - web3.padLeft(m.voter, 64, "0") + - web3.padLeft(m.reward, 64, "0") + - this.packNum(m.name.length) + web3.fromAscii(m.name).substr(2) + - this.packNum(id.length/2) + id + - this.packNum(m.ip.length) + web3.fromAscii(m.ip).substr(2) + - this.packNum(m.port) - - stakes += web3.padLeft(m.staker, 64, "0") + - this.packNum(m.stake) - } - return { - "nodes": nodes, - "stakes": stakes, - "staker": data.staker, - "ecosystem": data.ecosystem, - "maintenance": data.maintenance, - "feecollector": data.feecollector, - "env": data.env - } - } - - this.nonce = function() { - return this._nonce++ - } - - // returns transaction hash, or throws error - this.deployContract = function(data) { - var tx = { - from: this.from, - data: data, - gas: this.gas, - gasPrice: this.gasPrice, - nonce: this.nonce() - } - var stx = offlineWalletSignTx(this.wallet.id, tx, eth.chainId()) - return eth.sendRawTransaction(stx) - } - - // wait for transaction receipt for contract address, then - // load a contract - // Contract resolveContract(ABI abi, hash txh) - this.resolveContract = function(abi, txh) { - for (var i = 0; i < this.receiptCheckParams.count; i++ ) { - var r = eth.getTransactionReceipt(txh) - if (r != null && r.contractAddress != null) { - var ctr = web3.eth.contract(abi).at(r.contractAddress) - ctr.transactionHash = txh - return ctr - } - msleep(this.receiptCheckParams.interval) - } - throw "Cannot get contract address for " + txh - } - - // sends a simple or method transaction, returns transaction hash - this.sendTx = function(to, value, data) { - var tx = {from:this.from, to:to, gas:this.gas, - gasPrice:this.gasPrice, nonce:this.nonce()} - if (value) - tx.value = value - if (data) - tx.data = data - var stx = offlineWalletSignTx(this.wallet.id, tx, eth.chainId()) - return eth.sendRawTransaction(stx) - } - - this.checkReceipt = function(tx) { - for (var i = 0; i < this.receiptCheckParams.count; i++ ) { - var r = eth.getTransactionReceipt(tx) - if (r != null) - return web3.toBigNumber(r.status) == 1 - msleep(this.receiptCheckParams.interval) - } - throw "Cannot get a transaction receipt for " + tx - } - - this.sendStakingDeposit = function (to, data, stake) { - var tx = { from: this.from, to: to, gas: this.gas, gasPrice: this.gasPrice, nonce: this.nonce(), value: "0" } - tx.value = stake - if (data) tx.data = data - var stx = offlineWalletSignTx(this.wallet.id, tx, eth.chainId()) - - return eth.sendRawTransaction(stx) - } - - // bool deploy(string walletUrl, string password, string cfg) - this.deploy = function(walletUrl, password, cfg, doInitOnce) { - w = offlineWalletOpen(walletUrl, password) - if (!w || !w.id || !w.address) { - throw "Offline wallet is not loaded" - } - this.wallet = w - this.from = this.wallet.address - this._nonce = eth.getTransactionCount(this.from, 'pending') - - var data - if (!(data = loadFile(cfg))) - throw "cannot load governance contract .js or config .json file" - - // check if contracts exist - var contractNames = [ "Registry", "EnvStorageImp", "Staking", "StakingImp", - "BallotStorage", "EnvStorage", "GovImp", "Gov" ] - for (var i in contractNames) { - var cn = contractNames[i] - if (eval("typeof " + cn + "_data") == "undefined" || - eval("typeof " + cn + "_contract") == "undefined") - throw cn + " not found" - } - - // check config.js - eval("var data = " + data) - this.verifyCfg(data) - - // initial members and nodes data - var initData = this.getInitialGovernanceMembersAndNodes(data) - - // bootnode - var bootNode = { - "name": web3.fromAscii(data.members[0].name), - "id": data.members[0].id, - "ip": web3.fromAscii(data.members[0].ip), - "port": data.members[0].port, - "stake": data.members[0].stake - } - - // contacts, transactions to be deployed - var registry, envStorageImp, staking, stakingImp, ballotStorage, envStorage, govImp, gov - var txs = new Array() - - // 1. deploy Registry and EnvStorageImp contracts - this.log("Deploying Registry and EnvStorageImp...") - registry = this.deployContract(Registry_data) - envStorageImp = this.deployContract(EnvStorageImp_data) - stakingImp = this.deployContract(StakingImp_data) - - this.log("Waiting for receipts...") - envStorageImp = this.resolveContract(EnvStorageImp_contract.abi, envStorageImp) - registry = this.resolveContract(Registry_contract.abi, registry) - stakingImp = this.resolveContract(StakingImp_contract.abi, stakingImp); - - // 2. deploy Staking, BallotStorage, EnvStorage, GovImp, Gov - this.log("Deploying Staking, BallotStorage, EnvStorage, GovImp & Gov...") - var code = Staking_contract.getData(stakingImp.address, {data: Staking_data}) - staking = this.deployContract(code) - var code = BallotStorage_contract.getData(registry.address, {data: BallotStorage_data}) - ballotStorage = this.deployContract(code) - code = EnvStorage_contract.getData(envStorageImp.address, {data: EnvStorage_data}) - envStorage = this.deployContract(code) - govImp = this.deployContract(GovImp_data) - - this.log("Waiting for receipts...") - govImp = this.resolveContract(GovImp_contract.abi, govImp) - code = Gov_contract.getData(govImp.address, { data: Gov_data }) - gov = this.deployContract(code) - - this.log("Waiting for gov contract...") - gov = this.resolveContract(Gov_contract.abi, gov) - envStorage = this.resolveContract(EnvStorage_contract.abi, envStorage) - ballotStorage = this.resolveContract(BallotStorage_contract.abi, ballotStorage) - staking = this.resolveContract(Staking_contract.abi, staking) - - // 3. setup registry - this.log("Setting registry...") - txs.length = 0 - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "Staking", staking.address)) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "BallotStorage", ballotStorage.address)) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "EnvStorage", envStorage.address)) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "GovernanceContract", gov.address)) - if (initData.staker) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "StakingReward", initData.staker)) - if (initData.ecosystem) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "Ecosystem", initData.ecosystem)) - if (initData.maintenance) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "Maintenance", initData.maintenance)) - if (initData.feecollector) - txs[txs.length] = this.sendTx(registry.address, null, - registry.setContractDomain.getData( - "FeeCollector", initData.feecollector)) - - // no need to wait for the receipts for the above - - // 4. initialize environment storage data: - this.log("Initializing environment storage...") - data.env = data.env || {} - // Just changing address doesn't work here. Address is embedded in - // the methods. Have to re-construct temporary EnvStorageImp here. - var tmpEnvStorageImp = web3.eth.contract(envStorageImp.abi).at(envStorage.address) - var envNames = [ - web3.sha3("blocksPer"), - web3.sha3("ballotDurationMin"), web3.sha3("ballotDurationMax"), - web3.sha3("stakingMin"), web3.sha3("stakingMax"), - web3.sha3("MaxIdleBlockInterval"), - web3.sha3("blockCreationTime"), - web3.sha3("blockRewardAmount"), - web3.sha3("maxPriorityFeePerGas"), - web3.sha3("blockRewardDistributionBlockProducer"), - web3.sha3("blockRewardDistributionStakingReward"), - web3.sha3("blockRewardDistributionEcosystem"), - web3.sha3("blockRewardDistributionMaintenance"), - web3.sha3("maxBaseFee"), - web3.sha3("blockGasLimit"), - web3.sha3("baseFeeMaxChangeRate"), - web3.sha3("gasTargetPercentage") ] - var rewardDistributionMethod = data.env.rewardDistributionMethod || [ 4000, 1000, 2500, 2500 ] - var envValues = [ - 1, - data.env.ballotDurationMin || 86400, - data.env.ballotDurationMax || 604800, - data.env.stakingMin || 1500000000000000000000000, - data.env.stakingMax || 1500000000000000000000000, - data.env.MaxIdleBlockInterval || 5, - data.env.blockCreationTime || 1000, - // mint amount: 1 wemix - data.env.blockRewardAmount || web3.toWei(1, 'ether'), - // tip: 100 gwei - data.env.maxPriorityFeePerGas || web3.toWei(100, 'gwei'), - // NCPs, WEMIX Staker, Eco System, Maintenance - rewardDistributionMethod[0], - rewardDistributionMethod[1], - rewardDistributionMethod[2], - rewardDistributionMethod[3], - // maxBaseFee * 21000 -> 1.05 wemix - data.env.maxBaseFee || web3.toWei(50000, 'gwei'), - data.env.blockGasLimit || 5000 * 21000, - data.env.baseFeeMaxChangeRate || 55, - data.env.gasTargetPercentage || 30 ] - txs[txs.length] = this.sendTx(envStorage.address, null, - tmpEnvStorageImp.initialize.getData(registry.address, envNames, envValues)) - - // 5. deposit staking - var tmpStakingImp = web3.eth.contract(stakingImp.abi).at(staking.address) - code = tmpStakingImp.init.getData(registry.address, - doInitOnce ? initData.stakes : "", {data: Staking_data}) - txs[txs.length] = this.sendTx(staking.address, null, code); - txs[txs.length] = this.sendStakingDeposit(staking.address, tmpStakingImp.deposit.getData(), web3.toBigNumber(bootNode.stake).toString(10)); - for(i=0;i $d/.rc wait } -# void init_gov(String node, String config_json, String account_file, bool doInitOnce) +# void init_gov(String node, String config_json, String account_file, Number gov_lock_amount (wei) ) # account_file can be # 1. keystore file: "" # 2. nano ledger: "ledger:" @@ -77,10 +77,16 @@ function init_gov () NODE="$1" CONFIG="$2" ACCT="$3" - [ "$4" = "0" ] && INIT_ONCE=false || INIT_ONCE=true + PASSWORD="$4" + LOCKAMOUNT="$5" if [ ! -f "$CONFIG" ]; then - echo "Cannot find config file: $2" + echo "Cannot find config file: $CONFIG" + return 1 + fi + + if [ ! -f "$ACCT" ]; then + echo "Cannot find account file: $ACCT" return 1 fi @@ -92,15 +98,13 @@ function init_gov () return 1 fi - if [ ! -f "${d}/conf/WemixGovernance.js" ]; then - echo "Cannot find ${d}/conf/WemixGovernance.js" - return 1 + if [ -z "$PASSWORD" ]; then + exec ${GWEMIX} wemix deploy-governance --url "$d/gwemix.ipc" ${CONFIG} ${ACCT} ${LOCKAMOUNT} + elif [ -f "$PASSWORD" ]; then + exec ${GWEMIX} wemix deploy-governance --url "$d/gwemix.ipc" --password ${PASSWORD} ${CONFIG} ${ACCT} ${LOCKAMOUNT} + else + exec ${GWEMIX} wemix deploy-governance --url "$d/gwemix.ipc" --password <(echo ${PASSWORD}) ${CONFIG} ${ACCT} ${LOCKAMOUNT} fi - - PORT=$(grep PORT ${d}/.rc | sed -e 's/PORT=//') - [ "$PORT" = "" ] && PORT=8588 - - exec ${GWEMIX} attach http://localhost:${PORT} --preload "$d/conf/WemixGovernance.js,$d/conf/deploy-governance.js" --exec 'GovernanceDeployer.deploy("'${ACCT}'", "", "'${CONFIG}'", '${INIT_ONCE}')' } function wipe () @@ -233,7 +237,7 @@ case "$1" in if [ $# -lt 4 ]; then usage; else - init_gov "$2" "$3" "$4" "$5" + init_gov "$2" "$3" "$4" "$5" "$6" fi ;; diff --git a/wemix/scripts/solc.sh b/wemix/scripts/solc.sh deleted file mode 100755 index 2e3cc16c50b1..000000000000 --- a/wemix/scripts/solc.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash - -[ "${SOL_GAS}" = "" ] && SOL_GAS="0x10000000" - -SOLC= -solc --version > /dev/null 2>&1 -if [ $? = 0 ]; then - SOLC=solc -else -# docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:stable" - docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:0.4.24" -fi - -if [ "$SOLC" = "" ]; then - echo "Cannot find solc or docker." - exit 1 -fi - -function usage () -{ - echo "$(basename $0) [-f ] [-g gas] [-p gas-price] [-l :]+ - [ | ] - --f : oupput format: \"js\" || \"json\", default is \"js\". --g : gas amount to spend. --p : gas price --l :: library name and address pair separated by ':'. - Multiple -l options can be used to specify multiple libraries. --r =: remap paths, e.g. \"wherever=/foo/bar\" - -Output Formats: - \"js\": creates 'remix'-generated .js style file that can be loaded to - geth/gmet console. - \"json\": creates 'truffle'-generated .json style file. - -Environment Variables: - SOL_GAS for gas amount, equivalent to -g option. - SOL_LIBS for libaries, equivalent to -l option. Pairs should be separated by - space, e.g. \"name1:0x123..456 name2:abc..def\". -" -} - -# int compile(string solFile, string jsFile) -function compile () -{ - ${SOLC} ${PATH_REMAP} --optimize --abi --bin $1 | awk -v gas="$SOL_GAS" -v gas_price="$SOL_GASPRICE" -v libs="$SOL_LIBS" -v outfmt=$outfmt ' -function flush2js() { - if (length(gas_price) != 0) { - gas_price_2 = ",\ - gasPrice: \"" gas_price "\""; - } - if (length(code_name) > 0) { - printf "\n\ -function %s_new() {\n\ - return %s_contract.new(\n\ - {\n\ - from: web3.eth.accounts[0],\n\ - data: %s_data,\n\ - gas: \"%s\"%s\n\ - }, function (e, contract) {\n\ - if (typeof contract.address !== \"undefined\") {\n\ - console.log(\"Contract mined! address: \" + contract.address + \" transactionHash: \" + contract.transactionHash);\n\ - }\n\ - });\n\ -}\n\ -\n\ -function %s_load(addr) {\n\ - return %s_contract.at(addr);\n\ -}\n\ -", code_name, code_name, code_name, gas, gas_price_2, code_name, code_name; - } -} - -function flush2json() { - if (length(code_name) > 0) { - printf "{\n\ - \"contractName\": \"%s\",\n\ - \"abi\": %s,\n\ - \"bytecode\": \"0x%s\"\n\ -}\n\ -", code_name, abi, code; - } -} - -function flush2abi() { - if (length(code_name) > 0) { - printf "{\n\ - \"contractName\": \"%s\",\n\ - \"abi\": %s\n\ -}\n\ -", code_name, abi, code; - } -} - -function flush() { - if (outfmt == "js") - flush2js(); - else if (outfmt == "json") - flush2json(); - else - flush2abi(); -} - -END { - flush() -} - -/^$/ { - flush() - code_name = "" -} - -/^=======/ { - code_name = $0 - sub("^=.*:", "", code_name) - sub(" =======$", "", code_name) -} - -# abi -/^\[/ { - if (length(code_name) > 0) { - abi = $0 - if (outfmt == "js") - print "var " code_name "_contract = web3.eth.contract(" abi ");"; - } -} - -# binary: 60606040, 60806040 for contracts, 610eb861 for libraries -/^6[01]/ { - if (length(code_name) > 0) { - code = $0; - n = split(libs, alibs, " +"); - for (i = 1; i <= n; i++) { - if (split(alibs[i], nv, ":") != 2) - continue; - sub("^0x", "", nv[2]); - gsub("_+[^_]*" nv[1] "_+", nv[2], code); - } - if (outfmt == "js") - print "var " code_name "_data = \"0x" code "\";"; - } -} -' > $2; -} - -args=`getopt f:g:l:p:r: $*` -if [ $? != 0 ]; then - usage; - exit 1; -fi -set -- $args - -outfmt=js -for i; do - case "$i" in - -f) - outfmt=$2 - shift; - shift;; - -g) - SOL_GAS=$2 - shift; - shift;; - -p) - SOL_GASPRICE=$2 - shift; - shift;; - -l) - [ "$SOL_LIBS" = "" ] || SOL_LIBS="$SOL_LIBS " - SOL_LIBS="${SOL_LIBS}$2"; - shift; - shift;; - -r) - [ "$PATH_REMAP" = "" ] || PATH_REMAP="$PATH_REMAP " - PATH_REMAP="${PATH_REMAP}$2"; - shift; - shift;; - esac -done - -if [ $# != 3 -o "$outfmt" != "js" -a "$outfmt" != "json" -a "$outfmt" != "abi" ]; then - usage - exit 1 -fi - -compile "$2" "$3" - -# EOF diff --git a/wemix/sync.go b/wemix/sync.go index 75a8e7fcd1ab..5032f38f65fa 100644 --- a/wemix/sync.go +++ b/wemix/sync.go @@ -3,7 +3,6 @@ package wemix import ( - "bytes" "context" "encoding/json" "fmt" @@ -324,7 +323,7 @@ func syncCheck() error { } // if we're in sync, nothing we can do - if work != nil && work.Height == header.Number.Int64() && bytes.Equal(work.Hash.Bytes(), header.Hash().Bytes()) { + if work != nil && work.Height == header.Number.Int64() && work.Hash == header.Hash() { log.Debug("sync check: in sync", "height", work.Height, "hash", work.Hash) return err } @@ -355,7 +354,7 @@ func syncCheck() error { if state.LatestBlockHeight == nil { continue } - if state.LatestBlockHeight.Int64() == work.Height && bytes.Equal(work.Hash.Bytes(), state.LatestBlockHash.Bytes()) { + if state.LatestBlockHeight.Int64() == work.Height && work.Hash == state.LatestBlockHash { exists = true break }