diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index d99808f5..38bfb25d 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -13,6 +13,7 @@ jobs: matrix: go-version: [ 1.21.x ] goarch: [ "amd64" ] + test: ["e2e", "edge", "multirollup"] runs-on: ubuntu-latest steps: - name: Checkout code @@ -24,4 +25,4 @@ jobs: env: GOARCH: ${{ matrix.goarch }} - name: Test - run: make test-full + run: make test-${{ matrix.test }} diff --git a/.github/workflows/test-edge.yml b/.github/workflows/test-edge.yml deleted file mode 100644 index 7f933d12..00000000 --- a/.github/workflows/test-edge.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test -on: - push: - branches: - - main - - master - - develop - - update-external-dependencies - pull_request: -jobs: - test-edge: - strategy: - matrix: - go-version: [ 1.21.x ] - goarch: [ "amd64" ] - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} - env: - GOARCH: ${{ matrix.goarch }} - - name: Test - run: make test-edge diff --git a/.gitignore b/.gitignore index 4efbf96d..9dad8e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ config/config.mainnet.toml config/config.testnet.toml +**__debug** diff --git a/Makefile b/Makefile index 833f3976..04e83b2f 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,44 @@ include version.mk DOCKER_COMPOSE := docker-compose -f docker-compose.yml -DOCKER_COMPOSE_STATE_DB := zkevm-state-db -DOCKER_COMPOSE_POOL_DB := zkevm-pool-db -DOCKER_COMPOSE_RPC_DB := zkevm-rpc-db -DOCKER_COMPOSE_BRIDGE_DB := zkevm-bridge-db -DOCKER_COMPOSE_ZKEVM_NODE := zkevm-node +DOCKER_COMPOSE_DB := zkevm-db +DOCKER_COMPOSE_ZKEVM_NODE-1 := zkevm-node-1 +DOCKER_COMPOSE_ZKEVM_NODE-2 := zkevm-node-2 DOCKER_COMPOSE_ZKEVM_NODE_V1TOV2 := zkevm-node-v1tov2 DOCKER_COMPOSE_ZKEVM_AGGREGATOR_V1TOV2 := zkevm-aggregator-v1tov2 DOCKER_COMPOSE_L1_NETWORK := zkevm-mock-l1-network DOCKER_COMPOSE_L1_NETWORK_V1TOV2 := zkevm-v1tov2-l1-network -DOCKER_COMPOSE_ZKPROVER := zkevm-prover +DOCKER_COMPOSE_ZKPROVER-1 := zkevm-prover-1 +DOCKER_COMPOSE_ZKPROVER-2 := zkevm-prover-2 DOCKER_COMPOSE_ZKPROVER_V1TOV2 := zkevm-prover-v1tov2 -DOCKER_COMPOSE_BRIDGE := zkevm-bridge-service +DOCKER_COMPOSE_BRIDGE-1 := zkevm-bridge-service-1 +DOCKER_COMPOSE_BRIDGE-2 := zkevm-bridge-service-2 DOCKER_COMPOSE_BRIDGE_V1TOV2 := zkevm-bridge-service-v1tov2 -RUN_STATE_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_STATE_DB) -RUN_POOL_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_POOL_DB) -RUN_BRIDGE_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_DB) -RUN_DBS := ${RUN_BRIDGE_DB} && ${RUN_STATE_DB} && ${RUN_POOL_DB} -RUN_NODE := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKEVM_NODE) +RUN_DB := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_DB) +RUN_NODE_1 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKEVM_NODE-1) +RUN_NODE_2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKEVM_NODE-2) RUN_NODE_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKEVM_NODE_V1TOV2) RUN_AGGREGATOR_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKEVM_AGGREGATOR_V1TOV2) RUN_L1_NETWORK := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_L1_NETWORK) RUN_L1_NETWORK_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_L1_NETWORK_V1TOV2) -RUN_ZKPROVER := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKPROVER) +RUN_ZKPROVER_1 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKPROVER-1) +RUN_ZKPROVER_2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKPROVER-2) RUN_ZKPROVER_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_ZKPROVER_V1TOV2) -RUN_BRIDGE := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE) +RUN_BRIDGE_1 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE-1) +RUN_BRIDGE_2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE-2) RUN_BRIDGE_V1TOV2 := $(DOCKER_COMPOSE) up -d $(DOCKER_COMPOSE_BRIDGE_V1TOV2) -STOP_NODE_DB := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_NODE_DB) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_NODE_DB) -STOP_BRIDGE_DB := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_DB) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_DB) -STOP_DBS := ${STOP_NODE_DB} && ${STOP_BRIDGE_DB} -STOP_NODE := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKEVM_NODE) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKEVM_NODE) +STOP_DB := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_DB) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_DB) +STOP_NODE := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKEVM_NODE-1) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKEVM_NODE-1) STOP_NODE_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKEVM_NODE_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKEVM_NODE_V1TOV2) STOP_AGGREGATOR_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKEVM_AGGREGATOR_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKEVM_AGGREGATOR_V1TOV2) STOP_NETWORK := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_L1_NETWORK) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_L1_NETWORK) STOP_NETWORK_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_L1_NETWORK_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_L1_NETWORK_V1TOV2) -STOP_ZKPROVER := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKPROVER) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKPROVER) +STOP_ZKPROVER_1 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKPROVER-1) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKPROVER-1) +STOP_ZKPROVER_2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKPROVER-2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKPROVER-2) STOP_ZKPROVER_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_ZKPROVER_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_ZKPROVER_V1TOV2) -STOP_BRIDGE := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE) +STOP_BRIDGE := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE-1) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE-1) STOP_BRIDGE_V1TOV2 := $(DOCKER_COMPOSE) stop $(DOCKER_COMPOSE_BRIDGE_V1TOV2) && $(DOCKER_COMPOSE) rm -f $(DOCKER_COMPOSE_BRIDGE_V1TOV2) STOP := $(DOCKER_COMPOSE) down --remove-orphans @@ -71,9 +70,9 @@ install-git-hooks: ## Moves hook files to the .git/hooks directory .PHONY: test test: ## Runs only short tests without checking race conditions - $(STOP_BRIDGE_DB) || true - $(RUN_BRIDGE_DB); sleep 3 - trap '$(STOP_BRIDGE_DB)' EXIT; go test --cover -short -p 1 ./... + $(STOP_DB) || true + $(RUN_DB); sleep 3 + trap '$(STOP_DB)' EXIT; go test --cover -short -p 1 ./... .PHONY: install-linter install-linter: ## Installs the linter @@ -83,33 +82,17 @@ install-linter: ## Installs the linter build-docker: ## Builds a docker image with the zkevm bridge binary docker build -t zkevm-bridge-service -f ./Dockerfile . -.PHONY: run-db-node -run-db-node: ## Runs the node database - $(RUN_NODE_DB) +.PHONY: run-db +run-db: ## Runs the node database + $(RUN_DB) -.PHONY: stop-db-node -stop-db-node: ## Stops the node database - $(STOP_NODE_DB) - -.PHONY: run-db-bridge -run-db-bridge: ## Runs the node database - $(RUN_BRIDGE_DB) - -.PHONY: stop-db-bridge -stop-db-bridge: ## Stops the node database - $(STOP_BRIDGE_DB) - -.PHONY: run-dbs -run-dbs: ## Runs the node database - $(RUN_DBS) - -.PHONY: stop-dbs -stop-dbs: ## Stops the node database - $(STOP_DBS) +.PHONY: stop-db +stop-db: ## Stops the node database + $(STOP_DB) .PHONY: run-node run-node: ## Runs the node - $(RUN_NODE) + $(RUN_NODE_1) .PHONY: stop-node stop-node: ## Stops the node @@ -149,11 +132,11 @@ stop-network-v1tov2: ## Stops the l1 network .PHONY: run-prover run-prover: ## Runs the zk prover - $(RUN_ZKPROVER) + $(RUN_ZKPROVER_1) .PHONY: stop-prover stop-prover: ## Stops the zk prover - $(STOP_ZKPROVER) + $(STOP_ZKPROVER_1) .PHONY: run-prover-v1tov2 run-prover-v1tov2: ## Runs the zk prover @@ -165,7 +148,7 @@ stop-prover-v1tov2: ## Stops the zk prover .PHONY: run-bridge run-bridge: ## Runs the bridge service - $(RUN_BRIDGE) + $(RUN_BRIDGE_1) .PHONY: stop-bridge stop-bridge: ## Stops the bridge service @@ -188,18 +171,26 @@ restart: stop run ## Executes `make stop` and `make run` commands .PHONY: run run: stop ## runs all services - $(RUN_DBS) + $(RUN_DB) $(RUN_L1_NETWORK) sleep 5 - $(RUN_ZKPROVER) + $(RUN_ZKPROVER_1) sleep 3 - $(RUN_NODE) - sleep 7 - $(RUN_BRIDGE) + $(RUN_NODE_1) + sleep 25 + $(RUN_BRIDGE_1) + +.PHONY: run-2Rollups +run-2Rollups: run + $(RUN_ZKPROVER_2) + sleep 3 + $(RUN_NODE_2) + sleep 25 + $(RUN_BRIDGE_2) .PHONY: run-v1tov2 run-v1tov2: stop ## runs all services - $(RUN_DBS) + $(RUN_DB) $(RUN_L1_NETWORK_V1TOV2) sleep 5 $(RUN_ZKPROVER_V1TOV2) @@ -224,9 +215,9 @@ stop-mockserver: ## Stops the mock bridge service .PHONY: bench bench: ## benchmark test - $(STOP_BRIDGE_DB) || true - $(RUN_BRIDGE_DB); sleep 3 - trap '$(STOP_BRIDGE_DB)' EXIT; go test -run=NOTEST -timeout=30m -bench=Small ./test/benchmark/... + $(STOP_DB) || true + $(RUN_DB); sleep 3 + trap '$(STOP_DB)' EXIT; go test -run=NOTEST -timeout=30m -bench=Small ./test/benchmark/... .PHONY: bench-full bench-full: export ZKEVM_BRIDGE_DATABASE_PORT = 5432 @@ -236,8 +227,8 @@ bench-full: ## benchmark full test go test -run=NOTEST -bench=Medium . && \ go test -run=NOTEST -timeout=30m -bench=Large . -.PHONY: test-full -test-full: build-docker stop run ## Runs all tests checking race conditions +.PHONY: test-e2e +test-e2e: build-docker stop run ## Runs all tests checking race conditions sleep 3 trap '$(STOP)' EXIT; MallocNanoZone=0 go test -v -failfast -race -p 1 -timeout 2400s ./test/e2e/... -count 1 -tags='e2e' @@ -246,6 +237,11 @@ test-edge: build-docker stop run ## Runs all tests checking race conditions sleep 3 trap '$(STOP)' EXIT; MallocNanoZone=0 go test -v -failfast -race -p 1 -timeout 2400s ./test/e2e/... -count 1 -tags='edge' +.PHONY: test-multirollup +test-multirollup: build-docker stop run-2Rollups ## Runs all tests checking race conditions + sleep 3 + trap '$(STOP)' EXIT; MallocNanoZone=0 go test -v -failfast -race -p 1 -timeout 2400s ./test/e2e/... -count 1 -tags='multirollup' + .PHONY: validate validate: lint build test-full ## Validates the whole integrity of the code base diff --git a/bridgectrl/bridgectrl.go b/bridgectrl/bridgectrl.go index 8014d859..3fd0e060 100644 --- a/bridgectrl/bridgectrl.go +++ b/bridgectrl/bridgectrl.go @@ -61,7 +61,7 @@ func (bt *BridgeController) GetNetworkID(networkID uint) (uint8, error) { // AddDeposit adds deposit information to the bridge tree. func (bt *BridgeController) AddDeposit(ctx context.Context, deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error { leaf := hashDeposit(deposit) - tID, err := bt.GetNetworkID(deposit.NetworkID) + tID, err := bt.GetNetworkID(deposit.OriginNetwork) if err != nil { return err } diff --git a/bridgectrl/bridgectrl_test.go b/bridgectrl/bridgectrl_test.go index 7e7a83f0..99451fdb 100644 --- a/bridgectrl/bridgectrl_test.go +++ b/bridgectrl/bridgectrl_test.go @@ -64,15 +64,15 @@ func TestBridgeTree(t *testing.T) { require.NoError(t, err) amount, _ := new(big.Int).SetString(testVector.Amount, 0) deposit := ðerman.Deposit{ - LeafType: 0, - OriginalNetwork: testVector.OriginalNetwork, - OriginalAddress: common.HexToAddress(testVector.TokenAddress), - Amount: amount, - DestinationNetwork: testVector.DestinationNetwork, - DestinationAddress: common.HexToAddress(testVector.DestinationAddress), - BlockID: blockID, - DepositCount: uint(i), - Metadata: common.FromHex(testVector.Metadata), + LeafType: 0, + OriginalTokenNetwork: testVector.OriginalNetwork, + OriginalTokenAddress: common.HexToAddress(testVector.TokenAddress), + Amount: amount, + DestinationNetwork: testVector.DestinationNetwork, + DestinationAddress: common.HexToAddress(testVector.DestinationAddress), + BlockID: blockID, + DepositCount: uint(i), + Metadata: common.FromHex(testVector.Metadata), } leafHash := hashDeposit(deposit) assert.Equal(t, testVector.ExpectedHash, hex.EncodeToString(leafHash[:])) @@ -84,7 +84,7 @@ func TestBridgeTree(t *testing.T) { // test reorg orgRoot, err := bt.exitTrees[0].store.GetRoot(ctx, uint(i), 0, nil) require.NoError(t, err) - require.NoError(t, store.Reset(ctx, uint64(i), deposit.NetworkID, nil)) + require.NoError(t, store.Reset(ctx, uint64(i), deposit.OriginNetwork, nil)) err = bt.ReorgMT(ctx, uint(i), testVectors[i].OriginalNetwork, nil) require.NoError(t, err) blockID, err = store.AddBlock(context.TODO(), block, nil) diff --git a/bridgectrl/hash.go b/bridgectrl/hash.go index a59ddfc2..e16f17ce 100644 --- a/bridgectrl/hash.go +++ b/bridgectrl/hash.go @@ -37,11 +37,11 @@ func generateZeroHashes(height uint8) [][KeyLen]byte { func hashDeposit(deposit *etherman.Deposit) [KeyLen]byte { var res [KeyLen]byte origNet := make([]byte, 4) //nolint:gomnd - binary.BigEndian.PutUint32(origNet, uint32(deposit.OriginalNetwork)) + binary.BigEndian.PutUint32(origNet, uint32(deposit.OriginalTokenNetwork)) destNet := make([]byte, 4) //nolint:gomnd binary.BigEndian.PutUint32(destNet, uint32(deposit.DestinationNetwork)) var buf [KeyLen]byte metaHash := keccak256.Hash(deposit.Metadata) - copy(res[:], keccak256.Hash([]byte{deposit.LeafType}, origNet, deposit.OriginalAddress[:], destNet, deposit.DestinationAddress[:], deposit.Amount.FillBytes(buf[:]), metaHash)) + copy(res[:], keccak256.Hash([]byte{deposit.LeafType}, origNet, deposit.OriginalTokenAddress[:], destNet, deposit.DestinationAddress[:], deposit.Amount.FillBytes(buf[:]), metaHash)) return res } diff --git a/bridgectrl/merkletree_test.go b/bridgectrl/merkletree_test.go index 42fd12f7..979daad5 100644 --- a/bridgectrl/merkletree_test.go +++ b/bridgectrl/merkletree_test.go @@ -60,14 +60,14 @@ func TestLeafHash(t *testing.T) { require.True(t, err) deposit := ðerman.Deposit{ - OriginalNetwork: testVector.OriginalNetwork, - OriginalAddress: common.HexToAddress(testVector.TokenAddress), - Amount: amount, - DestinationNetwork: testVector.DestinationNetwork, - DestinationAddress: common.HexToAddress(testVector.DestinationAddress), - BlockNumber: 0, - DepositCount: uint(ti + 1), - Metadata: common.FromHex(testVector.Metadata), + OriginalTokenNetwork: testVector.OriginalNetwork, + OriginalTokenAddress: common.HexToAddress(testVector.TokenAddress), + Amount: amount, + DestinationNetwork: testVector.DestinationNetwork, + DestinationAddress: common.HexToAddress(testVector.DestinationAddress), + BlockNumber: 0, + DepositCount: uint(ti + 1), + Metadata: common.FromHex(testVector.Metadata), } leafHash := hashDeposit(deposit) assert.Equal(t, testVector.ExpectedHash[2:], hex.EncodeToString(leafHash[:])) @@ -105,14 +105,14 @@ func TestMTAddLeaf(t *testing.T) { ) for i := 0; i <= ti; i++ { deposit = ðerman.Deposit{ - OriginalNetwork: testVector.NewLeaf.OriginalNetwork, - OriginalAddress: common.HexToAddress(testVector.NewLeaf.TokenAddress), - Amount: amount, - DestinationNetwork: testVector.NewLeaf.DestinationNetwork, - DestinationAddress: common.HexToAddress(testVector.NewLeaf.DestinationAddress), - BlockNumber: 0, - DepositCount: uint(i), - Metadata: common.FromHex(testVector.NewLeaf.Metadata), + OriginalTokenNetwork: testVector.NewLeaf.OriginalNetwork, + OriginalTokenAddress: common.HexToAddress(testVector.NewLeaf.TokenAddress), + Amount: amount, + DestinationNetwork: testVector.NewLeaf.DestinationNetwork, + DestinationAddress: common.HexToAddress(testVector.NewLeaf.DestinationAddress), + BlockNumber: 0, + DepositCount: uint(i), + Metadata: common.FromHex(testVector.NewLeaf.Metadata), } depositID, err := store.AddDeposit(ctx, deposit, nil) require.NoError(t, err) @@ -173,14 +173,14 @@ func TestMTGetProof(t *testing.T) { blockID, err := store.AddBlock(context.TODO(), block, nil) require.NoError(t, err) deposit := ðerman.Deposit{ - OriginalNetwork: leaf.OriginalNetwork, - OriginalAddress: common.HexToAddress(leaf.TokenAddress), - Amount: amount, - DestinationNetwork: leaf.DestinationNetwork, - DestinationAddress: common.HexToAddress(leaf.DestinationAddress), - BlockID: blockID, - DepositCount: uint(li), - Metadata: common.FromHex(leaf.Metadata), + OriginalTokenNetwork: leaf.OriginalNetwork, + OriginalTokenAddress: common.HexToAddress(leaf.TokenAddress), + Amount: amount, + DestinationNetwork: leaf.DestinationNetwork, + DestinationAddress: common.HexToAddress(leaf.DestinationAddress), + BlockID: blockID, + DepositCount: uint(li), + Metadata: common.FromHex(leaf.Metadata), } depositID, err := store.AddDeposit(ctx, deposit, nil) require.NoError(t, err) @@ -233,14 +233,14 @@ func TestUpdateMT(t *testing.T) { require.True(t, result) for i := 0; i <= ti; i++ { deposit := ðerman.Deposit{ - OriginalNetwork: testVector.NewLeaf.OriginalNetwork, - OriginalAddress: common.HexToAddress(testVector.NewLeaf.TokenAddress), - Amount: amount, - DestinationNetwork: testVector.NewLeaf.DestinationNetwork, - DestinationAddress: common.HexToAddress(testVector.NewLeaf.DestinationAddress), - BlockNumber: 0, - DepositCount: uint(i), - Metadata: common.FromHex(testVector.NewLeaf.Metadata), + OriginalTokenNetwork: testVector.NewLeaf.OriginalNetwork, + OriginalTokenAddress: common.HexToAddress(testVector.NewLeaf.TokenAddress), + Amount: amount, + DestinationNetwork: testVector.NewLeaf.DestinationNetwork, + DestinationAddress: common.HexToAddress(testVector.NewLeaf.DestinationAddress), + BlockNumber: 0, + DepositCount: uint(i), + Metadata: common.FromHex(testVector.NewLeaf.Metadata), } _, err := store.AddDeposit(ctx, deposit, nil) require.NoError(t, err) @@ -386,14 +386,14 @@ func TestCheckMerkleProof(t *testing.T) { var height uint8 = 32 amount, _ := big.NewInt(0).SetString("10000000000000000000", 0) deposit := ðerman.Deposit{ - OriginalNetwork: 0, - OriginalAddress: common.Address{}, - Amount: amount, - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress("0xc949254d682d8c9ad5682521675b8f43b102aec4"), - BlockNumber: 0, - DepositCount: 0, - Metadata: []byte{}, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.Address{}, + Amount: amount, + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress("0xc949254d682d8c9ad5682521675b8f43b102aec4"), + BlockNumber: 0, + DepositCount: 0, + Metadata: []byte{}, } leafHash := hashDeposit(deposit) smtProof := [][KeyLen]byte{ diff --git a/claimtxman/claimtxman.go b/claimtxman/claimtxman.go index 0fa826e9..3e7db509 100644 --- a/claimtxman/claimtxman.go +++ b/claimtxman/claimtxman.go @@ -85,6 +85,7 @@ func (tm *ClaimTxManager) Start() { for { select { case <-tm.ctx.Done(): + ticker.Stop() return case netID := <-tm.chSynced: if netID == tm.l2NetworkID && !tm.synced { @@ -154,35 +155,39 @@ func (tm *ClaimTxManager) processDepositStatus(ger *etherman.GlobalExitRoot, dbT return err } for _, deposit := range deposits { - if tm.l2NetworkID != deposit.DestinationNetwork { - log.Infof("Ignoring deposit: %d: dest_net: %d, we are:%d", deposit.DepositCount, deposit.DestinationNetwork, tm.l2NetworkID) - continue - } - - claimHash, err := tm.bridgeService.GetDepositStatus(tm.ctx, deposit.DepositCount, deposit.DestinationNetwork) + claimHash, err := tm.bridgeService.GetDepositStatus(tm.ctx, deposit.DepositCount, deposit.OriginalTokenNetwork, deposit.DestinationNetwork) if err != nil { log.Errorf("error getting deposit status for deposit %d. Error: %v", deposit.DepositCount, err) return err } + if len(claimHash) > 0 || deposit.LeafType == LeafTypeMessage && !tm.isDepositMessageAllowed(deposit) { - log.Infof("Ignoring deposit: %d, leafType: %d, claimHash: %s, deposit.OriginalAddress: %s", deposit.DepositCount, deposit.LeafType, claimHash, deposit.OriginalAddress.String()) + log.Infof("Ignoring deposit: %d, leafType: %d, claimHash: %s, deposit.OriginalAddress: %s", deposit.DepositCount, deposit.LeafType, claimHash, deposit.OriginalTokenAddress.String()) + continue + } + + if tm.l2NetworkID != deposit.DestinationNetwork { + log.Debugf("Ignoring deposit: %d", deposit.DepositCount) continue } log.Infof("create the claim tx for the deposit %d", deposit.DepositCount) - ger, proof, rollupProof, err := tm.bridgeService.GetClaimProof(deposit.DepositCount, deposit.NetworkID, dbTx) + ger, proof, rollupProof, err := tm.bridgeService.GetClaimProof(deposit.DepositCount, deposit.OriginNetwork, dbTx) if err != nil { log.Errorf("error getting Claim Proof for deposit %d. Error: %v", deposit.DepositCount, err) return err } + var ( mtProof [mtHeight][keyLen]byte mtRollupProof [mtHeight][keyLen]byte ) + for i := 0; i < mtHeight; i++ { mtProof[i] = proof[i] mtRollupProof[i] = rollupProof[i] } + tx, err := tm.l2Node.BuildSendClaim(tm.ctx, deposit, mtProof, mtRollupProof, ðerman.GlobalExitRoot{ ExitRoots: []common.Hash{ @@ -190,10 +195,12 @@ func (tm *ClaimTxManager) processDepositStatus(ger *etherman.GlobalExitRoot, dbT ger.ExitRoots[1], }}, 1, 1, 1, tm.rollupID, tm.auth) + if err != nil { log.Errorf("error BuildSendClaim tx for deposit %d. Error: %v", deposit.DepositCount, err) return err } + if err = tm.addClaimTx(deposit.DepositCount, tm.auth.From, tx.To(), nil, tx.Data(), dbTx); err != nil { log.Errorf("error adding claim tx for deposit %d. Error: %v", deposit.DepositCount, err) return err @@ -205,7 +212,7 @@ func (tm *ClaimTxManager) processDepositStatus(ger *etherman.GlobalExitRoot, dbT func (tm *ClaimTxManager) isDepositMessageAllowed(deposit *etherman.Deposit) bool { for _, addr := range tm.cfg.AuthorizedClaimMessageAddresses { - if deposit.OriginalAddress == addr { + if deposit.OriginalTokenAddress == addr { log.Infof("MessageBridge from authorized account detected: %+v, account: %s", deposit, addr.String()) return true } diff --git a/claimtxman/claimtxman_test.go b/claimtxman/claimtxman_test.go index 4be670df..121d0621 100644 --- a/claimtxman/claimtxman_test.go +++ b/claimtxman/claimtxman_test.go @@ -28,15 +28,15 @@ func TestMonitoredTxStorage(t *testing.T) { require.NoError(t, err) deposit := ðerman.Deposit{ - NetworkID: 0, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), - BlockNumber: 1, - DepositCount: 1, - Metadata: common.FromHex("0x0"), + OriginNetwork: 0, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), + BlockNumber: 1, + DepositCount: 1, + Metadata: common.FromHex("0x0"), } _, err = pg.AddDeposit(ctx, deposit, tx) require.NoError(t, err) @@ -111,21 +111,21 @@ func TestUpdateDepositStatus(t *testing.T) { require.NoError(t, err) deposit := ðerman.Deposit{ - NetworkID: 0, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), - BlockNumber: 1, - BlockID: blockID, - DepositCount: 1, - Metadata: common.FromHex("0x0"), + OriginNetwork: 0, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), + BlockNumber: 1, + BlockID: blockID, + DepositCount: 1, + Metadata: common.FromHex("0x0"), } depositID, err := pg.AddDeposit(ctx, deposit, nil) require.NoError(t, err) l1Root := common.FromHex("0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e") - require.NoError(t, pg.SetRoot(ctx, l1Root, depositID, deposit.NetworkID, nil)) + require.NoError(t, pg.SetRoot(ctx, l1Root, depositID, deposit.OriginNetwork, nil)) block = ðerman.Block{ BlockNumber: 1, @@ -139,47 +139,47 @@ func TestUpdateDepositStatus(t *testing.T) { destAdr := "0x4d5Cf5032B2a844602278b01199ED191A86c93ff" deposit = ðerman.Deposit{ - NetworkID: 1, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress(destAdr), - BlockNumber: 1, - BlockID: blockID, - DepositCount: 1, - Metadata: common.FromHex("0x0"), + OriginNetwork: 1, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress(destAdr), + BlockNumber: 1, + BlockID: blockID, + DepositCount: 1, + Metadata: common.FromHex("0x0"), } depositID, err = pg.AddDeposit(ctx, deposit, nil) require.NoError(t, err) l2Root := common.FromHex("0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30") - require.NoError(t, pg.SetRoot(ctx, l2Root, depositID, deposit.NetworkID, nil)) + require.NoError(t, pg.SetRoot(ctx, l2Root, depositID, deposit.OriginNetwork, nil)) _, err = pg.Exec(ctx, "INSERT INTO mt.rollup_exit (leaf, rollup_id, root, block_id) VALUES ($1, $2, $3, $4)", l2Root, 1, l2Root, blockID) require.NoError(t, err) deposit = ðerman.Deposit{ - NetworkID: 1, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress(destAdr), - BlockNumber: 1, - BlockID: blockID, - DepositCount: 2, - Metadata: common.FromHex("0x0"), + OriginNetwork: 1, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress(destAdr), + BlockNumber: 1, + BlockID: blockID, + DepositCount: 2, + Metadata: common.FromHex("0x0"), } depositID, err = pg.AddDeposit(ctx, deposit, nil) require.NoError(t, err) l2Root1 := common.FromHex("0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2") - require.NoError(t, pg.SetRoot(ctx, l2Root1, depositID, deposit.NetworkID, nil)) + require.NoError(t, pg.SetRoot(ctx, l2Root1, depositID, deposit.OriginNetwork, nil)) deposits, err := pg.UpdateL1DepositsStatus(ctx, l1Root, nil) require.NoError(t, err) require.Len(t, deposits, 1) require.True(t, deposits[0].ReadyForClaim) require.Equal(t, uint(1), deposits[0].DepositCount) - require.Equal(t, uint(0), deposits[0].NetworkID) + require.Equal(t, uint(0), deposits[0].OriginNetwork) require.NoError(t, pg.UpdateL2DepositsStatus(ctx, l2Root, 1, 1, nil)) deposits, err = pg.GetDeposits(ctx, destAdr, 10, 0, nil) @@ -210,21 +210,21 @@ func TestUpdateL2DepositStatusMultipleRollups(t *testing.T) { require.NoError(t, err) deposit1 := ðerman.Deposit{ - NetworkID: 1, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress(destAdr), - BlockNumber: 1, - BlockID: blockID1, - DepositCount: 1, - Metadata: common.FromHex("0x0"), + OriginNetwork: 1, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress(destAdr), + BlockNumber: 1, + BlockID: blockID1, + DepositCount: 1, + Metadata: common.FromHex("0x0"), } depositID1, err := pg.AddDeposit(ctx, deposit1, nil) require.NoError(t, err) l2Root1 := common.FromHex("0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30") - require.NoError(t, pg.SetRoot(ctx, l2Root1, depositID1, deposit1.NetworkID, nil)) + require.NoError(t, pg.SetRoot(ctx, l2Root1, depositID1, deposit1.OriginNetwork, nil)) _, err = pg.Exec(ctx, "INSERT INTO mt.rollup_exit (leaf, rollup_id, root, block_id) VALUES ($1, $2, $3, $4)", l2Root1, 1, l2Root1, blockID1) require.NoError(t, err) @@ -239,21 +239,21 @@ func TestUpdateL2DepositStatusMultipleRollups(t *testing.T) { require.NoError(t, err) deposit2 := ðerman.Deposit{ - NetworkID: 2, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 2, - DestinationAddress: common.HexToAddress(destAdr), - BlockNumber: 1, - BlockID: blockID2, - DepositCount: 1, - Metadata: common.FromHex("0x0"), + OriginNetwork: 2, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 2, + DestinationAddress: common.HexToAddress(destAdr), + BlockNumber: 1, + BlockID: blockID2, + DepositCount: 1, + Metadata: common.FromHex("0x0"), } depositID2, err := pg.AddDeposit(ctx, deposit2, nil) require.NoError(t, err) l2Root2 := common.FromHex("0x90c89934975cc71a021a11dbe78cb2008d77e018dfffcc629b8d6d4dc905ac5c") - require.NoError(t, pg.SetRoot(ctx, l2Root2, depositID2, deposit2.NetworkID, nil)) + require.NoError(t, pg.SetRoot(ctx, l2Root2, depositID2, deposit2.OriginNetwork, nil)) _, err = pg.Exec(ctx, "INSERT INTO mt.rollup_exit (leaf, rollup_id, root, block_id) VALUES ($1, $2, $3, $4)", l2Root2, 1, l2Root2, blockID2) require.NoError(t, err) diff --git a/claimtxman/interfaces.go b/claimtxman/interfaces.go index 47f16235..58f3e4fd 100644 --- a/claimtxman/interfaces.go +++ b/claimtxman/interfaces.go @@ -24,5 +24,5 @@ type storageInterface interface { type bridgeServiceInterface interface { GetClaimProof(depositCnt, networkID uint, dbTx pgx.Tx) (*etherman.GlobalExitRoot, [][bridgectrl.KeyLen]byte, [][bridgectrl.KeyLen]byte, error) - GetDepositStatus(ctx context.Context, depositCount uint, destNetworkID uint) (string, error) + GetDepositStatus(ctx context.Context, depositCount uint, originNetworkID, destNetworkID uint) (string, error) } diff --git a/cmd/run.go b/cmd/run.go index 9b022cb2..bd11c2cd 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -53,20 +53,12 @@ func start(ctx *cli.Context) error { return err } - networkID, err := l1Etherman.GetNetworkID(ctx.Context) + networkID := l1Etherman.GetRollupID() log.Infof("main network id: %d", networkID) - if err != nil { - log.Error(err) - return err - } var networkIDs = []uint{networkID} for _, client := range l2Ethermans { - networkID, err := client.GetNetworkID(ctx.Context) - if err != nil { - log.Error(err) - return err - } + networkID := client.GetRollupID() log.Infof("l2 network id: %d", networkID) networkIDs = append(networkIDs, networkID) } @@ -95,7 +87,9 @@ func start(ctx *cli.Context) error { log.Error(err) return err } - rollupID := l1Etherman.GetRollupID() + + // TODO: this works because the service only supports one L2 network + rollupID := l2Ethermans[0].GetRollupID() bridgeService := server.NewBridgeService(c.BridgeServer, c.BridgeController.Height, networkIDs, apiStorage, rollupID) err = server.RunServer(c.BridgeServer, bridgeService) if err != nil { @@ -153,7 +147,7 @@ func setupLog(c log.Config) { } func newEthermans(c *config.Config) (*etherman.Client, []*etherman.Client, error) { - l1Etherman, err := etherman.NewClient(c.Etherman, c.NetworkConfig.PolygonBridgeAddress, c.NetworkConfig.PolygonZkEVMGlobalExitRootAddress, c.NetworkConfig.PolygonRollupManagerAddress, c.NetworkConfig.PolygonZkEvmAddress) + l1Etherman, err := etherman.NewL1Client(c.Etherman.L1URL, c.NetworkConfig.PolygonBridgeAddress, c.NetworkConfig.PolygonZkEVMGlobalExitRootAddress, c.NetworkConfig.PolygonRollupManagerAddress, c.NetworkConfig.PolygonZkEvmAddress) if err != nil { log.Error("L1 etherman error: ", err) return nil, nil, err @@ -161,9 +155,15 @@ func newEthermans(c *config.Config) (*etherman.Client, []*etherman.Client, error if len(c.L2PolygonBridgeAddresses) != len(c.Etherman.L2URLs) { log.Fatal("environment configuration error. zkevm bridge addresses and zkevm node urls mismatch") } + if len(c.L2PolygonBridgeAddresses) != 1 { + return nil, nil, fmt.Errorf( + "the bridge service only supports working with a single L2, but %d were provided", + len(c.L2PolygonBridgeAddresses), + ) + } var l2Ethermans []*etherman.Client - for i, addr := range c.L2PolygonBridgeAddresses { - l2Etherman, err := etherman.NewL2Client(c.Etherman.L2URLs[i], addr) + for i, bridgeAddr := range c.L2PolygonBridgeAddresses { + l2Etherman, err := etherman.NewL2Client(c.Etherman.L2URLs[i], bridgeAddr) if err != nil { log.Error("L2 etherman ", i, c.Etherman.L2URLs[i], ", error: ", err) return l1Etherman, nil, err diff --git a/db/pgstorage/migrations/0007_test.go b/db/pgstorage/migrations/0007_test.go index a6fb0a7a..d008e42d 100644 --- a/db/pgstorage/migrations/0007_test.go +++ b/db/pgstorage/migrations/0007_test.go @@ -60,7 +60,7 @@ func (m migrationTest0007) RunAssertsAfterMigrationUp(t *testing.T, db *sql.DB) amount string ) getClaimSQL := "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" - _ = db.QueryRow(getClaimSQL, 3, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) + _ = db.QueryRow(getClaimSQL, 3, 1).Scan(&claim.DepositCount, &claim.OriginalTokenNetwork, &claim.OriginalTokenAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.DestinationNetwork, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) assert.Equal(t, uint64(0), claim.RollupIndex) assert.Equal(t, false, claim.MainnetFlag) @@ -69,7 +69,7 @@ func (m migrationTest0007) RunAssertsAfterMigrationUp(t *testing.T, db *sql.DB) assert.NoError(t, err) getClaimSQL = "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" - _ = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) + _ = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.DepositCount, &claim.OriginalTokenNetwork, &claim.OriginalTokenAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.DestinationNetwork, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) assert.NoError(t, err) assert.Equal(t, uint64(37), claim.RollupIndex) assert.Equal(t, true, claim.MainnetFlag) @@ -97,10 +97,10 @@ func (m migrationTest0007) RunAssertsAfterMigrationDown(t *testing.T, db *sql.DB amount string ) getClaimSQL := "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" - err = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) + err = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.DepositCount, &claim.OriginalTokenNetwork, &claim.OriginalTokenAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.DestinationNetwork, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) assert.Error(t, err) getClaimSQL = "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash FROM sync.claim WHERE index = $1 AND network_id = $2" - err = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash) + err = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.DepositCount, &claim.OriginalTokenNetwork, &claim.OriginalTokenAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.DestinationNetwork, &claim.TxHash) assert.NoError(t, err) } diff --git a/db/pgstorage/migrations/0009.sql b/db/pgstorage/migrations/0009.sql new file mode 100644 index 00000000..c53fb0dc --- /dev/null +++ b/db/pgstorage/migrations/0009.sql @@ -0,0 +1,9 @@ +-- +migrate Up + +ALTER TABLE sync.deposit +ADD COLUMN IF NOT EXISTS origin_rollup_id BIGINT DEFAULT 0; + +-- +migrate Down + +ALTER TABLE sync.deposit +DROP COLUMN IF EXISTS origin_rollup_id; \ No newline at end of file diff --git a/db/pgstorage/migrations/0010.sql b/db/pgstorage/migrations/0010.sql new file mode 100644 index 00000000..66684d9e --- /dev/null +++ b/db/pgstorage/migrations/0010.sql @@ -0,0 +1,9 @@ +-- +migrate Up + +ALTER TABLE sync.claim DROP CONSTRAINT claim_pkey; +ALTER TABLE sync.claim ADD PRIMARY KEY (index, rollup_index, mainnet_flag); + +-- +migrate Down + +ALTER TABLE sync.claim DROP CONSTRAINT claim_pkey; +ALTER TABLE sync.claim ADD PRIMARY KEY (network_id, index); \ No newline at end of file diff --git a/db/pgstorage/migrations/0010_test.go b/db/pgstorage/migrations/0010_test.go new file mode 100644 index 00000000..6e2dec8c --- /dev/null +++ b/db/pgstorage/migrations/0010_test.go @@ -0,0 +1,84 @@ +package migrations_test + +import ( + "database/sql" + "errors" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +type migrationTest0010 struct{} + +const ( + originalDepositSQL = ` + INSERT INTO sync.claim (block_id, network_id, index, mainnet_flag, rollup_index, orig_addr, dest_addr, tx_hash) + VALUES(69, 0, 1, false, 0, decode('00','hex'), decode('00','hex'), decode('00','hex')); + ` // Rollup 1 to L1 + conflictingDeposit = ` + INSERT INTO sync.claim (block_id, network_id, index, mainnet_flag, rollup_index, orig_addr, dest_addr, tx_hash) + VALUES(69, 0, 1, false, 1, decode('00','hex'), decode('00','hex'), decode('00','hex')); + ` // Rollup 2 to L1 +) + +func (m migrationTest0010) InsertData(db *sql.DB) error { + block := "INSERT INTO sync.block (id, block_num, block_hash, parent_hash, network_id, received_at) VALUES(69, 2803824, decode('27474F16174BBE50C294FE13C190B92E42B2368A6D4AEB8A4A015F52816296C3','hex'), decode('C9B5033799ADF3739383A0489EFBE8A0D4D5E4478778A4F4304562FD51AE4C07','hex'), 1, '0001-01-01 01:00:00.000');" + if _, err := db.Exec(block); err != nil { + return err + } + + if _, err := db.Exec(originalDepositSQL); err != nil { + return err + } + _, err := db.Exec(conflictingDeposit) + if err == nil || !strings.Contains(err.Error(), "ERROR: duplicate key value violates unique constraint \"claim_pkey\" (SQLSTATE 23505)") { + return errors.New("should violate primary key") + } + + return nil +} + +func (m migrationTest0010) RunAssertsAfterMigrationUp(t *testing.T, db *sql.DB) { + // check that original row still in there + selectClaim := `SELECT block_id, network_id, index, mainnet_flag, rollup_index FROM sync.claim;` + row := db.QueryRow(selectClaim) + var ( + block_id, network_id, index, rollup_index int + mainnet_flag bool + ) + assert.NoError(t, row.Scan(&block_id, &network_id, &index, &mainnet_flag, &rollup_index)) + assert.Equal(t, 69, block_id) + assert.Equal(t, 0, network_id) + assert.Equal(t, 1, index) + assert.Equal(t, false, mainnet_flag) + assert.Equal(t, 0, rollup_index) + + // Add deposit that originally would have caused pkey violation + _, err := db.Exec(conflictingDeposit) + assert.NoError(t, err) + + // Remove conflicting deposit so it's possible to run the migration down + _, err = db.Exec("DELETE FROM sync.claim WHERE rollup_index = 1;") + assert.NoError(t, err) +} + +func (m migrationTest0010) RunAssertsAfterMigrationDown(t *testing.T, db *sql.DB) { + // check that original row still in there + selectClaim := `SELECT block_id, network_id, index, mainnet_flag, rollup_index FROM sync.claim;` + row := db.QueryRow(selectClaim) + var ( + block_id, network_id, index, rollup_index int + mainnet_flag bool + ) + assert.NoError(t, row.Scan(&block_id, &network_id, &index, &mainnet_flag, &rollup_index)) + assert.Equal(t, 69, block_id) + assert.Equal(t, 0, network_id) + assert.Equal(t, 1, index) + assert.Equal(t, false, mainnet_flag) + assert.Equal(t, 0, rollup_index) +} + +func TestMigration0010(t *testing.T) { + runMigrationTest(t, 10, migrationTest0010{}) +} diff --git a/db/pgstorage/migrations/0011.sql b/db/pgstorage/migrations/0011.sql new file mode 100644 index 00000000..632dff39 --- /dev/null +++ b/db/pgstorage/migrations/0011.sql @@ -0,0 +1,9 @@ +-- +migrate Up + +ALTER TABLE sync.deposit +DROP COLUMN IF EXISTS origin_rollup_id; + +-- +migrate Down + +ALTER TABLE sync.deposit +ADD COLUMN IF NOT EXISTS origin_rollup_id BIGINT DEFAULT 0; \ No newline at end of file diff --git a/db/pgstorage/migrations/0012.sql b/db/pgstorage/migrations/0012.sql new file mode 100644 index 00000000..f0e65d00 --- /dev/null +++ b/db/pgstorage/migrations/0012.sql @@ -0,0 +1,25 @@ +-- +migrate Up +ALTER TABLE sync.claim +ALTER COLUMN network_id TYPE BIGINT; + +ALTER TABLE sync.deposit +ALTER COLUMN network_id TYPE BIGINT; + +ALTER TABLE sync.block +ALTER COLUMN network_id TYPE BIGINT; + +ALTER TABLE sync.token_wrapped +ALTER COLUMN network_id TYPE BIGINT; + +-- +migrate Down +ALTER TABLE sync.claim +ALTER COLUMN network_id TYPE INTEGER; + +ALTER TABLE sync.deposit +ALTER COLUMN network_id TYPE INTEGER; + +ALTER TABLE sync.block +ALTER COLUMN network_id TYPE INTEGER; + +ALTER TABLE sync.token_wrapped +ALTER COLUMN network_id TYPE INTEGER; \ No newline at end of file diff --git a/db/pgstorage/pgstorage.go b/db/pgstorage/pgstorage.go index aecfc5c0..774d93fd 100644 --- a/db/pgstorage/pgstorage.go +++ b/db/pgstorage/pgstorage.go @@ -111,10 +111,27 @@ func (p *PostgresStorage) AddGlobalExitRoot(ctx context.Context, exitRoot *ether // AddDeposit adds new deposit to the storage. func (p *PostgresStorage) AddDeposit(ctx context.Context, deposit *etherman.Deposit, dbTx pgx.Tx) (uint64, error) { - const addDepositSQL = "INSERT INTO sync.deposit (leaf_type, network_id, orig_net, orig_addr, amount, dest_net, dest_addr, block_id, deposit_cnt, tx_hash, metadata) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING id" + const addDepositSQL = ` + INSERT INTO sync.deposit ( + leaf_type, network_id, orig_net, orig_addr, amount, dest_net, dest_addr, block_id, deposit_cnt, tx_hash, metadata + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING id` e := p.getExecQuerier(dbTx) var depositID uint64 - err := e.QueryRow(ctx, addDepositSQL, deposit.LeafType, deposit.NetworkID, deposit.OriginalNetwork, deposit.OriginalAddress, deposit.Amount.String(), deposit.DestinationNetwork, deposit.DestinationAddress, deposit.BlockID, deposit.DepositCount, deposit.TxHash, deposit.Metadata).Scan(&depositID) + err := e.QueryRow( + ctx, + addDepositSQL, + deposit.LeafType, + deposit.OriginNetwork, + deposit.OriginalTokenNetwork, + deposit.OriginalTokenAddress, + deposit.Amount.String(), + deposit.DestinationNetwork, + deposit.DestinationAddress, + deposit.BlockID, + deposit.DepositCount, + deposit.TxHash, + deposit.Metadata, + ).Scan(&depositID) return depositID, err } @@ -122,7 +139,7 @@ func (p *PostgresStorage) AddDeposit(ctx context.Context, deposit *etherman.Depo func (p *PostgresStorage) AddClaim(ctx context.Context, claim *etherman.Claim, dbTx pgx.Tx) error { const addClaimSQL = "INSERT INTO sync.claim (network_id, index, orig_net, orig_addr, amount, dest_addr, block_id, tx_hash, rollup_index, mainnet_flag) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)" e := p.getExecQuerier(dbTx) - _, err := e.Exec(ctx, addClaimSQL, claim.NetworkID, claim.Index, claim.OriginalNetwork, claim.OriginalAddress, claim.Amount.String(), claim.DestinationAddress, claim.BlockID, claim.TxHash, claim.RollupIndex, claim.MainnetFlag) + _, err := e.Exec(ctx, addClaimSQL, claim.DestinationNetwork, claim.DepositCount, claim.OriginalTokenNetwork, claim.OriginalTokenAddress, claim.Amount.String(), claim.DestinationAddress, claim.BlockID, claim.TxHash, claim.RollupIndex, claim.MainnetFlag) return err } @@ -198,13 +215,50 @@ func (p *PostgresStorage) AddTrustedGlobalExitRoot(ctx context.Context, trustedE } // GetClaim gets a specific claim from the storage. -func (p *PostgresStorage) GetClaim(ctx context.Context, depositCount, networkID uint, dbTx pgx.Tx) (*etherman.Claim, error) { +func (p *PostgresStorage) GetClaim(ctx context.Context, depositCount, originNetworkID, destNetworkID uint, dbTx pgx.Tx) (*etherman.Claim, error) { var ( claim etherman.Claim amount string ) - const getClaimSQL = "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" - err := p.getExecQuerier(dbTx).QueryRow(ctx, getClaimSQL, depositCount, networkID).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) + + // origin rollup ID is calculated as follows: + // // if mainnet_flag: 0 + // // else: rollup_index + 1 + // destination rollup ID == network_id: network that has received the claim, therefore, the destination rollupID of the claim + + const getClaimSQLOriginMainnet = ` + SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index + FROM sync.claim + WHERE index = $1 AND mainnet_flag AND network_id = $2; + ` + + const getClaimSQLOriginRollup = ` + SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index + FROM sync.claim + WHERE index = $1 AND NOT mainnet_flag AND rollup_index + 1 = $2 AND network_id = $3; + ` + + var row pgx.Row + if originNetworkID == 0 { + claim.MainnetFlag = true + row = p.getExecQuerier(dbTx). + QueryRow(ctx, getClaimSQLOriginMainnet, depositCount, destNetworkID) + } else { + row = p.getExecQuerier(dbTx). + QueryRow(ctx, getClaimSQLOriginRollup, depositCount, originNetworkID, destNetworkID) + } + + err := row.Scan( + &claim.DepositCount, + &claim.OriginalTokenNetwork, + &claim.OriginalTokenAddress, + &amount, + &claim.DestinationAddress, + &claim.BlockID, + &claim.DestinationNetwork, + &claim.TxHash, + &claim.RollupIndex, + ) if errors.Is(err, pgx.ErrNoRows) { return nil, gerror.ErrStorageNotFound } @@ -218,8 +272,27 @@ func (p *PostgresStorage) GetDeposit(ctx context.Context, depositCounterUser uin deposit etherman.Deposit amount string ) - const getDepositSQL = "SELECT leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim FROM sync.deposit as d INNER JOIN sync.block as b ON d.network_id = b.network_id AND d.block_id = b.id WHERE d.network_id = $1 AND deposit_cnt = $2" - err := p.getExecQuerier(dbTx).QueryRow(ctx, getDepositSQL, networkID, depositCounterUser).Scan(&deposit.LeafType, &deposit.OriginalNetwork, &deposit.OriginalAddress, &amount, &deposit.DestinationNetwork, &deposit.DestinationAddress, &deposit.DepositCount, &deposit.BlockID, &deposit.BlockNumber, &deposit.NetworkID, &deposit.TxHash, &deposit.Metadata, &deposit.ReadyForClaim) + const getDepositSQL = ` + SELECT leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim + FROM sync.deposit as d INNER JOIN sync.block as b ON d.network_id = b.network_id AND d.block_id = b.id + WHERE d.network_id = $1 AND deposit_cnt = $2` + err := p.getExecQuerier(dbTx). + QueryRow(ctx, getDepositSQL, networkID, depositCounterUser). + Scan( + &deposit.LeafType, + &deposit.OriginalTokenNetwork, + &deposit.OriginalTokenAddress, + &amount, + &deposit.DestinationNetwork, + &deposit.DestinationAddress, + &deposit.DepositCount, + &deposit.BlockID, + &deposit.BlockNumber, + &deposit.OriginNetwork, + &deposit.TxHash, + &deposit.Metadata, + &deposit.ReadyForClaim, + ) if errors.Is(err, pgx.ErrNoRows) { return nil, gerror.ErrStorageNotFound } @@ -504,7 +577,7 @@ func (p *PostgresStorage) GetClaims(ctx context.Context, destAddr string, limit claim etherman.Claim amount string ) - err = rows.Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) + err = rows.Scan(&claim.DepositCount, &claim.OriginalTokenNetwork, &claim.OriginalTokenAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.DestinationNetwork, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) if err != nil { return nil, err } @@ -516,7 +589,11 @@ func (p *PostgresStorage) GetClaims(ctx context.Context, destAddr string, limit // GetDeposits gets the deposit list which be smaller than depositCount. func (p *PostgresStorage) GetDeposits(ctx context.Context, destAddr string, limit uint, offset uint, dbTx pgx.Tx) ([]*etherman.Deposit, error) { - const getDepositsSQL = "SELECT leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim FROM sync.deposit as d INNER JOIN sync.block as b ON d.network_id = b.network_id AND d.block_id = b.id WHERE dest_addr = $1 ORDER BY d.block_id DESC, d.deposit_cnt DESC LIMIT $2 OFFSET $3" + const getDepositsSQL = ` + SELECT leaf_type, orig_net, orig_addr, amount, dest_net, dest_addr, deposit_cnt, block_id, b.block_num, d.network_id, tx_hash, metadata, ready_for_claim + FROM sync.deposit as d INNER JOIN sync.block as b ON d.network_id = b.network_id AND d.block_id = b.id + WHERE dest_addr = $1 ORDER BY d.block_id DESC, d.deposit_cnt DESC LIMIT $2 OFFSET $3 + ` rows, err := p.getExecQuerier(dbTx).Query(ctx, getDepositsSQL, common.FromHex(destAddr), limit, offset) if err != nil { return nil, err @@ -529,7 +606,21 @@ func (p *PostgresStorage) GetDeposits(ctx context.Context, destAddr string, limi deposit etherman.Deposit amount string ) - err = rows.Scan(&deposit.LeafType, &deposit.OriginalNetwork, &deposit.OriginalAddress, &amount, &deposit.DestinationNetwork, &deposit.DestinationAddress, &deposit.DepositCount, &deposit.BlockID, &deposit.BlockNumber, &deposit.NetworkID, &deposit.TxHash, &deposit.Metadata, &deposit.ReadyForClaim) + err = rows.Scan( + &deposit.LeafType, + &deposit.OriginalTokenNetwork, + &deposit.OriginalTokenAddress, + &amount, + &deposit.DestinationNetwork, + &deposit.DestinationAddress, + &deposit.DepositCount, + &deposit.BlockID, + &deposit.BlockNumber, + &deposit.OriginNetwork, + &deposit.TxHash, + &deposit.Metadata, + &deposit.ReadyForClaim, + ) if err != nil { return nil, err } @@ -573,7 +664,7 @@ func (p *PostgresStorage) UpdateL1DepositsStatus(ctx context.Context, exitRoot [ deposit etherman.Deposit amount string ) - err = rows.Scan(&deposit.LeafType, &deposit.OriginalNetwork, &deposit.OriginalAddress, &amount, &deposit.DestinationNetwork, &deposit.DestinationAddress, &deposit.DepositCount, &deposit.BlockID, &deposit.NetworkID, &deposit.TxHash, &deposit.Metadata, &deposit.ReadyForClaim) + err = rows.Scan(&deposit.LeafType, &deposit.OriginalTokenNetwork, &deposit.OriginalTokenAddress, &amount, &deposit.DestinationNetwork, &deposit.DestinationAddress, &deposit.DepositCount, &deposit.BlockID, &deposit.OriginNetwork, &deposit.TxHash, &deposit.Metadata, &deposit.ReadyForClaim) if err != nil { return nil, err } diff --git a/db/pgstorage/utils.go b/db/pgstorage/utils.go index 34befc71..e18059cc 100644 --- a/db/pgstorage/utils.go +++ b/db/pgstorage/utils.go @@ -84,11 +84,11 @@ func InitOrReset(cfg Config) error { func NewConfigFromEnv() Config { maxConns, _ := strconv.Atoi(getEnv("ZKEVM_BRIDGE_DATABASE_MAXCONNS", "500")) return Config{ - User: getEnv("ZKEVM_BRIDGE_DATABASE_USER", "test_user"), - Password: getEnv("ZKEVM_BRIDGE_DATABASE_PASSWORD", "test_password"), - Name: getEnv("ZKEVM_BRIDGE_DATABASE_NAME", "test_db"), + User: getEnv("ZKEVM_BRIDGE_DATABASE_USER", "user"), + Password: getEnv("ZKEVM_BRIDGE_DATABASE_PASSWORD", "pass"), + Name: getEnv("ZKEVM_BRIDGE_DATABASE_NAME", "bridge_db_1"), Host: getEnv("ZKEVM_BRIDGE_DATABASE_HOST", "localhost"), - Port: getEnv("ZKEVM_BRIDGE_DATABASE_PORT", "5435"), + Port: getEnv("ZKEVM_BRIDGE_DATABASE_PORT", "5432"), MaxConns: maxConns, } } diff --git a/db/storage_test.go b/db/storage_test.go index 1b9d47a3..2f580b04 100644 --- a/db/storage_test.go +++ b/db/storage_test.go @@ -30,16 +30,16 @@ func TestInsertDeposit(t *testing.T) { }, tx) require.NoError(t, err) deposit := ðerman.Deposit{ - NetworkID: 1, - OriginalNetwork: 4294967295, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 4294967295, - DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), - BlockNumber: 1, - BlockID: 1, - DepositCount: 1, - Metadata: common.FromHex("0x00"), + OriginNetwork: 1, + OriginalTokenNetwork: 4294967295, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 4294967295, + DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), + BlockNumber: 1, + BlockID: 1, + DepositCount: 1, + Metadata: common.FromHex("0x00"), } _, err = pg.AddDeposit(ctx, deposit, tx) require.NoError(t, err) @@ -311,32 +311,32 @@ func TestBSStorage(t *testing.T) { require.NoError(t, err) deposit := ðerman.Deposit{ - NetworkID: 0, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationNetwork: 1, - DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), - BlockNumber: 1, - BlockID: 1, - DepositCount: 1, - Metadata: common.FromHex("0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000005436f696e410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003434f410000000000000000000000000000000000000000000000000000000000"), + OriginNetwork: 0, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationNetwork: 1, + DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), + BlockNumber: 1, + BlockID: 1, + DepositCount: 1, + Metadata: common.FromHex("0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000005436f696e410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003434f410000000000000000000000000000000000000000000000000000000000"), } _, err = pg.AddDeposit(ctx, deposit, tx) require.NoError(t, err) claim := ðerman.Claim{ - Index: 1, - OriginalNetwork: 0, - OriginalAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), - Amount: big.NewInt(1000000), - DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), - BlockID: 1, - BlockNumber: 2, - NetworkID: 0, - TxHash: common.HexToHash("0x29e885edaf8e4b51e1d2e05f9da28161d2fb4f6b1d53827d9b80a23cf2d7d9f2"), - RollupIndex: 1, - MainnetFlag: true, + DepositCount: 1, + OriginalTokenNetwork: 0, + OriginalTokenAddress: common.HexToAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"), + Amount: big.NewInt(1000000), + DestinationAddress: common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), + BlockID: 1, + BlockNumber: 2, + DestinationNetwork: 1, + TxHash: common.HexToHash("0x29e885edaf8e4b51e1d2e05f9da28161d2fb4f6b1d53827d9b80a23cf2d7d9f2"), + RollupIndex: 0, + MainnetFlag: true, } err = pg.AddClaim(ctx, claim, tx) require.NoError(t, err) @@ -365,11 +365,11 @@ func TestBSStorage(t *testing.T) { require.NoError(t, err) require.Equal(t, count, uint64(1)) - rClaim, err := pg.GetClaim(ctx, 1, 0, tx) + rClaim, err := pg.GetClaim(ctx, 1, 0, 1, tx) require.NoError(t, err) require.Equal(t, rClaim.DestinationAddress, claim.DestinationAddress) - require.Equal(t, rClaim.NetworkID, claim.NetworkID) - require.Equal(t, rClaim.Index, claim.Index) + require.Equal(t, rClaim.DestinationNetwork, claim.DestinationNetwork) + require.Equal(t, rClaim.DepositCount, claim.DepositCount) require.Equal(t, rClaim.RollupIndex, claim.RollupIndex) require.Equal(t, rClaim.MainnetFlag, claim.MainnetFlag) @@ -379,7 +379,7 @@ func TestBSStorage(t *testing.T) { wrappedToken := ðerman.TokenWrapped{ OriginalNetwork: 0, - OriginalTokenAddress: deposit.OriginalAddress, + OriginalTokenAddress: deposit.OriginalTokenAddress, WrappedTokenAddress: common.HexToAddress("0x187Bd40226A7073b49163b1f6c2b73d8F2aa8478"), BlockID: 1, BlockNumber: 1, diff --git a/docker-compose.yml b/docker-compose.yml index 1802d13e..e48b20e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,16 @@ version: '3.5' services: - zkevm-state-db: - container_name: zkevm-state-db + +# Shared for all rollups + + zkevm-mock-l1-network: + container_name: zkevm-local-l1-network + image: hermeznetwork/geth-zkevm-contracts:2rollups + ports: + - 8545:8545 + + zkevm-db: + container_name: zkevm-db image: postgres deploy: resources: @@ -12,75 +21,112 @@ services: ports: - 5432:5432 volumes: - - ./test/config/prover/initproverdb.sql:/docker-entrypoint-initdb.d/init.sql + # This script will create the folowing DBs: prover_db_1, pool_db_1, bridge_db_1, prover_db_2 state_db_2, pool_db_2, bridge_db_2 + # It will also create the schema for prover_db_* DBs + - ./test/config/init_dbs.sql:/docker-entrypoint-initdb.d/init.sql environment: - - POSTGRES_USER=state_user - - POSTGRES_PASSWORD=state_password - - POSTGRES_DB=state_db + - POSTGRES_USER=user + - POSTGRES_PASSWORD=pass + - POSTGRES_DB=state_db_1 command: ["postgres", "-N", "500"] - zkevm-pool-db: - container_name: zkevm-pool-db - image: postgres - deploy: - resources: - limits: - memory: 2G - reservations: - memory: 1G - ports: - - 5433:5432 - environment: - - POSTGRES_USER=pool_user - - POSTGRES_PASSWORD=pool_password - - POSTGRES_DB=pool_db - command: ["postgres", "-N", "500"] +# Rollup 1 - zkevm-bridge-db: - container_name: zkevm-bridge-db - image: postgres - deploy: - resources: - limits: - memory: 2G - reservations: - memory: 1G - expose: - - 5435 + zkevm-prover-1: + container_name: zkevm-prover-1 + platform: linux/amd64 + image: hermeznetwork/zkevm-prover:v4.0.14 ports: - - 5435:5432 + - 50061:50061 # MT + - 50071:50071 # Executor + volumes: + - ./test/config/prover/prover-1.json:/usr/src/app/config.json + command: > + zkProver -c /usr/src/app/config.json environment: - - POSTGRES_USER=test_user - - POSTGRES_PASSWORD=test_password - - POSTGRES_DB=test_db - command: ["postgres", "-N", "500"] + EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU: 1 - zkevm-node: - container_name: zkevm-node - image: hermeznetwork/zkevm-node:v0.5.0 + zkevm-node-1: + container_name: zkevm-node-1 + image: hermeznetwork/zkevm-node:v0.5.12 ports: - 8123:8123 - - 61090:61090 + volumes: + - ./test/config/node/sequencer-1.keystore:/pk/keystore.sequencer + - ./test/config/node/aggregator-1.keystore:/pk/keystore.aggregator + - ./test/config/node/zkevm-node-1.toml:/app/config.toml + - ./test/config/node/genesis-1.json:/app/genesis.json + command: + - "/bin/sh" + - "-c" + - "/app/zkevm-node approve --network custom --custom-network-file /app/genesis.json --am 115792089237316195423570985008687907853269984665640564039457584007913129639935 -y --cfg /app/config.toml --key-store-path /pk/keystore.sequencer --password testonly && + /app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,sequence-sender,aggregator,eth-tx-manager,l2gaspricer\" --http.api eth,net,debug,zkevm,txpool,web3" + + zkevm-bridge-service-1: + container_name: zkevm-bridge-service-1 + image: zkevm-bridge-service + ports: + - 8080:8080 + - 9090:9090 + volumes: + - ./test/config/bridge/claimtx.keystore:/pk/keystore.claimtxmanager + - ./test/config/bridge/bridge-1.toml:/app/config.toml + command: + - "/bin/sh" + - "-c" + - "/app/zkevm-bridge run --cfg /app/config.toml" + +# Rollup 2 + + zkevm-prover-2: + container_name: zkevm-prover-2 + platform: linux/amd64 + image: hermeznetwork/zkevm-prover:v4.0.14 + ports: + - 50062:50061 # MT + - 50072:50071 # Executor + volumes: + - ./test/config/prover/prover-2.json:/usr/src/app/config.json + command: > + zkProver -c /usr/src/app/config.json environment: - - ZKEVM_NODE_STATE_DB_HOST=zkevm-state-db - - ZKEVM_NODE_POOL_HOST=zkevm-pool-db - - ZKEVM_NODE_RPC_DB_HOST=zkevm-rpc-db - - ZKEVM_NODE_SEQUENCER_FINALIZER_BATCHMAXDELTATIMESTAMP="4s" - - ZKEVM_NODE_SEQUENCER_FINALIZER_L2BLOCKMAXDELTATIMESTAMP="1s" + EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU: 1 + + zkevm-node-2: + container_name: zkevm-node-2 + image: hermeznetwork/zkevm-node:v0.5.12 + ports: + - 8124:8123 volumes: - - ./test/test.keystore.sequencer:/pk/keystore.sequencer - - ./test/test.keystore.aggregator:/pk/keystore.aggregator - - ./test/config/node/config.zkevm.node.toml:/app/config.toml - - ./test/config/node/genesis.local.json:/app/genesis.json + - ./test/config/node/sequencer-2.keystore:/pk/keystore.sequencer + - ./test/config/node/aggregator-2.keystore:/pk/keystore.aggregator + - ./test/config/node/zkevm-node-2.toml:/app/config.toml + - ./test/config/node/genesis-2.json:/app/genesis.json command: - "/bin/sh" - "-c" - "/app/zkevm-node approve --network custom --custom-network-file /app/genesis.json --am 115792089237316195423570985008687907853269984665640564039457584007913129639935 -y --cfg /app/config.toml --key-store-path /pk/keystore.sequencer --password testonly && /app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,sequence-sender,aggregator,eth-tx-manager,l2gaspricer\" --http.api eth,net,debug,zkevm,txpool,web3" + zkevm-bridge-service-2: + container_name: zkevm-bridge-service-2 + image: zkevm-bridge-service + ports: + - 8081:8080 + - 9091:9090 + volumes: + - ./test/config/bridge/claimtx.keystore:/pk/keystore.claimtxmanager + - ./test/config/bridge/bridge-2.toml:/app/config.toml + command: + - "/bin/sh" + - "-c" + - "/app/zkevm-bridge run --cfg /app/config.toml" + +# V1 to V2 + zkevm-node-v1tov2: container_name: zkevm-node-v1tov2 - image: hermeznetwork/zkevm-node:v0.5.0 + image: hermeznetwork/zkevm-node:v0.5.12 ports: - 8123:8123 - 9091:9091 # needed if metrics enabled @@ -104,7 +150,7 @@ services: zkevm-aggregator-v1tov2: container_name: zkevm-aggregator-v1tov2 - image: hermeznetwork/zkevm-node:v0.5.0 + image: hermeznetwork/zkevm-node:v0.5.12 ports: - 9092:9091 # needed if metrics enabled environment: @@ -125,12 +171,6 @@ services: - "-c" - "/app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"aggregator\"" - zkevm-mock-l1-network: - container_name: zkevm-local-l1-network - image: hermeznetwork/geth-zkevm-contracts:v2.1.1-fork.7-geth1.12.0 - ports: - - 8545:8545 - zkevm-v1tov2-l1-network: container_name: zkevm-v1tov2-l1-network image: hermeznetwork/geth-zkevm-contracts:v2.1.1-lxly-updateV1ToV2-etrog-geth1.12.0 @@ -161,22 +201,9 @@ services: - "full" - "--rpc.allow-unprotected-txs" - zkevm-prover: - container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:v4.0.1 - ports: - - 50051:50051 # Prover - - 50052:50052 # MockProver - - 50061:50061 # MT - - 50071:50071 # Executor - volumes: - - ./test/config/prover/config.prover.json:/usr/src/app/config.json - command: > - zkProver -c /usr/src/app/config.json - zkevm-prover-v1tov2: container_name: zkevm-prover-v1tov2 - image: hermeznetwork/zkevm-prover:v4.0.1 + image: hermeznetwork/zkevm-prover:v4.0.14 environment: - AGGREGATOR_CLIENT_HOST=zkevm-aggregator-v1tov2 ports: @@ -189,26 +216,6 @@ services: command: > zkProver -c /usr/src/app/config.json - zkevm-bridge-service: - container_name: zkevm-bridge-service - image: zkevm-bridge-service - ports: - - 8080:8080 - - 9090:9090 - environment: - - ZKEVM_BRIDGE_DATABASE_USER=test_user - - ZKEVM_BRIDGE_DATABASE_PASSWORD=test_password - - ZKEVM_BRIDGE_DATABASE_NAME=test_db - - ZKEVM_BRIDGE_DATABASE_HOST=zkevm-bridge-db - - ZKEVM_BRIDGE_DATABASE_PORT=5432 - volumes: - - ./test/test.keystore.claimtx:/pk/keystore.claimtxmanager - - ./config/config.local.toml:/app/config.toml - command: - - "/bin/sh" - - "-c" - - "/app/zkevm-bridge run --cfg /app/config.toml" - zkevm-bridge-service-v1tov2: container_name: zkevm-bridge-service-v1tov2 image: zkevm-bridge-service @@ -232,4 +239,4 @@ services: command: - "/bin/sh" - "-c" - - "/app/zkevm-bridge run --cfg /app/config.toml" \ No newline at end of file + - "/app/zkevm-bridge run --cfg /app/config.toml" diff --git a/etherman/etherman.go b/etherman/etherman.go index d2bdda95..974a6a45 100644 --- a/etherman/etherman.go +++ b/etherman/etherman.go @@ -87,6 +87,8 @@ var ( // ErrNotFound is used when the object is not found ErrNotFound = errors.New("Not found") + // ErrTokenNotCreated is used when a token doesn't exist on a given network + ErrTokenNotCreated = errors.New("token does not exist on the network") ) // EventOrder is the the type used to identify the events order @@ -120,16 +122,16 @@ type Client struct { OldPolygonBridge *oldpolygonzkevmbridge.Oldpolygonzkevmbridge PolygonZkEVMGlobalExitRoot *polygonzkevmglobalexitroot.Polygonzkevmglobalexitroot PolygonRollupManager *polygonrollupmanager.Polygonrollupmanager - RollupID uint32 + rollupID uint32 SCAddresses []common.Address } -// NewClient creates a new etherman. -func NewClient(cfg Config, polygonBridgeAddr, polygonZkEVMGlobalExitRootAddress, polygonRollupManagerAddress, polygonZkEvmAddress common.Address) (*Client, error) { +// NewL1Client creates a new etherman. +func NewL1Client(l1URL string, polygonBridgeAddr, polygonZkEVMGlobalExitRootAddress, polygonRollupManagerAddress, polygonZkEvmAddress common.Address) (*Client, error) { // Connect to ethereum node - ethClient, err := ethclient.Dial(cfg.L1URL) + ethClient, err := ethclient.Dial(l1URL) if err != nil { - log.Errorf("error connecting to %s: %+v", cfg.L1URL, err) + log.Errorf("error connecting to %s: %+v", l1URL, err) return nil, err } // Create smc clients @@ -149,12 +151,6 @@ func NewClient(cfg Config, polygonBridgeAddr, polygonZkEVMGlobalExitRootAddress, if err != nil { return nil, err } - // Get RollupID - rollupID, err := polygonRollupManager.RollupAddressToID(&bind.CallOpts{Pending: false}, polygonZkEvmAddress) - if err != nil { - return nil, err - } - log.Debug("rollupID: ", rollupID) var scAddresses []common.Address scAddresses = append(scAddresses, polygonZkEVMGlobalExitRootAddress, polygonBridgeAddr, polygonRollupManagerAddress) @@ -164,7 +160,7 @@ func NewClient(cfg Config, polygonBridgeAddr, polygonZkEVMGlobalExitRootAddress, OldPolygonBridge: oldpolygonBridge, PolygonZkEVMGlobalExitRoot: polygonZkEVMGlobalExitRoot, PolygonRollupManager: polygonRollupManager, - RollupID: rollupID, + rollupID: 0, SCAddresses: scAddresses}, nil } @@ -187,7 +183,18 @@ func NewL2Client(url string, polygonBridgeAddr common.Address) (*Client, error) } scAddresses := []common.Address{polygonBridgeAddr} - return &Client{EtherClient: ethClient, PolygonBridge: bridge, OldPolygonBridge: oldpolygonBridge, SCAddresses: scAddresses}, nil + rollupID, err := bridge.NetworkID(&bind.CallOpts{Pending: false}) + if err != nil { + return nil, err + } + + return &Client{ + EtherClient: ethClient, + PolygonBridge: bridge, + OldPolygonBridge: oldpolygonBridge, + SCAddresses: scAddresses, + rollupID: rollupID, + }, nil } // GetRollupInfoByBlockRange function retrieves the Rollup information that are included in all this ethereum blocks @@ -418,22 +425,24 @@ func (etherMan *Client) processUpdateGlobalExitRootEvent(ctx context.Context, ma } func (etherMan *Client) depositEvent(ctx context.Context, vLog types.Log, blocks *[]Block, blocksOrder *map[common.Hash][]Order) error { - log.Debug("Deposit event detected. Processing...") + log.Debugf("Deposit event detected. From RollupID %d Processing...", etherMan.GetRollupID()) d, err := etherMan.PolygonBridge.ParseBridgeEvent(vLog) if err != nil { return err } - var deposit Deposit - deposit.Amount = d.Amount - deposit.BlockNumber = vLog.BlockNumber - deposit.OriginalNetwork = uint(d.OriginNetwork) - deposit.DestinationAddress = d.DestinationAddress - deposit.DestinationNetwork = uint(d.DestinationNetwork) - deposit.OriginalAddress = d.OriginAddress - deposit.DepositCount = uint(d.DepositCount) - deposit.TxHash = vLog.TxHash - deposit.Metadata = d.Metadata - deposit.LeafType = d.LeafType + deposit := Deposit{ + Amount: d.Amount, + BlockNumber: vLog.BlockNumber, + OriginalTokenNetwork: uint(d.OriginNetwork), + DestinationAddress: d.DestinationAddress, + DestinationNetwork: uint(d.DestinationNetwork), + OriginalTokenAddress: d.OriginAddress, + DepositCount: uint(d.DepositCount), + TxHash: vLog.TxHash, + Metadata: d.Metadata, + LeafType: d.LeafType, + OriginNetwork: etherMan.GetRollupID(), + } if len(*blocks) == 0 || ((*blocks)[len(*blocks)-1].BlockHash != vLog.BlockHash || (*blocks)[len(*blocks)-1].BlockNumber != vLog.BlockNumber) { fullBlock, err := etherMan.EtherClient.BlockByHash(ctx, vLog.BlockHash) @@ -472,7 +481,7 @@ func (etherMan *Client) newClaimEvent(ctx context.Context, vLog types.Log, block if err != nil { return err } - mainnetFlag, rollupIndex, localExitRootIndex, err := decodeGlobalIndex(c.GlobalIndex) + mainnetFlag, rollupIndex, localExitRootIndex, err := DecodeGlobalIndex(c.GlobalIndex) if err != nil { return err } @@ -483,9 +492,9 @@ func (etherMan *Client) claimEvent(ctx context.Context, vLog types.Log, blocks * var claim Claim claim.Amount = amount claim.DestinationAddress = destinationAddress - claim.Index = Index - claim.OriginalNetwork = originNetwork - claim.OriginalAddress = originAddress + claim.DepositCount = Index + claim.OriginalTokenNetwork = originNetwork + claim.OriginalTokenAddress = originAddress claim.BlockNumber = vLog.BlockNumber claim.TxHash = vLog.TxHash claim.RollupIndex = rollupIndex @@ -584,15 +593,6 @@ func (etherMan *Client) EthBlockByNumber(ctx context.Context, blockNumber uint64 return block, nil } -// GetNetworkID gets the network ID of the dedicated chain. -func (etherMan *Client) GetNetworkID(ctx context.Context) (uint, error) { - networkID, err := etherMan.PolygonBridge.NetworkID(&bind.CallOpts{Pending: false}) - if err != nil { - return 0, err - } - return uint(networkID), nil -} - func (etherMan *Client) verifyBatchesTrustedAggregatorEvent(ctx context.Context, vLog types.Log, blocks *[]Block, blocksOrder *map[common.Hash][]Order) error { log.Debug("VerifyBatchesTrustedAggregator event detected. Processing...") vb, err := etherMan.PolygonRollupManager.ParseVerifyBatchesTrustedAggregator(vLog) @@ -645,11 +645,13 @@ func (etherMan *Client) verifyBatches(ctx context.Context, vLog types.Log, block return nil } +// GetRollupID returns the ID of the rollup that this etherman is connected to through the RPC. +// So this will return 0 in case is the etherman for L1 func (etherMan *Client) GetRollupID() uint { - return uint(etherMan.RollupID) + return uint(etherMan.rollupID) } -func decodeGlobalIndex(globalIndex *big.Int) (bool, uint64, uint64, error) { +func DecodeGlobalIndex(globalIndex *big.Int) (bool, uint64, uint64, error) { const lengthGlobalIndexInBytes = 32 var buf [32]byte gIBytes := globalIndex.FillBytes(buf[:]) @@ -686,7 +688,9 @@ func (etherMan *Client) createNewRollupEvent(ctx context.Context, vLog types.Log if err != nil { return err } - if rollup.RollupID != etherMan.RollupID { + // TODO: this is broken. Should have an array of rollup IDs that the bridge service cares about + // as GetRollupID will always return 0 in this case. Leaving it as it is since this event is basically ignored + if rollup.RollupID != uint32(etherMan.GetRollupID()) { return nil } @@ -718,7 +722,9 @@ func (etherMan *Client) AddExistingRollupEvent(ctx context.Context, vLog types.L if err != nil { return err } - if rollup.RollupID != etherMan.RollupID { + // TODO: this is broken. Should have an array of rollup IDs that the bridge service cares about + // as GetRollupID will always return 0 in this case. Leaving it as it is since this event is basically ignored + if rollup.RollupID != uint32(etherMan.GetRollupID()) { return nil } @@ -743,3 +749,27 @@ func (etherMan *Client) AddExistingRollupEvent(ctx context.Context, vLog types.L (*blocksOrder)[(*blocks)[len(*blocks)-1].BlockHash] = append((*blocksOrder)[(*blocks)[len(*blocks)-1].BlockHash], or) return nil } + +// GasTokenAddress returns the token used to pay gas of the network +func (etherMan *Client) GasTokenAddress() (common.Address, error) { + return etherMan.PolygonBridge.GasTokenAddress(nil) +} + +// WETHToken returns the address were ETH is mapped as an ERC20 when the network +// doesn't use ETH as native token +func (etherMan *Client) WETHToken() (common.Address, error) { + return etherMan.PolygonBridge.WETHToken(nil) +} + +// GetTokenWrappedAddress return the address of a token from another network in this network +func (etherMan *Client) GetTokenWrappedAddress(originNetwork uint32, originTokenAddr common.Address) (common.Address, error) { + addr, err := etherMan.PolygonBridge.GetTokenWrappedAddress(nil, originNetwork, originTokenAddr) + if err != nil { + return addr, err + } + zeroAddr := common.Address{} + if addr == zeroAddr { + return addr, ErrTokenNotCreated + } + return addr, err +} diff --git a/etherman/etherman_test.go b/etherman/etherman_test.go index 23d94a51..26247106 100644 --- a/etherman/etherman_test.go +++ b/etherman/etherman_test.go @@ -123,12 +123,12 @@ func TestBridgeEvents(t *testing.T) { assert.Equal(t, ClaimsOrder, order[block[0].BlockHash][1].Name) assert.Equal(t, big.NewInt(1000000000000000000), block[0].Claims[0].Amount) assert.Equal(t, uint64(5), block[0].BlockNumber) - assert.NotEqual(t, common.Address{}, block[0].Claims[0].OriginalAddress) + assert.NotEqual(t, common.Address{}, block[0].Claims[0].OriginalTokenAddress) assert.Equal(t, auth.From, block[0].Claims[0].DestinationAddress) - assert.Equal(t, uint(34), block[0].Claims[0].Index) + assert.Equal(t, uint(34), block[0].Claims[0].DepositCount) assert.Equal(t, uint64(0), block[0].Claims[0].RollupIndex) assert.Equal(t, true, block[0].Claims[0].MainnetFlag) - assert.Equal(t, uint(0), block[0].Claims[0].OriginalNetwork) + assert.Equal(t, uint(0), block[0].Claims[0].OriginalTokenNetwork) assert.Equal(t, uint64(5), block[0].Claims[0].BlockNumber) } @@ -140,7 +140,7 @@ func TestDecodeGlobalIndex(t *testing.T) { for _, n := range gi { t.Logf("%08b ", n) } - mainnetFlag, rollupIndex, localExitRootIndex, err := decodeGlobalIndex(globalIndex) + mainnetFlag, rollupIndex, localExitRootIndex, err := DecodeGlobalIndex(globalIndex) require.NoError(t, err) assert.Equal(t, false, mainnetFlag) assert.Equal(t, uint64(1), rollupIndex) @@ -152,7 +152,7 @@ func TestDecodeGlobalIndex(t *testing.T) { for _, n := range gi { t.Logf("%08b ", n) } - mainnetFlag, rollupIndex, localExitRootIndex, err = decodeGlobalIndex(globalIndex) + mainnetFlag, rollupIndex, localExitRootIndex, err = DecodeGlobalIndex(globalIndex) require.NoError(t, err) assert.Equal(t, false, mainnetFlag) assert.Equal(t, uint64(2), rollupIndex) @@ -164,7 +164,7 @@ func TestDecodeGlobalIndex(t *testing.T) { for _, n := range gi { t.Logf("%08b ", n) } - mainnetFlag, rollupIndex, localExitRootIndex, err = decodeGlobalIndex(globalIndex) + mainnetFlag, rollupIndex, localExitRootIndex, err = DecodeGlobalIndex(globalIndex) require.NoError(t, err) assert.Equal(t, true, mainnetFlag) assert.Equal(t, uint64(0), rollupIndex) @@ -176,7 +176,7 @@ func TestDecodeGlobalIndex(t *testing.T) { for _, n := range gi { t.Logf("%08b ", n) } - mainnetFlag, rollupIndex, localExitRootIndex, err = decodeGlobalIndex(globalIndex) + mainnetFlag, rollupIndex, localExitRootIndex, err = DecodeGlobalIndex(globalIndex) require.NoError(t, err) assert.Equal(t, true, mainnetFlag) assert.Equal(t, uint64(0), rollupIndex) diff --git a/etherman/types.go b/etherman/types.go index 57d146ce..fa3ea831 100644 --- a/etherman/types.go +++ b/etherman/types.go @@ -33,35 +33,43 @@ type GlobalExitRoot struct { // Deposit struct type Deposit struct { - LeafType uint8 - OriginalNetwork uint - OriginalAddress common.Address - Amount *big.Int - DestinationNetwork uint - DestinationAddress common.Address - DepositCount uint - BlockID uint64 - BlockNumber uint64 - NetworkID uint - TxHash common.Hash - Metadata []byte + LeafType uint8 + OriginalTokenNetwork uint + OriginalTokenAddress common.Address + Amount *big.Int + DestinationNetwork uint + DestinationAddress common.Address + DepositCount uint + BlockID uint64 + BlockNumber uint64 + OriginNetwork uint + TxHash common.Hash + Metadata []byte // it is only used for the bridge service ReadyForClaim bool } // Claim struct type Claim struct { - MainnetFlag bool - RollupIndex uint64 - Index uint - OriginalNetwork uint - OriginalAddress common.Address - Amount *big.Int - DestinationAddress common.Address - BlockID uint64 - BlockNumber uint64 - NetworkID uint - TxHash common.Hash + MainnetFlag bool + RollupIndex uint64 + DepositCount uint + OriginalTokenNetwork uint + OriginalTokenAddress common.Address + Amount *big.Int + DestinationAddress common.Address + BlockID uint64 + BlockNumber uint64 + DestinationNetwork uint + TxHash common.Hash +} + +// OriginNetwork returns the rollup ID of the claim +func (c *Claim) OriginNetwork() uint { + if c.MainnetFlag { + return 0 + } + return uint(c.RollupIndex + 1) } // TokenWrapped struct diff --git a/server/interfaces.go b/server/interfaces.go index c32c7928..75f3347a 100644 --- a/server/interfaces.go +++ b/server/interfaces.go @@ -13,7 +13,7 @@ type bridgeServiceStorage interface { GetRoot(ctx context.Context, depositCnt uint, network uint, dbTx pgx.Tx) ([]byte, error) GetDepositCountByRoot(ctx context.Context, root []byte, network uint8, dbTx pgx.Tx) (uint, error) GetLatestExitRoot(ctx context.Context, isRollup bool, dbTx pgx.Tx) (*etherman.GlobalExitRoot, error) - GetClaim(ctx context.Context, index uint, networkID uint, dbTx pgx.Tx) (*etherman.Claim, error) + GetClaim(ctx context.Context, index uint, originNetworkID, destNetworkID uint, dbTx pgx.Tx) (*etherman.Claim, error) GetClaims(ctx context.Context, destAddr string, limit uint, offset uint, dbTx pgx.Tx) ([]*etherman.Claim, error) GetClaimCount(ctx context.Context, destAddr string, dbTx pgx.Tx) (uint64, error) GetDeposit(ctx context.Context, depositCnt uint, networkID uint, dbTx pgx.Tx) (*etherman.Deposit, error) diff --git a/server/service.go b/server/service.go index 9b9bb1a9..bbe4be68 100644 --- a/server/service.go +++ b/server/service.go @@ -211,12 +211,12 @@ func emptyProof() [][bridgectrl.KeyLen]byte { } // GetDepositStatus returns deposit with ready_for_claim status. -func (s *bridgeService) GetDepositStatus(ctx context.Context, depositCount uint, destNetworkID uint) (string, error) { +func (s *bridgeService) GetDepositStatus(ctx context.Context, depositCount uint, originNetworkID, destNetworkID uint) (string, error) { var ( claimTxHash string ) // Get the claim tx hash - claim, err := s.storage.GetClaim(ctx, depositCount, destNetworkID, nil) + claim, err := s.storage.GetClaim(ctx, depositCount, originNetworkID, destNetworkID, nil) if err != nil { if err != gerror.ErrStorageNotFound { return "", err @@ -256,24 +256,24 @@ func (s *bridgeService) GetBridges(ctx context.Context, req *pb.GetBridgesReques var pbDeposits []*pb.Deposit for _, deposit := range deposits { - claimTxHash, err := s.GetDepositStatus(ctx, deposit.DepositCount, deposit.DestinationNetwork) + claimTxHash, err := s.GetDepositStatus(ctx, deposit.DepositCount, deposit.OriginNetwork, deposit.DestinationNetwork) if err != nil { return nil, err } - mainnetFlag := deposit.NetworkID == 0 + mainnetFlag := deposit.OriginNetwork == 0 rollupIndex := s.rollupID - 1 localExitRootIndex := deposit.DepositCount pbDeposits = append( pbDeposits, &pb.Deposit{ LeafType: uint32(deposit.LeafType), - OrigNet: uint32(deposit.OriginalNetwork), - OrigAddr: deposit.OriginalAddress.Hex(), + OrigNet: uint32(deposit.OriginalTokenNetwork), + OrigAddr: deposit.OriginalTokenAddress.Hex(), Amount: deposit.Amount.String(), DestNet: uint32(deposit.DestinationNetwork), DestAddr: deposit.DestinationAddress.Hex(), BlockNum: deposit.BlockNumber, DepositCnt: uint64(deposit.DepositCount), - NetworkId: uint32(deposit.NetworkID), + NetworkId: uint32(deposit.OriginNetwork), TxHash: deposit.TxHash.String(), ClaimTxHash: claimTxHash, Metadata: "0x" + hex.EncodeToString(deposit.Metadata), @@ -311,11 +311,11 @@ func (s *bridgeService) GetClaims(ctx context.Context, req *pb.GetClaimsRequest) var pbClaims []*pb.Claim for _, claim := range claims { pbClaims = append(pbClaims, &pb.Claim{ - Index: uint64(claim.Index), - OrigNet: uint32(claim.OriginalNetwork), - OrigAddr: claim.OriginalAddress.Hex(), + Index: uint64(claim.DepositCount), + OrigNet: uint32(claim.OriginalTokenNetwork), + OrigAddr: claim.OriginalTokenAddress.Hex(), Amount: claim.Amount.String(), - NetworkId: uint32(claim.NetworkID), + NetworkId: uint32(claim.DestinationNetwork), DestAddr: claim.DestinationAddress.Hex(), BlockNum: claim.BlockNumber, TxHash: claim.TxHash.String(), @@ -367,7 +367,7 @@ func (s *bridgeService) GetBridge(ctx context.Context, req *pb.GetBridgeRequest) return nil, err } - claimTxHash, err := s.GetDepositStatus(ctx, uint(req.DepositCnt), deposit.DestinationNetwork) + claimTxHash, err := s.GetDepositStatus(ctx, uint(req.DepositCnt), deposit.OriginNetwork, deposit.DestinationNetwork) if err != nil { return nil, err } @@ -375,14 +375,14 @@ func (s *bridgeService) GetBridge(ctx context.Context, req *pb.GetBridgeRequest) return &pb.GetBridgeResponse{ Deposit: &pb.Deposit{ LeafType: uint32(deposit.LeafType), - OrigNet: uint32(deposit.OriginalNetwork), - OrigAddr: deposit.OriginalAddress.Hex(), + OrigNet: uint32(deposit.OriginalTokenNetwork), + OrigAddr: deposit.OriginalTokenAddress.Hex(), Amount: deposit.Amount.String(), DestNet: uint32(deposit.DestinationNetwork), DestAddr: deposit.DestinationAddress.Hex(), BlockNum: deposit.BlockNumber, DepositCnt: uint64(deposit.DepositCount), - NetworkId: uint32(deposit.NetworkID), + NetworkId: uint32(deposit.OriginNetwork), TxHash: deposit.TxHash.String(), ClaimTxHash: claimTxHash, Metadata: "0x" + hex.EncodeToString(deposit.Metadata), diff --git a/synchronizer/interfaces.go b/synchronizer/interfaces.go index 77bf7e51..87390562 100644 --- a/synchronizer/interfaces.go +++ b/synchronizer/interfaces.go @@ -16,7 +16,6 @@ type ethermanInterface interface { HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error) - GetNetworkID(ctx context.Context) (uint, error) GetRollupID() uint } diff --git a/synchronizer/mock_bridgectrl.go b/synchronizer/mock_bridgectrl.go index f7c1e9d1..cd7dff6e 100644 --- a/synchronizer/mock_bridgectrl.go +++ b/synchronizer/mock_bridgectrl.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.39.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package synchronizer @@ -20,10 +20,6 @@ type bridgectrlMock struct { func (_m *bridgectrlMock) AddDeposit(ctx context.Context, deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error { ret := _m.Called(ctx, deposit, depositID, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddDeposit") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.Deposit, uint64, pgx.Tx) error); ok { r0 = rf(ctx, deposit, depositID, dbTx) @@ -38,10 +34,6 @@ func (_m *bridgectrlMock) AddDeposit(ctx context.Context, deposit *etherman.Depo func (_m *bridgectrlMock) AddRollupExitLeaf(ctx context.Context, rollupLeaf etherman.RollupExitLeaf, dbTx pgx.Tx) error { ret := _m.Called(ctx, rollupLeaf, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddRollupExitLeaf") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, etherman.RollupExitLeaf, pgx.Tx) error); ok { r0 = rf(ctx, rollupLeaf, dbTx) @@ -56,10 +48,6 @@ func (_m *bridgectrlMock) AddRollupExitLeaf(ctx context.Context, rollupLeaf ethe func (_m *bridgectrlMock) GetNetworkID(networkID uint) (uint8, error) { ret := _m.Called(networkID) - if len(ret) == 0 { - panic("no return value specified for GetNetworkID") - } - var r0 uint8 var r1 error if rf, ok := ret.Get(0).(func(uint) (uint8, error)); ok { @@ -84,10 +72,6 @@ func (_m *bridgectrlMock) GetNetworkID(networkID uint) (uint8, error) { func (_m *bridgectrlMock) ReorgMT(ctx context.Context, depositCount uint, networkID uint, dbTx pgx.Tx) error { ret := _m.Called(ctx, depositCount, networkID, dbTx) - if len(ret) == 0 { - panic("no return value specified for ReorgMT") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, uint, uint, pgx.Tx) error); ok { r0 = rf(ctx, depositCount, networkID, dbTx) diff --git a/synchronizer/mock_dbtx.go b/synchronizer/mock_dbtx.go index e3a48a61..6ccb4c99 100644 --- a/synchronizer/mock_dbtx.go +++ b/synchronizer/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.39.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package synchronizer @@ -20,10 +20,6 @@ type dbTxMock struct { func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) - if len(ret) == 0 { - panic("no return value specified for Begin") - } - var r0 pgx.Tx var r1 error if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { @@ -50,10 +46,6 @@ func (_m *dbTxMock) Begin(ctx context.Context) (pgx.Tx, error) { func (_m *dbTxMock) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error { ret := _m.Called(ctx, f) - if len(ret) == 0 { - panic("no return value specified for BeginFunc") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, func(pgx.Tx) error) error); ok { r0 = rf(ctx, f) @@ -68,10 +60,6 @@ func (_m *dbTxMock) BeginFunc(ctx context.Context, f func(pgx.Tx) error) error { func (_m *dbTxMock) Commit(ctx context.Context) error { ret := _m.Called(ctx) - if len(ret) == 0 { - panic("no return value specified for Commit") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(ctx) @@ -86,10 +74,6 @@ func (_m *dbTxMock) Commit(ctx context.Context) error { func (_m *dbTxMock) Conn() *pgx.Conn { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for Conn") - } - var r0 *pgx.Conn if rf, ok := ret.Get(0).(func() *pgx.Conn); ok { r0 = rf() @@ -106,10 +90,6 @@ func (_m *dbTxMock) Conn() *pgx.Conn { func (_m *dbTxMock) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error) { ret := _m.Called(ctx, tableName, columnNames, rowSrc) - if len(ret) == 0 { - panic("no return value specified for CopyFrom") - } - var r0 int64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, pgx.Identifier, []string, pgx.CopyFromSource) (int64, error)); ok { @@ -137,10 +117,6 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface _ca = append(_ca, arguments...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Exec") - } - var r0 pgconn.CommandTag var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgconn.CommandTag, error)); ok { @@ -167,10 +143,6 @@ func (_m *dbTxMock) Exec(ctx context.Context, sql string, arguments ...interface func (_m *dbTxMock) LargeObjects() pgx.LargeObjects { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for LargeObjects") - } - var r0 pgx.LargeObjects if rf, ok := ret.Get(0).(func() pgx.LargeObjects); ok { r0 = rf() @@ -185,10 +157,6 @@ func (_m *dbTxMock) LargeObjects() pgx.LargeObjects { func (_m *dbTxMock) Prepare(ctx context.Context, name string, sql string) (*pgconn.StatementDescription, error) { ret := _m.Called(ctx, name, sql) - if len(ret) == 0 { - panic("no return value specified for Prepare") - } - var r0 *pgconn.StatementDescription var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string) (*pgconn.StatementDescription, error)); ok { @@ -218,10 +186,6 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) _ca = append(_ca, args...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for Query") - } - var r0 pgx.Rows var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) (pgx.Rows, error)); ok { @@ -248,10 +212,6 @@ func (_m *dbTxMock) Query(ctx context.Context, sql string, args ...interface{}) func (_m *dbTxMock) QueryFunc(ctx context.Context, sql string, args []interface{}, scans []interface{}, f func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error) { ret := _m.Called(ctx, sql, args, scans, f) - if len(ret) == 0 { - panic("no return value specified for QueryFunc") - } - var r0 pgconn.CommandTag var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, []interface{}, []interface{}, func(pgx.QueryFuncRow) error) (pgconn.CommandTag, error)); ok { @@ -281,10 +241,6 @@ func (_m *dbTxMock) QueryRow(ctx context.Context, sql string, args ...interface{ _ca = append(_ca, args...) ret := _m.Called(_ca...) - if len(ret) == 0 { - panic("no return value specified for QueryRow") - } - var r0 pgx.Row if rf, ok := ret.Get(0).(func(context.Context, string, ...interface{}) pgx.Row); ok { r0 = rf(ctx, sql, args...) @@ -301,10 +257,6 @@ func (_m *dbTxMock) QueryRow(ctx context.Context, sql string, args ...interface{ func (_m *dbTxMock) Rollback(ctx context.Context) error { ret := _m.Called(ctx) - if len(ret) == 0 { - panic("no return value specified for Rollback") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(ctx) @@ -319,10 +271,6 @@ func (_m *dbTxMock) Rollback(ctx context.Context) error { func (_m *dbTxMock) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults { ret := _m.Called(ctx, b) - if len(ret) == 0 { - panic("no return value specified for SendBatch") - } - var r0 pgx.BatchResults if rf, ok := ret.Get(0).(func(context.Context, *pgx.Batch) pgx.BatchResults); ok { r0 = rf(ctx, b) diff --git a/synchronizer/mock_etherman.go b/synchronizer/mock_etherman.go index 74ced374..4b8c80ff 100644 --- a/synchronizer/mock_etherman.go +++ b/synchronizer/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.39.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package synchronizer @@ -24,10 +24,6 @@ type ethermanMock struct { func (_m *ethermanMock) EthBlockByNumber(ctx context.Context, blockNumber uint64) (*types.Block, error) { ret := _m.Called(ctx, blockNumber) - if len(ret) == 0 { - panic("no return value specified for EthBlockByNumber") - } - var r0 *types.Block var r1 error if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Block, error)); ok { @@ -50,42 +46,10 @@ func (_m *ethermanMock) EthBlockByNumber(ctx context.Context, blockNumber uint64 return r0, r1 } -// GetNetworkID provides a mock function with given fields: ctx -func (_m *ethermanMock) GetNetworkID(ctx context.Context) (uint, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for GetNetworkID") - } - - var r0 uint - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (uint, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) uint); ok { - r0 = rf(ctx) - } else { - r0 = ret.Get(0).(uint) - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetRollupID provides a mock function with given fields: func (_m *ethermanMock) GetRollupID() uint { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetRollupID") - } - var r0 uint if rf, ok := ret.Get(0).(func() uint); ok { r0 = rf() @@ -100,10 +64,6 @@ func (_m *ethermanMock) GetRollupID() uint { func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error) { ret := _m.Called(ctx, fromBlock, toBlock) - if len(ret) == 0 { - panic("no return value specified for GetRollupInfoByBlockRange") - } - var r0 []etherman.Block var r1 map[common.Hash][]etherman.Order var r2 error @@ -139,10 +99,6 @@ func (_m *ethermanMock) GetRollupInfoByBlockRange(ctx context.Context, fromBlock func (_m *ethermanMock) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { ret := _m.Called(ctx, number) - if len(ret) == 0 { - panic("no return value specified for HeaderByNumber") - } - var r0 *types.Header var r1 error if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok { diff --git a/synchronizer/mock_storage.go b/synchronizer/mock_storage.go index 4379727f..ea9574de 100644 --- a/synchronizer/mock_storage.go +++ b/synchronizer/mock_storage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.39.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package synchronizer @@ -20,10 +20,6 @@ type storageMock struct { func (_m *storageMock) AddBlock(ctx context.Context, block *etherman.Block, dbTx pgx.Tx) (uint64, error) { ret := _m.Called(ctx, block, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddBlock") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.Block, pgx.Tx) (uint64, error)); ok { @@ -48,10 +44,6 @@ func (_m *storageMock) AddBlock(ctx context.Context, block *etherman.Block, dbTx func (_m *storageMock) AddClaim(ctx context.Context, claim *etherman.Claim, dbTx pgx.Tx) error { ret := _m.Called(ctx, claim, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddClaim") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.Claim, pgx.Tx) error); ok { r0 = rf(ctx, claim, dbTx) @@ -66,10 +58,6 @@ func (_m *storageMock) AddClaim(ctx context.Context, claim *etherman.Claim, dbTx func (_m *storageMock) AddDeposit(ctx context.Context, deposit *etherman.Deposit, dbTx pgx.Tx) (uint64, error) { ret := _m.Called(ctx, deposit, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddDeposit") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.Deposit, pgx.Tx) (uint64, error)); ok { @@ -94,10 +82,6 @@ func (_m *storageMock) AddDeposit(ctx context.Context, deposit *etherman.Deposit func (_m *storageMock) AddGlobalExitRoot(ctx context.Context, exitRoot *etherman.GlobalExitRoot, dbTx pgx.Tx) error { ret := _m.Called(ctx, exitRoot, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddGlobalExitRoot") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.GlobalExitRoot, pgx.Tx) error); ok { r0 = rf(ctx, exitRoot, dbTx) @@ -112,10 +96,6 @@ func (_m *storageMock) AddGlobalExitRoot(ctx context.Context, exitRoot *etherman func (_m *storageMock) AddTokenWrapped(ctx context.Context, tokenWrapped *etherman.TokenWrapped, dbTx pgx.Tx) error { ret := _m.Called(ctx, tokenWrapped, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddTokenWrapped") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.TokenWrapped, pgx.Tx) error); ok { r0 = rf(ctx, tokenWrapped, dbTx) @@ -130,10 +110,6 @@ func (_m *storageMock) AddTokenWrapped(ctx context.Context, tokenWrapped *etherm func (_m *storageMock) AddTrustedGlobalExitRoot(ctx context.Context, trustedExitRoot *etherman.GlobalExitRoot, dbTx pgx.Tx) (bool, error) { ret := _m.Called(ctx, trustedExitRoot, dbTx) - if len(ret) == 0 { - panic("no return value specified for AddTrustedGlobalExitRoot") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(context.Context, *etherman.GlobalExitRoot, pgx.Tx) (bool, error)); ok { @@ -158,10 +134,6 @@ func (_m *storageMock) AddTrustedGlobalExitRoot(ctx context.Context, trustedExit func (_m *storageMock) BeginDBTransaction(ctx context.Context) (pgx.Tx, error) { ret := _m.Called(ctx) - if len(ret) == 0 { - panic("no return value specified for BeginDBTransaction") - } - var r0 pgx.Tx var r1 error if rf, ok := ret.Get(0).(func(context.Context) (pgx.Tx, error)); ok { @@ -188,10 +160,6 @@ func (_m *storageMock) BeginDBTransaction(ctx context.Context) (pgx.Tx, error) { func (_m *storageMock) CheckIfRootExists(ctx context.Context, root []byte, network uint8, dbTx pgx.Tx) (bool, error) { ret := _m.Called(ctx, root, network, dbTx) - if len(ret) == 0 { - panic("no return value specified for CheckIfRootExists") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(context.Context, []byte, uint8, pgx.Tx) (bool, error)); ok { @@ -216,10 +184,6 @@ func (_m *storageMock) CheckIfRootExists(ctx context.Context, root []byte, netwo func (_m *storageMock) Commit(ctx context.Context, dbTx pgx.Tx) error { ret := _m.Called(ctx, dbTx) - if len(ret) == 0 { - panic("no return value specified for Commit") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) error); ok { r0 = rf(ctx, dbTx) @@ -234,10 +198,6 @@ func (_m *storageMock) Commit(ctx context.Context, dbTx pgx.Tx) error { func (_m *storageMock) GetLastBlock(ctx context.Context, networkID uint, dbTx pgx.Tx) (*etherman.Block, error) { ret := _m.Called(ctx, networkID, dbTx) - if len(ret) == 0 { - panic("no return value specified for GetLastBlock") - } - var r0 *etherman.Block var r1 error if rf, ok := ret.Get(0).(func(context.Context, uint, pgx.Tx) (*etherman.Block, error)); ok { @@ -264,10 +224,6 @@ func (_m *storageMock) GetLastBlock(ctx context.Context, networkID uint, dbTx pg func (_m *storageMock) GetLatestL1SyncedExitRoot(ctx context.Context, dbTx pgx.Tx) (*etherman.GlobalExitRoot, error) { ret := _m.Called(ctx, dbTx) - if len(ret) == 0 { - panic("no return value specified for GetLatestL1SyncedExitRoot") - } - var r0 *etherman.GlobalExitRoot var r1 error if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (*etherman.GlobalExitRoot, error)); ok { @@ -294,10 +250,6 @@ func (_m *storageMock) GetLatestL1SyncedExitRoot(ctx context.Context, dbTx pgx.T func (_m *storageMock) GetNumberDeposits(ctx context.Context, origNetworkID uint, blockNumber uint64, dbTx pgx.Tx) (uint64, error) { ret := _m.Called(ctx, origNetworkID, blockNumber, dbTx) - if len(ret) == 0 { - panic("no return value specified for GetNumberDeposits") - } - var r0 uint64 var r1 error if rf, ok := ret.Get(0).(func(context.Context, uint, uint64, pgx.Tx) (uint64, error)); ok { @@ -322,10 +274,6 @@ func (_m *storageMock) GetNumberDeposits(ctx context.Context, origNetworkID uint func (_m *storageMock) GetPreviousBlock(ctx context.Context, networkID uint, offset uint64, dbTx pgx.Tx) (*etherman.Block, error) { ret := _m.Called(ctx, networkID, offset, dbTx) - if len(ret) == 0 { - panic("no return value specified for GetPreviousBlock") - } - var r0 *etherman.Block var r1 error if rf, ok := ret.Get(0).(func(context.Context, uint, uint64, pgx.Tx) (*etherman.Block, error)); ok { @@ -352,10 +300,6 @@ func (_m *storageMock) GetPreviousBlock(ctx context.Context, networkID uint, off func (_m *storageMock) IsLxLyActivated(ctx context.Context, dbTx pgx.Tx) (bool, error) { ret := _m.Called(ctx, dbTx) - if len(ret) == 0 { - panic("no return value specified for IsLxLyActivated") - } - var r0 bool var r1 error if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) (bool, error)); ok { @@ -380,10 +324,6 @@ func (_m *storageMock) IsLxLyActivated(ctx context.Context, dbTx pgx.Tx) (bool, func (_m *storageMock) Reset(ctx context.Context, blockNumber uint64, networkID uint, dbTx pgx.Tx) error { ret := _m.Called(ctx, blockNumber, networkID, dbTx) - if len(ret) == 0 { - panic("no return value specified for Reset") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, uint64, uint, pgx.Tx) error); ok { r0 = rf(ctx, blockNumber, networkID, dbTx) @@ -398,10 +338,6 @@ func (_m *storageMock) Reset(ctx context.Context, blockNumber uint64, networkID func (_m *storageMock) Rollback(ctx context.Context, dbTx pgx.Tx) error { ret := _m.Called(ctx, dbTx) - if len(ret) == 0 { - panic("no return value specified for Rollback") - } - var r0 error if rf, ok := ret.Get(0).(func(context.Context, pgx.Tx) error); ok { r0 = rf(ctx, dbTx) diff --git a/synchronizer/mock_zkevmclient.go b/synchronizer/mock_zkevmclient.go index fb943353..ae841164 100644 --- a/synchronizer/mock_zkevmclient.go +++ b/synchronizer/mock_zkevmclient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.39.0. DO NOT EDIT. +// Code generated by mockery v2.32.0. DO NOT EDIT. package synchronizer @@ -21,10 +21,6 @@ type zkEVMClientMock struct { func (_m *zkEVMClientMock) ExitRootsByGER(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error) { ret := _m.Called(ctx, globalExitRoot) - if len(ret) == 0 { - panic("no return value specified for ExitRootsByGER") - } - var r0 *types.ExitRoots var r1 error if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.ExitRoots, error)); ok { @@ -51,10 +47,6 @@ func (_m *zkEVMClientMock) ExitRootsByGER(ctx context.Context, globalExitRoot co func (_m *zkEVMClientMock) GetLatestGlobalExitRoot(ctx context.Context) (common.Hash, error) { ret := _m.Called(ctx) - if len(ret) == 0 { - panic("no return value specified for GetLatestGlobalExitRoot") - } - var r0 common.Hash var r1 error if rf, ok := ret.Get(0).(func(context.Context) (common.Hash, error)); ok { diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index 3c53114a..93cf4eab 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -49,10 +49,7 @@ func NewSynchronizer( chSynced chan uint, cfg Config) (Synchronizer, error) { ctx, cancel := context.WithCancel(ctx) - networkID, err := ethMan.GetNetworkID(ctx) - if err != nil { - log.Fatal("error getting networkID. Error: ", err) - } + networkID := ethMan.GetRollupID() ger, err := storage.(storageInterface).GetLatestL1SyncedExitRoot(ctx, nil) if err != nil { if err == gerror.ErrStorageNotFound { @@ -527,46 +524,12 @@ func (s *ClientSynchronizer) checkReorg(latestBlock *etherman.Block) (*etherman. } func (s *ClientSynchronizer) processVerifyBatch(verifyBatch etherman.VerifiedBatch, blockID uint64, dbTx pgx.Tx) error { - if verifyBatch.RollupID == s.etherMan.GetRollupID()-1 { - // Just check that the calculated RollupExitRoot is fine - network, err := s.bridgeCtrl.GetNetworkID(s.networkID) - if err != nil { - log.Errorf("networkID: %d, error getting NetworkID. Error: %v", s.networkID, err) - rollbackErr := s.storage.Rollback(s.ctx, dbTx) - if rollbackErr != nil { - log.Errorf("networkID: %d, error rolling back state. BlockNumber: %d, rollbackErr: %v, error : %s", - s.networkID, verifyBatch.BlockNumber, rollbackErr, err.Error()) - return rollbackErr - } - return err - } - ok, err := s.storage.CheckIfRootExists(s.ctx, verifyBatch.LocalExitRoot.Bytes(), network, dbTx) - if err != nil { - log.Errorf("networkID: %d, error Checking if root exists. Error: %v", s.networkID, err) - rollbackErr := s.storage.Rollback(s.ctx, dbTx) - if rollbackErr != nil { - log.Errorf("networkID: %d, error rolling back state. BlockNumber: %d, rollbackErr: %v, error : %s", - s.networkID, verifyBatch.BlockNumber, rollbackErr, err.Error()) - return rollbackErr - } - return err - } - if !ok { - log.Errorf("networkID: %d, Root: %s doesn't exist!", s.networkID, verifyBatch.LocalExitRoot.String()) - rollbackErr := s.storage.Rollback(s.ctx, dbTx) - if rollbackErr != nil { - log.Errorf("networkID: %d, error rolling back state. BlockNumber: %d, rollbackErr: %v, error : %s", - s.networkID, verifyBatch.BlockNumber, rollbackErr, err.Error()) - return rollbackErr - } - return fmt.Errorf("networkID: %d, Root: %s doesn't exist!", s.networkID, verifyBatch.LocalExitRoot.String()) - } - } rollupLeaf := etherman.RollupExitLeaf{ BlockID: blockID, Leaf: verifyBatch.LocalExitRoot, RollupId: verifyBatch.RollupID, } + // Update rollupExitRoot err := s.bridgeCtrl.AddRollupExitLeaf(s.ctx, rollupLeaf, dbTx) if err != nil { @@ -601,7 +564,6 @@ func (s *ClientSynchronizer) processGlobalExitRoot(globalExitRoot etherman.Globa func (s *ClientSynchronizer) processDeposit(deposit etherman.Deposit, blockID uint64, dbTx pgx.Tx) error { deposit.BlockID = blockID - deposit.NetworkID = s.networkID depositID, err := s.storage.AddDeposit(s.ctx, &deposit, dbTx) if err != nil { log.Errorf("networkID: %d, failed to store new deposit locally, BlockNumber: %d, Deposit: %+v err: %v", s.networkID, deposit.BlockNumber, deposit, err) @@ -629,12 +591,13 @@ func (s *ClientSynchronizer) processDeposit(deposit etherman.Deposit, blockID ui } func (s *ClientSynchronizer) processClaim(claim etherman.Claim, blockID uint64, dbTx pgx.Tx) error { - if claim.RollupIndex != uint64(s.etherMan.GetRollupID()) && claim.RollupIndex != 0 { - log.Debugf("Claim for different Rollup (RollupID: %d, RollupIndex: %d). Ignoring...", s.etherMan.GetRollupID(), claim.RollupIndex) - return nil - } + // TODO: we need to know all the rollupIDs that we care about in order to filter + // if !claim.MainnetFlag && claim.GetOriginRollupID() != s.etherMan.GetRollupID() { + // log.Debugf("claim from different Rollup (RollupID: %d, RollupIndex: %d). Ignoring...", s.etherMan.GetRollupID(), claim.RollupIndex) + // return nil + // } claim.BlockID = blockID - claim.NetworkID = s.networkID + claim.DestinationNetwork = s.networkID err := s.storage.AddClaim(s.ctx, &claim, dbTx) if err != nil { log.Errorf("networkID: %d, error storing new Claim in Block: %d, Claim: %+v, err: %v", s.networkID, claim.BlockNumber, claim, err) diff --git a/synchronizer/synchronizer_test.go b/synchronizer/synchronizer_test.go index 8855af40..2463b334 100644 --- a/synchronizer/synchronizer_test.go +++ b/synchronizer/synchronizer_test.go @@ -32,7 +32,7 @@ func TestSyncGer(t *testing.T) { SyncChunkSize: 10, } ctx := mock.MatchedBy(func(ctx context.Context) bool { return ctx != nil }) - m.Etherman.On("GetNetworkID", ctx).Return(uint(0), nil) + m.Etherman.On("GetRollupID").Return(uint(0), nil) m.Storage.On("GetLatestL1SyncedExitRoot", ctx, nil).Return(ðerman.GlobalExitRoot{}, gerror.ErrStorageNotFound).Once() m.Storage.On("IsLxLyActivated", ctx, nil).Return(true, nil).Once() chEvent := make(chan *etherman.GlobalExitRoot) diff --git a/test/benchmark/api_test.go b/test/benchmark/api_test.go index 18d5f546..c0621fef 100644 --- a/test/benchmark/api_test.go +++ b/test/benchmark/api_test.go @@ -53,16 +53,16 @@ func initAddresses(count int) []common.Address { func randDeposit(r *rand.Rand, depositCnt uint, blockID uint64, networkID int) *etherman.Deposit { return ðerman.Deposit{ - LeafType: 0, - OriginalNetwork: networks[0], - OriginalAddress: common.Address{}, - Amount: big.NewInt(1000000000000), - DestinationNetwork: networks[1-networkID], - DestinationAddress: addresses[rand.Intn(len(addresses))], //nolint: gosec - DepositCount: depositCnt, - BlockID: blockID, - NetworkID: networks[networkID], - Metadata: randBytes(r, 20), + LeafType: 0, + OriginalTokenNetwork: networks[0], + OriginalTokenAddress: common.Address{}, + Amount: big.NewInt(1000000000000), + DestinationNetwork: networks[1-networkID], + DestinationAddress: addresses[rand.Intn(len(addresses))], //nolint: gosec + DepositCount: depositCnt, + BlockID: blockID, + OriginNetwork: networks[networkID], + Metadata: randBytes(r, 20), } } @@ -115,14 +115,14 @@ func initServer(b *testing.B, bench benchmark) *bridgectrl.BridgeController { } require.NoError(b, err) err = store.AddClaim(context.TODO(), ðerman.Claim{ - Index: deposit.DepositCount, - OriginalNetwork: deposit.OriginalNetwork, - Amount: deposit.Amount, - NetworkID: deposit.DestinationNetwork, - DestinationAddress: deposit.DestinationAddress, - RollupIndex: 1, - MainnetFlag: false, - BlockID: id, + DepositCount: deposit.DepositCount, + OriginalTokenNetwork: deposit.OriginalTokenNetwork, + Amount: deposit.Amount, + DestinationNetwork: deposit.DestinationNetwork, + DestinationAddress: deposit.DestinationAddress, + RollupIndex: 0, + MainnetFlag: networkID == 0, + BlockID: id, }, dbTx) require.NoError(b, err) require.NoError(b, store.Commit(context.TODO(), dbTx)) diff --git a/test/config/bridge/bridge-1.toml b/test/config/bridge/bridge-1.toml new file mode 100644 index 00000000..c21796a2 --- /dev/null +++ b/test/config/bridge/bridge-1.toml @@ -0,0 +1,56 @@ +[Log] +Level = "warn" +Outputs = ["stdout"] + +[SyncDB] +Database = "postgres" +User = "user" +Password = "pass" +Name = "bridge_db_1" +Host = "zkevm-db" +Port = "5432" +MaxConns = 20 + +[ClaimTxManager] +Enabled = true +FrequencyToMonitorTxs = "1s" +PrivateKey = {Path = "/pk/keystore.claimtxmanager", Password = "testonly"} +RetryInterval = "1s" +RetryNumber = 10 +AuthorizedClaimMessageAddresses = ["0x90F79bf6EB2c4f870365E785982E1f101E93b906"] + +[Etherman] +L1URL = "http://zkevm-mock-l1-network:8545" +L2URLs = ["http://zkevm-node-1:8123"] + +[Synchronizer] +SyncInterval = "1s" +SyncChunkSize = 100 + +[BridgeController] +Store = "postgres" +Height = 32 + +[BridgeServer] +GRPCPort = "9090" +HTTPPort = "8080" +CacheSize = 100000 +DefaultPageLimit = 25 +MaxPageLimit = 100 +BridgeVersion = "v1" + [BridgeServer.DB] + Database = "postgres" + User = "user" + Password = "pass" + Name = "bridge_db_1" + Host = "zkevm-db" + Port = "5432" + MaxConns = 20 + +[NetworkConfig] +GenBlockNumber = 1 +PolygonBridgeAddress = "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8" +PolygonZkEVMGlobalExitRootAddress = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" +PolygonRollupManagerAddress = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" +PolygonZkEvmAddress = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" +L2PolygonBridgeAddresses = ["0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8"] diff --git a/test/config/bridge/bridge-2.toml b/test/config/bridge/bridge-2.toml new file mode 100644 index 00000000..bb2ad29d --- /dev/null +++ b/test/config/bridge/bridge-2.toml @@ -0,0 +1,56 @@ +[Log] +Level = "warn" +Outputs = ["stdout"] + +[SyncDB] +Database = "postgres" +User = "user" +Password = "pass" +Name = "bridge_db_2" +Host = "zkevm-db" +Port = "5432" +MaxConns = 20 + +[ClaimTxManager] +Enabled = true +FrequencyToMonitorTxs = "1s" +PrivateKey = {Path = "/pk/keystore.claimtxmanager", Password = "testonly"} +RetryInterval = "1s" +RetryNumber = 10 +AuthorizedClaimMessageAddresses = ["0x90F79bf6EB2c4f870365E785982E1f101E93b906"] + +[Etherman] +L1URL = "http://zkevm-mock-l1-network:8545" +L2URLs = ["http://zkevm-node-2:8123"] + +[Synchronizer] +SyncInterval = "1s" +SyncChunkSize = 100 + +[BridgeController] +Store = "postgres" +Height = 32 + +[BridgeServer] +GRPCPort = "9090" +HTTPPort = "8080" +CacheSize = 100000 +DefaultPageLimit = 25 +MaxPageLimit = 100 +BridgeVersion = "v1" + [BridgeServer.DB] + Database = "postgres" + User = "user" + Password = "pass" + Name = "bridge_db_2" + Host = "zkevm-db" + Port = "5432" + MaxConns = 20 + +[NetworkConfig] +GenBlockNumber = 1 +PolygonBridgeAddress = "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8" +PolygonZkEVMGlobalExitRootAddress = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" +PolygonRollupManagerAddress = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" +PolygonZkEvmAddress = "0x3Ca8f9C04c7e3E1624Ac2008F92f6F366A869444" +L2PolygonBridgeAddresses = ["0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8"] diff --git a/test/test.keystore.claimtx b/test/config/bridge/claimtx.keystore similarity index 100% rename from test/test.keystore.claimtx rename to test/config/bridge/claimtx.keystore diff --git a/test/config/init_dbs.sql b/test/config/init_dbs.sql new file mode 100644 index 00000000..2f95b649 --- /dev/null +++ b/test/config/init_dbs.sql @@ -0,0 +1,39 @@ +-- This script will create the folowing DBs: prover_db_1, pool_db_1, bridge_db_1, prover_db_2 state_db_2, pool_db_2, bridge_db_2 +-- It will also create the schema for prover_db_* DBs + +CREATE DATABASE prover_db_1; +CREATE DATABASE pool_db_1; +CREATE DATABASE bridge_db_1; + +CREATE DATABASE state_db_2; +CREATE DATABASE prover_db_2; +CREATE DATABASE pool_db_2; +CREATE DATABASE bridge_db_2; + +\connect prover_db_1; + +CREATE SCHEMA state; +CREATE TABLE state.nodes (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); +CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); + +CREATE USER prover_user_1 with password 'prover_pass'; +ALTER DATABASE prover_db_1 OWNER TO prover_user_1; +ALTER SCHEMA state OWNER TO prover_user_1; +ALTER SCHEMA public OWNER TO prover_user_1; +ALTER TABLE state.nodes OWNER TO prover_user_1; +ALTER TABLE state.program OWNER TO prover_user_1; +ALTER USER prover_user_1 SET SEARCH_PATH=state; + +\connect prover_db_2; + +CREATE SCHEMA state; +CREATE TABLE state.nodes (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); +CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); + +CREATE USER prover_user_2 with password 'prover_pass'; +ALTER DATABASE prover_db_2 OWNER TO prover_user_2; +ALTER SCHEMA state OWNER TO prover_user_2; +ALTER SCHEMA public OWNER TO prover_user_2; +ALTER TABLE state.nodes OWNER TO prover_user_2; +ALTER TABLE state.program OWNER TO prover_user_2; +ALTER USER prover_user_2 SET SEARCH_PATH=state; diff --git a/test/test.keystore.aggregator b/test/config/node/aggregator-1.keystore similarity index 100% rename from test/test.keystore.aggregator rename to test/config/node/aggregator-1.keystore diff --git a/test/config/node/aggregator-2.keystore b/test/config/node/aggregator-2.keystore new file mode 100644 index 00000000..4a6fab71 --- /dev/null +++ b/test/config/node/aggregator-2.keystore @@ -0,0 +1 @@ +{"address":"9965507d1a55bcc2695c58ba16fb37d819b0a4dc","crypto":{"cipher":"aes-128-ctr","ciphertext":"58c70f3dcd1082dde67139e35582e0f13ff8cdf29f99f85648fd44434ffaedd9","cipherparams":{"iv":"d80b9f93460e76fb1cc03c39fdb14ef5"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"91423984e31be2541fb757593041c8c95dac2624f09040ce4189d15da19449bc"},"mac":"dea5f893609c1a46d86713c9031d99ea531a3b44cb5da666432f677a8e3d3fd9"},"id":"57648c58-6979-447d-a262-ecff68a2a456","version":3} \ No newline at end of file diff --git a/test/config/node/genesis-1.json b/test/config/node/genesis-1.json new file mode 100644 index 00000000..6f7a6867 --- /dev/null +++ b/test/config/node/genesis-1.json @@ -0,0 +1,100 @@ +{ + "l1Config": { + "chainId": 1337, + "polygonZkEVMAddress": "0x8dAF17A20c9DBA35f005b6324F493785D239719d", + "polygonRollupManagerAddress": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", + "polTokenAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "polygonZkEVMGlobalExitRootAddress": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" + }, + "genesisBlockNumber": 69, + "root": "0xcc9ec17819f4ac7f282949ca8c379c4d3ee1b8b7908c51b9b405b6319af67b32", + "genesis": [ + { + "contractName": "PolygonZkEVMDeployer", + "balance": "0", + "nonce": "4", + "address": "0x51dbd54FCCb6b3A07738fd3E156D588e71f79973", + "bytecode": "0x6080604052600436106100705760003560e01c8063715018a61161004e578063715018a6146100e65780638da5cb5b146100fb578063e11ae6cb14610126578063f2fde38b1461013957600080fd5b80632b79805a146100755780634a94d4871461008a5780636d07dbf81461009d575b600080fd5b610088610083366004610927565b610159565b005b6100886100983660046109c7565b6101cb565b3480156100a957600080fd5b506100bd6100b8366004610a1e565b61020d565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b50610088610220565b34801561010757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100bd565b610088610134366004610a40565b610234565b34801561014557600080fd5b50610088610154366004610a90565b61029b565b610161610357565b600061016e8585856103d8565b905061017a8183610537565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a15050505050565b6101d3610357565b6101de83838361057b565b506040517f25adb19089b6a549831a273acdf7908cff8b7ee5f551f8d1d37996cf01c5df5b90600090a1505050565b600061021983836105a9565b9392505050565b610228610357565b61023260006105b6565b565b61023c610357565b60006102498484846103d8565b60405173ffffffffffffffffffffffffffffffffffffffff821681529091507fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a150505050565b6102a3610357565b73ffffffffffffffffffffffffffffffffffffffff811661034b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610354816105b6565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610342565b600083471015610444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610342565b81516000036104af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610342565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610342565b6060610219838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061062b565b60606105a1848484604051806060016040528060298152602001610b3d6029913961062b565b949350505050565b6000610219838330610744565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610342565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516106e69190610acf565b60006040518083038185875af1925050503d8060008114610723576040519150601f19603f3d011682016040523d82523d6000602084013e610728565b606091505b50915091506107398783838761076e565b979650505050505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b606083156108045782516000036107fd5773ffffffffffffffffffffffffffffffffffffffff85163b6107fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610342565b50816105a1565b6105a183838151156108195781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103429190610aeb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261088d57600080fd5b813567ffffffffffffffff808211156108a8576108a861084d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156108ee576108ee61084d565b8160405283815286602085880101111561090757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561093d57600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561096357600080fd5b61096f8883890161087c565b9350606087013591508082111561098557600080fd5b506109928782880161087c565b91505092959194509250565b803573ffffffffffffffffffffffffffffffffffffffff811681146109c257600080fd5b919050565b6000806000606084860312156109dc57600080fd5b6109e58461099e565b9250602084013567ffffffffffffffff811115610a0157600080fd5b610a0d8682870161087c565b925050604084013590509250925092565b60008060408385031215610a3157600080fd5b50508035926020909101359150565b600080600060608486031215610a5557600080fd5b8335925060208401359150604084013567ffffffffffffffff811115610a7a57600080fd5b610a868682870161087c565b9150509250925092565b600060208284031215610aa257600080fd5b6102198261099e565b60005b83811015610ac6578181015183820152602001610aae565b50506000910152565b60008251610ae1818460208701610aab565b9190910192915050565b6020815260008251806020840152610b0a816040850160208701610aab565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220964619cee0e0baf94c6f8763f013be157da5d54c89e5cff4a8caf4266e13f13a64736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266" + } + }, + { + "contractName": "ProxyAdmin", + "balance": "0", + "nonce": "1", + "address": "0xe34Fe58DDa5b8c6D547E4857E987633aa86a5e90", + "bytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461012b57806399a88ec41461013e578063f2fde38b1461015e578063f3b7dead1461017e57600080fd5b8063204e1c7a14610080578063715018a6146100c95780637eff275e146100e05780638da5cb5b14610100575b600080fd5b34801561008c57600080fd5b506100a061009b366004610608565b61019e565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d557600080fd5b506100de610255565b005b3480156100ec57600080fd5b506100de6100fb36600461062c565b610269565b34801561010c57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100a0565b6100de610139366004610694565b6102f7565b34801561014a57600080fd5b506100de61015936600461062c565b61038c565b34801561016a57600080fd5b506100de610179366004610608565b6103e8565b34801561018a57600080fd5b506100a0610199366004610608565b6104a4565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907f5c60da1b00000000000000000000000000000000000000000000000000000000815260040190565b600060405180830381855afa9150503d8060008114610225576040519150601f19603f3d011682016040523d82523d6000602084013e61022a565b606091505b50915091508161023957600080fd5b8080602001905181019061024d9190610788565b949350505050565b61025d6104f0565b6102676000610571565b565b6102716104f0565b6040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690638f283970906024015b600060405180830381600087803b1580156102db57600080fd5b505af11580156102ef573d6000803e3d6000fd5b505050505050565b6102ff6104f0565b6040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690634f1ef28690349061035590869086906004016107a5565b6000604051808303818588803b15801561036e57600080fd5b505af1158015610382573d6000803e3d6000fd5b5050505050505050565b6103946104f0565b6040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690633659cfe6906024016102c1565b6103f06104f0565b73ffffffffffffffffffffffffffffffffffffffff8116610498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104a181610571565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907ff851a44000000000000000000000000000000000000000000000000000000000815260040190565b60005473ffffffffffffffffffffffffffffffffffffffff163314610267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048f565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff811681146104a157600080fd5b60006020828403121561061a57600080fd5b8135610625816105e6565b9392505050565b6000806040838503121561063f57600080fd5b823561064a816105e6565b9150602083013561065a816105e6565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156106a957600080fd5b83356106b4816105e6565b925060208401356106c4816105e6565b9150604084013567ffffffffffffffff808211156106e157600080fd5b818601915086601f8301126106f557600080fd5b81358181111561070757610707610665565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561074d5761074d610665565b8160405282815289602084870101111561076657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561079a57600080fd5b8151610625816105e6565b73ffffffffffffffffffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b818110156107ef578581018301518582016060015282016107d3565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea2646970667358221220c9867ffac53151bdb1305d8f5e3e883cd83e5270c7ec09cdc24e837b2e65239064736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000165878a594ca255338adfa4d48449f69242eb8f" + } + }, + { + "contractName": "PolygonZkEVMBridge implementation", + "balance": "0", + "nonce": "1", + "address": "0x493732fB136a380920C390a85fc27d79C7b70756", + "bytecode": "0x6080604052600436106101a35760003560e01c806383f24403116100e2578063ccaa2d1111610085578063ccaa2d1114610511578063cd58657914610531578063d02103ca14610544578063dbc169761461056b578063ee25560b14610580578063f5efcd79146105ad578063f811bff7146105cd578063fb570834146105ed57600080fd5b806383f244031461040b5780638ed7e3f21461042b578063aaa13cc21461044b578063b8b284d01461046b578063bab161bf1461048b578063be5831c7146104ad578063c00f14ab146104d1578063cc461632146104f157600080fd5b80633cbc795b1161014a5780633cbc795b146102fd5780633e197043146103365780634b2f336d146103565780635ca1e165146103765780637843298b1461038b57806379e2cf97146103ab57806381b1c174146103c057806383c43a55146103f657600080fd5b806315064c96146101a85780632072f6c5146101d757806322e95f2c146101ee578063240ff3781461021b57806327aef4e81461022e5780632dfdf0b514610250578063318aee3d146102745780633c351e10146102dd575b600080fd5b3480156101b457600080fd5b506068546101c29060ff1681565b60405190151581526020015b60405180910390f35b3480156101e357600080fd5b506101ec61060d565b005b3480156101fa57600080fd5b5061020e610209366004612b65565b610642565b6040516101ce9190612b9c565b6101ec610229366004612c06565b610693565b34801561023a57600080fd5b50610243610703565b6040516101ce9190612ccf565b34801561025c57600080fd5b5061026660535481565b6040519081526020016101ce565b34801561028057600080fd5b506102b961028f366004612ce9565b606b6020526000908152604090205463ffffffff811690600160201b90046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b039091166020830152016101ce565b3480156102e957600080fd5b50606d5461020e906001600160a01b031681565b34801561030957600080fd5b50606d5461032190600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b34801561034257600080fd5b50610266610351366004612d15565b610791565b34801561036257600080fd5b50606f5461020e906001600160a01b031681565b34801561038257600080fd5b5061026661081e565b34801561039757600080fd5b5061020e6103a6366004612d94565b6108fb565b3480156103b757600080fd5b506101ec610925565b3480156103cc57600080fd5b5061020e6103db366004612ddd565b606a602052600090815260409020546001600160a01b031681565b34801561040257600080fd5b50610243610946565b34801561041757600080fd5b50610266610426366004612e08565b610965565b34801561043757600080fd5b50606c5461020e906001600160a01b031681565b34801561045757600080fd5b5061020e610466366004612f12565b610a3b565b34801561047757600080fd5b506101ec610486366004612fad565b610b3d565b34801561049757600080fd5b5060685461032190610100900463ffffffff1681565b3480156104b957600080fd5b5060685461032190600160c81b900463ffffffff1681565b3480156104dd57600080fd5b506102436104ec366004612ce9565b610c04565b3480156104fd57600080fd5b506101c261050c36600461302f565b610c49565b34801561051d57600080fd5b506101ec61052c366004613062565b610cd2565b6101ec61053f36600461314d565b6111c7565b34801561055057600080fd5b5060685461020e90600160281b90046001600160a01b031681565b34801561057757600080fd5b506101ec611621565b34801561058c57600080fd5b5061026661059b366004612ddd565b60696020526000908152604090205481565b3480156105b957600080fd5b506101ec6105c8366004613062565b611654565b3480156105d957600080fd5b506101ec6105e83660046131e2565b6118ef565b3480156105f957600080fd5b506101c261060836600461328a565b611b62565b606c546001600160a01b0316331461063857604051631736745960e31b815260040160405180910390fd5b610640611b7a565b565b6000606a6000848460405160200161065b9291906132d2565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff16156106b757604051630bc011ff60e21b815260040160405180910390fd5b34158015906106d05750606f546001600160a01b031615155b156106ee576040516301bd897160e61b815260040160405180910390fd5b6106fc858534868686611bd6565b5050505050565b606e8054610710906132fc565b80601f016020809104026020016040519081016040528092919081815260200182805461073c906132fc565b80156107895780601f1061075e57610100808354040283529160200191610789565b820191906000526020600020905b81548152906001019060200180831161076c57829003601f168201915b505050505081565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b605354600090819081805b60208110156108f2578083901c600116600103610886576033816020811061085357610853613336565b015460408051602081019290925281018590526060016040516020818303038152906040528051906020012093506108b3565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b604080516020810184905290810183905260600160405160208183030381529060405280519060200120915080806108ea90613362565b915050610829565b50919392505050565b600061091d848461090b85611ca0565b61091486611d5f565b61046687611e17565b949350505050565b605354606854600160c81b900463ffffffff16101561064057610640611ecf565b60405180611ba00160405280611b668152602001613a7a611b66913981565b600083815b6020811015610a3257600163ffffffff8516821c811690036109d55784816020811061099857610998613336565b6020020135826040516020016109b8929190918252602082015260400190565b604051602081830303815290604052805190602001209150610a20565b818582602081106109e8576109e8613336565b6020020135604051602001610a07929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80610a2a81613362565b91505061096a565b50949350505050565b6000808686604051602001610a519291906132d2565b604051602081830303815290604052805190602001209050600060ff60f81b308360405180611ba00160405280611b668152602001613a7a611b669139898989604051602001610aa39392919061337b565b60408051601f1981840301815290829052610ac192916020016133b4565b60405160208183030381529060405280519060200120604051602001610b1994939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f19018152919052805160209091012098975050505050505050565b60685460ff1615610b6157604051630bc011ff60e21b815260040160405180910390fd5b606f546001600160a01b0316610b8a5760405163dde3cda760e01b815260040160405180910390fd5b606f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac90610bbc90339088906004016133e3565b600060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b50505050610bfc868686868686611bd6565b505050505050565b6060610c0f82611ca0565b610c1883611d5f565b610c2184611e17565b604051602001610c339392919061337b565b6040516020818303038152906040529050919050565b6068546000908190610100900463ffffffff16158015610c6f575063ffffffff83166001145b15610c81575063ffffffff8316610ca8565b610c95600160201b63ffffffff85166133fc565b610ca59063ffffffff8616613413565b90505b600881901c600090815260696020526040902054600160ff9092169190911b908116149392505050565b60685460ff1615610cf657604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614610d26576040516302caf51760e11b815260040160405180910390fd5b610d5a8c8c8c8c8c610d5560008e8e8e8e8e8e8e604051610d48929190613426565b6040518091039020610791565b611f68565b6001600160a01b038616610e9257606f546001600160a01b0316610e295760006001600160a01b03851684825b6040519080825280601f01601f191660200182016040528015610db1576020820181803683370190505b50604051610dbf9190613436565b60006040518083038185875af1925050503d8060008114610dfc576040519150601f19603f3d011682016040523d82523d6000602084013e610e01565b606091505b5050905080610e2357604051630ce8f45160e31b815260040160405180910390fd5b5061117a565b606f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990610e5b90879087906004016133e3565b600060405180830381600087803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b5050505061117a565b606d546001600160a01b038781169116148015610ec05750606d5463ffffffff888116600160a01b90920416145b15610ed85760006001600160a01b0385168482610d87565b60685463ffffffff610100909104811690881603610f0957610f046001600160a01b03871685856120c7565b61117a565b60008787604051602001610f1e9291906132d2565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b031680611116576000610f968386868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212292505050565b6040516340c10f1960e01b81529091506001600160a01b038216906340c10f1990610fc7908a908a906004016133e3565b600060405180830381600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b5050505080606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808b63ffffffff1681526020018a6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398a8a83888860405161110895949392919061347b565b60405180910390a150611177565b6040516340c10f1960e01b81526001600160a01b038216906340c10f199061114490899089906004016133e3565b600060405180830381600087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b505050505b50505b7f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d8a888887876040516111b19594939291906134b4565b60405180910390a1505050505050505050505050565b60685460ff16156111eb57604051630bc011ff60e21b815260040160405180910390fd5b6111f361219e565b60685463ffffffff610100909104811690881603611224576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b03881661130a578834146112585760405163b89240f560e01b815260040160405180910390fd5b606d54606e80546001600160a01b0383169650600160a01b90920463ffffffff16945090611285906132fc565b80601f01602080910402602001604051908101604052809291908181526020018280546112b1906132fc565b80156112fe5780601f106112d3576101008083540402835291602001916112fe565b820191906000526020600020905b8154815290600101906020018083116112e157829003601f168201915b50505050509150611596565b34156113295760405163798ee6f160e01b815260040160405180910390fd5b606f546001600160a01b03908116908916036113a457604051632770a7eb60e21b81526001600160a01b03891690639dc29fac9061136d9033908d906004016133e3565b600060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b50505050611596565b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff81168352600160201b9004909216918101829052901561145c57604051632770a7eb60e21b81526001600160a01b038a1690639dc29fac906114179033908e906004016133e3565b600060405180830381600087803b15801561143157600080fd5b505af1158015611445573d6000803e3d6000fd5b505050508060200151945080600001519350611589565b851561146e5761146e898b89896121f7565b6040516370a0823160e01b81526000906001600160a01b038b16906370a082319061149d903090600401612b9c565b602060405180830381865afa1580156114ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114de91906134e6565b90506114f56001600160a01b038b1633308e61253d565b6040516370a0823160e01b81526000906001600160a01b038c16906370a0823190611524903090600401612b9c565b602060405180830381865afa158015611541573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156591906134e6565b905061157182826134ff565b6068548c9850610100900463ffffffff169650935050505b61159289610c04565b9250505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e86886053546040516115d6989796959493929190613512565b60405180910390a16115fd6115f8600085878f8f878980519060200120610791565b612575565b861561160b5761160b611ecf565b5050505061161860018055565b50505050505050565b606c546001600160a01b0316331461164c57604051631736745960e31b815260040160405180910390fd5b610640612660565b60685460ff161561167857604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff86811661010090920416146116a8576040516302caf51760e11b815260040160405180910390fd5b6116ca8c8c8c8c8c610d5560018e8e8e8e8e8e8e604051610d48929190613426565b606f546000906001600160a01b031661178157846001600160a01b031684888a86866040516024016116ff949392919061357d565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b179052516117349190613436565b60006040518083038185875af1925050503d8060008114611771576040519150601f19603f3d011682016040523d82523d6000602084013e611776565b606091505b505080915050611883565b606f546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906117b390889088906004016133e3565b600060405180830381600087803b1580156117cd57600080fd5b505af11580156117e1573d6000803e3d6000fd5b50505050846001600160a01b031687898585604051602401611806949392919061357d565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525161183b9190613436565b6000604051808303816000865af19150503d8060008114611878576040519150601f19603f3d011682016040523d82523d6000602084013e61187d565b606091505b50909150505b806118a1576040516337e391c360e01b815260040160405180910390fd5b7f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d8b898988886040516118d89594939291906134b4565b60405180910390a150505050505050505050505050565b600054610100900460ff161580801561190f5750600054600160ff909116105b806119295750303b158015611929575060005460ff166001145b6119915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156119b4576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff8a160265010000000000600160c81b03191617600160281b6001600160a01b038781169190910291909117909155606c80546001600160a01b0319168583161790558616611a3d5763ffffffff851615611a3857604051630d43a60960e11b815260040160405180910390fd5b611b0c565b606d805463ffffffff8716600160a01b026001600160c01b03199091166001600160a01b03891617179055606e611a7483826135fe565b50611aeb6000801b6012604051602001611ad791906060808252600d908201526c2bb930b83832b21022ba3432b960991b608082015260a060208201819052600490820152630ae8aa8960e31b60c082015260ff91909116604082015260e00190565b604051602081830303815290604052612122565b606f80546001600160a01b0319166001600160a01b03929092169190911790555b611b146126b8565b8015611618576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b600081611b70868686610965565b1495945050505050565b60685460ff1615611b9e57604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b60685463ffffffff610100909104811690871603611c07576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338989898888605354604051611c5b999897969594939291906136bd565b60405180910390a1611c926115f86001606860019054906101000a900463ffffffff16338a8a8a8989604051610d48929190613426565b8215610bfc57610bfc611ecf565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b03861691611ce79190613436565b600060405180830381855afa9150503d8060008114611d22576040519150601f19603f3d011682016040523d82523d6000602084013e611d27565b606091505b509150915081611d5657604051806040016040528060078152602001664e4f5f4e414d4560c81b81525061091d565b61091d816126e7565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b03861691611da69190613436565b600060405180830381855afa9150503d8060008114611de1576040519150601f19603f3d011682016040523d82523d6000602084013e611de6565b606091505b509150915081611d5657604051806040016040528060098152602001681393d7d4d6535093d360ba1b81525061091d565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611e5d9190613436565b600060405180830381855afa9150503d8060008114611e98576040519150601f19603f3d011682016040523d82523d6000602084013e611e9d565b606091505b5091509150818015611eb0575080516020145b611ebb57601261091d565b8080602001905181019061091d919061372a565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d611f1661081e565b6040518263ffffffff1660e01b8152600401611f3491815260200190565b600060405180830381600087803b158015611f4e57600080fd5b505af1158015611f62573d6000803e3d6000fd5b50505050565b606854604080516020808201879052818301869052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af1158015611fe2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200691906134e6565b90508060000361202857604051622f6fad60e01b815260040160405180910390fd5b600080600160401b87161561206857869150612046848a8489611b62565b612063576040516338105f3b60e21b815260040160405180910390fd5b6120b2565b602087901c612078816001613747565b915087925061209361208b868c86610965565b8a8389611b62565b6120b0576040516338105f3b60e21b815260040160405180910390fd5b505b6120bc8282612875565b505050505050505050565b61211d8363a9059cbb60e01b84846040516024016120e69291906133e3565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261291d565b505050565b60008060405180611ba00160405280611b668152602001613a7a611b669139836040516020016121539291906133b4565b6040516020818303038152906040529050838151602083016000f591506001600160a01b038216612197576040516305f7d84960e51b815260040160405180910390fd5b5092915050565b6002600154036121f05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611988565b6002600155565b60006122066004828486613764565b61220f9161378e565b9050632afa533160e01b6001600160e01b03198216016123a357600080808080808061223e896004818d613764565b81019061224b91906137be565b9650965096509650965096509650336001600160a01b0316876001600160a01b03161461228b5760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03861630146122b45760405163750643af60e01b815260040160405180910390fd5b8a85146122d4576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e16916123529190613436565b6000604051808303816000865af19150503d806000811461238f576040519150601f19603f3d011682016040523d82523d6000602084013e612394565b606091505b505050505050505050506106fc565b6001600160e01b031981166323f2ebc360e21b146123d457604051637141605d60e11b815260040160405180910390fd5b6000808080808080806123ea8a6004818e613764565b8101906123f79190613812565b97509750975097509750975097509750336001600160a01b0316886001600160a01b0316146124395760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03871630146124625760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f16916124e99190613436565b6000604051808303816000865af19150503d8060008114612526576040519150601f19603f3d011682016040523d82523d6000602084013e61252b565b606091505b50505050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611f629085906323b872dd60e01b906084016120e6565b80600161258460206002613979565b61258e91906134ff565b605354106125af576040516377ae67b360e11b815260040160405180910390fd5b60006053600081546125c090613362565b9182905550905060005b6020811015612651578082901c6001166001036125fd5782603382602081106125f5576125f5613336565b015550505050565b6033816020811061261057612610613336565b01546040805160208101929092528101849052606001604051602081830303815290604052805190602001209250808061264990613362565b9150506125ca565b5061211d613985565b60018055565b60685460ff1661268357604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600054610100900460ff166126df5760405162461bcd60e51b81526004016119889061399b565b6106406129ef565b60606040825110612706578180602001905181019061068d91906139e6565b81516020036128425760005b602081108015612741575082818151811061272f5761272f613336565b01602001516001600160f81b03191615155b15612758578061275081613362565b915050612712565b806000036127905750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b6000816001600160401b038111156127aa576127aa612e47565b6040519080825280601f01601f1916602001820160405280156127d4576020820181803683370190505b50905060005b8281101561283a578481815181106127f4576127f4613336565b602001015160f81c60f81b82828151811061281157612811613336565b60200101906001600160f81b031916908160001a9053508061283281613362565b9150506127da565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b606854600090610100900463ffffffff16158015612899575063ffffffff82166001145b156128ab575063ffffffff82166128d2565b6128bf600160201b63ffffffff84166133fc565b6128cf9063ffffffff8516613413565b90505b600881901c60008181526069602052604081208054600160ff861690811b9182189283905592909190818316900361161857604051630c8d9eab60e31b815260040160405180910390fd5b6000612972826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a169092919063ffffffff16565b80519091501561211d57808060200190518101906129909190613a5c565b61211d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611988565b600054610100900460ff1661265a5760405162461bcd60e51b81526004016119889061399b565b606061091d848460008585600080866001600160a01b03168587604051612a3d9190613436565b60006040518083038185875af1925050503d8060008114612a7a576040519150601f19603f3d011682016040523d82523d6000602084013e612a7f565b606091505b5091509150612a9087838387612a9b565b979650505050505050565b60608315612b0a578251600003612b03576001600160a01b0385163b612b035760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611988565b508161091d565b61091d8383815115612b1f5781518083602001fd5b8060405162461bcd60e51b81526004016119889190612ccf565b803563ffffffff8116811461287057600080fd5b6001600160a01b0381168114612b6257600080fd5b50565b60008060408385031215612b7857600080fd5b612b8183612b39565b91506020830135612b9181612b4d565b809150509250929050565b6001600160a01b0391909116815260200190565b8015158114612b6257600080fd5b60008083601f840112612bd057600080fd5b5081356001600160401b03811115612be757600080fd5b602083019150836020828501011115612bff57600080fd5b9250929050565b600080600080600060808688031215612c1e57600080fd5b612c2786612b39565b94506020860135612c3781612b4d565b93506040860135612c4781612bb0565b925060608601356001600160401b03811115612c6257600080fd5b612c6e88828901612bbe565b969995985093965092949392505050565b60005b83811015612c9a578181015183820152602001612c82565b50506000910152565b60008151808452612cbb816020860160208601612c7f565b601f01601f19169290920160200192915050565b602081526000612ce26020830184612ca3565b9392505050565b600060208284031215612cfb57600080fd5b8135612ce281612b4d565b60ff81168114612b6257600080fd5b600080600080600080600060e0888a031215612d3057600080fd5b8735612d3b81612d06565b9650612d4960208901612b39565b95506040880135612d5981612b4d565b9450612d6760608901612b39565b93506080880135612d7781612b4d565b9699959850939692959460a0840135945060c09093013592915050565b600080600060608486031215612da957600080fd5b612db284612b39565b92506020840135612dc281612b4d565b91506040840135612dd281612b4d565b809150509250925092565b600060208284031215612def57600080fd5b5035919050565b80610400810183101561068d57600080fd5b60008060006104408486031215612e1e57600080fd5b83359250612e2f8560208601612df6565b9150612e3e6104208501612b39565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e8557612e85612e47565b604052919050565b60006001600160401b03821115612ea657612ea6612e47565b50601f01601f191660200190565b6000612ec7612ec284612e8d565b612e5d565b9050828152838383011115612edb57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612f0357600080fd5b612ce283833560208501612eb4565b600080600080600060a08688031215612f2a57600080fd5b612f3386612b39565b94506020860135612f4381612b4d565b935060408601356001600160401b0380821115612f5f57600080fd5b612f6b89838a01612ef2565b94506060880135915080821115612f8157600080fd5b50612f8e88828901612ef2565b9250506080860135612f9f81612d06565b809150509295509295909350565b60008060008060008060a08789031215612fc657600080fd5b612fcf87612b39565b95506020870135612fdf81612b4d565b9450604087013593506060870135612ff681612bb0565b925060808701356001600160401b0381111561301157600080fd5b61301d89828a01612bbe565b979a9699509497509295939492505050565b6000806040838503121561304257600080fd5b61304b83612b39565b915061305960208401612b39565b90509250929050565b6000806000806000806000806000806000806109208d8f03121561308557600080fd5b61308f8e8e612df6565b9b5061309f8e6104008f01612df6565b9a506108008d013599506108208d013598506108408d013597506130c66108608e01612b39565b96506130d66108808e0135612b4d565b6108808d013595506130eb6108a08e01612b39565b94506130fb6108c08e0135612b4d565b6108c08d013593506108e08d013592506001600160401b036109008e0135111561312457600080fd5b6131358e6109008f01358f01612bbe565b81935080925050509295989b509295989b509295989b565b600080600080600080600060c0888a03121561316857600080fd5b61317188612b39565b9650602088013561318181612b4d565b955060408801359450606088013561319881612b4d565b935060808801356131a881612bb0565b925060a08801356001600160401b038111156131c357600080fd5b6131cf8a828b01612bbe565b989b979a50959850939692959293505050565b60008060008060008060c087890312156131fb57600080fd5b61320487612b39565b9550602087013561321481612b4d565b945061322260408801612b39565b9350606087013561323281612b4d565b9250608087013561324281612b4d565b915060a08701356001600160401b0381111561325d57600080fd5b8701601f8101891361326e57600080fd5b61327d89823560208401612eb4565b9150509295509295509295565b60008060008061046085870312156132a157600080fd5b843593506132b28660208701612df6565b92506132c16104208601612b39565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b600181811c9082168061331057607f821691505b60208210810361333057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133745761337461334c565b5060010190565b60608152600061338e6060830186612ca3565b82810360208401526133a08186612ca3565b91505060ff83166040830152949350505050565b600083516133c6818460208801612c7f565b8351908301906133da818360208801612c7f565b01949350505050565b6001600160a01b03929092168252602082015260400190565b808202811582820484141761068d5761068d61334c565b8082018082111561068d5761068d61334c565b8183823760009101908152919050565b60008251613448818460208701612c7f565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff861681526001600160a01b03858116602083015284166040820152608060608201819052600090612a909083018486613452565b94855263ffffffff9390931660208501526001600160a01b039182166040850152166060830152608082015260a00190565b6000602082840312156134f857600080fd5b5051919050565b8181038181111561068d5761068d61334c565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c0830181905260009161356484830187612ca3565b925080851660e085015250509998505050505050505050565b6001600160a01b038516815263ffffffff841660208201526060604082018190526000906135ae9083018486613452565b9695505050505050565b601f82111561211d57600081815260208120601f850160051c810160208610156135df5750805b601f850160051c820191505b81811015610bfc578281556001016135eb565b81516001600160401b0381111561361757613617612e47565b61362b8161362584546132fc565b846135b8565b602080601f83116001811461366057600084156136485750858301515b600019600386901b1c1916600185901b178555610bfc565b600085815260208120601f198616915b8281101561368f57888601518255948401946001909101908401613670565b50858210156136ad5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c083018190526000916137108483018789613452565b925080851660e085015250509a9950505050505050505050565b60006020828403121561373c57600080fd5b8151612ce281612d06565b63ffffffff8181168382160190808211156121975761219761334c565b6000808585111561377457600080fd5b8386111561378157600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156137b65780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a0312156137d957600080fd5b87356137e481612b4d565b965060208801356137f481612b4d565b955060408801359450606088013593506080880135612d7781612d06565b600080600080600080600080610100898b03121561382f57600080fd5b883561383a81612b4d565b9750602089013561384a81612b4d565b96506040890135955060608901359450608089013561386881612bb0565b935060a089013561387881612d06565b979a969950949793969295929450505060c08201359160e0013590565b600181815b808511156138d05781600019048211156138b6576138b661334c565b808516156138c357918102915b93841c939080029061389a565b509250929050565b6000826138e75750600161068d565b816138f45750600061068d565b816001811461390a576002811461391457613930565b600191505061068d565b60ff8411156139255761392561334c565b50506001821b61068d565b5060208310610133831016604e8410600b8410161715613953575081810a61068d565b61395d8383613895565b80600019048211156139715761397161334c565b029392505050565b6000612ce283836138d8565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156139f857600080fd5b81516001600160401b03811115613a0e57600080fd5b8201601f81018413613a1f57600080fd5b8051613a2d612ec282612e8d565b818152856020838501011115613a4257600080fd5b613a53826020830160208601612c7f565b95945050505050565b600060208284031215613a6e57600080fd5b8151612ce281612bb056fe6101006040523480156200001257600080fd5b5060405162001b6638038062001b6683398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516116aa620004bc6000396000610237015260008181610307015281816105c001526106a70152600061053a015260008181610379015261050401526116aa6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063a457c2d71161008c578063d505accf11610066578063d505accf1461039b578063dd62ed3e146103ae578063ffa1ad74146103f457600080fd5b8063a457c2d71461034e578063a9059cbb14610361578063cd0d00961461037457600080fd5b806395d89b41116100bd57806395d89b41146102e75780639dc29fac146102ef578063a3c573eb1461030257600080fd5b806370a08231146102915780637ecebe00146102c757600080fd5b806330adf81f1161012f5780633644e515116101145780633644e51514610261578063395093511461026957806340c10f191461027c57600080fd5b806330adf81f14610209578063313ce5671461023057600080fd5b806318160ddd1161016057806318160ddd146101bd57806320606b70146101cf57806323b872dd146101f657600080fd5b806306fdde031461017c578063095ea7b31461019a575b600080fd5b610184610430565b60405161019191906113e4565b60405180910390f35b6101ad6101a8366004611479565b6104c2565b6040519015158152602001610191565b6002545b604051908152602001610191565b6101c17f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6101ad6102043660046114a3565b6104dc565b6101c17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610191565b6101c1610500565b6101ad610277366004611479565b61055c565b61028f61028a366004611479565b6105a8565b005b6101c161029f3660046114df565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101c16102d53660046114df565b60056020526000908152604090205481565b610184610680565b61028f6102fd366004611479565b61068f565b6103297f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610191565b6101ad61035c366004611479565b61075e565b6101ad61036f366004611479565b61082f565b6101c17f000000000000000000000000000000000000000000000000000000000000000081565b61028f6103a9366004611501565b61083d565b6101c16103bc366004611574565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101846040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60606003805461043f906115a7565b80601f016020809104026020016040519081016040528092919081815260200182805461046b906115a7565b80156104b85780601f1061048d576101008083540402835291602001916104b8565b820191906000526020600020905b81548152906001019060200180831161049b57829003601f168201915b5050505050905090565b6000336104d0818585610b73565b60019150505b92915050565b6000336104ea858285610d27565b6104f5858585610dfe565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614610537576105324661106d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104d090829086906105a3908790611629565b610b73565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084015b60405180910390fd5b61067c8282611135565b5050565b60606004805461043f906115a7565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d427269646765000000000000000000000000000000006064820152608401610669565b61067c8282611228565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610669565b6104f58286868403610b73565b6000336104d0818585610dfe565b834211156108cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a204578706972656420706560448201527f726d6974000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866109268361163c565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610991610500565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610a55573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590610ad057508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b610b5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c696420736960448201527f676e6174757265000000000000000000000000000000000000000000000000006064820152608401610669565b610b678a8a8a610b73565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610cb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610df85781811015610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610669565b610df88484848403610b73565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610f44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610df8565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611098610430565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b73ffffffffffffffffffffffffffffffffffffffff82166111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610669565b80600260008282546111c49190611629565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff82166112cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d1a565b600060208083528351808285015260005b81811015611411578581018301518582016040015282016113f5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b919050565b6000806040838503121561148c57600080fd5b61149583611450565b946020939093013593505050565b6000806000606084860312156114b857600080fd5b6114c184611450565b92506114cf60208501611450565b9150604084013590509250925092565b6000602082840312156114f157600080fd5b6114fa82611450565b9392505050565b600080600080600080600060e0888a03121561151c57600080fd5b61152588611450565b965061153360208901611450565b95506040880135945060608801359350608088013560ff8116811461155757600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561158757600080fd5b61159083611450565b915061159e60208401611450565b90509250929050565b600181811c908216806115bb57607f821691505b6020821081036115f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104d6576104d66115fa565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361166d5761166d6115fa565b506001019056fea26469706673582212208d88fee561cff7120d381c345cfc534cef8229a272dc5809d4bbb685ad67141164736f6c63430008110033a2646970667358221220914f18d5b241f0d10b2ebc814aadeee338ad60bad704683e414dad415cb2e14d64736f6c63430008140033" + }, + { + "contractName": "PolygonZkEVMBridge proxy", + "balance": "340282366920938463463374607431768211455", + "nonce": "1", + "address": "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8", + "bytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461086f565b610135565b61006b6100a336600461088a565b61017f565b3480156100b457600080fd5b506100bd6101f3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461086f565b610231565b34801561011257600080fd5b506100bd61025e565b61012361028c565b61013361012e610363565b61036d565b565b61013d610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816040518060200160405280600081525060006103d1565b50565b61017461011b565b610187610391565b73ffffffffffffffffffffffffffffffffffffffff1633036101eb576101e68383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103d1915050565b505050565b6101e661011b565b60006101fd610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610363565b905090565b61022e61011b565b90565b610239610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816103fc565b6000610268610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610391565b610294610391565b73ffffffffffffffffffffffffffffffffffffffff163303610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600061022161045d565b3660008037600080366000845af43d6000803e80801561038c573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6103da83610485565b6000825111806103e75750805b156101e6576103f683836104d2565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610425610391565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a1610174816104fe565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103b5565b61048e8161060a565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606104f7838360405180606001604052806027815260200161099f602791396106d5565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81166105a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035a565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b73ffffffffffffffffffffffffffffffffffffffff81163b6106ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161035a565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105c4565b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516106ff9190610931565b600060405180830381855af49150503d806000811461073a576040519150601f19603f3d011682016040523d82523d6000602084013e61073f565b606091505b50915091506107508683838761075a565b9695505050505050565b606083156107f05782516000036107e95773ffffffffffffffffffffffffffffffffffffffff85163b6107e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161035a565b50816107fa565b6107fa8383610802565b949350505050565b8151156108125781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035a919061094d565b803573ffffffffffffffffffffffffffffffffffffffff8116811461086a57600080fd5b919050565b60006020828403121561088157600080fd5b6104f782610846565b60008060006040848603121561089f57600080fd5b6108a884610846565b9250602084013567ffffffffffffffff808211156108c557600080fd5b818601915086601f8301126108d957600080fd5b8135818111156108e857600080fd5b8760208285010111156108fa57600080fd5b6020830194508093505050509250925092565b60005b83811015610928578181015183820152602001610910565b50506000910152565b6000825161094381846020870161090d565b9190910192915050565b602081526000825180602084015261096c81604085016020870161090d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220701a0c26bdd76686e63fc3c65e4f28a20ba3ecc8a60246733c0627e679c9804e64736f6c63430008140033", + "storage": { + "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", + "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000493732fb136a380920c390a85fc27d79c7b70756" + } + }, + { + "contractName": "PolygonZkEVMGlobalExitRootL2 implementation", + "balance": "0", + "nonce": "1", + "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + "bytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806301fd904414610051578063257b36321461006d57806333d6247d1461008d578063a3c573eb146100a2575b600080fd5b61005a60015481565b6040519081526020015b60405180910390f35b61005a61007b366004610162565b60006020819052908152604090205481565b6100a061009b366004610162565b6100ee565b005b6100c97f000000000000000000000000b7098a13a48ece087d3da15b2d28ece0f89819b881565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610064565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b7098a13a48ece087d3da15b2d28ece0f89819b8161461015d576040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600155565b60006020828403121561017457600080fd5b503591905056fea2646970667358221220ea2171e2c85c8bff947affc409ef6fc6a8fe82fb8c174ddeda988651e595d66564736f6c63430008140033" + }, + { + "contractName": "PolygonZkEVMGlobalExitRootL2 proxy", + "balance": "0", + "nonce": "1", + "address": "0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa", + "bytecode": "0x60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033", + "storage": { + "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", + "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000dc64a140aa3e981100a9beca4e685f962f0cf6c9" + } + }, + { + "contractName": "PolygonZkEVMTimelock", + "balance": "0", + "nonce": "1", + "address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", + "bytecode": "0x6080604052600436106101c65760003560e01c806364d62353116100f7578063b1c5f42711610095578063d547741f11610064578063d547741f14610661578063e38335e514610681578063f23a6e6114610694578063f27a0c92146106d957600080fd5b8063b1c5f427146105af578063bc197c81146105cf578063c4d252f514610614578063d45c44351461063457600080fd5b80638f61f4f5116100d15780638f61f4f5146104e157806391d1485414610515578063a217fddf14610566578063b08e51c01461057b57600080fd5b806364d62353146104815780638065657f146104a15780638f2a0bb0146104c157600080fd5b8063248a9ca31161016457806331d507501161013e57806331d50750146103c857806336568abe146103e85780633a6aae7214610408578063584b153e1461046157600080fd5b8063248a9ca3146103475780632ab0f529146103775780632f2ff15d146103a857600080fd5b80630d3cf6fc116101a05780630d3cf6fc1461026b578063134008d31461029f57806313bc9f20146102b2578063150b7a02146102d257600080fd5b806301d5062a146101d257806301ffc9a7146101f457806307bd02651461022957600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b506101f26101ed366004611c52565b6106ee565b005b34801561020057600080fd5b5061021461020f366004611cc7565b610783565b60405190151581526020015b60405180910390f35b34801561023557600080fd5b5061025d7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b604051908152602001610220565b34801561027757600080fd5b5061025d7f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b6101f26102ad366004611d09565b6107df565b3480156102be57600080fd5b506102146102cd366004611d75565b6108d7565b3480156102de57600080fd5b506103166102ed366004611e9a565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610220565b34801561035357600080fd5b5061025d610362366004611d75565b60009081526020819052604090206001015490565b34801561038357600080fd5b50610214610392366004611d75565b6000908152600160208190526040909120541490565b3480156103b457600080fd5b506101f26103c3366004611f02565b6108fd565b3480156103d457600080fd5b506102146103e3366004611d75565b610927565b3480156103f457600080fd5b506101f2610403366004611f02565b610940565b34801561041457600080fd5b5061043c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610220565b34801561046d57600080fd5b5061021461047c366004611d75565b6109f8565b34801561048d57600080fd5b506101f261049c366004611d75565b610a0e565b3480156104ad57600080fd5b5061025d6104bc366004611d09565b610ade565b3480156104cd57600080fd5b506101f26104dc366004611f73565b610b1d565b3480156104ed57600080fd5b5061025d7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc181565b34801561052157600080fd5b50610214610530366004611f02565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561057257600080fd5b5061025d600081565b34801561058757600080fd5b5061025d7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f78381565b3480156105bb57600080fd5b5061025d6105ca366004612025565b610d4f565b3480156105db57600080fd5b506103166105ea36600461214e565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561062057600080fd5b506101f261062f366004611d75565b610d94565b34801561064057600080fd5b5061025d61064f366004611d75565b60009081526001602052604090205490565b34801561066d57600080fd5b506101f261067c366004611f02565b610e8f565b6101f261068f366004612025565b610eb4565b3480156106a057600080fd5b506103166106af3660046121f8565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b3480156106e557600080fd5b5061025d611161565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc161071881611244565b6000610728898989898989610ade565b90506107348184611251565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a604051610770969594939291906122a6565b60405180910390a3505050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806107d957506107d98261139e565b92915050565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff1661085c5761085c8133611435565b600061086c888888888888610ade565b905061087881856114ed565b6108848888888861162a565b6000817fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588a8a8a8a6040516108bc94939291906122f1565b60405180910390a36108cd8161172e565b5050505050505050565b6000818152600160205260408120546001811180156108f65750428111155b9392505050565b60008281526020819052604090206001015461091881611244565b61092283836117d7565b505050565b60008181526001602052604081205481905b1192915050565b73ffffffffffffffffffffffffffffffffffffffff811633146109ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6109f482826118c7565b5050565b6000818152600160208190526040822054610939565b333014610a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201527f62652074696d656c6f636b00000000000000000000000000000000000000000060648201526084016109e1565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b6000868686868686604051602001610afb969594939291906122a6565b6040516020818303038152906040528051906020012090509695505050505050565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1610b4781611244565b888714610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b888514610c65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b6000610c778b8b8b8b8b8b8b8b610d4f565b9050610c838184611251565b60005b8a811015610d415780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e85818110610cc357610cc3612331565b9050602002016020810190610cd89190612360565b8d8d86818110610cea57610cea612331565b905060200201358c8c87818110610d0357610d03612331565b9050602002810190610d15919061237b565b8c8b604051610d29969594939291906122a6565b60405180910390a3610d3a8161240f565b9050610c86565b505050505050505050505050565b60008888888888888888604051602001610d709897969594939291906124f7565b60405160208183030381529060405280519060200120905098975050505050505050565b7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f783610dbe81611244565b610dc7826109f8565b610e53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20636160448201527f6e6e6f742062652063616e63656c6c656400000000000000000000000000000060648201526084016109e1565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610eaa81611244565b61092283836118c7565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff16610f3157610f318133611435565b878614610fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b87841461104f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b60006110618a8a8a8a8a8a8a8a610d4f565b905061106d81856114ed565b60005b8981101561114b5760008b8b8381811061108c5761108c612331565b90506020020160208101906110a19190612360565b905060008a8a848181106110b7576110b7612331565b9050602002013590503660008a8a868181106110d5576110d5612331565b90506020028101906110e7919061237b565b915091506110f78484848461162a565b84867fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588686868660405161112e94939291906122f1565b60405180910390a350505050806111449061240f565b9050611070565b506111558161172e565b50505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161580159061123257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166315064c966040518163ffffffff1660e01b8152600401602060405180830381865afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123291906125be565b1561123d5750600090565b5060025490565b61124e8133611435565b50565b61125a82610927565b156112e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201527f7265616479207363686564756c6564000000000000000000000000000000000060648201526084016109e1565b6112ef611161565b81101561137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e7460448201527f2064656c6179000000000000000000000000000000000000000000000000000060648201526084016109e1565b61138881426125e0565b6000928352600160205260409092209190915550565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806107d957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107d9565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f4576114738161197e565b61147e83602061199d565b60405160200161148f929190612617565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526109e191600401612698565b6114f6826108d7565b611582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b80158061159e5750600081815260016020819052604090912054145b6109f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e67206465706560448201527f6e64656e6379000000000000000000000000000000000000000000000000000060648201526084016109e1565b60008473ffffffffffffffffffffffffffffffffffffffff168484846040516116549291906126e9565b60006040518083038185875af1925050503d8060008114611691576040519150601f19603f3d011682016040523d82523d6000602084013e611696565b606091505b5050905080611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e67207460448201527f72616e73616374696f6e2072657665727465640000000000000000000000000060648201526084016109e1565b5050505050565b611737816108d7565b6117c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b600090815260016020819052604090912055565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118693390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60606107d973ffffffffffffffffffffffffffffffffffffffff831660145b606060006119ac8360026126f9565b6119b79060026125e0565b67ffffffffffffffff8111156119cf576119cf611d8e565b6040519080825280601f01601f1916602001820160405280156119f9576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611a3057611a30612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611a9357611a93612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000611acf8460026126f9565b611ada9060016125e0565b90505b6001811115611b77577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611b1b57611b1b612331565b1a60f81b828281518110611b3157611b31612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93611b7081612710565b9050611add565b5083156108f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109e1565b803573ffffffffffffffffffffffffffffffffffffffff81168114611c0457600080fd5b919050565b60008083601f840112611c1b57600080fd5b50813567ffffffffffffffff811115611c3357600080fd5b602083019150836020828501011115611c4b57600080fd5b9250929050565b600080600080600080600060c0888a031215611c6d57600080fd5b611c7688611be0565b965060208801359550604088013567ffffffffffffffff811115611c9957600080fd5b611ca58a828b01611c09565b989b979a50986060810135976080820135975060a09091013595509350505050565b600060208284031215611cd957600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108f657600080fd5b60008060008060008060a08789031215611d2257600080fd5b611d2b87611be0565b955060208701359450604087013567ffffffffffffffff811115611d4e57600080fd5b611d5a89828a01611c09565b979a9699509760608101359660809091013595509350505050565b600060208284031215611d8757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611e0457611e04611d8e565b604052919050565b600082601f830112611e1d57600080fd5b813567ffffffffffffffff811115611e3757611e37611d8e565b611e6860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611dbd565b818152846020838601011115611e7d57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611eb057600080fd5b611eb985611be0565b9350611ec760208601611be0565b925060408501359150606085013567ffffffffffffffff811115611eea57600080fd5b611ef687828801611e0c565b91505092959194509250565b60008060408385031215611f1557600080fd5b82359150611f2560208401611be0565b90509250929050565b60008083601f840112611f4057600080fd5b50813567ffffffffffffffff811115611f5857600080fd5b6020830191508360208260051b8501011115611c4b57600080fd5b600080600080600080600080600060c08a8c031215611f9157600080fd5b893567ffffffffffffffff80821115611fa957600080fd5b611fb58d838e01611f2e565b909b50995060208c0135915080821115611fce57600080fd5b611fda8d838e01611f2e565b909950975060408c0135915080821115611ff357600080fd5b506120008c828d01611f2e565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b60008060008060008060008060a0898b03121561204157600080fd5b883567ffffffffffffffff8082111561205957600080fd5b6120658c838d01611f2e565b909a50985060208b013591508082111561207e57600080fd5b61208a8c838d01611f2e565b909850965060408b01359150808211156120a357600080fd5b506120b08b828c01611f2e565b999c989b509699959896976060870135966080013595509350505050565b600082601f8301126120df57600080fd5b8135602067ffffffffffffffff8211156120fb576120fb611d8e565b8160051b61210a828201611dbd565b928352848101820192828101908785111561212457600080fd5b83870192505b848310156121435782358252918301919083019061212a565b979650505050505050565b600080600080600060a0868803121561216657600080fd5b61216f86611be0565b945061217d60208701611be0565b9350604086013567ffffffffffffffff8082111561219a57600080fd5b6121a689838a016120ce565b945060608801359150808211156121bc57600080fd5b6121c889838a016120ce565b935060808801359150808211156121de57600080fd5b506121eb88828901611e0c565b9150509295509295909350565b600080600080600060a0868803121561221057600080fd5b61221986611be0565b945061222760208701611be0565b93506040860135925060608601359150608086013567ffffffffffffffff81111561225157600080fd5b6121eb88828901611e0c565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a0604082015260006122dc60a08301868861225d565b60608301949094525060800152949350505050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061232760608301848661225d565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561237257600080fd5b6108f682611be0565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123b057600080fd5b83018035915067ffffffffffffffff8211156123cb57600080fd5b602001915036819003821315611c4b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612440576124406123e0565b5060010190565b81835260006020808501808196508560051b810191508460005b878110156124ea57828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030181126124a057600080fd5b8701858101903567ffffffffffffffff8111156124bc57600080fd5b8036038213156124cb57600080fd5b6124d686828461225d565b9a87019a9550505090840190600101612461565b5091979650505050505050565b60a0808252810188905260008960c08301825b8b8110156125455773ffffffffffffffffffffffffffffffffffffffff61253084611be0565b1682526020928301929091019060010161250a565b5083810360208501528881527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89111561257e57600080fd5b8860051b9150818a602083013701828103602090810160408501526125a69082018789612447565b60608401959095525050608001529695505050505050565b6000602082840312156125d057600080fd5b815180151581146108f657600080fd5b808201808211156107d9576107d96123e0565b60005b8381101561260e5781810151838201526020016125f6565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161264f8160178501602088016125f3565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161268c8160288401602088016125f3565b01602801949350505050565b60208152600082518060208401526126b78160408501602087016125f3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b8183823760009101908152919050565b80820281158282048414176107d9576107d96123e0565b60008161271f5761271f6123e0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220c474c39da3523b28ebfa5fd66c05b42d6ddcc4a57055483bdda32888b366016164736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000000e10", + "0xaedcc9e7897c0d335bdc5d92fe3a8b4f23727fe558cd1c19f332b28716a30559": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xf5e61edb9c9cc6bfbae4463e9a2b1dd6ac3b44ddef38f18016e56ba0363910d9": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x64494413541ff93b31aa309254e3fed72a7456e9845988b915b4c7a7ceba8814": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x60b9d94c75b7b3f721925089391e4644cd890cb5e6466f9596dfbd2c54e0b280": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x3412d5605ac6cd444957cedb533e5dacad6378b4bc819ebe3652188a665066d6": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x4b63b79f1e338a49559dcd3193ac9eecc50d0f275d24e97cc8c319e5a31a8bd0": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d706a": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x800d5dfe4bba53eedee06cd4546a27da8de00f12db83f56062976d4493fda899": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xc3ad33e20b0c56a223ad5104fff154aa010f8715b9c981fd38fdc60a4d1a52fc": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5" + } + }, + { + "accountName": "keyless Deployer", + "balance": "0", + "nonce": "1", + "address": "0x28BB4e66addE1f042B77E04cf7D3784C1dcDBbA3" + }, + { + "accountName": "deployer", + "balance": "100000000000000000000000", + "nonce": "8", + "address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + } + ] + } \ No newline at end of file diff --git a/test/config/node/genesis-2.json b/test/config/node/genesis-2.json new file mode 100644 index 00000000..ed5219f0 --- /dev/null +++ b/test/config/node/genesis-2.json @@ -0,0 +1,100 @@ +{ + "l1Config": { + "chainId": 1337, + "polygonZkEVMAddress": "0x3Ca8f9C04c7e3E1624Ac2008F92f6F366A869444", + "polygonRollupManagerAddress": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", + "polTokenAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "polygonZkEVMGlobalExitRootAddress": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" + }, + "genesisBlockNumber": 84, + "root": "0xcc9ec17819f4ac7f282949ca8c379c4d3ee1b8b7908c51b9b405b6319af67b32", + "genesis": [ + { + "contractName": "PolygonZkEVMDeployer", + "balance": "0", + "nonce": "4", + "address": "0x51dbd54FCCb6b3A07738fd3E156D588e71f79973", + "bytecode": "0x6080604052600436106100705760003560e01c8063715018a61161004e578063715018a6146100e65780638da5cb5b146100fb578063e11ae6cb14610126578063f2fde38b1461013957600080fd5b80632b79805a146100755780634a94d4871461008a5780636d07dbf81461009d575b600080fd5b610088610083366004610927565b610159565b005b6100886100983660046109c7565b6101cb565b3480156100a957600080fd5b506100bd6100b8366004610a1e565b61020d565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b50610088610220565b34801561010757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100bd565b610088610134366004610a40565b610234565b34801561014557600080fd5b50610088610154366004610a90565b61029b565b610161610357565b600061016e8585856103d8565b905061017a8183610537565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a15050505050565b6101d3610357565b6101de83838361057b565b506040517f25adb19089b6a549831a273acdf7908cff8b7ee5f551f8d1d37996cf01c5df5b90600090a1505050565b600061021983836105a9565b9392505050565b610228610357565b61023260006105b6565b565b61023c610357565b60006102498484846103d8565b60405173ffffffffffffffffffffffffffffffffffffffff821681529091507fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a150505050565b6102a3610357565b73ffffffffffffffffffffffffffffffffffffffff811661034b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610354816105b6565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610342565b600083471015610444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610342565b81516000036104af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610342565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610342565b6060610219838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061062b565b60606105a1848484604051806060016040528060298152602001610b3d6029913961062b565b949350505050565b6000610219838330610744565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610342565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516106e69190610acf565b60006040518083038185875af1925050503d8060008114610723576040519150601f19603f3d011682016040523d82523d6000602084013e610728565b606091505b50915091506107398783838761076e565b979650505050505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b606083156108045782516000036107fd5773ffffffffffffffffffffffffffffffffffffffff85163b6107fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610342565b50816105a1565b6105a183838151156108195781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103429190610aeb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261088d57600080fd5b813567ffffffffffffffff808211156108a8576108a861084d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156108ee576108ee61084d565b8160405283815286602085880101111561090757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561093d57600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561096357600080fd5b61096f8883890161087c565b9350606087013591508082111561098557600080fd5b506109928782880161087c565b91505092959194509250565b803573ffffffffffffffffffffffffffffffffffffffff811681146109c257600080fd5b919050565b6000806000606084860312156109dc57600080fd5b6109e58461099e565b9250602084013567ffffffffffffffff811115610a0157600080fd5b610a0d8682870161087c565b925050604084013590509250925092565b60008060408385031215610a3157600080fd5b50508035926020909101359150565b600080600060608486031215610a5557600080fd5b8335925060208401359150604084013567ffffffffffffffff811115610a7a57600080fd5b610a868682870161087c565b9150509250925092565b600060208284031215610aa257600080fd5b6102198261099e565b60005b83811015610ac6578181015183820152602001610aae565b50506000910152565b60008251610ae1818460208701610aab565b9190910192915050565b6020815260008251806020840152610b0a816040850160208701610aab565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220964619cee0e0baf94c6f8763f013be157da5d54c89e5cff4a8caf4266e13f13a64736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266" + } + }, + { + "contractName": "ProxyAdmin", + "balance": "0", + "nonce": "1", + "address": "0xe34Fe58DDa5b8c6D547E4857E987633aa86a5e90", + "bytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461012b57806399a88ec41461013e578063f2fde38b1461015e578063f3b7dead1461017e57600080fd5b8063204e1c7a14610080578063715018a6146100c95780637eff275e146100e05780638da5cb5b14610100575b600080fd5b34801561008c57600080fd5b506100a061009b366004610608565b61019e565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d557600080fd5b506100de610255565b005b3480156100ec57600080fd5b506100de6100fb36600461062c565b610269565b34801561010c57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100a0565b6100de610139366004610694565b6102f7565b34801561014a57600080fd5b506100de61015936600461062c565b61038c565b34801561016a57600080fd5b506100de610179366004610608565b6103e8565b34801561018a57600080fd5b506100a0610199366004610608565b6104a4565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907f5c60da1b00000000000000000000000000000000000000000000000000000000815260040190565b600060405180830381855afa9150503d8060008114610225576040519150601f19603f3d011682016040523d82523d6000602084013e61022a565b606091505b50915091508161023957600080fd5b8080602001905181019061024d9190610788565b949350505050565b61025d6104f0565b6102676000610571565b565b6102716104f0565b6040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690638f283970906024015b600060405180830381600087803b1580156102db57600080fd5b505af11580156102ef573d6000803e3d6000fd5b505050505050565b6102ff6104f0565b6040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690634f1ef28690349061035590869086906004016107a5565b6000604051808303818588803b15801561036e57600080fd5b505af1158015610382573d6000803e3d6000fd5b5050505050505050565b6103946104f0565b6040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690633659cfe6906024016102c1565b6103f06104f0565b73ffffffffffffffffffffffffffffffffffffffff8116610498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104a181610571565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907ff851a44000000000000000000000000000000000000000000000000000000000815260040190565b60005473ffffffffffffffffffffffffffffffffffffffff163314610267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048f565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff811681146104a157600080fd5b60006020828403121561061a57600080fd5b8135610625816105e6565b9392505050565b6000806040838503121561063f57600080fd5b823561064a816105e6565b9150602083013561065a816105e6565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156106a957600080fd5b83356106b4816105e6565b925060208401356106c4816105e6565b9150604084013567ffffffffffffffff808211156106e157600080fd5b818601915086601f8301126106f557600080fd5b81358181111561070757610707610665565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561074d5761074d610665565b8160405282815289602084870101111561076657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561079a57600080fd5b8151610625816105e6565b73ffffffffffffffffffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b818110156107ef578581018301518582016060015282016107d3565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea2646970667358221220c9867ffac53151bdb1305d8f5e3e883cd83e5270c7ec09cdc24e837b2e65239064736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000165878a594ca255338adfa4d48449f69242eb8f" + } + }, + { + "contractName": "PolygonZkEVMBridge implementation", + "balance": "0", + "nonce": "1", + "address": "0x493732fB136a380920C390a85fc27d79C7b70756", + "bytecode": "0x6080604052600436106101a35760003560e01c806383f24403116100e2578063ccaa2d1111610085578063ccaa2d1114610511578063cd58657914610531578063d02103ca14610544578063dbc169761461056b578063ee25560b14610580578063f5efcd79146105ad578063f811bff7146105cd578063fb570834146105ed57600080fd5b806383f244031461040b5780638ed7e3f21461042b578063aaa13cc21461044b578063b8b284d01461046b578063bab161bf1461048b578063be5831c7146104ad578063c00f14ab146104d1578063cc461632146104f157600080fd5b80633cbc795b1161014a5780633cbc795b146102fd5780633e197043146103365780634b2f336d146103565780635ca1e165146103765780637843298b1461038b57806379e2cf97146103ab57806381b1c174146103c057806383c43a55146103f657600080fd5b806315064c96146101a85780632072f6c5146101d757806322e95f2c146101ee578063240ff3781461021b57806327aef4e81461022e5780632dfdf0b514610250578063318aee3d146102745780633c351e10146102dd575b600080fd5b3480156101b457600080fd5b506068546101c29060ff1681565b60405190151581526020015b60405180910390f35b3480156101e357600080fd5b506101ec61060d565b005b3480156101fa57600080fd5b5061020e610209366004612b65565b610642565b6040516101ce9190612b9c565b6101ec610229366004612c06565b610693565b34801561023a57600080fd5b50610243610703565b6040516101ce9190612ccf565b34801561025c57600080fd5b5061026660535481565b6040519081526020016101ce565b34801561028057600080fd5b506102b961028f366004612ce9565b606b6020526000908152604090205463ffffffff811690600160201b90046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b039091166020830152016101ce565b3480156102e957600080fd5b50606d5461020e906001600160a01b031681565b34801561030957600080fd5b50606d5461032190600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016101ce565b34801561034257600080fd5b50610266610351366004612d15565b610791565b34801561036257600080fd5b50606f5461020e906001600160a01b031681565b34801561038257600080fd5b5061026661081e565b34801561039757600080fd5b5061020e6103a6366004612d94565b6108fb565b3480156103b757600080fd5b506101ec610925565b3480156103cc57600080fd5b5061020e6103db366004612ddd565b606a602052600090815260409020546001600160a01b031681565b34801561040257600080fd5b50610243610946565b34801561041757600080fd5b50610266610426366004612e08565b610965565b34801561043757600080fd5b50606c5461020e906001600160a01b031681565b34801561045757600080fd5b5061020e610466366004612f12565b610a3b565b34801561047757600080fd5b506101ec610486366004612fad565b610b3d565b34801561049757600080fd5b5060685461032190610100900463ffffffff1681565b3480156104b957600080fd5b5060685461032190600160c81b900463ffffffff1681565b3480156104dd57600080fd5b506102436104ec366004612ce9565b610c04565b3480156104fd57600080fd5b506101c261050c36600461302f565b610c49565b34801561051d57600080fd5b506101ec61052c366004613062565b610cd2565b6101ec61053f36600461314d565b6111c7565b34801561055057600080fd5b5060685461020e90600160281b90046001600160a01b031681565b34801561057757600080fd5b506101ec611621565b34801561058c57600080fd5b5061026661059b366004612ddd565b60696020526000908152604090205481565b3480156105b957600080fd5b506101ec6105c8366004613062565b611654565b3480156105d957600080fd5b506101ec6105e83660046131e2565b6118ef565b3480156105f957600080fd5b506101c261060836600461328a565b611b62565b606c546001600160a01b0316331461063857604051631736745960e31b815260040160405180910390fd5b610640611b7a565b565b6000606a6000848460405160200161065b9291906132d2565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b60685460ff16156106b757604051630bc011ff60e21b815260040160405180910390fd5b34158015906106d05750606f546001600160a01b031615155b156106ee576040516301bd897160e61b815260040160405180910390fd5b6106fc858534868686611bd6565b5050505050565b606e8054610710906132fc565b80601f016020809104026020016040519081016040528092919081815260200182805461073c906132fc565b80156107895780601f1061075e57610100808354040283529160200191610789565b820191906000526020600020905b81548152906001019060200180831161076c57829003601f168201915b505050505081565b6040516001600160f81b031960f889901b1660208201526001600160e01b031960e088811b821660218401526001600160601b0319606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b605354600090819081805b60208110156108f2578083901c600116600103610886576033816020811061085357610853613336565b015460408051602081019290925281018590526060016040516020818303038152906040528051906020012093506108b3565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b604080516020810184905290810183905260600160405160208183030381529060405280519060200120915080806108ea90613362565b915050610829565b50919392505050565b600061091d848461090b85611ca0565b61091486611d5f565b61046687611e17565b949350505050565b605354606854600160c81b900463ffffffff16101561064057610640611ecf565b60405180611ba00160405280611b668152602001613a7a611b66913981565b600083815b6020811015610a3257600163ffffffff8516821c811690036109d55784816020811061099857610998613336565b6020020135826040516020016109b8929190918252602082015260400190565b604051602081830303815290604052805190602001209150610a20565b818582602081106109e8576109e8613336565b6020020135604051602001610a07929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b80610a2a81613362565b91505061096a565b50949350505050565b6000808686604051602001610a519291906132d2565b604051602081830303815290604052805190602001209050600060ff60f81b308360405180611ba00160405280611b668152602001613a7a611b669139898989604051602001610aa39392919061337b565b60408051601f1981840301815290829052610ac192916020016133b4565b60405160208183030381529060405280519060200120604051602001610b1994939291906001600160f81b031994909416845260609290921b6001600160601b03191660018401526015830152603582015260550190565b60408051808303601f19018152919052805160209091012098975050505050505050565b60685460ff1615610b6157604051630bc011ff60e21b815260040160405180910390fd5b606f546001600160a01b0316610b8a5760405163dde3cda760e01b815260040160405180910390fd5b606f54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac90610bbc90339088906004016133e3565b600060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b50505050610bfc868686868686611bd6565b505050505050565b6060610c0f82611ca0565b610c1883611d5f565b610c2184611e17565b604051602001610c339392919061337b565b6040516020818303038152906040529050919050565b6068546000908190610100900463ffffffff16158015610c6f575063ffffffff83166001145b15610c81575063ffffffff8316610ca8565b610c95600160201b63ffffffff85166133fc565b610ca59063ffffffff8616613413565b90505b600881901c600090815260696020526040902054600160ff9092169190911b908116149392505050565b60685460ff1615610cf657604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff8681166101009092041614610d26576040516302caf51760e11b815260040160405180910390fd5b610d5a8c8c8c8c8c610d5560008e8e8e8e8e8e8e604051610d48929190613426565b6040518091039020610791565b611f68565b6001600160a01b038616610e9257606f546001600160a01b0316610e295760006001600160a01b03851684825b6040519080825280601f01601f191660200182016040528015610db1576020820181803683370190505b50604051610dbf9190613436565b60006040518083038185875af1925050503d8060008114610dfc576040519150601f19603f3d011682016040523d82523d6000602084013e610e01565b606091505b5050905080610e2357604051630ce8f45160e31b815260040160405180910390fd5b5061117a565b606f546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990610e5b90879087906004016133e3565b600060405180830381600087803b158015610e7557600080fd5b505af1158015610e89573d6000803e3d6000fd5b5050505061117a565b606d546001600160a01b038781169116148015610ec05750606d5463ffffffff888116600160a01b90920416145b15610ed85760006001600160a01b0385168482610d87565b60685463ffffffff610100909104811690881603610f0957610f046001600160a01b03871685856120c7565b61117a565b60008787604051602001610f1e9291906132d2565b60408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b031680611116576000610f968386868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212292505050565b6040516340c10f1960e01b81529091506001600160a01b038216906340c10f1990610fc7908a908a906004016133e3565b600060405180830381600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b5050505080606a600085815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808b63ffffffff1681526020018a6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398a8a83888860405161110895949392919061347b565b60405180910390a150611177565b6040516340c10f1960e01b81526001600160a01b038216906340c10f199061114490899089906004016133e3565b600060405180830381600087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b505050505b50505b7f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d8a888887876040516111b19594939291906134b4565b60405180910390a1505050505050505050505050565b60685460ff16156111eb57604051630bc011ff60e21b815260040160405180910390fd5b6111f361219e565b60685463ffffffff610100909104811690881603611224576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b03881661130a578834146112585760405163b89240f560e01b815260040160405180910390fd5b606d54606e80546001600160a01b0383169650600160a01b90920463ffffffff16945090611285906132fc565b80601f01602080910402602001604051908101604052809291908181526020018280546112b1906132fc565b80156112fe5780601f106112d3576101008083540402835291602001916112fe565b820191906000526020600020905b8154815290600101906020018083116112e157829003601f168201915b50505050509150611596565b34156113295760405163798ee6f160e01b815260040160405180910390fd5b606f546001600160a01b03908116908916036113a457604051632770a7eb60e21b81526001600160a01b03891690639dc29fac9061136d9033908d906004016133e3565b600060405180830381600087803b15801561138757600080fd5b505af115801561139b573d6000803e3d6000fd5b50505050611596565b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff81168352600160201b9004909216918101829052901561145c57604051632770a7eb60e21b81526001600160a01b038a1690639dc29fac906114179033908e906004016133e3565b600060405180830381600087803b15801561143157600080fd5b505af1158015611445573d6000803e3d6000fd5b505050508060200151945080600001519350611589565b851561146e5761146e898b89896121f7565b6040516370a0823160e01b81526000906001600160a01b038b16906370a082319061149d903090600401612b9c565b602060405180830381865afa1580156114ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114de91906134e6565b90506114f56001600160a01b038b1633308e61253d565b6040516370a0823160e01b81526000906001600160a01b038c16906370a0823190611524903090600401612b9c565b602060405180830381865afa158015611541573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156591906134e6565b905061157182826134ff565b6068548c9850610100900463ffffffff169650935050505b61159289610c04565b9250505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e86886053546040516115d6989796959493929190613512565b60405180910390a16115fd6115f8600085878f8f878980519060200120610791565b612575565b861561160b5761160b611ecf565b5050505061161860018055565b50505050505050565b606c546001600160a01b0316331461164c57604051631736745960e31b815260040160405180910390fd5b610640612660565b60685460ff161561167857604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff86811661010090920416146116a8576040516302caf51760e11b815260040160405180910390fd5b6116ca8c8c8c8c8c610d5560018e8e8e8e8e8e8e604051610d48929190613426565b606f546000906001600160a01b031661178157846001600160a01b031684888a86866040516024016116ff949392919061357d565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b179052516117349190613436565b60006040518083038185875af1925050503d8060008114611771576040519150601f19603f3d011682016040523d82523d6000602084013e611776565b606091505b505080915050611883565b606f546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906117b390889088906004016133e3565b600060405180830381600087803b1580156117cd57600080fd5b505af11580156117e1573d6000803e3d6000fd5b50505050846001600160a01b031687898585604051602401611806949392919061357d565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525161183b9190613436565b6000604051808303816000865af19150503d8060008114611878576040519150601f19603f3d011682016040523d82523d6000602084013e61187d565b606091505b50909150505b806118a1576040516337e391c360e01b815260040160405180910390fd5b7f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d8b898988886040516118d89594939291906134b4565b60405180910390a150505050505050505050505050565b600054610100900460ff161580801561190f5750600054600160ff909116105b806119295750303b158015611929575060005460ff166001145b6119915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156119b4576000805461ff0019166101001790555b60688054610100600160c81b03191661010063ffffffff8a160265010000000000600160c81b03191617600160281b6001600160a01b038781169190910291909117909155606c80546001600160a01b0319168583161790558616611a3d5763ffffffff851615611a3857604051630d43a60960e11b815260040160405180910390fd5b611b0c565b606d805463ffffffff8716600160a01b026001600160c01b03199091166001600160a01b03891617179055606e611a7483826135fe565b50611aeb6000801b6012604051602001611ad791906060808252600d908201526c2bb930b83832b21022ba3432b960991b608082015260a060208201819052600490820152630ae8aa8960e31b60c082015260ff91909116604082015260e00190565b604051602081830303815290604052612122565b606f80546001600160a01b0319166001600160a01b03929092169190911790555b611b146126b8565b8015611618576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b600081611b70868686610965565b1495945050505050565b60685460ff1615611b9e57604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b60685463ffffffff610100909104811690871603611c07576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff16338989898888605354604051611c5b999897969594939291906136bd565b60405180910390a1611c926115f86001606860019054906101000a900463ffffffff16338a8a8a8989604051610d48929190613426565b8215610bfc57610bfc611ecf565b60408051600481526024810182526020810180516001600160e01b03166306fdde0360e01b179052905160609160009182916001600160a01b03861691611ce79190613436565b600060405180830381855afa9150503d8060008114611d22576040519150601f19603f3d011682016040523d82523d6000602084013e611d27565b606091505b509150915081611d5657604051806040016040528060078152602001664e4f5f4e414d4560c81b81525061091d565b61091d816126e7565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b03861691611da69190613436565b600060405180830381855afa9150503d8060008114611de1576040519150601f19603f3d011682016040523d82523d6000602084013e611de6565b606091505b509150915081611d5657604051806040016040528060098152602001681393d7d4d6535093d360ba1b81525061091d565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691611e5d9190613436565b600060405180830381855afa9150503d8060008114611e98576040519150601f19603f3d011682016040523d82523d6000602084013e611e9d565b606091505b5091509150818015611eb0575080516020145b611ebb57601261091d565b8080602001905181019061091d919061372a565b6053546068805463ffffffff909216600160c81b0263ffffffff60c81b1990921691909117908190556001600160a01b03600160281b909104166333d6247d611f1661081e565b6040518263ffffffff1660e01b8152600401611f3491815260200190565b600060405180830381600087803b158015611f4e57600080fd5b505af1158015611f62573d6000803e3d6000fd5b50505050565b606854604080516020808201879052818301869052825180830384018152606083019384905280519101206312bd9b1960e11b9092526064810191909152600091600160281b90046001600160a01b03169063257b3632906084016020604051808303816000875af1158015611fe2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200691906134e6565b90508060000361202857604051622f6fad60e01b815260040160405180910390fd5b600080600160401b87161561206857869150612046848a8489611b62565b612063576040516338105f3b60e21b815260040160405180910390fd5b6120b2565b602087901c612078816001613747565b915087925061209361208b868c86610965565b8a8389611b62565b6120b0576040516338105f3b60e21b815260040160405180910390fd5b505b6120bc8282612875565b505050505050505050565b61211d8363a9059cbb60e01b84846040516024016120e69291906133e3565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261291d565b505050565b60008060405180611ba00160405280611b668152602001613a7a611b669139836040516020016121539291906133b4565b6040516020818303038152906040529050838151602083016000f591506001600160a01b038216612197576040516305f7d84960e51b815260040160405180910390fd5b5092915050565b6002600154036121f05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611988565b6002600155565b60006122066004828486613764565b61220f9161378e565b9050632afa533160e01b6001600160e01b03198216016123a357600080808080808061223e896004818d613764565b81019061224b91906137be565b9650965096509650965096509650336001600160a01b0316876001600160a01b03161461228b5760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03861630146122b45760405163750643af60e01b815260040160405180910390fd5b8a85146122d4576040516303fffc4b60e01b815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b1790529151918e16916123529190613436565b6000604051808303816000865af19150503d806000811461238f576040519150601f19603f3d011682016040523d82523d6000602084013e612394565b606091505b505050505050505050506106fc565b6001600160e01b031981166323f2ebc360e21b146123d457604051637141605d60e11b815260040160405180910390fd5b6000808080808080806123ea8a6004818e613764565b8101906123f79190613812565b97509750975097509750975097509750336001600160a01b0316886001600160a01b0316146124395760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b03871630146124625760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f16916124e99190613436565b6000604051808303816000865af19150503d8060008114612526576040519150601f19603f3d011682016040523d82523d6000602084013e61252b565b606091505b50505050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611f629085906323b872dd60e01b906084016120e6565b80600161258460206002613979565b61258e91906134ff565b605354106125af576040516377ae67b360e11b815260040160405180910390fd5b60006053600081546125c090613362565b9182905550905060005b6020811015612651578082901c6001166001036125fd5782603382602081106125f5576125f5613336565b015550505050565b6033816020811061261057612610613336565b01546040805160208101929092528101849052606001604051602081830303815290604052805190602001209250808061264990613362565b9150506125ca565b5061211d613985565b60018055565b60685460ff1661268357604051635386698160e01b815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600054610100900460ff166126df5760405162461bcd60e51b81526004016119889061399b565b6106406129ef565b60606040825110612706578180602001905181019061068d91906139e6565b81516020036128425760005b602081108015612741575082818151811061272f5761272f613336565b01602001516001600160f81b03191615155b15612758578061275081613362565b915050612712565b806000036127905750506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b6020820152919050565b6000816001600160401b038111156127aa576127aa612e47565b6040519080825280601f01601f1916602001820160405280156127d4576020820181803683370190505b50905060005b8281101561283a578481815181106127f4576127f4613336565b602001015160f81c60f81b82828151811061281157612811613336565b60200101906001600160f81b031916908160001a9053508061283281613362565b9150506127da565b509392505050565b50506040805180820190915260128152714e4f545f56414c49445f454e434f44494e4760701b602082015290565b919050565b606854600090610100900463ffffffff16158015612899575063ffffffff82166001145b156128ab575063ffffffff82166128d2565b6128bf600160201b63ffffffff84166133fc565b6128cf9063ffffffff8516613413565b90505b600881901c60008181526069602052604081208054600160ff861690811b9182189283905592909190818316900361161857604051630c8d9eab60e31b815260040160405180910390fd5b6000612972826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a169092919063ffffffff16565b80519091501561211d57808060200190518101906129909190613a5c565b61211d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611988565b600054610100900460ff1661265a5760405162461bcd60e51b81526004016119889061399b565b606061091d848460008585600080866001600160a01b03168587604051612a3d9190613436565b60006040518083038185875af1925050503d8060008114612a7a576040519150601f19603f3d011682016040523d82523d6000602084013e612a7f565b606091505b5091509150612a9087838387612a9b565b979650505050505050565b60608315612b0a578251600003612b03576001600160a01b0385163b612b035760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611988565b508161091d565b61091d8383815115612b1f5781518083602001fd5b8060405162461bcd60e51b81526004016119889190612ccf565b803563ffffffff8116811461287057600080fd5b6001600160a01b0381168114612b6257600080fd5b50565b60008060408385031215612b7857600080fd5b612b8183612b39565b91506020830135612b9181612b4d565b809150509250929050565b6001600160a01b0391909116815260200190565b8015158114612b6257600080fd5b60008083601f840112612bd057600080fd5b5081356001600160401b03811115612be757600080fd5b602083019150836020828501011115612bff57600080fd5b9250929050565b600080600080600060808688031215612c1e57600080fd5b612c2786612b39565b94506020860135612c3781612b4d565b93506040860135612c4781612bb0565b925060608601356001600160401b03811115612c6257600080fd5b612c6e88828901612bbe565b969995985093965092949392505050565b60005b83811015612c9a578181015183820152602001612c82565b50506000910152565b60008151808452612cbb816020860160208601612c7f565b601f01601f19169290920160200192915050565b602081526000612ce26020830184612ca3565b9392505050565b600060208284031215612cfb57600080fd5b8135612ce281612b4d565b60ff81168114612b6257600080fd5b600080600080600080600060e0888a031215612d3057600080fd5b8735612d3b81612d06565b9650612d4960208901612b39565b95506040880135612d5981612b4d565b9450612d6760608901612b39565b93506080880135612d7781612b4d565b9699959850939692959460a0840135945060c09093013592915050565b600080600060608486031215612da957600080fd5b612db284612b39565b92506020840135612dc281612b4d565b91506040840135612dd281612b4d565b809150509250925092565b600060208284031215612def57600080fd5b5035919050565b80610400810183101561068d57600080fd5b60008060006104408486031215612e1e57600080fd5b83359250612e2f8560208601612df6565b9150612e3e6104208501612b39565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715612e8557612e85612e47565b604052919050565b60006001600160401b03821115612ea657612ea6612e47565b50601f01601f191660200190565b6000612ec7612ec284612e8d565b612e5d565b9050828152838383011115612edb57600080fd5b828260208301376000602084830101529392505050565b600082601f830112612f0357600080fd5b612ce283833560208501612eb4565b600080600080600060a08688031215612f2a57600080fd5b612f3386612b39565b94506020860135612f4381612b4d565b935060408601356001600160401b0380821115612f5f57600080fd5b612f6b89838a01612ef2565b94506060880135915080821115612f8157600080fd5b50612f8e88828901612ef2565b9250506080860135612f9f81612d06565b809150509295509295909350565b60008060008060008060a08789031215612fc657600080fd5b612fcf87612b39565b95506020870135612fdf81612b4d565b9450604087013593506060870135612ff681612bb0565b925060808701356001600160401b0381111561301157600080fd5b61301d89828a01612bbe565b979a9699509497509295939492505050565b6000806040838503121561304257600080fd5b61304b83612b39565b915061305960208401612b39565b90509250929050565b6000806000806000806000806000806000806109208d8f03121561308557600080fd5b61308f8e8e612df6565b9b5061309f8e6104008f01612df6565b9a506108008d013599506108208d013598506108408d013597506130c66108608e01612b39565b96506130d66108808e0135612b4d565b6108808d013595506130eb6108a08e01612b39565b94506130fb6108c08e0135612b4d565b6108c08d013593506108e08d013592506001600160401b036109008e0135111561312457600080fd5b6131358e6109008f01358f01612bbe565b81935080925050509295989b509295989b509295989b565b600080600080600080600060c0888a03121561316857600080fd5b61317188612b39565b9650602088013561318181612b4d565b955060408801359450606088013561319881612b4d565b935060808801356131a881612bb0565b925060a08801356001600160401b038111156131c357600080fd5b6131cf8a828b01612bbe565b989b979a50959850939692959293505050565b60008060008060008060c087890312156131fb57600080fd5b61320487612b39565b9550602087013561321481612b4d565b945061322260408801612b39565b9350606087013561323281612b4d565b9250608087013561324281612b4d565b915060a08701356001600160401b0381111561325d57600080fd5b8701601f8101891361326e57600080fd5b61327d89823560208401612eb4565b9150509295509295509295565b60008060008061046085870312156132a157600080fd5b843593506132b28660208701612df6565b92506132c16104208601612b39565b939692955092936104400135925050565b60e09290921b6001600160e01b031916825260601b6001600160601b031916600482015260180190565b600181811c9082168061331057607f821691505b60208210810361333057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133745761337461334c565b5060010190565b60608152600061338e6060830186612ca3565b82810360208401526133a08186612ca3565b91505060ff83166040830152949350505050565b600083516133c6818460208801612c7f565b8351908301906133da818360208801612c7f565b01949350505050565b6001600160a01b03929092168252602082015260400190565b808202811582820484141761068d5761068d61334c565b8082018082111561068d5761068d61334c565b8183823760009101908152919050565b60008251613448818460208701612c7f565b9190910192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff861681526001600160a01b03858116602083015284166040820152608060608201819052600090612a909083018486613452565b94855263ffffffff9390931660208501526001600160a01b039182166040850152166060830152608082015260a00190565b6000602082840312156134f857600080fd5b5051919050565b8181038181111561068d5761068d61334c565b60ff8916815263ffffffff88811660208301526001600160a01b03888116604084015287821660608401528616608083015260a0820185905261010060c0830181905260009161356484830187612ca3565b925080851660e085015250509998505050505050505050565b6001600160a01b038516815263ffffffff841660208201526060604082018190526000906135ae9083018486613452565b9695505050505050565b601f82111561211d57600081815260208120601f850160051c810160208610156135df5750805b601f850160051c820191505b81811015610bfc578281556001016135eb565b81516001600160401b0381111561361757613617612e47565b61362b8161362584546132fc565b846135b8565b602080601f83116001811461366057600084156136485750858301515b600019600386901b1c1916600185901b178555610bfc565b600085815260208120601f198616915b8281101561368f57888601518255948401946001909101908401613670565b50858210156136ad5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60ff8a16815263ffffffff89811660208301526001600160a01b03898116604084015288821660608401528716608083015260a0820186905261010060c083018190526000916137108483018789613452565b925080851660e085015250509a9950505050505050505050565b60006020828403121561373c57600080fd5b8151612ce281612d06565b63ffffffff8181168382160190808211156121975761219761334c565b6000808585111561377457600080fd5b8386111561378157600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156137b65780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a0312156137d957600080fd5b87356137e481612b4d565b965060208801356137f481612b4d565b955060408801359450606088013593506080880135612d7781612d06565b600080600080600080600080610100898b03121561382f57600080fd5b883561383a81612b4d565b9750602089013561384a81612b4d565b96506040890135955060608901359450608089013561386881612bb0565b935060a089013561387881612d06565b979a969950949793969295929450505060c08201359160e0013590565b600181815b808511156138d05781600019048211156138b6576138b661334c565b808516156138c357918102915b93841c939080029061389a565b509250929050565b6000826138e75750600161068d565b816138f45750600061068d565b816001811461390a576002811461391457613930565b600191505061068d565b60ff8411156139255761392561334c565b50506001821b61068d565b5060208310610133831016604e8410600b8410161715613953575081810a61068d565b61395d8383613895565b80600019048211156139715761397161334c565b029392505050565b6000612ce283836138d8565b634e487b7160e01b600052600160045260246000fd5b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156139f857600080fd5b81516001600160401b03811115613a0e57600080fd5b8201601f81018413613a1f57600080fd5b8051613a2d612ec282612e8d565b818152856020838501011115613a4257600080fd5b613a53826020830160208601612c7f565b95945050505050565b600060208284031215613a6e57600080fd5b8151612ce281612bb056fe6101006040523480156200001257600080fd5b5060405162001b6638038062001b6683398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516116aa620004bc6000396000610237015260008181610307015281816105c001526106a70152600061053a015260008181610379015261050401526116aa6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063a457c2d71161008c578063d505accf11610066578063d505accf1461039b578063dd62ed3e146103ae578063ffa1ad74146103f457600080fd5b8063a457c2d71461034e578063a9059cbb14610361578063cd0d00961461037457600080fd5b806395d89b41116100bd57806395d89b41146102e75780639dc29fac146102ef578063a3c573eb1461030257600080fd5b806370a08231146102915780637ecebe00146102c757600080fd5b806330adf81f1161012f5780633644e515116101145780633644e51514610261578063395093511461026957806340c10f191461027c57600080fd5b806330adf81f14610209578063313ce5671461023057600080fd5b806318160ddd1161016057806318160ddd146101bd57806320606b70146101cf57806323b872dd146101f657600080fd5b806306fdde031461017c578063095ea7b31461019a575b600080fd5b610184610430565b60405161019191906113e4565b60405180910390f35b6101ad6101a8366004611479565b6104c2565b6040519015158152602001610191565b6002545b604051908152602001610191565b6101c17f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6101ad6102043660046114a3565b6104dc565b6101c17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610191565b6101c1610500565b6101ad610277366004611479565b61055c565b61028f61028a366004611479565b6105a8565b005b6101c161029f3660046114df565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101c16102d53660046114df565b60056020526000908152604090205481565b610184610680565b61028f6102fd366004611479565b61068f565b6103297f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610191565b6101ad61035c366004611479565b61075e565b6101ad61036f366004611479565b61082f565b6101c17f000000000000000000000000000000000000000000000000000000000000000081565b61028f6103a9366004611501565b61083d565b6101c16103bc366004611574565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101846040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60606003805461043f906115a7565b80601f016020809104026020016040519081016040528092919081815260200182805461046b906115a7565b80156104b85780601f1061048d576101008083540402835291602001916104b8565b820191906000526020600020905b81548152906001019060200180831161049b57829003601f168201915b5050505050905090565b6000336104d0818585610b73565b60019150505b92915050565b6000336104ea858285610d27565b6104f5858585610dfe565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000004614610537576105324661106d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104d090829086906105a3908790611629565b610b73565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084015b60405180910390fd5b61067c8282611135565b5050565b60606004805461043f906115a7565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d427269646765000000000000000000000000000000006064820152608401610669565b61067c8282611228565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610822576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610669565b6104f58286868403610b73565b6000336104d0818585610dfe565b834211156108cc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a204578706972656420706560448201527f726d6974000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a9190866109268361163c565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610991610500565b6040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281019190915260428101839052606201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610a55573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590610ad057508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b610b5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c696420736960448201527f676e6174757265000000000000000000000000000000000000000000000000006064820152608401610669565b610b678a8a8a610b73565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610cb8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610df85781811015610deb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610669565b610df88484848403610b73565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff8216610f44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610ffa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610df8565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611098610430565b8051602091820120604080518082018252600181527f310000000000000000000000000000000000000000000000000000000000000090840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b73ffffffffffffffffffffffffffffffffffffffff82166111b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610669565b80600260008282546111c49190611629565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff82166112cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610669565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d1a565b600060208083528351808285015260005b81811015611411578581018301518582016040015282016113f5565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b919050565b6000806040838503121561148c57600080fd5b61149583611450565b946020939093013593505050565b6000806000606084860312156114b857600080fd5b6114c184611450565b92506114cf60208501611450565b9150604084013590509250925092565b6000602082840312156114f157600080fd5b6114fa82611450565b9392505050565b600080600080600080600060e0888a03121561151c57600080fd5b61152588611450565b965061153360208901611450565b95506040880135945060608801359350608088013560ff8116811461155757600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561158757600080fd5b61159083611450565b915061159e60208401611450565b90509250929050565b600181811c908216806115bb57607f821691505b6020821081036115f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104d6576104d66115fa565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361166d5761166d6115fa565b506001019056fea26469706673582212208d88fee561cff7120d381c345cfc534cef8229a272dc5809d4bbb685ad67141164736f6c63430008110033a2646970667358221220914f18d5b241f0d10b2ebc814aadeee338ad60bad704683e414dad415cb2e14d64736f6c63430008140033" + }, + { + "contractName": "PolygonZkEVMBridge proxy", + "balance": "340282366920938463463374607431768211455", + "nonce": "1", + "address": "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8", + "bytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461086f565b610135565b61006b6100a336600461088a565b61017f565b3480156100b457600080fd5b506100bd6101f3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461086f565b610231565b34801561011257600080fd5b506100bd61025e565b61012361028c565b61013361012e610363565b61036d565b565b61013d610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816040518060200160405280600081525060006103d1565b50565b61017461011b565b610187610391565b73ffffffffffffffffffffffffffffffffffffffff1633036101eb576101e68383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103d1915050565b505050565b6101e661011b565b60006101fd610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610363565b905090565b61022e61011b565b90565b610239610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816103fc565b6000610268610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610391565b610294610391565b73ffffffffffffffffffffffffffffffffffffffff163303610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600061022161045d565b3660008037600080366000845af43d6000803e80801561038c573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6103da83610485565b6000825111806103e75750805b156101e6576103f683836104d2565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610425610391565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a1610174816104fe565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103b5565b61048e8161060a565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606104f7838360405180606001604052806027815260200161099f602791396106d5565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81166105a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035a565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b73ffffffffffffffffffffffffffffffffffffffff81163b6106ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161035a565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105c4565b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516106ff9190610931565b600060405180830381855af49150503d806000811461073a576040519150601f19603f3d011682016040523d82523d6000602084013e61073f565b606091505b50915091506107508683838761075a565b9695505050505050565b606083156107f05782516000036107e95773ffffffffffffffffffffffffffffffffffffffff85163b6107e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161035a565b50816107fa565b6107fa8383610802565b949350505050565b8151156108125781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035a919061094d565b803573ffffffffffffffffffffffffffffffffffffffff8116811461086a57600080fd5b919050565b60006020828403121561088157600080fd5b6104f782610846565b60008060006040848603121561089f57600080fd5b6108a884610846565b9250602084013567ffffffffffffffff808211156108c557600080fd5b818601915086601f8301126108d957600080fd5b8135818111156108e857600080fd5b8760208285010111156108fa57600080fd5b6020830194508093505050509250925092565b60005b83811015610928578181015183820152602001610910565b50506000910152565b6000825161094381846020870161090d565b9190910192915050565b602081526000825180602084015261096c81604085016020870161090d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220701a0c26bdd76686e63fc3c65e4f28a20ba3ecc8a60246733c0627e679c9804e64736f6c63430008140033", + "storage": { + "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", + "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000493732fb136a380920c390a85fc27d79c7b70756" + } + }, + { + "contractName": "PolygonZkEVMGlobalExitRootL2 implementation", + "balance": "0", + "nonce": "1", + "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + "bytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806301fd904414610051578063257b36321461006d57806333d6247d1461008d578063a3c573eb146100a2575b600080fd5b61005a60015481565b6040519081526020015b60405180910390f35b61005a61007b366004610162565b60006020819052908152604090205481565b6100a061009b366004610162565b6100ee565b005b6100c97f000000000000000000000000b7098a13a48ece087d3da15b2d28ece0f89819b881565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610064565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b7098a13a48ece087d3da15b2d28ece0f89819b8161461015d576040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600155565b60006020828403121561017457600080fd5b503591905056fea2646970667358221220ea2171e2c85c8bff947affc409ef6fc6a8fe82fb8c174ddeda988651e595d66564736f6c63430008140033" + }, + { + "contractName": "PolygonZkEVMGlobalExitRootL2 proxy", + "balance": "0", + "nonce": "1", + "address": "0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa", + "bytecode": "0x60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033", + "storage": { + "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", + "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000dc64a140aa3e981100a9beca4e685f962f0cf6c9" + } + }, + { + "contractName": "PolygonZkEVMTimelock", + "balance": "0", + "nonce": "1", + "address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", + "bytecode": "0x6080604052600436106101c65760003560e01c806364d62353116100f7578063b1c5f42711610095578063d547741f11610064578063d547741f14610661578063e38335e514610681578063f23a6e6114610694578063f27a0c92146106d957600080fd5b8063b1c5f427146105af578063bc197c81146105cf578063c4d252f514610614578063d45c44351461063457600080fd5b80638f61f4f5116100d15780638f61f4f5146104e157806391d1485414610515578063a217fddf14610566578063b08e51c01461057b57600080fd5b806364d62353146104815780638065657f146104a15780638f2a0bb0146104c157600080fd5b8063248a9ca31161016457806331d507501161013e57806331d50750146103c857806336568abe146103e85780633a6aae7214610408578063584b153e1461046157600080fd5b8063248a9ca3146103475780632ab0f529146103775780632f2ff15d146103a857600080fd5b80630d3cf6fc116101a05780630d3cf6fc1461026b578063134008d31461029f57806313bc9f20146102b2578063150b7a02146102d257600080fd5b806301d5062a146101d257806301ffc9a7146101f457806307bd02651461022957600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b506101f26101ed366004611c52565b6106ee565b005b34801561020057600080fd5b5061021461020f366004611cc7565b610783565b60405190151581526020015b60405180910390f35b34801561023557600080fd5b5061025d7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b604051908152602001610220565b34801561027757600080fd5b5061025d7f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b6101f26102ad366004611d09565b6107df565b3480156102be57600080fd5b506102146102cd366004611d75565b6108d7565b3480156102de57600080fd5b506103166102ed366004611e9a565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610220565b34801561035357600080fd5b5061025d610362366004611d75565b60009081526020819052604090206001015490565b34801561038357600080fd5b50610214610392366004611d75565b6000908152600160208190526040909120541490565b3480156103b457600080fd5b506101f26103c3366004611f02565b6108fd565b3480156103d457600080fd5b506102146103e3366004611d75565b610927565b3480156103f457600080fd5b506101f2610403366004611f02565b610940565b34801561041457600080fd5b5061043c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610220565b34801561046d57600080fd5b5061021461047c366004611d75565b6109f8565b34801561048d57600080fd5b506101f261049c366004611d75565b610a0e565b3480156104ad57600080fd5b5061025d6104bc366004611d09565b610ade565b3480156104cd57600080fd5b506101f26104dc366004611f73565b610b1d565b3480156104ed57600080fd5b5061025d7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc181565b34801561052157600080fd5b50610214610530366004611f02565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561057257600080fd5b5061025d600081565b34801561058757600080fd5b5061025d7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f78381565b3480156105bb57600080fd5b5061025d6105ca366004612025565b610d4f565b3480156105db57600080fd5b506103166105ea36600461214e565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561062057600080fd5b506101f261062f366004611d75565b610d94565b34801561064057600080fd5b5061025d61064f366004611d75565b60009081526001602052604090205490565b34801561066d57600080fd5b506101f261067c366004611f02565b610e8f565b6101f261068f366004612025565b610eb4565b3480156106a057600080fd5b506103166106af3660046121f8565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b3480156106e557600080fd5b5061025d611161565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc161071881611244565b6000610728898989898989610ade565b90506107348184611251565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a604051610770969594939291906122a6565b60405180910390a3505050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806107d957506107d98261139e565b92915050565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff1661085c5761085c8133611435565b600061086c888888888888610ade565b905061087881856114ed565b6108848888888861162a565b6000817fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588a8a8a8a6040516108bc94939291906122f1565b60405180910390a36108cd8161172e565b5050505050505050565b6000818152600160205260408120546001811180156108f65750428111155b9392505050565b60008281526020819052604090206001015461091881611244565b61092283836117d7565b505050565b60008181526001602052604081205481905b1192915050565b73ffffffffffffffffffffffffffffffffffffffff811633146109ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6109f482826118c7565b5050565b6000818152600160208190526040822054610939565b333014610a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201527f62652074696d656c6f636b00000000000000000000000000000000000000000060648201526084016109e1565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b6000868686868686604051602001610afb969594939291906122a6565b6040516020818303038152906040528051906020012090509695505050505050565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1610b4781611244565b888714610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b888514610c65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b6000610c778b8b8b8b8b8b8b8b610d4f565b9050610c838184611251565b60005b8a811015610d415780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e85818110610cc357610cc3612331565b9050602002016020810190610cd89190612360565b8d8d86818110610cea57610cea612331565b905060200201358c8c87818110610d0357610d03612331565b9050602002810190610d15919061237b565b8c8b604051610d29969594939291906122a6565b60405180910390a3610d3a8161240f565b9050610c86565b505050505050505050505050565b60008888888888888888604051602001610d709897969594939291906124f7565b60405160208183030381529060405280519060200120905098975050505050505050565b7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f783610dbe81611244565b610dc7826109f8565b610e53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20636160448201527f6e6e6f742062652063616e63656c6c656400000000000000000000000000000060648201526084016109e1565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610eaa81611244565b61092283836118c7565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff16610f3157610f318133611435565b878614610fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b87841461104f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b60006110618a8a8a8a8a8a8a8a610d4f565b905061106d81856114ed565b60005b8981101561114b5760008b8b8381811061108c5761108c612331565b90506020020160208101906110a19190612360565b905060008a8a848181106110b7576110b7612331565b9050602002013590503660008a8a868181106110d5576110d5612331565b90506020028101906110e7919061237b565b915091506110f78484848461162a565b84867fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588686868660405161112e94939291906122f1565b60405180910390a350505050806111449061240f565b9050611070565b506111558161172e565b50505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161580159061123257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166315064c966040518163ffffffff1660e01b8152600401602060405180830381865afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123291906125be565b1561123d5750600090565b5060025490565b61124e8133611435565b50565b61125a82610927565b156112e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201527f7265616479207363686564756c6564000000000000000000000000000000000060648201526084016109e1565b6112ef611161565b81101561137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e7460448201527f2064656c6179000000000000000000000000000000000000000000000000000060648201526084016109e1565b61138881426125e0565b6000928352600160205260409092209190915550565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806107d957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107d9565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f4576114738161197e565b61147e83602061199d565b60405160200161148f929190612617565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526109e191600401612698565b6114f6826108d7565b611582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b80158061159e5750600081815260016020819052604090912054145b6109f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e67206465706560448201527f6e64656e6379000000000000000000000000000000000000000000000000000060648201526084016109e1565b60008473ffffffffffffffffffffffffffffffffffffffff168484846040516116549291906126e9565b60006040518083038185875af1925050503d8060008114611691576040519150601f19603f3d011682016040523d82523d6000602084013e611696565b606091505b5050905080611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e67207460448201527f72616e73616374696f6e2072657665727465640000000000000000000000000060648201526084016109e1565b5050505050565b611737816108d7565b6117c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b600090815260016020819052604090912055565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118693390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60606107d973ffffffffffffffffffffffffffffffffffffffff831660145b606060006119ac8360026126f9565b6119b79060026125e0565b67ffffffffffffffff8111156119cf576119cf611d8e565b6040519080825280601f01601f1916602001820160405280156119f9576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611a3057611a30612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611a9357611a93612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000611acf8460026126f9565b611ada9060016125e0565b90505b6001811115611b77577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611b1b57611b1b612331565b1a60f81b828281518110611b3157611b31612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93611b7081612710565b9050611add565b5083156108f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109e1565b803573ffffffffffffffffffffffffffffffffffffffff81168114611c0457600080fd5b919050565b60008083601f840112611c1b57600080fd5b50813567ffffffffffffffff811115611c3357600080fd5b602083019150836020828501011115611c4b57600080fd5b9250929050565b600080600080600080600060c0888a031215611c6d57600080fd5b611c7688611be0565b965060208801359550604088013567ffffffffffffffff811115611c9957600080fd5b611ca58a828b01611c09565b989b979a50986060810135976080820135975060a09091013595509350505050565b600060208284031215611cd957600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108f657600080fd5b60008060008060008060a08789031215611d2257600080fd5b611d2b87611be0565b955060208701359450604087013567ffffffffffffffff811115611d4e57600080fd5b611d5a89828a01611c09565b979a9699509760608101359660809091013595509350505050565b600060208284031215611d8757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611e0457611e04611d8e565b604052919050565b600082601f830112611e1d57600080fd5b813567ffffffffffffffff811115611e3757611e37611d8e565b611e6860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611dbd565b818152846020838601011115611e7d57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611eb057600080fd5b611eb985611be0565b9350611ec760208601611be0565b925060408501359150606085013567ffffffffffffffff811115611eea57600080fd5b611ef687828801611e0c565b91505092959194509250565b60008060408385031215611f1557600080fd5b82359150611f2560208401611be0565b90509250929050565b60008083601f840112611f4057600080fd5b50813567ffffffffffffffff811115611f5857600080fd5b6020830191508360208260051b8501011115611c4b57600080fd5b600080600080600080600080600060c08a8c031215611f9157600080fd5b893567ffffffffffffffff80821115611fa957600080fd5b611fb58d838e01611f2e565b909b50995060208c0135915080821115611fce57600080fd5b611fda8d838e01611f2e565b909950975060408c0135915080821115611ff357600080fd5b506120008c828d01611f2e565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b60008060008060008060008060a0898b03121561204157600080fd5b883567ffffffffffffffff8082111561205957600080fd5b6120658c838d01611f2e565b909a50985060208b013591508082111561207e57600080fd5b61208a8c838d01611f2e565b909850965060408b01359150808211156120a357600080fd5b506120b08b828c01611f2e565b999c989b509699959896976060870135966080013595509350505050565b600082601f8301126120df57600080fd5b8135602067ffffffffffffffff8211156120fb576120fb611d8e565b8160051b61210a828201611dbd565b928352848101820192828101908785111561212457600080fd5b83870192505b848310156121435782358252918301919083019061212a565b979650505050505050565b600080600080600060a0868803121561216657600080fd5b61216f86611be0565b945061217d60208701611be0565b9350604086013567ffffffffffffffff8082111561219a57600080fd5b6121a689838a016120ce565b945060608801359150808211156121bc57600080fd5b6121c889838a016120ce565b935060808801359150808211156121de57600080fd5b506121eb88828901611e0c565b9150509295509295909350565b600080600080600060a0868803121561221057600080fd5b61221986611be0565b945061222760208701611be0565b93506040860135925060608601359150608086013567ffffffffffffffff81111561225157600080fd5b6121eb88828901611e0c565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a0604082015260006122dc60a08301868861225d565b60608301949094525060800152949350505050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061232760608301848661225d565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561237257600080fd5b6108f682611be0565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123b057600080fd5b83018035915067ffffffffffffffff8211156123cb57600080fd5b602001915036819003821315611c4b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612440576124406123e0565b5060010190565b81835260006020808501808196508560051b810191508460005b878110156124ea57828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030181126124a057600080fd5b8701858101903567ffffffffffffffff8111156124bc57600080fd5b8036038213156124cb57600080fd5b6124d686828461225d565b9a87019a9550505090840190600101612461565b5091979650505050505050565b60a0808252810188905260008960c08301825b8b8110156125455773ffffffffffffffffffffffffffffffffffffffff61253084611be0565b1682526020928301929091019060010161250a565b5083810360208501528881527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89111561257e57600080fd5b8860051b9150818a602083013701828103602090810160408501526125a69082018789612447565b60608401959095525050608001529695505050505050565b6000602082840312156125d057600080fd5b815180151581146108f657600080fd5b808201808211156107d9576107d96123e0565b60005b8381101561260e5781810151838201526020016125f6565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161264f8160178501602088016125f3565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161268c8160288401602088016125f3565b01602801949350505050565b60208152600082518060208401526126b78160408501602087016125f3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b8183823760009101908152919050565b80820281158282048414176107d9576107d96123e0565b60008161271f5761271f6123e0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220c474c39da3523b28ebfa5fd66c05b42d6ddcc4a57055483bdda32888b366016164736f6c63430008140033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000000e10", + "0xaedcc9e7897c0d335bdc5d92fe3a8b4f23727fe558cd1c19f332b28716a30559": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xf5e61edb9c9cc6bfbae4463e9a2b1dd6ac3b44ddef38f18016e56ba0363910d9": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x64494413541ff93b31aa309254e3fed72a7456e9845988b915b4c7a7ceba8814": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x60b9d94c75b7b3f721925089391e4644cd890cb5e6466f9596dfbd2c54e0b280": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x3412d5605ac6cd444957cedb533e5dacad6378b4bc819ebe3652188a665066d6": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x4b63b79f1e338a49559dcd3193ac9eecc50d0f275d24e97cc8c319e5a31a8bd0": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d706a": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", + "0x800d5dfe4bba53eedee06cd4546a27da8de00f12db83f56062976d4493fda899": "0x0000000000000000000000000000000000000000000000000000000000000001", + "0xc3ad33e20b0c56a223ad5104fff154aa010f8715b9c981fd38fdc60a4d1a52fc": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5" + } + }, + { + "accountName": "keyless Deployer", + "balance": "0", + "nonce": "1", + "address": "0x28BB4e66addE1f042B77E04cf7D3784C1dcDBbA3" + }, + { + "accountName": "deployer", + "balance": "100000000000000000000000", + "nonce": "8", + "address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + } + ] + } \ No newline at end of file diff --git a/test/config/node/genesis.local.json b/test/config/node/genesis.local.json deleted file mode 100644 index 042bd754..00000000 --- a/test/config/node/genesis.local.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "l1Config": { - "chainId": 1337, - "polygonZkEVMAddress": "0x8dAF17A20c9DBA35f005b6324F493785D239719d", - "polygonRollupManagerAddress": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", - "polTokenAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", - "polygonZkEVMGlobalExitRootAddress": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" - }, - "genesisBlockNumber": 138, - "root": "0xa64456534f3bbe93f991c0139342a0ef52df95c6999eaa5ec8a69741da407f9a", - "genesis": [ - { - "contractName": "PolygonZkEVMDeployer", - "balance": "0", - "nonce": "4", - "address": "0x51dbd54FCCb6b3A07738fd3E156D588e71f79973", - "bytecode": "0x6080604052600436106100705760003560e01c8063715018a61161004e578063715018a6146100e65780638da5cb5b146100fb578063e11ae6cb14610126578063f2fde38b1461013957600080fd5b80632b79805a146100755780634a94d4871461008a5780636d07dbf81461009d575b600080fd5b610088610083366004610927565b610159565b005b6100886100983660046109c7565b6101cb565b3480156100a957600080fd5b506100bd6100b8366004610a1e565b61020d565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b50610088610220565b34801561010757600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100bd565b610088610134366004610a40565b610234565b34801561014557600080fd5b50610088610154366004610a90565b61029b565b610161610357565b600061016e8585856103d8565b905061017a8183610537565b5060405173ffffffffffffffffffffffffffffffffffffffff821681527fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a15050505050565b6101d3610357565b6101de83838361057b565b506040517f25adb19089b6a549831a273acdf7908cff8b7ee5f551f8d1d37996cf01c5df5b90600090a1505050565b600061021983836105a9565b9392505050565b610228610357565b61023260006105b6565b565b61023c610357565b60006102498484846103d8565b60405173ffffffffffffffffffffffffffffffffffffffff821681529091507fba82f25fed02cd2a23d9f5d11c2ef588d22af5437cbf23bfe61d87257c480e4c9060200160405180910390a150505050565b6102a3610357565b73ffffffffffffffffffffffffffffffffffffffff811661034b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610354816105b6565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610232576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610342565b600083471015610444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e63650000006044820152606401610342565b81516000036104af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152606401610342565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152606401610342565b6060610219838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061062b565b60606105a1848484604051806060016040528060298152602001610b3d6029913961062b565b949350505050565b6000610219838330610744565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156106bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610342565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516106e69190610acf565b60006040518083038185875af1925050503d8060008114610723576040519150601f19603f3d011682016040523d82523d6000602084013e610728565b606091505b50915091506107398783838761076e565b979650505050505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b606083156108045782516000036107fd5773ffffffffffffffffffffffffffffffffffffffff85163b6107fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610342565b50816105a1565b6105a183838151156108195781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103429190610aeb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261088d57600080fd5b813567ffffffffffffffff808211156108a8576108a861084d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156108ee576108ee61084d565b8160405283815286602085880101111561090757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561093d57600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561096357600080fd5b61096f8883890161087c565b9350606087013591508082111561098557600080fd5b506109928782880161087c565b91505092959194509250565b803573ffffffffffffffffffffffffffffffffffffffff811681146109c257600080fd5b919050565b6000806000606084860312156109dc57600080fd5b6109e58461099e565b9250602084013567ffffffffffffffff811115610a0157600080fd5b610a0d8682870161087c565b925050604084013590509250925092565b60008060408385031215610a3157600080fd5b50508035926020909101359150565b600080600060608486031215610a5557600080fd5b8335925060208401359150604084013567ffffffffffffffff811115610a7a57600080fd5b610a868682870161087c565b9150509250925092565b600060208284031215610aa257600080fd5b6102198261099e565b60005b83811015610ac6578181015183820152602001610aae565b50506000910152565b60008251610ae1818460208701610aab565b9190910192915050565b6020815260008251806020840152610b0a816040850160208701610aab565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220964619cee0e0baf94c6f8763f013be157da5d54c89e5cff4a8caf4266e13f13a64736f6c63430008140033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266" - } - }, - { - "contractName": "ProxyAdmin", - "balance": "0", - "nonce": "1", - "address": "0xe34Fe58DDa5b8c6D547E4857E987633aa86a5e90", - "bytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461012b57806399a88ec41461013e578063f2fde38b1461015e578063f3b7dead1461017e57600080fd5b8063204e1c7a14610080578063715018a6146100c95780637eff275e146100e05780638da5cb5b14610100575b600080fd5b34801561008c57600080fd5b506100a061009b366004610608565b61019e565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d557600080fd5b506100de610255565b005b3480156100ec57600080fd5b506100de6100fb36600461062c565b610269565b34801561010c57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166100a0565b6100de610139366004610694565b6102f7565b34801561014a57600080fd5b506100de61015936600461062c565b61038c565b34801561016a57600080fd5b506100de610179366004610608565b6103e8565b34801561018a57600080fd5b506100a0610199366004610608565b6104a4565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907f5c60da1b00000000000000000000000000000000000000000000000000000000815260040190565b600060405180830381855afa9150503d8060008114610225576040519150601f19603f3d011682016040523d82523d6000602084013e61022a565b606091505b50915091508161023957600080fd5b8080602001905181019061024d9190610788565b949350505050565b61025d6104f0565b6102676000610571565b565b6102716104f0565b6040517f8f28397000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690638f283970906024015b600060405180830381600087803b1580156102db57600080fd5b505af11580156102ef573d6000803e3d6000fd5b505050505050565b6102ff6104f0565b6040517f4f1ef28600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690634f1ef28690349061035590869086906004016107a5565b6000604051808303818588803b15801561036e57600080fd5b505af1158015610382573d6000803e3d6000fd5b5050505050505050565b6103946104f0565b6040517f3659cfe600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152831690633659cfe6906024016102c1565b6103f06104f0565b73ffffffffffffffffffffffffffffffffffffffff8116610498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6104a181610571565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff166040516101ea907ff851a44000000000000000000000000000000000000000000000000000000000815260040190565b60005473ffffffffffffffffffffffffffffffffffffffff163314610267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048f565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff811681146104a157600080fd5b60006020828403121561061a57600080fd5b8135610625816105e6565b9392505050565b6000806040838503121561063f57600080fd5b823561064a816105e6565b9150602083013561065a816105e6565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156106a957600080fd5b83356106b4816105e6565b925060208401356106c4816105e6565b9150604084013567ffffffffffffffff808211156106e157600080fd5b818601915086601f8301126106f557600080fd5b81358181111561070757610707610665565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561074d5761074d610665565b8160405282815289602084870101111561076657600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561079a57600080fd5b8151610625816105e6565b73ffffffffffffffffffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b818110156107ef578581018301518582016060015282016107d3565b5060006060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea2646970667358221220c9867ffac53151bdb1305d8f5e3e883cd83e5270c7ec09cdc24e837b2e65239064736f6c63430008140033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000165878a594ca255338adfa4d48449f69242eb8f" - } - }, - { - "contractName": "PolygonZkEVMBridge implementation", - "balance": "0", - "nonce": "1", - "address": "0x12864938EADb26501034339667CabFB3d7045CD2", - "bytecode": "0x608060405260043610620001ff5760003560e01c806383f244031162000117578063ccaa2d1111620000a1578063ee25560b116200006c578063ee25560b1462000639578063f5efcd79146200066a578063f811bff7146200068f578063fb57083414620006b457600080fd5b8063ccaa2d1114620005ba578063cd58657914620005df578063d02103ca14620005f6578063dbc16976146200062157600080fd5b8063bab161bf11620000e2578063bab161bf1462000526578063be5831c7146200054a578063c00f14ab1462000570578063cc461632146200059557600080fd5b806383f2440314620004955780638ed7e3f214620004ba578063aaa13cc214620004dc578063b8b284d0146200050157600080fd5b80633c351e1011620001995780635ca1e16511620001645780635ca1e16514620004065780637843298b146200041e57806379e2cf97146200044357806381b1c174146200045b57600080fd5b80633c351e1014620003615780633cbc795b14620003835780633e19704314620003bf5780634b2f336d14620003e457600080fd5b8063240ff37811620001da578063240ff378146200028d57806327aef4e814620002a45780632dfdf0b514620002cb578063318aee3d14620002f257600080fd5b806315064c9614620002045780632072f6c5146200023557806322e95f2c146200024f575b600080fd5b3480156200021157600080fd5b50606854620002209060ff1681565b60405190151581526020015b60405180910390f35b3480156200024257600080fd5b506200024d620006d9565b005b3480156200025c57600080fd5b50620002746200026e366004620031fd565b62000711565b6040516001600160a01b0390911681526020016200022c565b6200024d6200029e36600462003294565b6200077c565b348015620002b157600080fd5b50620002bc6200080a565b6040516200022c91906200336c565b348015620002d857600080fd5b50620002e360535481565b6040519081526020016200022c565b348015620002ff57600080fd5b506200033c6200031136600462003388565b606b6020526000908152604090205463ffffffff81169064010000000090046001600160a01b031682565b6040805163ffffffff90931683526001600160a01b039091166020830152016200022c565b3480156200036e57600080fd5b50606d5462000274906001600160a01b031681565b3480156200039057600080fd5b50606d54620003a990600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016200022c565b348015620003cc57600080fd5b50620002e3620003de366004620033b8565b620008a0565b348015620003f157600080fd5b50606f5462000274906001600160a01b031681565b3480156200041357600080fd5b50620002e36200094a565b3480156200042b57600080fd5b50620002746200043d36600462003442565b62000a30565b3480156200045057600080fd5b506200024d62000a61565b3480156200046857600080fd5b50620002746200047a36600462003492565b606a602052600090815260409020546001600160a01b031681565b348015620004a257600080fd5b50620002e3620004b4366004620034bf565b62000a85565b348015620004c757600080fd5b50606c5462000274906001600160a01b031681565b348015620004e957600080fd5b5062000274620004fb366004620035de565b62000b69565b3480156200050e57600080fd5b506200024d6200052036600462003687565b62000cb7565b3480156200053357600080fd5b50606854620003a990610100900463ffffffff1681565b3480156200055757600080fd5b50606854620003a990600160c81b900463ffffffff1681565b3480156200057d57600080fd5b50620002bc6200058f36600462003388565b62000d9d565b348015620005a257600080fd5b5062000220620005b436600462003714565b62000dea565b348015620005c757600080fd5b506200024d620005d93660046200374c565b62000e7b565b6200024d620005f036600462003848565b6200140e565b3480156200060357600080fd5b5060685462000274906501000000000090046001600160a01b031681565b3480156200062e57600080fd5b506200024d620018c2565b3480156200064657600080fd5b50620002e36200065836600462003492565b60696020526000908152604090205481565b3480156200067757600080fd5b506200024d620006893660046200374c565b620018f8565b3480156200069c57600080fd5b506200024d620006ae366004620038ea565b62001be2565b348015620006c157600080fd5b5062000220620006d3366004620039a2565b62001f1b565b606c546001600160a01b031633146200070557604051631736745960e31b815260040160405180910390fd5b6200070f62001f35565b565b6040805160e084901b6001600160e01b031916602080830191909152606084901b6bffffffffffffffffffffffff1916602483015282516018818403018152603890920183528151918101919091206000908152606a90915220546001600160a01b03165b92915050565b60685460ff1615620007a157604051630bc011ff60e21b815260040160405180910390fd5b3415801590620007bb5750606f546001600160a01b031615155b15620007f3576040517f6f625c4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6200080385853486868662001f92565b5050505050565b606e80546200081990620039ef565b80601f01602080910402602001604051908101604052809291908181526020018280546200084790620039ef565b8015620008985780601f106200086c5761010080835404028352916020019162000898565b820191906000526020600020905b8154815290600101906020018083116200087a57829003601f168201915b505050505081565b6040517fff0000000000000000000000000000000000000000000000000000000000000060f889901b1660208201526001600160e01b031960e088811b821660218401526bffffffffffffffffffffffff19606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b605354600090819081805b602081101562000a27578083901c600116600103620009b8576033816020811062000984576200098462003a2b565b01546040805160208101929092528101859052606001604051602081830303815290604052805190602001209350620009e5565b60408051602081018690529081018390526060016040516020818303038152906040528051906020012093505b6040805160208101849052908101839052606001604051602081830303815290604052805190602001209150808062000a1e9062003a57565b91505062000955565b50919392505050565b600062000a59848462000a438562002066565b62000a4e866200215c565b620004fb8762002247565b949350505050565b605354606854600160c81b900463ffffffff1610156200070f576200070f62002321565b600083815b602081101562000b6057600163ffffffff8516821c8116900362000afc5784816020811062000abd5762000abd62003a2b565b60200201358260405160200162000ade929190918252602082015260400190565b60405160208183030381529060405280519060200120915062000b4b565b8185826020811062000b125762000b1262003a2b565b602002013560405160200162000b32929190918252602082015260400190565b6040516020818303038152906040528051906020012091505b8062000b578162003a57565b91505062000a8a565b50949350505050565b6040516001600160e01b031960e087901b1660208201526bffffffffffffffffffffffff19606086901b1660248201526000908190603801604051602081830303815290604052805190602001209050600060ff60f81b30836040518060200162000bd490620031c1565b601f1982820381018352601f90910116604081905262000bfd908b908b908b9060200162003a73565b60408051601f198184030181529082905262000c1d929160200162003ab0565b6040516020818303038152906040528051906020012060405160200162000c9394939291907fff0000000000000000000000000000000000000000000000000000000000000094909416845260609290921b6bffffffffffffffffffffffff191660018401526015830152603582015260550190565b60408051808303601f19018152919052805160209091012098975050505050505050565b60685460ff161562000cdc57604051630bc011ff60e21b815260040160405180910390fd5b606f546001600160a01b031662000d1f576040517fdde3cda700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606f54604051632770a7eb60e21b8152336004820152602481018690526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b15801562000d6c57600080fd5b505af115801562000d81573d6000803e3d6000fd5b5050505062000d9586868686868662001f92565b505050505050565b606062000daa8262002066565b62000db5836200215c565b62000dc08462002247565b60405160200162000dd49392919062003a73565b6040516020818303038152906040529050919050565b6068546000908190610100900463ffffffff1615801562000e11575063ffffffff83166001145b1562000e25575063ffffffff831662000e51565b62000e3c64010000000063ffffffff851662003ae3565b62000e4e9063ffffffff861662003afd565b90505b600881901c600090815260696020526040902054600160ff9092169190911b908116149392505050565b60685460ff161562000ea057604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff868116610100909204161462000ed1576040516302caf51760e11b815260040160405180910390fd5b62000f0b8c8c8c8c8c62000f0560008e8e8e8e8e8e8e60405162000ef792919062003b13565b6040518091039020620008a0565b620023d9565b6001600160a01b0386166200106a57606f546001600160a01b031662000ffc5760006001600160a01b03851684825b6040519080825280601f01601f19166020018201604052801562000f65576020820181803683370190505b5060405162000f75919062003b23565b60006040518083038185875af1925050503d806000811462000fb4576040519150601f19603f3d011682016040523d82523d6000602084013e62000fb9565b606091505b505090508062000ff5576040517f6747a28800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50620013a4565b606f546040516340c10f1960e01b81526001600160a01b03868116600483015260248201869052909116906340c10f1990604401600060405180830381600087803b1580156200104b57600080fd5b505af115801562001060573d6000803e3d6000fd5b50505050620013a4565b606d546001600160a01b038781169116148015620010995750606d5463ffffffff888116600160a01b90920416145b15620010b35760006001600160a01b038516848262000f3a565b60685463ffffffff610100909104811690881603620010e857620010e26001600160a01b038716858562002583565b620013a4565b6040516001600160e01b031960e089901b1660208201526bffffffffffffffffffffffff19606088901b16602482015260009060380160408051601f1981840301815291815281516020928301206000818152606a9093529120549091506001600160a01b0316806200133c5760008080620011678688018862003b41565b9250925092506000858484846040516200118190620031c1565b6200118f9392919062003a73565b8190604051809103906000f5905080158015620011b0573d6000803e3d6000fd5b506040516340c10f1960e01b81526001600160a01b038c81166004830152602482018c9052919250908216906340c10f1990604401600060405180830381600087803b1580156200120057600080fd5b505af115801562001215573d6000803e3d6000fd5b5050505080606a600088815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060405180604001604052808e63ffffffff1681526020018d6001600160a01b0316815250606b6000836001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816001600160a01b0302191690836001600160a01b031602179055509050507f490e59a1701b938786ac72570a1efeac994a3dbe96e2e883e19e902ace6e6a398d8d838b8b6040516200132a95949392919062003be0565b60405180910390a150505050620013a1565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b1580156200138757600080fd5b505af11580156200139c573d6000803e3d6000fd5b505050505b50505b604080518b815263ffffffff891660208201526001600160a01b0388811682840152861660608201526080810185905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a1505050505050505050505050565b60685460ff16156200143357604051630bc011ff60e21b815260040160405180910390fd5b6200143d62002606565b60685463ffffffff6101009091048116908816036200146f576040516302caf51760e11b815260040160405180910390fd5b6000806060876001600160a01b0388166200157957883414620014be576040517fb89240f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606d54606e80546001600160a01b0383169650600160a01b90920463ffffffff16945090620014ed90620039ef565b80601f01602080910402602001604051908101604052809291908181526020018280546200151b90620039ef565b80156200156c5780601f1062001540576101008083540402835291602001916200156c565b820191906000526020600020905b8154815290600101906020018083116200154e57829003601f168201915b505050505091506200182d565b3415620015b2576040517f798ee6f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606f546001600160a01b03908116908916036200163157604051632770a7eb60e21b8152336004820152602481018a90526001600160a01b03891690639dc29fac90604401600060405180830381600087803b1580156200161257600080fd5b505af115801562001627573d6000803e3d6000fd5b505050506200182d565b6001600160a01b038089166000908152606b602090815260409182902082518084019093525463ffffffff8116835264010000000090049092169181018290529015620016ee57604051632770a7eb60e21b8152336004820152602481018b90526001600160a01b038a1690639dc29fac90604401600060405180830381600087803b158015620016c157600080fd5b505af1158015620016d6573d6000803e3d6000fd5b5050505080602001519450806000015193506200181e565b8515620017035762001703898b898962002661565b6040516370a0823160e01b81523060048201526000906001600160a01b038b16906370a0823190602401602060405180830381865afa1580156200174b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001771919062003c1b565b90506200178a6001600160a01b038b1633308e62002a27565b6040516370a0823160e01b81523060048201526000906001600160a01b038c16906370a0823190602401602060405180830381865afa158015620017d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620017f8919062003c1b565b905062001806828262003c35565b6068548c9850610100900463ffffffff169650935050505b620018298962000d9d565b9250505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600084868e8e86886053546040516200186f98979695949392919062003c4b565b60405180910390a16200189a62001894600085878f8f878980519060200120620008a0565b62002a7a565b8615620018ab57620018ab62002321565b50505050620018b960018055565b50505050505050565b606c546001600160a01b03163314620018ee57604051631736745960e31b815260040160405180910390fd5b6200070f62002b92565b60685460ff16156200191d57604051630bc011ff60e21b815260040160405180910390fd5b60685463ffffffff86811661010090920416146200194e576040516302caf51760e11b815260040160405180910390fd5b620019748c8c8c8c8c62000f0560018e8e8e8e8e8e8e60405162000ef792919062003b13565b606f546000906001600160a01b031662001a3357846001600160a01b031684888a8686604051602401620019ac949392919062003cb7565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b17905251620019e3919062003b23565b60006040518083038185875af1925050503d806000811462001a22576040519150601f19603f3d011682016040523d82523d6000602084013e62001a27565b606091505b50508091505062001b3f565b606f546040516340c10f1960e01b81526001600160a01b03878116600483015260248201879052909116906340c10f1990604401600060405180830381600087803b15801562001a8257600080fd5b505af115801562001a97573d6000803e3d6000fd5b50505050846001600160a01b03168789858560405160240162001abe949392919062003cb7565b60408051601f198184030181529181526020820180516001600160e01b0316630c035af960e11b1790525162001af5919062003b23565b6000604051808303816000865af19150503d806000811462001b34576040519150601f19603f3d011682016040523d82523d6000602084013e62001b39565b606091505b50909150505b8062001b77576040517f37e391c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518c815263ffffffff8a1660208201526001600160a01b0389811682840152871660608201526080810186905290517f1df3f2a973a00d6635911755c260704e95e8a5876997546798770f76396fda4d9181900360a00190a150505050505050505050505050565b600054610100900460ff161580801562001c035750600054600160ff909116105b8062001c1f5750303b15801562001c1f575060005460ff166001145b62001c975760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b6000805460ff19166001179055801562001cbb576000805461ff0019166101001790555b606880547fffffffffffffff000000000000000000000000000000000000000000000000ff1661010063ffffffff8a16027fffffffffffffff0000000000000000000000000000000000000000ffffffffff1617650100000000006001600160a01b038781169190910291909117909155606c805473ffffffffffffffffffffffffffffffffffffffff1916858316179055861662001d995763ffffffff85161562001d93576040517f1a874c1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62001ec2565b606d805463ffffffff8716600160a01b027fffffffffffffffff0000000000000000000000000000000000000000000000009091166001600160a01b03891617179055606e62001dea838262003d3c565b506000801b601260405162001dff90620031c1565b6060808252600d908201527f5772617070656420457468657200000000000000000000000000000000000000608082015260a0602082018190526004908201527f574554480000000000000000000000000000000000000000000000000000000060c082015260ff909116604082015260e0018190604051809103906000f590508015801562001e93573d6000803e3d6000fd5b50606f805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790555b62001ecc62002c04565b8015620018b9576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050505050565b60008162001f2b86868662000a85565b1495945050505050565b60685460ff161562001f5a57604051630bc011ff60e21b815260040160405180910390fd5b6068805460ff191660011790556040517f2261efe5aef6fedc1fd1550b25facc9181745623049c7901287030b9ad1a549790600090a1565b60685463ffffffff61010090910481169087160362001fc4576040516302caf51760e11b815260040160405180910390fd5b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b6001606860019054906101000a900463ffffffff163389898988886053546040516200201a9998979695949392919062003e09565b60405180910390a162002055620018946001606860019054906101000a900463ffffffff16338a8a8a898960405162000ef792919062003b13565b821562000d955762000d9562002321565b60408051600481526024810182526020810180516001600160e01b03167f06fdde0300000000000000000000000000000000000000000000000000000000179052905160609160009182916001600160a01b03861691620020c8919062003b23565b600060405180830381855afa9150503d806000811462002105576040519150601f19603f3d011682016040523d82523d6000602084013e6200210a565b606091505b50915091508162002151576040518060400160405280600781526020017f4e4f5f4e414d450000000000000000000000000000000000000000000000000081525062000a59565b62000a598162002c7b565b60408051600481526024810182526020810180516001600160e01b03167f95d89b4100000000000000000000000000000000000000000000000000000000179052905160609160009182916001600160a01b03861691620021be919062003b23565b600060405180830381855afa9150503d8060008114620021fb576040519150601f19603f3d011682016040523d82523d6000602084013e62002200565b606091505b50915091508162002151576040518060400160405280600981526020017f4e4f5f53594d424f4c000000000000000000000000000000000000000000000081525062000a59565b60408051600481526024810182526020810180516001600160e01b03167f313ce567000000000000000000000000000000000000000000000000000000001790529051600091829182916001600160a01b03861691620022a8919062003b23565b600060405180830381855afa9150503d8060008114620022e5576040519150601f19603f3d011682016040523d82523d6000602084013e620022ea565b606091505b5091509150818015620022fe575080516020145b6200230b57601262000a59565b8080602001905181019062000a59919062003e77565b6053546068805463ffffffff909216600160c81b027fffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffff90921691909117908190556001600160a01b0365010000000000909104166333d6247d620023846200094a565b6040518263ffffffff1660e01b8152600401620023a391815260200190565b600060405180830381600087803b158015620023be57600080fd5b505af1158015620023d3573d6000803e3d6000fd5b50505050565b606854604080516020808201879052818301869052825180830384018152606083019384905280519101207f257b36320000000000000000000000000000000000000000000000000000000090925260648101919091526000916501000000000090046001600160a01b03169063257b3632906084016020604051808303816000875af11580156200246f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002495919062003c1b565b905080600003620024d1576040517e2f6fad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080680100000000000000008716156200251b57869150620024f7848a848962001f1b565b62002515576040516338105f3b60e21b815260040160405180910390fd5b6200256c565b602087901c6200252d81600162003e97565b91508792506200254c62002543868c8662000a85565b8a838962001f1b565b6200256a576040516338105f3b60e21b815260040160405180910390fd5b505b62002578828262002e6b565b505050505050505050565b6040516001600160a01b038316602482015260448101829052620026019084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915262002f35565b505050565b6002600154036200265a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162001c8e565b6002600155565b600062002672600482848662003ebe565b6200267d9162003eea565b90507f2afa5331000000000000000000000000000000000000000000000000000000006001600160e01b031982160162002869576000808080808080620026c8896004818d62003ebe565b810190620026d7919062003f1b565b9650965096509650965096509650336001600160a01b0316876001600160a01b031614620027185760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b0386163014620027425760405163750643af60e01b815260040160405180910390fd5b8a85146200277c576040517f03fffc4b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b0389811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180516001600160e01b03167fd505accf000000000000000000000000000000000000000000000000000000001790529151918e169162002815919062003b23565b6000604051808303816000865af19150503d806000811462002854576040519150601f19603f3d011682016040523d82523d6000602084013e62002859565b606091505b5050505050505050505062000803565b6001600160e01b031981166323f2ebc360e21b14620028b4576040517fe282c0ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080808080620028cc8a6004818e62003ebe565b810190620028db919062003f76565b97509750975097509750975097509750336001600160a01b0316886001600160a01b0316146200291e5760405163912ecce760e01b815260040160405180910390fd5b6001600160a01b0387163014620029485760405163750643af60e01b815260040160405180910390fd5b604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905286151560a483015260ff861660c483015260e482018590526101048083018590528351808403909101815261012490920183526020820180516001600160e01b03166323f2ebc360e21b1790529151918f1691620029d1919062003b23565b6000604051808303816000865af19150503d806000811462002a10576040519150601f19603f3d011682016040523d82523d6000602084013e62002a15565b606091505b50505050505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052620023d39085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401620025c9565b80600162002a8b60206002620040ff565b62002a97919062003c35565b6053541062002ad2576040517fef5ccf6600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060536000815462002ae59062003a57565b9182905550905060005b602081101562002b81578082901c60011660010362002b2757826033826020811062002b1f5762002b1f62003a2b565b015550505050565b6033816020811062002b3d5762002b3d62003a2b565b01546040805160208101929092528101849052606001604051602081830303815290604052805190602001209250808062002b789062003a57565b91505062002aef565b50620026016200410d565b60018055565b60685460ff1662002bcf576040517f5386698100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6068805460ff191690556040517f1e5e34eea33501aecf2ebec9fe0e884a40804275ea7fe10b2ba084c8374308b390600090a1565b600054610100900460ff1662002c715760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162001c8e565b6200070f62003021565b6060604082511062002c9d578180602001905181019062000776919062004123565b815160200362002e2d5760005b60208110801562002cf5575082818151811062002ccb5762002ccb62003a2b565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1562002d10578062002d078162003a57565b91505062002caa565b8060000362002d5457505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e4700000000000000000000000000006020820152919050565b60008167ffffffffffffffff81111562002d725762002d7262003503565b6040519080825280601f01601f19166020018201604052801562002d9d576020820181803683370190505b50905060005b8281101562002e255784818151811062002dc15762002dc162003a2b565b602001015160f81c60f81b82828151811062002de15762002de162003a2b565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508062002e1c8162003a57565b91505062002da3565b509392505050565b505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e470000000000000000000000000000602082015290565b919050565b606854600090610100900463ffffffff1615801562002e90575063ffffffff82166001145b1562002ea4575063ffffffff821662002ed0565b62002ebb64010000000063ffffffff841662003ae3565b62002ecd9063ffffffff851662003afd565b90505b600881901c60008181526069602052604081208054600160ff861690811b91821892839055929091908183169003620018b9576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600062002f8c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200308e9092919063ffffffff16565b80519091501562002601578080602001905181019062002fad9190620041a3565b620026015760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840162001c8e565b600054610100900460ff1662002b8c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840162001c8e565b606062000a59848460008585600080866001600160a01b03168587604051620030b8919062003b23565b60006040518083038185875af1925050503d8060008114620030f7576040519150601f19603f3d011682016040523d82523d6000602084013e620030fc565b606091505b50915091506200310f878383876200311a565b979650505050505050565b606083156200318e57825160000362003186576001600160a01b0385163b620031865760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162001c8e565b508162000a59565b62000a598383815115620031a55781518083602001fd5b8060405162461bcd60e51b815260040162001c8e91906200336c565b6117a780620041c483390190565b803563ffffffff8116811462002e6657600080fd5b6001600160a01b0381168114620031fa57600080fd5b50565b600080604083850312156200321157600080fd5b6200321c83620031cf565b915060208301356200322e81620031e4565b809150509250929050565b8015158114620031fa57600080fd5b60008083601f8401126200325b57600080fd5b50813567ffffffffffffffff8111156200327457600080fd5b6020830191508360208285010111156200328d57600080fd5b9250929050565b600080600080600060808688031215620032ad57600080fd5b620032b886620031cf565b94506020860135620032ca81620031e4565b93506040860135620032dc8162003239565b9250606086013567ffffffffffffffff811115620032f957600080fd5b620033078882890162003248565b969995985093965092949392505050565b60005b83811015620033355781810151838201526020016200331b565b50506000910152565b600081518084526200335881602086016020860162003318565b601f01601f19169290920160200192915050565b6020815260006200338160208301846200333e565b9392505050565b6000602082840312156200339b57600080fd5b81356200338181620031e4565b60ff81168114620031fa57600080fd5b600080600080600080600060e0888a031215620033d457600080fd5b8735620033e181620033a8565b9650620033f160208901620031cf565b955060408801356200340381620031e4565b94506200341360608901620031cf565b935060808801356200342581620031e4565b9699959850939692959460a0840135945060c09093013592915050565b6000806000606084860312156200345857600080fd5b6200346384620031cf565b925060208401356200347581620031e4565b915060408401356200348781620031e4565b809150509250925092565b600060208284031215620034a557600080fd5b5035919050565b8061040081018310156200077657600080fd5b60008060006104408486031215620034d657600080fd5b83359250620034e98560208601620034ac565b9150620034fa6104208501620031cf565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562003545576200354562003503565b604052919050565b600067ffffffffffffffff8211156200356a576200356a62003503565b50601f01601f191660200190565b60006200358f62003589846200354d565b62003519565b9050828152838383011115620035a457600080fd5b828260208301376000602084830101529392505050565b600082601f830112620035cd57600080fd5b620033818383356020850162003578565b600080600080600060a08688031215620035f757600080fd5b6200360286620031cf565b945060208601356200361481620031e4565b9350604086013567ffffffffffffffff808211156200363257600080fd5b6200364089838a01620035bb565b945060608801359150808211156200365757600080fd5b506200366688828901620035bb565b92505060808601356200367981620033a8565b809150509295509295909350565b60008060008060008060a08789031215620036a157600080fd5b620036ac87620031cf565b95506020870135620036be81620031e4565b9450604087013593506060870135620036d78162003239565b9250608087013567ffffffffffffffff811115620036f457600080fd5b6200370289828a0162003248565b979a9699509497509295939492505050565b600080604083850312156200372857600080fd5b6200373383620031cf565b91506200374360208401620031cf565b90509250929050565b6000806000806000806000806000806000806109208d8f0312156200377057600080fd5b6200377c8e8e620034ac565b9b506200378e8e6104008f01620034ac565b9a506108008d013599506108208d013598506108408d01359750620037b76108608e01620031cf565b9650620037c96108808e0135620031e4565b6108808d01359550620037e06108a08e01620031cf565b9450620037f26108c08e0135620031e4565b6108c08d013593506108e08d0135925067ffffffffffffffff6109008e013511156200381d57600080fd5b620038308e6109008f01358f0162003248565b81935080925050509295989b509295989b509295989b565b600080600080600080600060c0888a0312156200386457600080fd5b6200386f88620031cf565b965060208801356200388181620031e4565b95506040880135945060608801356200389a81620031e4565b93506080880135620038ac8162003239565b925060a088013567ffffffffffffffff811115620038c957600080fd5b620038d78a828b0162003248565b989b979a50959850939692959293505050565b60008060008060008060c087890312156200390457600080fd5b6200390f87620031cf565b955060208701356200392181620031e4565b94506200393160408801620031cf565b935060608701356200394381620031e4565b925060808701356200395581620031e4565b915060a087013567ffffffffffffffff8111156200397257600080fd5b8701601f810189136200398457600080fd5b620039958982356020840162003578565b9150509295509295509295565b6000806000806104608587031215620039ba57600080fd5b84359350620039cd8660208701620034ac565b9250620039de6104208601620031cf565b939692955092936104400135925050565b600181811c9082168062003a0457607f821691505b60208210810362003a2557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162003a6c5762003a6c62003a41565b5060010190565b60608152600062003a8860608301866200333e565b828103602084015262003a9c81866200333e565b91505060ff83166040830152949350505050565b6000835162003ac481846020880162003318565b83519083019062003ada81836020880162003318565b01949350505050565b808202811582820484141762000776576200077662003a41565b8082018082111562000776576200077662003a41565b8183823760009101908152919050565b6000825162003b3781846020870162003318565b9190910192915050565b60008060006060848603121562003b5757600080fd5b833567ffffffffffffffff8082111562003b7057600080fd5b62003b7e87838801620035bb565b9450602086013591508082111562003b9557600080fd5b5062003ba486828701620035bb565b92505060408401356200348781620033a8565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b63ffffffff8616815260006001600160a01b038087166020840152808616604084015250608060608301526200310f60808301848662003bb7565b60006020828403121562003c2e57600080fd5b5051919050565b8181038181111562000776576200077662003a41565b600061010060ff8b16835263ffffffff808b1660208501526001600160a01b03808b166040860152818a1660608601528089166080860152508660a08501528160c085015262003c9e828501876200333e565b925080851660e085015250509998505050505050505050565b6001600160a01b038516815263ffffffff8416602082015260606040820152600062003ce860608301848662003bb7565b9695505050505050565b601f8211156200260157600081815260208120601f850160051c8101602086101562003d1b5750805b601f850160051c820191505b8181101562000d955782815560010162003d27565b815167ffffffffffffffff81111562003d595762003d5962003503565b62003d718162003d6a8454620039ef565b8462003cf2565b602080601f83116001811462003da9576000841562003d905750858301515b600019600386901b1c1916600185901b17855562000d95565b600085815260208120601f198616915b8281101562003dda5788860151825594840194600190910190840162003db9565b508582101562003df95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061010060ff8c16835263ffffffff808c1660208501526001600160a01b03808c166040860152818b166060860152808a166080860152508760a08501528160c085015262003e5d828501878962003bb7565b925080851660e085015250509a9950505050505050505050565b60006020828403121562003e8a57600080fd5b81516200338181620033a8565b63ffffffff81811683821601908082111562003eb75762003eb762003a41565b5092915050565b6000808585111562003ecf57600080fd5b8386111562003edd57600080fd5b5050820193919092039150565b6001600160e01b0319813581811691600485101562003f135780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a03121562003f3757600080fd5b873562003f4481620031e4565b9650602088013562003f5681620031e4565b9550604088013594506060880135935060808801356200342581620033a8565b600080600080600080600080610100898b03121562003f9457600080fd5b883562003fa181620031e4565b9750602089013562003fb381620031e4565b96506040890135955060608901359450608089013562003fd38162003239565b935060a089013562003fe581620033a8565b979a969950949793969295929450505060c08201359160e0013590565b600181815b808511156200404357816000190482111562004027576200402762003a41565b808516156200403557918102915b93841c939080029062004007565b509250929050565b6000826200405c5750600162000776565b816200406b5750600062000776565b81600181146200408457600281146200408f57620040af565b600191505062000776565b60ff841115620040a357620040a362003a41565b50506001821b62000776565b5060208310610133831016604e8410600b8410161715620040d4575081810a62000776565b620040e0838362004002565b8060001904821115620040f757620040f762003a41565b029392505050565b60006200338183836200404b565b634e487b7160e01b600052600160045260246000fd5b6000602082840312156200413657600080fd5b815167ffffffffffffffff8111156200414e57600080fd5b8201601f810184136200416057600080fd5b80516200417162003589826200354d565b8181528560208385010111156200418757600080fd5b6200419a82602083016020860162003318565b95945050505050565b600060208284031215620041b657600080fd5b815162003381816200323956fe6101006040523480156200001257600080fd5b50604051620017a7380380620017a783398101604081905262000035916200028d565b82826003620000458382620003a1565b506004620000548282620003a1565b50503360c0525060ff811660e052466080819052620000739062000080565b60a052506200046d915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620000ad6200012e565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6060600380546200013f9062000312565b80601f01602080910402602001604051908101604052809291908181526020018280546200016d9062000312565b8015620001be5780601f106200019257610100808354040283529160200191620001be565b820191906000526020600020905b815481529060010190602001808311620001a057829003601f168201915b5050505050905090565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001f057600080fd5b81516001600160401b03808211156200020d576200020d620001c8565b604051601f8301601f19908116603f01168101908282118183101715620002385762000238620001c8565b816040528381526020925086838588010111156200025557600080fd5b600091505b838210156200027957858201830151818301840152908201906200025a565b600093810190920192909252949350505050565b600080600060608486031215620002a357600080fd5b83516001600160401b0380821115620002bb57600080fd5b620002c987838801620001de565b94506020860151915080821115620002e057600080fd5b50620002ef86828701620001de565b925050604084015160ff811681146200030757600080fd5b809150509250925092565b600181811c908216806200032757607f821691505b6020821081036200034857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039c57600081815260208120601f850160051c81016020861015620003775750805b601f850160051c820191505b81811015620003985782815560010162000383565b5050505b505050565b81516001600160401b03811115620003bd57620003bd620001c8565b620003d581620003ce845462000312565b846200034e565b602080601f8311600181146200040d5760008415620003f45750858301515b600019600386901b1c1916600185901b17855562000398565b600085815260208120601f198616915b828110156200043e578886015182559484019460019091019084016200041d565b50858210156200045d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516112eb620004bc60003960006102370152600081816102fa015281816105630152610623015260006104f701526000818161035f01526104c101526112eb6000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063a457c2d71161008c578063d505accf11610066578063d505accf14610381578063dd62ed3e14610394578063ffa1ad74146103cd57600080fd5b8063a457c2d714610334578063a9059cbb14610347578063cd0d00961461035a57600080fd5b806395d89b41116100bd57806395d89b41146102da5780639dc29fac146102e2578063a3c573eb146102f557600080fd5b806370a08231146102915780637ecebe00146102ba57600080fd5b806330adf81f1161012f5780633644e515116101145780633644e51514610261578063395093511461026957806340c10f191461027c57600080fd5b806330adf81f14610209578063313ce5671461023057600080fd5b806318160ddd1161016057806318160ddd146101bd57806320606b70146101cf57806323b872dd146101f657600080fd5b806306fdde031461017c578063095ea7b31461019a575b600080fd5b6101846103ed565b60405161019191906110a1565b60405180910390f35b6101ad6101a836600461110b565b61047f565b6040519015158152602001610191565b6002545b604051908152602001610191565b6101c17f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6101ad610204366004611135565b610499565b6101c17f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610191565b6101c16104bd565b6101ad61027736600461110b565b610519565b61028f61028a36600461110b565b610558565b005b6101c161029f366004611171565b6001600160a01b031660009081526020819052604090205490565b6101c16102c8366004611171565b60056020526000908152604090205481565b610184610609565b61028f6102f036600461110b565b610618565b61031c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610191565b6101ad61034236600461110b565b6106c0565b6101ad61035536600461110b565b61076a565b6101c17f000000000000000000000000000000000000000000000000000000000000000081565b61028f61038f366004611193565b610778565b6101c16103a2366004611206565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610184604051806040016040528060018152602001603160f81b81525081565b6060600380546103fc90611239565b80601f016020809104026020016040519081016040528092919081815260200182805461042890611239565b80156104755780601f1061044a57610100808354040283529160200191610475565b820191906000526020600020905b81548152906001019060200180831161045857829003601f168201915b5050505050905090565b60003361048d8185856109fd565b60019150505b92915050565b6000336104a7858285610b56565b6104b2858585610be8565b506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104f4576104ef46610dd5565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061048d9082908690610553908790611289565b6109fd565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105fb5760405162461bcd60e51b815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084015b60405180910390fd5b6106058282610e81565b5050565b6060600480546103fc90611239565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106b65760405162461bcd60e51b815260206004820152603060248201527f546f6b656e577261707065643a3a6f6e6c794272696467653a204e6f7420506f60448201527f6c79676f6e5a6b45564d4272696467650000000000000000000000000000000060648201526084016105f2565b6106058282610f40565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091908381101561075d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016105f2565b6104b282868684036109fd565b60003361048d818585610be8565b834211156107ed5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e577261707065643a3a7065726d69743a204578706972656420706560448201527f726d69740000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b038716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a91908661083a8361129c565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006108986104bd565b6040517f1901000000000000000000000000000000000000000000000000000000000000602082015260228101919091526042810183905260620160408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa15801561093e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906109745750896001600160a01b0316816001600160a01b0316145b6109e65760405162461bcd60e51b815260206004820152602760248201527f546f6b656e577261707065643a3a7065726d69743a20496e76616c696420736960448201527f676e61747572650000000000000000000000000000000000000000000000000060648201526084016105f2565b6109f18a8a8a6109fd565b50505050505050505050565b6001600160a01b038316610a785760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b038216610af45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610be25781811015610bd55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016105f2565b610be284848484036109fd565b50505050565b6001600160a01b038316610c645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b038216610ce05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b03831660009081526020819052604090205481811015610d6f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610be2565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f610e006103ed565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018390523060a082015260c001604051602081830303815290604052805190602001209050919050565b6001600160a01b038216610ed75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105f2565b8060026000828254610ee99190611289565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b038216610fbc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b0382166000908152602081905260409020548181101561104b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016105f2565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610b49565b600060208083528351808285015260005b818110156110ce578581018301518582016040015282016110b2565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461110657600080fd5b919050565b6000806040838503121561111e57600080fd5b611127836110ef565b946020939093013593505050565b60008060006060848603121561114a57600080fd5b611153846110ef565b9250611161602085016110ef565b9150604084013590509250925092565b60006020828403121561118357600080fd5b61118c826110ef565b9392505050565b600080600080600080600060e0888a0312156111ae57600080fd5b6111b7886110ef565b96506111c5602089016110ef565b95506040880135945060608801359350608088013560ff811681146111e957600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561121957600080fd5b611222836110ef565b9150611230602084016110ef565b90509250929050565b600181811c9082168061124d57607f821691505b60208210810361126d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561049357610493611273565b6000600182016112ae576112ae611273565b506001019056fea2646970667358221220aee05225eb578ca4601af39623d6cec4d7df11fc43f9c71ce59466ac2db4e37864736f6c63430008140033a26469706673582212202371b7d4c0384f70a2b904847ca70da52a1432c9a54bc07a292aeb4703fc816864736f6c63430008140033" - }, - { - "contractName": "PolygonZkEVMBridge proxy", - "balance": "340282366920938463463374607431768211455", - "nonce": "1", - "address": "0xCca6ECD73932e49633B9307e1aa0fC174525F424", - "bytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461086f565b610135565b61006b6100a336600461088a565b61017f565b3480156100b457600080fd5b506100bd6101f3565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461086f565b610231565b34801561011257600080fd5b506100bd61025e565b61012361028c565b61013361012e610363565b61036d565b565b61013d610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816040518060200160405280600081525060006103d1565b50565b61017461011b565b610187610391565b73ffffffffffffffffffffffffffffffffffffffff1633036101eb576101e68383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103d1915050565b505050565b6101e661011b565b60006101fd610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610363565b905090565b61022e61011b565b90565b610239610391565b73ffffffffffffffffffffffffffffffffffffffff16330361017757610174816103fc565b6000610268610391565b73ffffffffffffffffffffffffffffffffffffffff16330361022657610221610391565b610294610391565b73ffffffffffffffffffffffffffffffffffffffff163303610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600061022161045d565b3660008037600080366000845af43d6000803e80801561038c573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6103da83610485565b6000825111806103e75750805b156101e6576103f683836104d2565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610425610391565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a1610174816104fe565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103b5565b61048e8161060a565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606104f7838360405180606001604052806027815260200161099f602791396106d5565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81166105a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161035a565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b73ffffffffffffffffffffffffffffffffffffffff81163b6106ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161035a565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105c4565b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516106ff9190610931565b600060405180830381855af49150503d806000811461073a576040519150601f19603f3d011682016040523d82523d6000602084013e61073f565b606091505b50915091506107508683838761075a565b9695505050505050565b606083156107f05782516000036107e95773ffffffffffffffffffffffffffffffffffffffff85163b6107e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161035a565b50816107fa565b6107fa8383610802565b949350505050565b8151156108125781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035a919061094d565b803573ffffffffffffffffffffffffffffffffffffffff8116811461086a57600080fd5b919050565b60006020828403121561088157600080fd5b6104f782610846565b60008060006040848603121561089f57600080fd5b6108a884610846565b9250602084013567ffffffffffffffff808211156108c557600080fd5b818601915086601f8301126108d957600080fd5b8135818111156108e857600080fd5b8760208285010111156108fa57600080fd5b6020830194508093505050509250925092565b60005b83811015610928578181015183820152602001610910565b50506000910152565b6000825161094381846020870161090d565b9190910192915050565b602081526000825180602084015261096c81604085016020870161090d565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220701a0c26bdd76686e63fc3c65e4f28a20ba3ecc8a60246733c0627e679c9804e64736f6c63430008140033", - "storage": { - "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", - "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000012864938eadb26501034339667cabfb3d7045cd2" - } - }, - { - "contractName": "PolygonZkEVMGlobalExitRootL2 implementation", - "balance": "0", - "nonce": "1", - "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", - "bytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806301fd904414610051578063257b36321461006d57806333d6247d1461008d578063a3c573eb146100a2575b600080fd5b61005a60015481565b6040519081526020015b60405180910390f35b61005a61007b366004610162565b60006020819052908152604090205481565b6100a061009b366004610162565b6100ee565b005b6100c97f000000000000000000000000cca6ecd73932e49633b9307e1aa0fc174525f42481565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610064565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cca6ecd73932e49633b9307e1aa0fc174525f424161461015d576040517fb49365dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600155565b60006020828403121561017457600080fd5b503591905056fea2646970667358221220ea2171e2c85c8bff947affc409ef6fc6a8fe82fb8c174ddeda988651e595d66564736f6c63430008140033" - }, - { - "contractName": "PolygonZkEVMGlobalExitRootL2 proxy", - "balance": "0", - "nonce": "1", - "address": "0xa40d5f56745a118d0906a34e69aec8c0db1cb8fa", - "bytecode": "0x60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033", - "storage": { - "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000e34fe58dda5b8c6d547e4857e987633aa86a5e90", - "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000dc64a140aa3e981100a9beca4e685f962f0cf6c9" - } - }, - { - "contractName": "PolygonZkEVMTimelock", - "balance": "0", - "nonce": "1", - "address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", - "bytecode": "0x6080604052600436106101c65760003560e01c806364d62353116100f7578063b1c5f42711610095578063d547741f11610064578063d547741f14610661578063e38335e514610681578063f23a6e6114610694578063f27a0c92146106d957600080fd5b8063b1c5f427146105af578063bc197c81146105cf578063c4d252f514610614578063d45c44351461063457600080fd5b80638f61f4f5116100d15780638f61f4f5146104e157806391d1485414610515578063a217fddf14610566578063b08e51c01461057b57600080fd5b806364d62353146104815780638065657f146104a15780638f2a0bb0146104c157600080fd5b8063248a9ca31161016457806331d507501161013e57806331d50750146103c857806336568abe146103e85780633a6aae7214610408578063584b153e1461046157600080fd5b8063248a9ca3146103475780632ab0f529146103775780632f2ff15d146103a857600080fd5b80630d3cf6fc116101a05780630d3cf6fc1461026b578063134008d31461029f57806313bc9f20146102b2578063150b7a02146102d257600080fd5b806301d5062a146101d257806301ffc9a7146101f457806307bd02651461022957600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b506101f26101ed366004611c52565b6106ee565b005b34801561020057600080fd5b5061021461020f366004611cc7565b610783565b60405190151581526020015b60405180910390f35b34801561023557600080fd5b5061025d7fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e6381565b604051908152602001610220565b34801561027757600080fd5b5061025d7f5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca581565b6101f26102ad366004611d09565b6107df565b3480156102be57600080fd5b506102146102cd366004611d75565b6108d7565b3480156102de57600080fd5b506103166102ed366004611e9a565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610220565b34801561035357600080fd5b5061025d610362366004611d75565b60009081526020819052604090206001015490565b34801561038357600080fd5b50610214610392366004611d75565b6000908152600160208190526040909120541490565b3480156103b457600080fd5b506101f26103c3366004611f02565b6108fd565b3480156103d457600080fd5b506102146103e3366004611d75565b610927565b3480156103f457600080fd5b506101f2610403366004611f02565b610940565b34801561041457600080fd5b5061043c7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610220565b34801561046d57600080fd5b5061021461047c366004611d75565b6109f8565b34801561048d57600080fd5b506101f261049c366004611d75565b610a0e565b3480156104ad57600080fd5b5061025d6104bc366004611d09565b610ade565b3480156104cd57600080fd5b506101f26104dc366004611f73565b610b1d565b3480156104ed57600080fd5b5061025d7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc181565b34801561052157600080fd5b50610214610530366004611f02565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b34801561057257600080fd5b5061025d600081565b34801561058757600080fd5b5061025d7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f78381565b3480156105bb57600080fd5b5061025d6105ca366004612025565b610d4f565b3480156105db57600080fd5b506103166105ea36600461214e565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561062057600080fd5b506101f261062f366004611d75565b610d94565b34801561064057600080fd5b5061025d61064f366004611d75565b60009081526001602052604090205490565b34801561066d57600080fd5b506101f261067c366004611f02565b610e8f565b6101f261068f366004612025565b610eb4565b3480156106a057600080fd5b506103166106af3660046121f8565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b3480156106e557600080fd5b5061025d611161565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc161071881611244565b6000610728898989898989610ade565b90506107348184611251565b6000817f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8b8b8b8b8b8a604051610770969594939291906122a6565b60405180910390a3505050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806107d957506107d98261139e565b92915050565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff1661085c5761085c8133611435565b600061086c888888888888610ade565b905061087881856114ed565b6108848888888861162a565b6000817fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588a8a8a8a6040516108bc94939291906122f1565b60405180910390a36108cd8161172e565b5050505050505050565b6000818152600160205260408120546001811180156108f65750428111155b9392505050565b60008281526020819052604090206001015461091881611244565b61092283836117d7565b505050565b60008181526001602052604081205481905b1192915050565b73ffffffffffffffffffffffffffffffffffffffff811633146109ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6109f482826118c7565b5050565b6000818152600160208190526040822054610939565b333014610a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f54696d656c6f636b436f6e74726f6c6c65723a2063616c6c6572206d7573742060448201527f62652074696d656c6f636b00000000000000000000000000000000000000000060648201526084016109e1565b60025460408051918252602082018390527f11c24f4ead16507c69ac467fbd5e4eed5fb5c699626d2cc6d66421df253886d5910160405180910390a1600255565b6000868686868686604051602001610afb969594939291906122a6565b6040516020818303038152906040528051906020012090509695505050505050565b7fb09aa5aeb3702cfd50b6b62bc4532604938f21248a27a1d5ca736082b6819cc1610b4781611244565b888714610bd6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b888514610c65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b6000610c778b8b8b8b8b8b8b8b610d4f565b9050610c838184611251565b60005b8a811015610d415780827f4cf4410cc57040e44862ef0f45f3dd5a5e02db8eb8add648d4b0e236f1d07dca8e8e85818110610cc357610cc3612331565b9050602002016020810190610cd89190612360565b8d8d86818110610cea57610cea612331565b905060200201358c8c87818110610d0357610d03612331565b9050602002810190610d15919061237b565b8c8b604051610d29969594939291906122a6565b60405180910390a3610d3a8161240f565b9050610c86565b505050505050505050505050565b60008888888888888888604051602001610d709897969594939291906124f7565b60405160208183030381529060405280519060200120905098975050505050505050565b7ffd643c72710c63c0180259aba6b2d05451e3591a24e58b62239378085726f783610dbe81611244565b610dc7826109f8565b610e53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20636160448201527f6e6e6f742062652063616e63656c6c656400000000000000000000000000000060648201526084016109e1565b6000828152600160205260408082208290555183917fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb7091a25050565b600082815260208190526040902060010154610eaa81611244565b61092283836118c7565b600080527fdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d70696020527f5ba6852781629bcdcd4bdaa6de76d786f1c64b16acdac474e55bebc0ea157951547fd8aa0f3194971a2a116679f7c2090f6939c8d4e01a2a8d7e41d55e5351469e639060ff16610f3157610f318133611435565b878614610fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b87841461104f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f54696d656c6f636b436f6e74726f6c6c65723a206c656e677468206d69736d6160448201527f746368000000000000000000000000000000000000000000000000000000000060648201526084016109e1565b60006110618a8a8a8a8a8a8a8a610d4f565b905061106d81856114ed565b60005b8981101561114b5760008b8b8381811061108c5761108c612331565b90506020020160208101906110a19190612360565b905060008a8a848181106110b7576110b7612331565b9050602002013590503660008a8a868181106110d5576110d5612331565b90506020028101906110e7919061237b565b915091506110f78484848461162a565b84867fc2617efa69bab66782fa219543714338489c4e9e178271560a91b82c3f612b588686868660405161112e94939291906122f1565b60405180910390a350505050806111449061240f565b9050611070565b506111558161172e565b50505050505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161580159061123257507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166315064c966040518163ffffffff1660e01b8152600401602060405180830381865afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123291906125be565b1561123d5750600090565b5060025490565b61124e8133611435565b50565b61125a82610927565b156112e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20616c60448201527f7265616479207363686564756c6564000000000000000000000000000000000060648201526084016109e1565b6112ef611161565b81101561137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a20696e73756666696369656e7460448201527f2064656c6179000000000000000000000000000000000000000000000000000060648201526084016109e1565b61138881426125e0565b6000928352600160205260409092209190915550565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806107d957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146107d9565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f4576114738161197e565b61147e83602061199d565b60405160200161148f929190612617565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526109e191600401612698565b6114f6826108d7565b611582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b80158061159e5750600081815260016020819052604090912054145b6109f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f54696d656c6f636b436f6e74726f6c6c65723a206d697373696e67206465706560448201527f6e64656e6379000000000000000000000000000000000000000000000000000060648201526084016109e1565b60008473ffffffffffffffffffffffffffffffffffffffff168484846040516116549291906126e9565b60006040518083038185875af1925050503d8060008114611691576040519150601f19603f3d011682016040523d82523d6000602084013e611696565b606091505b5050905080611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f54696d656c6f636b436f6e74726f6c6c65723a20756e6465726c79696e67207460448201527f72616e73616374696f6e2072657665727465640000000000000000000000000060648201526084016109e1565b5050505050565b611737816108d7565b6117c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f54696d656c6f636b436f6e74726f6c6c65723a206f7065726174696f6e20697360448201527f206e6f742072656164790000000000000000000000000000000000000000000060648201526084016109e1565b600090815260016020819052604090912055565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556118693390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156109f45760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60606107d973ffffffffffffffffffffffffffffffffffffffff831660145b606060006119ac8360026126f9565b6119b79060026125e0565b67ffffffffffffffff8111156119cf576119cf611d8e565b6040519080825280601f01601f1916602001820160405280156119f9576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611a3057611a30612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611a9357611a93612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000611acf8460026126f9565b611ada9060016125e0565b90505b6001811115611b77577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110611b1b57611b1b612331565b1a60f81b828281518110611b3157611b31612331565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93611b7081612710565b9050611add565b5083156108f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109e1565b803573ffffffffffffffffffffffffffffffffffffffff81168114611c0457600080fd5b919050565b60008083601f840112611c1b57600080fd5b50813567ffffffffffffffff811115611c3357600080fd5b602083019150836020828501011115611c4b57600080fd5b9250929050565b600080600080600080600060c0888a031215611c6d57600080fd5b611c7688611be0565b965060208801359550604088013567ffffffffffffffff811115611c9957600080fd5b611ca58a828b01611c09565b989b979a50986060810135976080820135975060a09091013595509350505050565b600060208284031215611cd957600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108f657600080fd5b60008060008060008060a08789031215611d2257600080fd5b611d2b87611be0565b955060208701359450604087013567ffffffffffffffff811115611d4e57600080fd5b611d5a89828a01611c09565b979a9699509760608101359660809091013595509350505050565b600060208284031215611d8757600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611e0457611e04611d8e565b604052919050565b600082601f830112611e1d57600080fd5b813567ffffffffffffffff811115611e3757611e37611d8e565b611e6860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611dbd565b818152846020838601011115611e7d57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611eb057600080fd5b611eb985611be0565b9350611ec760208601611be0565b925060408501359150606085013567ffffffffffffffff811115611eea57600080fd5b611ef687828801611e0c565b91505092959194509250565b60008060408385031215611f1557600080fd5b82359150611f2560208401611be0565b90509250929050565b60008083601f840112611f4057600080fd5b50813567ffffffffffffffff811115611f5857600080fd5b6020830191508360208260051b8501011115611c4b57600080fd5b600080600080600080600080600060c08a8c031215611f9157600080fd5b893567ffffffffffffffff80821115611fa957600080fd5b611fb58d838e01611f2e565b909b50995060208c0135915080821115611fce57600080fd5b611fda8d838e01611f2e565b909950975060408c0135915080821115611ff357600080fd5b506120008c828d01611f2e565b9a9d999c50979a969997986060880135976080810135975060a0013595509350505050565b60008060008060008060008060a0898b03121561204157600080fd5b883567ffffffffffffffff8082111561205957600080fd5b6120658c838d01611f2e565b909a50985060208b013591508082111561207e57600080fd5b61208a8c838d01611f2e565b909850965060408b01359150808211156120a357600080fd5b506120b08b828c01611f2e565b999c989b509699959896976060870135966080013595509350505050565b600082601f8301126120df57600080fd5b8135602067ffffffffffffffff8211156120fb576120fb611d8e565b8160051b61210a828201611dbd565b928352848101820192828101908785111561212457600080fd5b83870192505b848310156121435782358252918301919083019061212a565b979650505050505050565b600080600080600060a0868803121561216657600080fd5b61216f86611be0565b945061217d60208701611be0565b9350604086013567ffffffffffffffff8082111561219a57600080fd5b6121a689838a016120ce565b945060608801359150808211156121bc57600080fd5b6121c889838a016120ce565b935060808801359150808211156121de57600080fd5b506121eb88828901611e0c565b9150509295509295909350565b600080600080600060a0868803121561221057600080fd5b61221986611be0565b945061222760208701611be0565b93506040860135925060608601359150608086013567ffffffffffffffff81111561225157600080fd5b6121eb88828901611e0c565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a0604082015260006122dc60a08301868861225d565b60608301949094525060800152949350505050565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061232760608301848661225d565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561237257600080fd5b6108f682611be0565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126123b057600080fd5b83018035915067ffffffffffffffff8211156123cb57600080fd5b602001915036819003821315611c4b57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612440576124406123e0565b5060010190565b81835260006020808501808196508560051b810191508460005b878110156124ea57828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18836030181126124a057600080fd5b8701858101903567ffffffffffffffff8111156124bc57600080fd5b8036038213156124cb57600080fd5b6124d686828461225d565b9a87019a9550505090840190600101612461565b5091979650505050505050565b60a0808252810188905260008960c08301825b8b8110156125455773ffffffffffffffffffffffffffffffffffffffff61253084611be0565b1682526020928301929091019060010161250a565b5083810360208501528881527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89111561257e57600080fd5b8860051b9150818a602083013701828103602090810160408501526125a69082018789612447565b60608401959095525050608001529695505050505050565b6000602082840312156125d057600080fd5b815180151581146108f657600080fd5b808201808211156107d9576107d96123e0565b60005b8381101561260e5781810151838201526020016125f6565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161264f8160178501602088016125f3565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161268c8160288401602088016125f3565b01602801949350505050565b60208152600082518060208401526126b78160408501602087016125f3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b8183823760009101908152919050565b80820281158282048414176107d9576107d96123e0565b60008161271f5761271f6123e0565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122048ac459f9165e9eaa91bead23625fe941931ad2332a61820c2a6d1dcd92c218164736f6c63430008140033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000000e10", - "0xaedcc9e7897c0d335bdc5d92fe3a8b4f23727fe558cd1c19f332b28716a30559": "0x0000000000000000000000000000000000000000000000000000000000000001", - "0xf5e61edb9c9cc6bfbae4463e9a2b1dd6ac3b44ddef38f18016e56ba0363910d9": "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x64494413541ff93b31aa309254e3fed72a7456e9845988b915b4c7a7ceba8814": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", - "0x60b9d94c75b7b3f721925089391e4644cd890cb5e6466f9596dfbd2c54e0b280": "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x3412d5605ac6cd444957cedb533e5dacad6378b4bc819ebe3652188a665066d6": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", - "0x4b63b79f1e338a49559dcd3193ac9eecc50d0f275d24e97cc8c319e5a31a8bd0": "0x0000000000000000000000000000000000000000000000000000000000000001", - "0xdae2aa361dfd1ca020a396615627d436107c35eff9fe7738a3512819782d706a": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5", - "0x800d5dfe4bba53eedee06cd4546a27da8de00f12db83f56062976d4493fda899": "0x0000000000000000000000000000000000000000000000000000000000000001", - "0xc3ad33e20b0c56a223ad5104fff154aa010f8715b9c981fd38fdc60a4d1a52fc": "0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5" - } - }, - { - "accountName": "keyless Deployer", - "balance": "0", - "nonce": "1", - "address": "0x28BB4e66addE1f042B77E04cf7D3784C1dcDBbA3" - }, - { - "accountName": "deployer", - "balance": "100000000000000000000000", - "nonce": "8", - "address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" - } - ] -} \ No newline at end of file diff --git a/test/test.keystore.sequencer b/test/config/node/sequencer-1.keystore similarity index 100% rename from test/test.keystore.sequencer rename to test/config/node/sequencer-1.keystore diff --git a/test/config/node/sequencer-2.keystore b/test/config/node/sequencer-2.keystore new file mode 100644 index 00000000..f6382a8d --- /dev/null +++ b/test/config/node/sequencer-2.keystore @@ -0,0 +1 @@ +{"address":"15d34aaf54267db7d7c367839aaf71a00a2c6a65","crypto":{"cipher":"aes-128-ctr","ciphertext":"44ae2b38312474970669d8c0dd146056f72c0f6d94c7c4ad5d8aad3782d15d0b","cipherparams":{"iv":"668c72a8a0d75d36df682d07ef4fcdec"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"699fa8720a4d609cfa6bedb8fd35d3b8bab370d41419a856d593217168f0dc57"},"mac":"982606ec979042ab5fb755b6879ebefeef9c26ed855c04c0c6ea0b4195af4445"},"id":"786a9f61-dcdc-4e74-8f08-44807582dc9a","version":3} \ No newline at end of file diff --git a/test/config/node/config.zkevm.node.toml b/test/config/node/zkevm-node-1.toml similarity index 70% rename from test/config/node/config.zkevm.node.toml rename to test/config/node/zkevm-node-1.toml index b84821a0..35ea4ca5 100644 --- a/test/config/node/config.zkevm.node.toml +++ b/test/config/node/zkevm-node-1.toml @@ -2,15 +2,15 @@ IsTrustedSequencer = true [Log] Environment = "development" # "production" or "development" -Level = "debug" +Level = "warn" Outputs = ["stderr"] [State] [State.DB] - User = "state_user" - Password = "state_password" - Name = "state_db" - Host = "zkevm-state-db" + User = "user" + Password = "pass" + Name = "state_db_1" + Host = "zkevm-db" Port = "5432" EnableLog = false MaxConns = 200 @@ -18,7 +18,7 @@ Outputs = ["stderr"] [State.Batch.Constraints] MaxTxsPerBatch = 300 MaxBatchBytesSize = 120000 - MaxCumulativeGasUsed = 30000000 + MaxCumulativeGasUsed = 1125899906842624 MaxKeccakHashes = 2145 MaxPoseidonHashes = 252357 MaxPoseidonPaddings = 135191 @@ -26,6 +26,7 @@ Outputs = ["stderr"] MaxArithmetics = 236585 MaxBinaries = 473170 MaxSteps = 7570538 + MaxSHA256Hashes = 1596 [Pool] FreeClaimGasLimit = 1500000 @@ -46,11 +47,14 @@ GlobalQueue = 1024 NetProfit = 1 BreakEvenFactor = 1.1 FinalDeviationPct = 10 + EthTransferGasPrice = 0 + EthTransferL1GasPriceFactor = 0 + L2GasPriceSuggesterFactor = 0.5 [Pool.DB] - User = "pool_user" - Password = "pool_password" - Name = "pool_db" - Host = "zkevm-pool-db" + User = "user" + Password = "pass" + Name = "pool_db_1" + Host = "zkevm-db" Port = "5432" EnableLog = false MaxConns = 200 @@ -59,7 +63,7 @@ GlobalQueue = 1024 URL = "http://zkevm-mock-l1-network:8545" ForkIDChunkSize = 20000 MultiGasProvider = false - [Etherman.Etherscan] + [Etherscan] ApiKey = "" [RPC] @@ -94,27 +98,25 @@ L1SynchronizationMode = "sequential" ApplyAfterNumRollupReceived = 10 [Sequencer] -WaitPeriodPoolIsEmpty = "1s" -LastBatchVirtualizationTimeMaxWaitPeriod = "5s" -BlocksAmountForTxsToBeDeleted = 100 -FrequencyToCheckTxsForDelete = "12h" -TxLifetimeCheckTimeout = "10m" -MaxTxLifetime = "3h" +DeletePoolTxsL1BlockConfirmations = 100 +DeletePoolTxsCheckInterval = "12h" +TxLifetimeCheckInterval = "10m" +TxLifetimeMax = "3h" +LoadPoolTxsCheckInterval = "500ms" +StateConsistencyCheckInterval = "5s" [Sequencer.Finalizer] - GERDeadlineTimeout = "2s" - ForcedBatchDeadlineTimeout = "5s" - SleepDuration = "100ms" - ResourcePercentageToCloseBatch = 10 - GERFinalityNumberOfBlocks = 0 - ClosingSignalsManagerWaitForCheckingL1Timeout = "1s" - ClosingSignalsManagerWaitForCheckingGER = "1s" - ClosingSignalsManagerWaitForCheckingForcedBatches = "1s" - ForcedBatchesFinalityNumberOfBlocks = 0 - TimestampResolution = "10s" - StopSequencerOnBatchNum = 0 - [Sequencer.DBManager] - PoolRetrievalInterval = "500ms" - L2ReorgRetrievalInterval = "5s" + NewTxsWaitInterval = "100ms" + ForcedBatchesTimeout = "5s" + ForcedBatchesL1BlockConfirmations = 1 + ForcedBatchesCheckInterval = "10s" + L1InfoTreeL1BlockConfirmations = 1 + L1InfoTreeCheckInterval = "10s" + BatchMaxDeltaTimestamp = "20s" + L2BlockMaxDeltaTimestamp = "4s" + ResourceExhaustedMarginPct = 10 + HaltOnBatchNumber = 0 + SequentialBatchSanityCheck = false + SequentialProcessL2Block = true [Sequencer.StreamServer] Port = 6900 Filename = "/datastreamer/datastream.bin" @@ -123,6 +125,7 @@ MaxTxLifetime = "3h" [SequenceSender] WaitPeriodSendSequence = "15s" LastBatchVirtualizationTimeMaxWaitPeriod = "10s" +L1BlockTimestampMargin = "5s" MaxTxSizeForL1 = 131072 L2Coinbase = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" PrivateKey = {Path = "/pk/keystore.sequencer", Password = "testonly"} @@ -130,8 +133,8 @@ PrivateKey = {Path = "/pk/keystore.sequencer", Password = "testonly"} [Aggregator] Host = "0.0.0.0" Port = 50081 -RetryTime = "3s" -VerifyProofInterval = "5s" +RetryTime = "5s" +VerifyProofInterval = "10s" TxProfitabilityCheckerType = "acceptall" TxProfitabilityMinReward = "1.1" ProofStatePollingInterval = "5s" @@ -139,6 +142,7 @@ SenderAddress = "0x70997970c51812dc3a010c7d01b50e0d17dc79c8" CleanupLockedProofsInterval = "2m" GeneratingProofCleanupThreshold = "10m" UpgradeEtrogBatchNumber = 0 +BatchProofL1BlockConfirmations = 2 [EthTxManager] ForcedGas = 0 @@ -148,17 +152,17 @@ PrivateKeys = [ ] [L2GasPriceSuggester] -Type = "follower" +Type = "default" UpdatePeriod = "10s" Factor = 0.5 DefaultGasPriceWei = 1000000000 MaxGasPriceWei = 0 [MTClient] -URI = "zkevm-prover:50061" +URI = "zkevm-prover-1:50061" [Executor] -URI = "zkevm-prover:50071" +URI = "zkevm-prover-1:50071" MaxGRPCMessageSize = 100000000 [Metrics] @@ -169,21 +173,11 @@ ProfilingHost = "0.0.0.0" ProfilingPort = 6060 ProfilingEnabled = true -#[EventLog] -# [EventLog.DB] -# User = "event_user" -# Password = "event_password" -# Name = "event_db" -# Host = "zkevm-event-db" -# Port = "5432" -# EnableLog = false -# MaxConns = 200 - [HashDB] -User = "prover_user" +User = "prover_user_1" Password = "prover_pass" -Name = "prover_db" -Host = "zkevm-state-db" +Name = "prover_db_1" +Host = "zkevm-db" Port = "5432" EnableLog = false -MaxConns = 200 +MaxConns = 200 \ No newline at end of file diff --git a/test/config/node/zkevm-node-2.toml b/test/config/node/zkevm-node-2.toml new file mode 100644 index 00000000..b60de081 --- /dev/null +++ b/test/config/node/zkevm-node-2.toml @@ -0,0 +1,183 @@ +IsTrustedSequencer = true + +[Log] +Environment = "development" # "production" or "development" +Level = "warn" +Outputs = ["stderr"] + +[State] + [State.DB] + User = "user" + Password = "pass" + Name = "state_db_2" + Host = "zkevm-db" + Port = "5432" + EnableLog = false + MaxConns = 200 + [State.Batch] + [State.Batch.Constraints] + MaxTxsPerBatch = 300 + MaxBatchBytesSize = 120000 + MaxCumulativeGasUsed = 1125899906842624 + MaxKeccakHashes = 2145 + MaxPoseidonHashes = 252357 + MaxPoseidonPaddings = 135191 + MaxMemAligns = 236585 + MaxArithmetics = 236585 + MaxBinaries = 473170 + MaxSteps = 7570538 + MaxSHA256Hashes = 1596 + +[Pool] +FreeClaimGasLimit = 1500000 +IntervalToRefreshBlockedAddresses = "5m" +IntervalToRefreshGasPrices = "5s" +MaxTxBytesSize=100132 +MaxTxDataBytesSize=100000 +DefaultMinGasPriceAllowed = 1000000000 +MinAllowedGasPriceInterval = "5m" +PollMinAllowedGasPriceInterval = "15s" +AccountQueue = 64 +GlobalQueue = 1024 + [Pool.EffectiveGasPrice] + Enabled = false + L1GasPriceFactor = 0.25 + ByteGasCost = 16 + ZeroByteGasCost = 4 + NetProfit = 1 + BreakEvenFactor = 1.1 + FinalDeviationPct = 10 + EthTransferGasPrice = 0 + EthTransferL1GasPriceFactor = 0 + L2GasPriceSuggesterFactor = 0.5 + [Pool.DB] + User = "user" + Password = "pass" + Name = "pool_db_2" + Host = "zkevm-db" + Port = "5432" + EnableLog = false + MaxConns = 200 + +[Etherman] +URL = "http://zkevm-mock-l1-network:8545" +ForkIDChunkSize = 20000 +MultiGasProvider = false + [Etherscan] + ApiKey = "" + +[RPC] +Host = "0.0.0.0" +Port = 8123 +ReadTimeout = "60s" +WriteTimeout = "60s" +MaxRequestsPerIPAndSecond = 5000 +SequencerNodeURI = "" +EnableL2SuggestedGasPricePolling = true + [RPC.WebSockets] + Enabled = true + Port = 8133 + +[Synchronizer] +SyncInterval = "1s" +SyncChunkSize = 100 +TrustedSequencerURL = "" # If it is empty or not specified, then the value is read from the smc. +L1SynchronizationMode = "sequential" + [Synchronizer.L1ParallelSynchronization] + MaxClients = 10 + MaxPendingNoProcessedBlocks = 25 + RequestLastBlockPeriod = "5s" + RequestLastBlockTimeout = "5s" + RequestLastBlockMaxRetries = 3 + StatisticsPeriod = "5m" + TimeoutMainLoop = "5m" + RollupInfoRetriesSpacing= "5s" + FallbackToSequentialModeOnSynchronized = false + [Synchronizer.L1ParallelSynchronization.PerformanceWarning] + AceptableInacctivityTime = "5s" + ApplyAfterNumRollupReceived = 10 + +[Sequencer] +DeletePoolTxsL1BlockConfirmations = 100 +DeletePoolTxsCheckInterval = "12h" +TxLifetimeCheckInterval = "10m" +TxLifetimeMax = "3h" +LoadPoolTxsCheckInterval = "500ms" +StateConsistencyCheckInterval = "5s" + [Sequencer.Finalizer] + NewTxsWaitInterval = "100ms" + ForcedBatchesTimeout = "5s" + ForcedBatchesL1BlockConfirmations = 1 + ForcedBatchesCheckInterval = "10s" + L1InfoTreeL1BlockConfirmations = 1 + L1InfoTreeCheckInterval = "10s" + BatchMaxDeltaTimestamp = "20s" + L2BlockMaxDeltaTimestamp = "4s" + ResourceExhaustedMarginPct = 10 + HaltOnBatchNumber = 0 + SequentialBatchSanityCheck = false + SequentialProcessL2Block = true + [Sequencer.StreamServer] + Port = 6900 + Filename = "/datastreamer/datastream.bin" + Enabled = false + +[SequenceSender] +WaitPeriodSendSequence = "15s" +LastBatchVirtualizationTimeMaxWaitPeriod = "10s" +L1BlockTimestampMargin = "5s" +MaxTxSizeForL1 = 131072 +L2Coinbase = "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65" +PrivateKey = {Path = "/pk/keystore.sequencer", Password = "testonly"} + +[Aggregator] +Host = "0.0.0.0" +Port = 50081 +RetryTime = "5s" +VerifyProofInterval = "10s" +TxProfitabilityCheckerType = "acceptall" +TxProfitabilityMinReward = "1.1" +ProofStatePollingInterval = "5s" +SenderAddress = "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc" +CleanupLockedProofsInterval = "2m" +GeneratingProofCleanupThreshold = "10m" +UpgradeEtrogBatchNumber = 0 +BatchProofL1BlockConfirmations = 2 + +[EthTxManager] +ForcedGas = 0 +PrivateKeys = [ + {Path = "/pk/keystore.sequencer", Password = "testonly"}, + {Path = "/pk/keystore.aggregator", Password = "testonly"} +] + +[L2GasPriceSuggester] +Type = "default" +UpdatePeriod = "10s" +Factor = 0.5 +DefaultGasPriceWei = 1000000000 +MaxGasPriceWei = 0 + +[MTClient] +URI = "zkevm-prover-2:50061" + +[Executor] +URI = "zkevm-prover-2:50071" +MaxGRPCMessageSize = 100000000 + +[Metrics] +Host = "0.0.0.0" +Port = 9091 +Enabled = false +ProfilingHost = "0.0.0.0" +ProfilingPort = 6060 +ProfilingEnabled = true + +[HashDB] +User = "prover_user_2" +Password = "prover_pass" +Name = "prover_db_2" +Host = "zkevm-db" +Port = "5432" +EnableLog = false +MaxConns = 200 \ No newline at end of file diff --git a/test/config/prover/initproverdb.sql b/test/config/prover/initproverdb.sql deleted file mode 100644 index a4f8616c..00000000 --- a/test/config/prover/initproverdb.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE DATABASE prover_db; -\connect prover_db; - -CREATE SCHEMA state; - -CREATE TABLE state.nodes (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); -CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); - -CREATE USER prover_user with password 'prover_pass'; -ALTER DATABASE prover_db OWNER TO prover_user; -ALTER SCHEMA state OWNER TO prover_user; -ALTER SCHEMA public OWNER TO prover_user; -ALTER TABLE state.nodes OWNER TO prover_user; -ALTER TABLE state.program OWNER TO prover_user; -ALTER USER prover_user SET SEARCH_PATH=state; diff --git a/test/config/prover/config.prover.json b/test/config/prover/prover-1.json similarity index 94% rename from test/config/prover/config.prover.json rename to test/config/prover/prover-1.json index d654fe2b..9afb619e 100644 --- a/test/config/prover/config.prover.json +++ b/test/config/prover/prover-1.json @@ -56,7 +56,7 @@ "aggregatorServerPort": 50081, "aggregatorClientPort": 50081, - "aggregatorClientHost": "zkevm-node", + "aggregatorClientHost": "zkevm-node-1", "mapConstPolsFile": false, "mapConstantsTreeFile": false, @@ -69,7 +69,7 @@ "outputPath": "output", - "databaseURL": "postgresql://prover_user:prover_pass@zkevm-state-db:5432/prover_db", + "databaseURL": "postgresql://prover_user_1:prover_pass@zkevm-db:5432/prover_db_1", "dbNodesTableName": "state.nodes", "dbProgramTableName": "state.program", "dbMultiWrite": true, diff --git a/test/config/prover/prover-2.json b/test/config/prover/prover-2.json new file mode 100644 index 00000000..833494c0 --- /dev/null +++ b/test/config/prover/prover-2.json @@ -0,0 +1,91 @@ +{ + "runExecutorServer": true, + "runExecutorClient": false, + "runExecutorClientMultithread": false, + + "runHashDBServer": true, + "runHashDBTest": false, + + "runAggregatorServer": false, + "runAggregatorClient": false, + "runAggregatorClientMock": true, + "aggregatorClientMockTimeout": 1, + "proverName": "test-prover", + + "runFileGenBatchProof": false, + "runFileGenAggregatedProof": false, + "runFileGenFinalProof": false, + "runFileProcessBatch": false, + "runFileProcessBatchMultithread": false, + + "runKeccakScriptGenerator": false, + "runKeccakTest": false, + "runStorageSMTest": false, + "runBinarySMTest": false, + "runMemAlignSMTest": false, + "runSHA256Test": false, + "runBlakeTest": false, + + "executeInParallel": true, + "useMainExecGenerated": false, + "saveRequestToFile": false, + "saveInputToFile": false, + "saveDbReadsToFile": false, + "saveDbReadsToFileOnChange": false, + "saveOutputToFile": true, + "saveProofToFile": true, + "saveResponseToFile": false, + "loadDBToMemCache": true, + "opcodeTracer": false, + "logRemoteDbReads": false, + "logExecutorServerResponses": false, + + "proverServerPort": 50051, + "proverServerMockPort": 50052, + "proverServerMockTimeout": 10000000, + "proverClientPort": 50051, + "proverClientHost": "127.0.0.1", + + "executorServerPort": 50071, + "executorROMLineTraces": false, + "executorClientPort": 50071, + "executorClientHost": "127.0.0.1", + + "hashDBServerPort": 50061, + "hashDBURL": "local", + + "aggregatorServerPort": 50081, + "aggregatorClientPort": 50081, + "aggregatorClientHost": "zkevm-node-2", + + "mapConstPolsFile": false, + "mapConstantsTreeFile": false, + + "inputFile": "input_executor_0.json", + "inputFile2": "input_executor_1.json", + + "keccakScriptFile": "config/scripts/keccak_script.json", + "storageRomFile": "config/scripts/storage_sm_rom.json", + + "outputPath": "output", + + "databaseURL": "postgresql://prover_user_2:prover_pass@zkevm-db:5432/prover_db_2", + "dbNodesTableName": "state.nodes", + "dbProgramTableName": "state.program", + "dbMultiWrite": true, + "dbFlushInParallel": false, + "dbMTCacheSize": 1024, + "dbProgramCacheSize": 512, + "dbNumberOfPoolConnections": 30, + "dbGetTree": true, + "cleanerPollingPeriod": 600, + "requestsPersistence": 3600, + "maxExecutorThreads": 20, + "maxProverThreads": 8, + "maxHashDBThreads": 8, + "ECRecoverPrecalc": false, + "ECRecoverPrecalcNThreads": 4, + "stateManager": true, + "useAssociativeCache" : false +} + diff --git a/test/e2e/bridge_test.go b/test/e2e/bridge_test.go index 75705462..3ae0b2ad 100644 --- a/test/e2e/bridge_test.go +++ b/test/e2e/bridge_test.go @@ -30,13 +30,15 @@ func TestE2E(t *testing.T) { ctx := context.Background() opsCfg := &operations.Config{ + L1NetworkURL: "http://localhost:8545", + L2NetworkURL: "http://localhost:8123", Storage: db.Config{ Database: "postgres", - Name: "test_db", - User: "test_user", - Password: "test_password", + Name: "bridge_db_1", + User: "user", + Password: "pass", Host: "localhost", - Port: "5435", + Port: "5432", MaxConns: 10, }, BT: bridgectrl.Config{ @@ -50,15 +52,6 @@ func TestE2E(t *testing.T) { DefaultPageLimit: 25, MaxPageLimit: 100, BridgeVersion: "v1", - DB: db.Config{ - Database: "postgres", - Name: "test_db", - User: "test_user", - Password: "test_password", - Host: "localhost", - Port: "5435", - MaxConns: 10, - }, }, } opsman, err := operations.NewManager(ctx, opsCfg) @@ -101,7 +94,7 @@ func TestE2E(t *testing.T) { require.Equal(t, 0, balance.Cmp(initL2Balance)) t.Log("Deposit: ", deposits[0]) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) // Check L2 funds to see if the amount has been increased balance2, err := opsman.CheckAccountBalance(ctx, operations.L2, &destAddr) @@ -188,7 +181,7 @@ func TestE2E(t *testing.T) { t.Log("Deposit: ", deposits[0]) t.Log("Before getClaimData: ", deposits[0].NetworkId, deposits[0].DepositCnt) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) time.Sleep(3 * time.Second) // wait for sync token_wrapped event tokenWrapped, err := opsman.GetTokenWrapped(ctx, 0, tokenAddr, false) @@ -230,7 +223,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) t.Log("deposit: ", deposits[0]) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) // Check L2 funds to see if the amount has been increased balance, err = opsman.CheckAccountTokenBalance(ctx, "l2", tokenWrapped.WrappedTokenAddress, &destAddr) @@ -321,7 +314,7 @@ func TestE2E(t *testing.T) { require.Equal(t, 0, big.NewInt(0).Cmp(balance)) t.Log("deposits[0]: ", deposits[0]) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) // Check L2 funds to see if the amount has been increased balance, err = opsman.CheckAccountTokenBalance(ctx, operations.L2, tokenAddr, &destAddr) @@ -365,7 +358,7 @@ func TestE2E(t *testing.T) { t.Log("Deposit: ", deposits[0]) t.Log("Before getClaimData: ", deposits[0].NetworkId, deposits[0].DepositCnt) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) time.Sleep(3 * time.Second) // wait for sync token_wrapped event tokenWrapped, err := opsman.GetTokenWrapped(ctx, 0, tokenAddr, false) @@ -470,7 +463,7 @@ func TestE2E(t *testing.T) { err = opsman.SendL1Deposit(ctx, tokenAddr, amount2, destNetwork, &origAddr) require.NoError(t, err) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) time.Sleep(3 * time.Second) // wait for sync token_wrapped event tokenWrapped, err := opsman.GetTokenWrapped(ctx, 0, tokenAddr, false) @@ -482,13 +475,13 @@ func TestE2E(t *testing.T) { t.Log("Balance tokenWrapped: ", balance) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) balance, err = opsman.CheckAccountTokenBalance(ctx, "l2", tokenWrapped.WrappedTokenAddress, &destAddr) require.NoError(t, err) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) // Check L2 funds to see if the amount has been increased balance, err = opsman.CheckAccountTokenBalance(ctx, "l2", tokenWrapped.WrappedTokenAddress, &destAddr) @@ -559,7 +552,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) // Check the claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) // Test L2 Bridge Message diff --git a/test/e2e/edge_test.go b/test/e2e/edge_test.go index a40610d2..8cd54f1a 100644 --- a/test/e2e/edge_test.go +++ b/test/e2e/edge_test.go @@ -29,7 +29,7 @@ func depositFromL1(ctx context.Context, opsman *operations.Manager, t *testing.T deposits, err := opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) require.NoError(t, err) // Check a L2 claim tx - err = opsman.CheckL2Claim(ctx, uint(deposits[0].DestNet), uint(deposits[0].DepositCnt)) + err = opsman.CheckClaim(ctx, deposits[0]) require.NoError(t, err) } @@ -61,13 +61,15 @@ func TestEdgeCase(t *testing.T) { ctx := context.Background() opsCfg := &operations.Config{ + L1NetworkURL: "http://localhost:8545", + L2NetworkURL: "http://localhost:8123", Storage: db.Config{ Database: "postgres", - Name: "test_db", - User: "test_user", - Password: "test_password", + Name: "bridge_db_1", + User: "user", + Password: "pass", Host: "localhost", - Port: "5435", + Port: "5432", MaxConns: 10, }, BT: bridgectrl.Config{ @@ -81,15 +83,6 @@ func TestEdgeCase(t *testing.T) { DefaultPageLimit: 25, MaxPageLimit: 100, BridgeVersion: "v1", - DB: db.Config{ - Database: "postgres", - Name: "test_db", - User: "test_user", - Password: "test_password", - Host: "localhost", - Port: "5435", - MaxConns: 10, - }, }, } diff --git a/test/e2e/multiplerollups_test.go b/test/e2e/multiplerollups_test.go new file mode 100644 index 00000000..51cc09ba --- /dev/null +++ b/test/e2e/multiplerollups_test.go @@ -0,0 +1,335 @@ +//go:build multirollup +// +build multirollup + +package e2e + +import ( + "context" + "math/big" + "testing" + + "github.com/0xPolygonHermez/zkevm-bridge-service/bridgectrl" + "github.com/0xPolygonHermez/zkevm-bridge-service/db" + "github.com/0xPolygonHermez/zkevm-bridge-service/server" + "github.com/0xPolygonHermez/zkevm-bridge-service/test/operations" + "github.com/0xPolygonHermez/zkevm-node/log" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" +) + +func TestMultipleRollups(t *testing.T) { + if testing.Short() { + t.Skip() + } + const ( + mainnetID uint32 = 0 + rollup1ID uint32 = 1 + rollup2ID uint32 = 2 + ) + ctx, opsman1, err := getOpsman("http://localhost:8123", "bridge_db_1", "8080", "9090") + require.NoError(t, err) + _, opsman2, err := getOpsman("http://localhost:8124", "bridge_db_2", "8081", "9091") + require.NoError(t, err) + + // Fund L2 sequencer for rollup 2. This is super dirty, but have no better way to do this at the moment + polAddr := common.HexToAddress("0x5FbDB2315678afecb367f032d93F642f64180aa3") + rollup2Sequencer := common.HexToAddress("0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65") + polAmount, ok := big.NewInt(0).SetString("10000000000000000000000", 10) + require.True(t, ok) + err = opsman2.MintPOL(ctx, polAddr, polAmount, operations.L1) + require.NoError(t, err) + err = opsman2.ERC20Transfer(ctx, polAddr, rollup2Sequencer, polAmount, operations.L1) + require.NoError(t, err) + + // L1 and R1 interactions + log.Info("L1 -- eth --> R1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: mainnetID, + destNet: rollup1ID, + originTokenNet: mainnetID, + originTokenAddr: common.Address{}, + amount: big.NewInt(999999999999999999), + }) + + log.Info("R1 -- eth --> L1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: rollup1ID, + destNet: mainnetID, + originTokenNet: mainnetID, + originTokenAddr: common.Address{}, + amount: big.NewInt(42069), + }) + + l1TokenAddr, _, err := opsman1.DeployERC20(ctx, "CREATED ON L1", "CL1", operations.L1) + require.NoError(t, err) + err = opsman1.MintERC20(ctx, l1TokenAddr, big.NewInt(999999999999999999), operations.L1) + require.NoError(t, err) + log.Info("L1 -- token from L1 --> R1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: mainnetID, + destNet: rollup1ID, + originTokenNet: mainnetID, + originTokenAddr: l1TokenAddr, + amount: big.NewInt(42069), + }) + + log.Info("R1 -- token from L1 --> L1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: rollup1ID, + destNet: mainnetID, + originTokenNet: mainnetID, + originTokenAddr: l1TokenAddr, + amount: big.NewInt(42069), + }) + + rollup1TokenAddr, _, err := opsman1.DeployERC20(ctx, "CREATED ON Rollup 1", "CR1", operations.L2) + require.NoError(t, err) + err = opsman1.MintERC20(ctx, rollup1TokenAddr, big.NewInt(999999999999999999), operations.L2) + require.NoError(t, err) + log.Info("R1 -- token from R1 --> L1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: rollup1ID, + destNet: mainnetID, + originTokenNet: rollup1ID, + originTokenAddr: rollup1TokenAddr, + amount: big.NewInt(42069), + }) + + log.Info("L1 -- token from R1 --> R1") + bridge(t, ctx, opsman1, bridgeData{ + originNet: mainnetID, + destNet: rollup1ID, + originTokenNet: rollup1ID, + originTokenAddr: rollup1TokenAddr, + amount: big.NewInt(42069), + }) + + // L1 and R2 interactions + nativeTokenR2 := opsman2.GetRollupNativeToken() + err = opsman2.MintPOL(ctx, nativeTokenR2, big.NewInt(999999999999999999), operations.L1) + require.NoError(t, err) + log.Info("L1 -- native token @ R2 --> R2") + bridge(t, ctx, opsman2, bridgeData{ + originNet: mainnetID, + destNet: rollup2ID, + originTokenNet: mainnetID, + originTokenAddr: nativeTokenR2, + amount: big.NewInt(999999999999999999), + }) + + log.Info("R2 -- native token @ R2 --> L1") + bridge(t, ctx, opsman2, bridgeData{ + originNet: rollup2ID, + destNet: mainnetID, + originTokenNet: mainnetID, + originTokenAddr: nativeTokenR2, + amount: big.NewInt(42069), + }) + + log.Info("L1 -- eth --> R2") + bridge(t, ctx, opsman2, bridgeData{ + originNet: mainnetID, + destNet: rollup2ID, + originTokenNet: mainnetID, + originTokenAddr: common.Address{}, + amount: big.NewInt(999999999999999999), + }) + + log.Info("R2 -- eth --> L1") + bridge(t, ctx, opsman2, bridgeData{ + originNet: rollup2ID, + destNet: mainnetID, + originTokenNet: mainnetID, + originTokenAddr: common.Address{}, + amount: big.NewInt(42069), + }) + + log.Info("L1 -- token from L1 --> R2") + bridge(t, ctx, opsman2, bridgeData{ + originNet: mainnetID, + destNet: rollup2ID, + originTokenNet: mainnetID, + originTokenAddr: l1TokenAddr, + amount: big.NewInt(42069), + }) + + log.Info("R2 -- token from L1 --> L1") + bridge(t, ctx, opsman2, bridgeData{ + originNet: rollup2ID, + destNet: mainnetID, + originTokenNet: mainnetID, + originTokenAddr: l1TokenAddr, + amount: big.NewInt(42069), + }) + + rollup2TokenAddr, _, err := opsman2.DeployERC20(ctx, "CREATED ON Rollup 2", "CR2", operations.L2) + require.NoError(t, err) + err = opsman2.MintERC20(ctx, rollup2TokenAddr, big.NewInt(999999999999999999), operations.L2) + require.NoError(t, err) + log.Info("R2 -- token from R2 --> L1") + bridge(t, ctx, opsman2, bridgeData{ + originNet: rollup2ID, + destNet: mainnetID, + originTokenNet: rollup2ID, + originTokenAddr: rollup2TokenAddr, + amount: big.NewInt(42069), + }) + + log.Info("L1 -- token from R2 --> R2") + bridge(t, ctx, opsman2, bridgeData{ + originNet: mainnetID, + destNet: rollup2ID, + originTokenNet: rollup2ID, + originTokenAddr: rollup2TokenAddr, + amount: big.NewInt(42069), + }) +} + +type bridgeData struct { + originNet uint32 + destNet uint32 + originTokenNet uint32 + originTokenAddr common.Address + amount *big.Int +} + +func bridge( + t *testing.T, + ctx context.Context, + opsman *operations.Manager, + bd bridgeData, +) { + // Sanity check that opsman support involved networks + rID, err := opsman.GetRollupID() + require.NoError(t, err) + require.False( + t, bd.originNet != 0 && bd.originNet != rID, + "opsman doesn't support all the networks involved", + ) + require.False( + t, bd.destNet != 0 && bd.destNet != rID, + "opsman doesn't support all the networks involved", + ) + + var ( + // This addresses are hardcoded on opsman. Would be nice to make it more flexible + // to be able to operate multiple accounts + destAddr common.Address + l1Addr = common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC") + l2Addr = common.HexToAddress("0xc949254d682d8c9ad5682521675b8f43b102aec4") + ) + if bd.destNet == 0 { + destAddr = l1Addr + } else { + destAddr = l2Addr + } + initialL1Balance, initialL2Balance, err := opsman.GetBalances( + ctx, + bd.originTokenNet, + bd.originTokenAddr, + l1Addr, + l2Addr, + ) + require.NoError(t, err) + log.Debugf( + "initial balance on L1: %d, initial balance on L2: %d", + initialL1Balance.Int64(), initialL2Balance.Int64(), + ) + if bd.originNet == 0 { + tokenAddr, err := opsman.GetTokenAddr(operations.L1, bd.originTokenNet, bd.originTokenAddr) + require.NoError(t, err) + log.Debugf( + "depositing %d tokens of addr %s on L1 to network %d", + bd.amount.Uint64(), tokenAddr, bd.destNet, + ) + err = opsman.SendL1Deposit(ctx, tokenAddr, bd.amount, bd.destNet, &destAddr) + require.NoError(t, err) + } else { + tokenAddr, err := opsman.GetTokenAddr(operations.L2, bd.originTokenNet, bd.originTokenAddr) + require.NoError(t, err) + log.Debugf( + "depositing %d tokens of addr %s on Rollup %d to Network %d", + bd.amount.Uint64(), tokenAddr, bd.destNet, + ) + err = opsman.SendL2Deposit(ctx, tokenAddr, bd.amount, bd.destNet, &destAddr) + require.NoError(t, err) + } + log.Debug("deposit sent") + + log.Debug("checking deposits from bridge service...") + deposits, err := opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) + require.NoError(t, err) + deposit := deposits[0] + + if bd.originNet == 0 { + log.Debug("waiting for claim tx to be sent on behalf of the user by bridge service...") + err = opsman.CheckClaim(ctx, deposit) + require.NoError(t, err) + log.Debug("deposit claimed on L2") + } else { + log.Debug("getting proof to perform claim from bridge service...") + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData( + ctx, + uint(deposit.NetworkId), + uint(deposit.DepositCnt), + ) + require.NoError(t, err) + log.Debug("sending claim tx to L1") + err = opsman.SendL1Claim(ctx, deposit, smtProof, smtRollupProof, globaExitRoot) + require.NoError(t, err) + log.Debug("claim sent") + } + + afterClaimL1Balance, afterClaimL2Balance, err := opsman.GetBalances( + ctx, + bd.originTokenNet, + bd.originTokenAddr, + l1Addr, + l2Addr, + ) + require.NoError(t, err) + log.Debugf( + "deosit claimed on network %d. final balance on L1: %d, final balance on L2: %d", + bd.originNet, afterClaimL1Balance.Int64(), afterClaimL2Balance.Int64(), + ) + // It's hard to get the expected balance after the process due to fees on L1/L2. + // TODO: refactor SendL1Deposit / SendL2Deposit / SendL1Claim and to return the tx receipt or whatever so we can check the gas used and the gas price + require.NotEqual(t, 0, initialL1Balance.Cmp(afterClaimL1Balance)) + require.NotEqual(t, 0, initialL2Balance.Cmp(afterClaimL2Balance)) +} + +func getOpsman( + l2NetworkURL string, + dbName string, + bridgeServiceHTTPPort string, + bridgeServiceGRPCPort string, +) (context.Context, *operations.Manager, error) { + ctx := context.Background() + opsCfg := &operations.Config{ + L1NetworkURL: "http://localhost:8545", + L2NetworkURL: l2NetworkURL, + Storage: db.Config{ + Database: "postgres", + Name: dbName, + User: "user", + Password: "pass", + Host: "localhost", + Port: "5432", + MaxConns: 10, + }, + BT: bridgectrl.Config{ + Store: "postgres", + Height: uint8(32), + }, + BS: server.Config{ + GRPCPort: bridgeServiceGRPCPort, + HTTPPort: bridgeServiceHTTPPort, + CacheSize: 100000, + DefaultPageLimit: 25, + MaxPageLimit: 100, + BridgeVersion: "v1", + }, + } + opsman, err := operations.NewManager(ctx, opsCfg) + return ctx, opsman, err +} diff --git a/test/mocksmartcontracts/abi/erc20permitmock.abi b/test/mocksmartcontracts/abi/erc20permitmock.abi new file mode 100644 index 00000000..d56a70bb --- /dev/null +++ b/test/mocksmartcontracts/abi/erc20permitmock.abi @@ -0,0 +1,515 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "address", + "name": "initialAccount", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialBalance", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712DOMAIN_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NAME_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VERSION_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approveInternal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferInternal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] \ No newline at end of file diff --git a/test/mocksmartcontracts/bin/erc20permitmock.bin b/test/mocksmartcontracts/bin/erc20permitmock.bin new file mode 100644 index 00000000..3eeed8a0 --- /dev/null +++ b/test/mocksmartcontracts/bin/erc20permitmock.bin @@ -0,0 +1 @@ +6080604052604051620018e6380380620018e6833981016040819052620000269162000201565b8383600362000036838262000322565b50600462000045828262000322565b5050506200005a82826200007160201b60201c565b505081516020909201919091206006555062000416565b6001600160a01b038216620000cc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e09190620003ee565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016457600080fd5b81516001600160401b03808211156200018157620001816200013c565b604051601f8301601f19908116603f01168101908282118183101715620001ac57620001ac6200013c565b81604052838152602092508683858801011115620001c957600080fd5b600091505b83821015620001ed5785820183015181830184015290820190620001ce565b600093810190920192909252949350505050565b600080600080608085870312156200021857600080fd5b84516001600160401b03808211156200023057600080fd5b6200023e8883890162000152565b955060208701519150808211156200025557600080fd5b50620002648782880162000152565b604087015190945090506001600160a01b03811681146200028457600080fd5b6060959095015193969295505050565b600181811c90821680620002a957607f821691505b602082108103620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200013757600081815260208120601f850160051c81016020861015620002f95750805b601f850160051c820191505b818110156200031a5782815560010162000305565b505050505050565b81516001600160401b038111156200033e576200033e6200013c565b62000356816200034f845462000294565b84620002d0565b602080601f8311600181146200038e5760008415620003755750858301515b600019600386901b1c1916600185901b1785556200031a565b600085815260208120601f198616915b82811015620003bf578886015182559484019460019091019084016200039e565b5085821015620003de5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200041057634e487b7160e01b600052601160045260246000fd5b92915050565b6114c080620004266000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806340c10f19116100e35780639e4e73181161008c578063c473af3311610066578063c473af33146103d6578063d505accf146103fd578063dd62ed3e1461041057600080fd5b80639e4e731814610389578063a457c2d7146103b0578063a9059cbb146103c357600080fd5b806370a08231116100bd57806370a082311461032b5780637ecebe001461036157806395d89b411461038157600080fd5b806340c10f19146102f257806342966c681461030557806356189cb41461031857600080fd5b806323b872dd116101455780633408e4701161011f5780633408e4701461024c5780633644e5151461025257806339509351146102df57600080fd5b806323b872dd1461020357806330adf81f14610216578063313ce5671461023d57600080fd5b8063095ea7b311610176578063095ea7b3146101c357806318160ddd146101e6578063222f5be0146101ee57600080fd5b806304622c2e1461019257806306fdde03146101ae575b600080fd5b61019b60065481565b6040519081526020015b60405180910390f35b6101b6610456565b6040516101a591906111e1565b6101d66101d1366004611276565b6104e8565b60405190151581526020016101a5565b60025461019b565b6102016101fc3660046112a0565b610502565b005b6101d66102113660046112a0565b610512565b61019b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b604051601281526020016101a5565b4661019b565b61019b6006546000907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f907fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc646604080516020810195909552840192909252606083015260808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6101d66102ed366004611276565b610536565b610201610300366004611276565b610582565b6102016103133660046112dc565b610590565b6102016103263660046112a0565b61059d565b61019b6103393660046112f5565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61019b61036f3660046112f5565b60056020526000908152604090205481565b6101b66105a8565b61019b7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc681565b6101d66103be366004611276565b6105b7565b6101d66103d1366004611276565b61068d565b61019b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61020161040b366004611317565b61069b565b61019b61041e36600461138a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b606060038054610465906113bd565b80601f0160208091040260200160405190810160405280929190818152602001828054610491906113bd565b80156104de5780601f106104b3576101008083540402835291602001916104de565b820191906000526020600020905b8154815290600101906020018083116104c157829003601f168201915b5050505050905090565b6000336104f68185856107e2565b60019150505b92915050565b61050d838383610995565b505050565b600033610520858285610c06565b61052b858585610995565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104f6908290869061057d90879061143f565b6107e2565b61058c8282610cd7565b5050565b61059a3382610dca565b50565b61050d8383836107e2565b606060048054610465906113bd565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610680576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052b82868684036107e2565b6000336104f6818585610995565b42841015610705576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f48455a3a3a7065726d69743a20415554485f45585049524544000000000000006044820152606401610677565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a91908661075f83611452565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506107cd8882868686610f8e565b6107d88888886107e2565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610884576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff8216610927576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610a38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff8216610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35b50505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c005781811015610cca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610677565b610c0084848484036107e2565b73ffffffffffffffffffffffffffffffffffffffff8216610d54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610677565b8060026000828254610d66919061143f565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610e6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610f23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600654604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f602080830191909152818301939093527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528251808303909101815260c08201909252815191909201207f190100000000000000000000000000000000000000000000000000000000000060e083015260e2820181905261010282018690529060009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa1580156110da573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061115557508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6107d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f48455a3a3a5f76616c69646174655369676e6564446174613a20494e56414c4960448201527f445f5349474e41545552450000000000000000000000000000000000000000006064820152608401610677565b600060208083528351808285015260005b8181101561120e578581018301518582016040015282016111f2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461127157600080fd5b919050565b6000806040838503121561128957600080fd5b6112928361124d565b946020939093013593505050565b6000806000606084860312156112b557600080fd5b6112be8461124d565b92506112cc6020850161124d565b9150604084013590509250925092565b6000602082840312156112ee57600080fd5b5035919050565b60006020828403121561130757600080fd5b6113108261124d565b9392505050565b600080600080600080600060e0888a03121561133257600080fd5b61133b8861124d565b96506113496020890161124d565b95506040880135945060608801359350608088013560ff8116811461136d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561139d57600080fd5b6113a68361124d565b91506113b46020840161124d565b90509250929050565b600181811c908216806113d157607f821691505b60208210810361140a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104fc576104fc611410565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361148357611483611410565b506001019056fea26469706673582212208b36599ef550f0c194373b0c511974c888d8ed7226087368a04dca3579711bcd64736f6c63430008140033 \ No newline at end of file diff --git a/test/mocksmartcontracts/erc20permitmock/erc20permitmock.go b/test/mocksmartcontracts/erc20permitmock/erc20permitmock.go new file mode 100644 index 00000000..8d375a6e --- /dev/null +++ b/test/mocksmartcontracts/erc20permitmock/erc20permitmock.go @@ -0,0 +1,1124 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc20permitmock + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// Erc20permitmockMetaData contains all meta data concerning the Erc20permitmock contract. +var Erc20permitmockMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"initialAccount\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EIP712DOMAIN_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NAME_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approveInternal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferInternal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x6080604052604051620018e6380380620018e6833981016040819052620000269162000201565b8383600362000036838262000322565b50600462000045828262000322565b5050506200005a82826200007160201b60201c565b505081516020909201919091206006555062000416565b6001600160a01b038216620000cc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620000e09190620003ee565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200016457600080fd5b81516001600160401b03808211156200018157620001816200013c565b604051601f8301601f19908116603f01168101908282118183101715620001ac57620001ac6200013c565b81604052838152602092508683858801011115620001c957600080fd5b600091505b83821015620001ed5785820183015181830184015290820190620001ce565b600093810190920192909252949350505050565b600080600080608085870312156200021857600080fd5b84516001600160401b03808211156200023057600080fd5b6200023e8883890162000152565b955060208701519150808211156200025557600080fd5b50620002648782880162000152565b604087015190945090506001600160a01b03811681146200028457600080fd5b6060959095015193969295505050565b600181811c90821680620002a957607f821691505b602082108103620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200013757600081815260208120601f850160051c81016020861015620002f95750805b601f850160051c820191505b818110156200031a5782815560010162000305565b505050505050565b81516001600160401b038111156200033e576200033e6200013c565b62000356816200034f845462000294565b84620002d0565b602080601f8311600181146200038e5760008415620003755750858301515b600019600386901b1c1916600185901b1785556200031a565b600085815260208120601f198616915b82811015620003bf578886015182559484019460019091019084016200039e565b5085821015620003de5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200041057634e487b7160e01b600052601160045260246000fd5b92915050565b6114c080620004266000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c806340c10f19116100e35780639e4e73181161008c578063c473af3311610066578063c473af33146103d6578063d505accf146103fd578063dd62ed3e1461041057600080fd5b80639e4e731814610389578063a457c2d7146103b0578063a9059cbb146103c357600080fd5b806370a08231116100bd57806370a082311461032b5780637ecebe001461036157806395d89b411461038157600080fd5b806340c10f19146102f257806342966c681461030557806356189cb41461031857600080fd5b806323b872dd116101455780633408e4701161011f5780633408e4701461024c5780633644e5151461025257806339509351146102df57600080fd5b806323b872dd1461020357806330adf81f14610216578063313ce5671461023d57600080fd5b8063095ea7b311610176578063095ea7b3146101c357806318160ddd146101e6578063222f5be0146101ee57600080fd5b806304622c2e1461019257806306fdde03146101ae575b600080fd5b61019b60065481565b6040519081526020015b60405180910390f35b6101b6610456565b6040516101a591906111e1565b6101d66101d1366004611276565b6104e8565b60405190151581526020016101a5565b60025461019b565b6102016101fc3660046112a0565b610502565b005b6101d66102113660046112a0565b610512565b61019b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b604051601281526020016101a5565b4661019b565b61019b6006546000907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f907fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc646604080516020810195909552840192909252606083015260808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6101d66102ed366004611276565b610536565b610201610300366004611276565b610582565b6102016103133660046112dc565b610590565b6102016103263660046112a0565b61059d565b61019b6103393660046112f5565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b61019b61036f3660046112f5565b60056020526000908152604090205481565b6101b66105a8565b61019b7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc681565b6101d66103be366004611276565b6105b7565b6101d66103d1366004611276565b61068d565b61019b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b61020161040b366004611317565b61069b565b61019b61041e36600461138a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b606060038054610465906113bd565b80601f0160208091040260200160405190810160405280929190818152602001828054610491906113bd565b80156104de5780601f106104b3576101008083540402835291602001916104de565b820191906000526020600020905b8154815290600101906020018083116104c157829003601f168201915b5050505050905090565b6000336104f68185856107e2565b60019150505b92915050565b61050d838383610995565b505050565b600033610520858285610c06565b61052b858585610995565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104f6908290869061057d90879061143f565b6107e2565b61058c8282610cd7565b5050565b61059a3382610dca565b50565b61050d8383836107e2565b606060048054610465906113bd565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610680576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61052b82868684036107e2565b6000336104f6818585610995565b42841015610705576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f48455a3a3a7065726d69743a20415554485f45585049524544000000000000006044820152606401610677565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918a918a918a91908661075f83611452565b9091555060408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506107cd8882868686610f8e565b6107d88888886107e2565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610884576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff8216610927576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610a38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff8216610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35b50505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c005781811015610cca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610677565b610c0084848484036107e2565b73ffffffffffffffffffffffffffffffffffffffff8216610d54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610677565b8060026000828254610d66919061143f565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610e6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610f23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610677565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600654604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f602080830191909152818301939093527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528251808303909101815260c08201909252815191909201207f190100000000000000000000000000000000000000000000000000000000000060e083015260e2820181905261010282018690529060009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa1580156110da573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81161580159061115557508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b6107d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f48455a3a3a5f76616c69646174655369676e6564446174613a20494e56414c4960448201527f445f5349474e41545552450000000000000000000000000000000000000000006064820152608401610677565b600060208083528351808285015260005b8181101561120e578581018301518582016040015282016111f2565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461127157600080fd5b919050565b6000806040838503121561128957600080fd5b6112928361124d565b946020939093013593505050565b6000806000606084860312156112b557600080fd5b6112be8461124d565b92506112cc6020850161124d565b9150604084013590509250925092565b6000602082840312156112ee57600080fd5b5035919050565b60006020828403121561130757600080fd5b6113108261124d565b9392505050565b600080600080600080600060e0888a03121561133257600080fd5b61133b8861124d565b96506113496020890161124d565b95506040880135945060608801359350608088013560ff8116811461136d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561139d57600080fd5b6113a68361124d565b91506113b46020840161124d565b90509250929050565b600181811c908216806113d157607f821691505b60208210810361140a577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156104fc576104fc611410565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361148357611483611410565b506001019056fea26469706673582212208b36599ef550f0c194373b0c511974c888d8ed7226087368a04dca3579711bcd64736f6c63430008140033", +} + +// Erc20permitmockABI is the input ABI used to generate the binding from. +// Deprecated: Use Erc20permitmockMetaData.ABI instead. +var Erc20permitmockABI = Erc20permitmockMetaData.ABI + +// Erc20permitmockBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use Erc20permitmockMetaData.Bin instead. +var Erc20permitmockBin = Erc20permitmockMetaData.Bin + +// DeployErc20permitmock deploys a new Ethereum contract, binding an instance of Erc20permitmock to it. +func DeployErc20permitmock(auth *bind.TransactOpts, backend bind.ContractBackend, name string, symbol string, initialAccount common.Address, initialBalance *big.Int) (common.Address, *types.Transaction, *Erc20permitmock, error) { + parsed, err := Erc20permitmockMetaData.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(Erc20permitmockBin), backend, name, symbol, initialAccount, initialBalance) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &Erc20permitmock{Erc20permitmockCaller: Erc20permitmockCaller{contract: contract}, Erc20permitmockTransactor: Erc20permitmockTransactor{contract: contract}, Erc20permitmockFilterer: Erc20permitmockFilterer{contract: contract}}, nil +} + +// Erc20permitmock is an auto generated Go binding around an Ethereum contract. +type Erc20permitmock struct { + Erc20permitmockCaller // Read-only binding to the contract + Erc20permitmockTransactor // Write-only binding to the contract + Erc20permitmockFilterer // Log filterer for contract events +} + +// Erc20permitmockCaller is an auto generated read-only Go binding around an Ethereum contract. +type Erc20permitmockCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20permitmockTransactor is an auto generated write-only Go binding around an Ethereum contract. +type Erc20permitmockTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20permitmockFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Erc20permitmockFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20permitmockSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Erc20permitmockSession struct { + Contract *Erc20permitmock // 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 +} + +// Erc20permitmockCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Erc20permitmockCallerSession struct { + Contract *Erc20permitmockCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Erc20permitmockTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Erc20permitmockTransactorSession struct { + Contract *Erc20permitmockTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Erc20permitmockRaw is an auto generated low-level Go binding around an Ethereum contract. +type Erc20permitmockRaw struct { + Contract *Erc20permitmock // Generic contract binding to access the raw methods on +} + +// Erc20permitmockCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Erc20permitmockCallerRaw struct { + Contract *Erc20permitmockCaller // Generic read-only contract binding to access the raw methods on +} + +// Erc20permitmockTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Erc20permitmockTransactorRaw struct { + Contract *Erc20permitmockTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewErc20permitmock creates a new instance of Erc20permitmock, bound to a specific deployed contract. +func NewErc20permitmock(address common.Address, backend bind.ContractBackend) (*Erc20permitmock, error) { + contract, err := bindErc20permitmock(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Erc20permitmock{Erc20permitmockCaller: Erc20permitmockCaller{contract: contract}, Erc20permitmockTransactor: Erc20permitmockTransactor{contract: contract}, Erc20permitmockFilterer: Erc20permitmockFilterer{contract: contract}}, nil +} + +// NewErc20permitmockCaller creates a new read-only instance of Erc20permitmock, bound to a specific deployed contract. +func NewErc20permitmockCaller(address common.Address, caller bind.ContractCaller) (*Erc20permitmockCaller, error) { + contract, err := bindErc20permitmock(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Erc20permitmockCaller{contract: contract}, nil +} + +// NewErc20permitmockTransactor creates a new write-only instance of Erc20permitmock, bound to a specific deployed contract. +func NewErc20permitmockTransactor(address common.Address, transactor bind.ContractTransactor) (*Erc20permitmockTransactor, error) { + contract, err := bindErc20permitmock(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Erc20permitmockTransactor{contract: contract}, nil +} + +// NewErc20permitmockFilterer creates a new log filterer instance of Erc20permitmock, bound to a specific deployed contract. +func NewErc20permitmockFilterer(address common.Address, filterer bind.ContractFilterer) (*Erc20permitmockFilterer, error) { + contract, err := bindErc20permitmock(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Erc20permitmockFilterer{contract: contract}, nil +} + +// bindErc20permitmock binds a generic wrapper to an already deployed contract. +func bindErc20permitmock(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := Erc20permitmockMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Erc20permitmock *Erc20permitmockRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Erc20permitmock.Contract.Erc20permitmockCaller.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 (_Erc20permitmock *Erc20permitmockRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Erc20permitmockTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Erc20permitmock *Erc20permitmockRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Erc20permitmockTransactor.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 (_Erc20permitmock *Erc20permitmockCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Erc20permitmock.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 (_Erc20permitmock *Erc20permitmockTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Erc20permitmock.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Erc20permitmock *Erc20permitmockTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Erc20permitmock.Contract.contract.Transact(opts, method, params...) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockSession) DOMAINSEPARATOR() ([32]byte, error) { + return _Erc20permitmock.Contract.DOMAINSEPARATOR(&_Erc20permitmock.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _Erc20permitmock.Contract.DOMAINSEPARATOR(&_Erc20permitmock.CallOpts) +} + +// EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33. +// +// Solidity: function EIP712DOMAIN_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCaller) EIP712DOMAINHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "EIP712DOMAIN_HASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33. +// +// Solidity: function EIP712DOMAIN_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockSession) EIP712DOMAINHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.EIP712DOMAINHASH(&_Erc20permitmock.CallOpts) +} + +// EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33. +// +// Solidity: function EIP712DOMAIN_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCallerSession) EIP712DOMAINHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.EIP712DOMAINHASH(&_Erc20permitmock.CallOpts) +} + +// NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e. +// +// Solidity: function NAME_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCaller) NAMEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "NAME_HASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e. +// +// Solidity: function NAME_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockSession) NAMEHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.NAMEHASH(&_Erc20permitmock.CallOpts) +} + +// NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e. +// +// Solidity: function NAME_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCallerSession) NAMEHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.NAMEHASH(&_Erc20permitmock.CallOpts) +} + +// PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. +// +// Solidity: function PERMIT_TYPEHASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "PERMIT_TYPEHASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. +// +// Solidity: function PERMIT_TYPEHASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockSession) PERMITTYPEHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.PERMITTYPEHASH(&_Erc20permitmock.CallOpts) +} + +// PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. +// +// Solidity: function PERMIT_TYPEHASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCallerSession) PERMITTYPEHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.PERMITTYPEHASH(&_Erc20permitmock.CallOpts) +} + +// VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318. +// +// Solidity: function VERSION_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCaller) VERSIONHASH(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "VERSION_HASH") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318. +// +// Solidity: function VERSION_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockSession) VERSIONHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.VERSIONHASH(&_Erc20permitmock.CallOpts) +} + +// VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318. +// +// Solidity: function VERSION_HASH() view returns(bytes32) +func (_Erc20permitmock *Erc20permitmockCallerSession) VERSIONHASH() ([32]byte, error) { + return _Erc20permitmock.Contract.VERSIONHASH(&_Erc20permitmock.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.Allowance(&_Erc20permitmock.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.Allowance(&_Erc20permitmock.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "balanceOf", account) + + 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 account) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.BalanceOf(&_Erc20permitmock.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.BalanceOf(&_Erc20permitmock.CallOpts, account) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Erc20permitmock *Erc20permitmockCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Erc20permitmock *Erc20permitmockSession) Decimals() (uint8, error) { + return _Erc20permitmock.Contract.Decimals(&_Erc20permitmock.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Erc20permitmock *Erc20permitmockCallerSession) Decimals() (uint8, error) { + return _Erc20permitmock.Contract.Decimals(&_Erc20permitmock.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainId) +func (_Erc20permitmock *Erc20permitmockCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainId) +func (_Erc20permitmock *Erc20permitmockSession) GetChainId() (*big.Int, error) { + return _Erc20permitmock.Contract.GetChainId(&_Erc20permitmock.CallOpts) +} + +// GetChainId is a free data retrieval call binding the contract method 0x3408e470. +// +// Solidity: function getChainId() view returns(uint256 chainId) +func (_Erc20permitmock *Erc20permitmockCallerSession) GetChainId() (*big.Int, error) { + return _Erc20permitmock.Contract.GetChainId(&_Erc20permitmock.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Erc20permitmock *Erc20permitmockCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Erc20permitmock *Erc20permitmockSession) Name() (string, error) { + return _Erc20permitmock.Contract.Name(&_Erc20permitmock.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Erc20permitmock *Erc20permitmockCallerSession) Name() (string, error) { + return _Erc20permitmock.Contract.Name(&_Erc20permitmock.CallOpts) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "nonces", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockSession) Nonces(arg0 common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.Nonces(&_Erc20permitmock.CallOpts, arg0) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address ) view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCallerSession) Nonces(arg0 common.Address) (*big.Int, error) { + return _Erc20permitmock.Contract.Nonces(&_Erc20permitmock.CallOpts, arg0) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Erc20permitmock *Erc20permitmockCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Erc20permitmock *Erc20permitmockSession) Symbol() (string, error) { + return _Erc20permitmock.Contract.Symbol(&_Erc20permitmock.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Erc20permitmock *Erc20permitmockCallerSession) Symbol() (string, error) { + return _Erc20permitmock.Contract.Symbol(&_Erc20permitmock.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Erc20permitmock.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Erc20permitmock *Erc20permitmockSession) TotalSupply() (*big.Int, error) { + return _Erc20permitmock.Contract.TotalSupply(&_Erc20permitmock.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Erc20permitmock *Erc20permitmockCallerSession) TotalSupply() (*big.Int, error) { + return _Erc20permitmock.Contract.TotalSupply(&_Erc20permitmock.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Approve(&_Erc20permitmock.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Approve(&_Erc20permitmock.TransactOpts, spender, amount) +} + +// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4. +// +// Solidity: function approveInternal(address owner, address spender, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockTransactor) ApproveInternal(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "approveInternal", owner, spender, value) +} + +// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4. +// +// Solidity: function approveInternal(address owner, address spender, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockSession) ApproveInternal(owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.ApproveInternal(&_Erc20permitmock.TransactOpts, owner, spender, value) +} + +// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4. +// +// Solidity: function approveInternal(address owner, address spender, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockTransactorSession) ApproveInternal(owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.ApproveInternal(&_Erc20permitmock.TransactOpts, owner, spender, value) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockTransactor) Burn(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "burn", amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Burn(&_Erc20permitmock.TransactOpts, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockTransactorSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Burn(&_Erc20permitmock.TransactOpts, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.DecreaseAllowance(&_Erc20permitmock.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.DecreaseAllowance(&_Erc20permitmock.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.IncreaseAllowance(&_Erc20permitmock.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.IncreaseAllowance(&_Erc20permitmock.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "mint", account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Mint(&_Erc20permitmock.TransactOpts, account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Erc20permitmock *Erc20permitmockTransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Mint(&_Erc20permitmock.TransactOpts, account, amount) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_Erc20permitmock *Erc20permitmockTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_Erc20permitmock *Erc20permitmockSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Permit(&_Erc20permitmock.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_Erc20permitmock *Erc20permitmockTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Permit(&_Erc20permitmock.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Transfer(&_Erc20permitmock.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.Transfer(&_Erc20permitmock.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.TransferFrom(&_Erc20permitmock.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Erc20permitmock *Erc20permitmockTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.TransferFrom(&_Erc20permitmock.TransactOpts, from, to, amount) +} + +// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0. +// +// Solidity: function transferInternal(address from, address to, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockTransactor) TransferInternal(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.contract.Transact(opts, "transferInternal", from, to, value) +} + +// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0. +// +// Solidity: function transferInternal(address from, address to, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockSession) TransferInternal(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.TransferInternal(&_Erc20permitmock.TransactOpts, from, to, value) +} + +// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0. +// +// Solidity: function transferInternal(address from, address to, uint256 value) returns() +func (_Erc20permitmock *Erc20permitmockTransactorSession) TransferInternal(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { + return _Erc20permitmock.Contract.TransferInternal(&_Erc20permitmock.TransactOpts, from, to, value) +} + +// Erc20permitmockApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Erc20permitmock contract. +type Erc20permitmockApprovalIterator struct { + Event *Erc20permitmockApproval // 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 *Erc20permitmockApprovalIterator) 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(Erc20permitmockApproval) + 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(Erc20permitmockApproval) + 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 *Erc20permitmockApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20permitmockApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20permitmockApproval represents a Approval event raised by the Erc20permitmock contract. +type Erc20permitmockApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*Erc20permitmockApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Erc20permitmock.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &Erc20permitmockApprovalIterator{contract: _Erc20permitmock.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Erc20permitmockApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Erc20permitmock.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + 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(Erc20permitmockApproval) + if err := _Erc20permitmock.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) ParseApproval(log types.Log) (*Erc20permitmockApproval, error) { + event := new(Erc20permitmockApproval) + if err := _Erc20permitmock.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Erc20permitmockTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Erc20permitmock contract. +type Erc20permitmockTransferIterator struct { + Event *Erc20permitmockTransfer // 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 *Erc20permitmockTransferIterator) 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(Erc20permitmockTransfer) + 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(Erc20permitmockTransfer) + 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 *Erc20permitmockTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20permitmockTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20permitmockTransfer represents a Transfer event raised by the Erc20permitmock contract. +type Erc20permitmockTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*Erc20permitmockTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Erc20permitmock.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &Erc20permitmockTransferIterator{contract: _Erc20permitmock.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *Erc20permitmockTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Erc20permitmock.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + 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(Erc20permitmockTransfer) + if err := _Erc20permitmock.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Erc20permitmock *Erc20permitmockFilterer) ParseTransfer(log types.Log) (*Erc20permitmockTransfer, error) { + event := new(Erc20permitmockTransfer) + if err := _Erc20permitmock.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/test/mocksmartcontracts/script.sh b/test/mocksmartcontracts/script.sh index f5a3897e..b6f91586 100755 --- a/test/mocksmartcontracts/script.sh +++ b/test/mocksmartcontracts/script.sh @@ -17,5 +17,6 @@ compilegen() { abigen --bin ${package}/${package}.bin --abi ${package}/${package}.abi --pkg=${package} --out=${package}/${package}.go } +gen erc20permitmock gen polygonzkevmbridge compilegen BridgeMessageReceiver \ No newline at end of file diff --git a/test/operations/interfaces.go b/test/operations/interfaces.go index 12fccd3b..2bef46b0 100644 --- a/test/operations/interfaces.go +++ b/test/operations/interfaces.go @@ -3,7 +3,6 @@ package operations import ( "context" - "github.com/0xPolygonHermez/zkevm-bridge-service/bridgectrl/pb" "github.com/0xPolygonHermez/zkevm-bridge-service/etherman" "github.com/ethereum/go-ethereum/common" "github.com/jackc/pgx/v4" @@ -18,7 +17,7 @@ type StorageInterface interface { GetTokenWrapped(ctx context.Context, originalNetwork uint, originalTokenAddress common.Address, dbTx pgx.Tx) (*etherman.TokenWrapped, error) GetDepositCountByRoot(ctx context.Context, root []byte, network uint8, dbTx pgx.Tx) (uint, error) UpdateBlocksForTesting(ctx context.Context, networkID uint, blockNum uint64, dbTx pgx.Tx) error - GetClaim(ctx context.Context, depositCount, networkID uint, dbTx pgx.Tx) (*etherman.Claim, error) + GetClaim(ctx context.Context, depositCount, origNetworkID, destNetworkID uint, dbTx pgx.Tx) (*etherman.Claim, error) UpdateDepositsStatusForTesting(ctx context.Context, dbTx pgx.Tx) error // synchronizer AddBlock(ctx context.Context, block *etherman.Block, dbTx pgx.Tx) (uint64, error) @@ -32,9 +31,3 @@ type StorageInterface interface { BeginDBTransaction(ctx context.Context) (pgx.Tx, error) Commit(ctx context.Context, dbTx pgx.Tx) error } - -// BridgeServiceInterface is an interface for the bridge service. -type BridgeServiceInterface interface { - GetBridges(ctx context.Context, req *pb.GetBridgesRequest) (*pb.GetBridgesResponse, error) - GetProof(ctx context.Context, req *pb.GetProofRequest) (*pb.GetProofResponse, error) -} diff --git a/test/operations/manager.go b/test/operations/manager.go index b96e2321..f868752d 100644 --- a/test/operations/manager.go +++ b/test/operations/manager.go @@ -2,6 +2,7 @@ package operations import ( "context" + "errors" "math/big" "os" "os/exec" @@ -25,6 +26,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) // NetworkSID is used to identify the network. @@ -39,13 +42,10 @@ const ( ) const ( - l1NetworkURL = "http://localhost:8545" - l2NetworkURL = "http://localhost:8123" - // PolTokenAddress token address PolTokenAddress = "0x5FbDB2315678afecb367f032d93F642f64180aa3" //nolint:gosec - l1BridgeAddr = "0xCca6ECD73932e49633B9307e1aa0fC174525F424" - l2BridgeAddr = "0xCca6ECD73932e49633B9307e1aa0fC174525F424" + L1BridgeAddr = "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8" + L2BridgeAddr = "0xB7098a13a48EcE087d3DA15b2D28eCE0f89819B8" l1AccHexAddress = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" @@ -55,11 +55,9 @@ const ( cmdDir = "../.." mtHeight = 32 - rollupID = 1 ) var ( - dbConfig = pgstorage.NewConfigFromEnv() accHexPrivateKeys = map[NetworkSID]string{ L1: "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a", //0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC L2: "0xdfd01798f92667dbf91df722434e8fbe96af0211d4d1b82bbbbc8f1def7a814f", //0xc949254d682d8c9ad5682521675b8f43b102aec4 @@ -68,9 +66,11 @@ var ( // Config is the main Manager configuration. type Config struct { - Storage db.Config - BT bridgectrl.Config - BS server.Config + Storage db.Config + BT bridgectrl.Config + BS server.Config + L1NetworkURL string + L2NetworkURL string } // Manager controls operations and has knowledge about how to set up and tear @@ -81,25 +81,26 @@ type Manager struct { storage StorageInterface bridgetree *bridgectrl.BridgeController - bridgeService BridgeServiceInterface + bridgeService pb.BridgeServiceClient - clients map[NetworkSID]*utils.Client + Clients map[NetworkSID]*utils.Client + l1Ethman *etherman.Client + l2Ethman *etherman.Client + l2NativeToken common.Address + wETH common.Address + rollupID uint32 } // NewManager returns a manager ready to be used and a potential error caused // during its creation (which can come from the setup of the db connection). func NewManager(ctx context.Context, cfg *Config) (*Manager, error) { - opsman := &Manager{ - cfg: cfg, - ctx: ctx, - } - //Init storage and mt - // err := pgstorage.InitOrReset(dbConfig) - // if err != nil { - // return nil, err - // } - - pgst, err := pgstorage.NewPostgresStorage(dbConfig) + pgst, err := pgstorage.NewPostgresStorage(pgstorage.Config{ + Name: cfg.Storage.Name, + User: cfg.Storage.User, + Password: cfg.Storage.Password, + Host: cfg.Storage.Host, + MaxConns: cfg.Storage.MaxConns, + }) if err != nil { return nil, err } @@ -107,39 +108,134 @@ func NewManager(ctx context.Context, cfg *Config) (*Manager, error) { if err != nil { return nil, err } - bt, err := bridgectrl.NewBridgeController(ctx, cfg.BT, []uint{0, 1}, pgst) + l1Client, err := utils.NewClient(ctx, cfg.L1NetworkURL, common.HexToAddress(L1BridgeAddr)) + if err != nil { + return nil, err + } + l2Client, err := utils.NewClient(ctx, cfg.L2NetworkURL, common.HexToAddress(L2BridgeAddr)) + if err != nil { + return nil, err + } + l2Ethman, err := etherman.NewL2Client( + cfg.L2NetworkURL, + common.HexToAddress(L1BridgeAddr), + ) + if err != nil { + return nil, err + } + rollupID := l2Ethman.GetRollupID() + bt, err := bridgectrl.NewBridgeController(ctx, cfg.BT, []uint{0, rollupID}, pgst) if err != nil { return nil, err } - l1Client, err := utils.NewClient(ctx, l1NetworkURL, common.HexToAddress(l1BridgeAddr)) + opts := []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithBlock(), + } + ctx, _ = context.WithTimeout(ctx, 5*time.Second) //nolint:gomnd,govet + bridgeConn, err := grpc.DialContext(ctx, "127.0.0.1:"+cfg.BS.GRPCPort, opts...) + if err != nil { + return nil, err + } + bService := pb.NewBridgeServiceClient(bridgeConn) + l1Ethman, err := etherman.NewL1Client( + cfg.L1NetworkURL, + common.HexToAddress(L1BridgeAddr), + common.HexToAddress("0x00"), // TODO + common.HexToAddress("0x00"), // TODO + common.HexToAddress("0x00"), // TODO + ) + if err != nil { + return nil, err + } + l2NativeToken, err := l2Ethman.GasTokenAddress() if err != nil { return nil, err } - l2Client, err := utils.NewClient(ctx, l2NetworkURL, common.HexToAddress(l2BridgeAddr)) + wETH, err := l2Ethman.WETHToken() if err != nil { return nil, err } - bService := server.NewBridgeService(cfg.BS, cfg.BT.Height, []uint{0, 1}, pgst, rollupID) - opsman.storage = st.(StorageInterface) - opsman.bridgetree = bt - opsman.bridgeService = bService - opsman.clients = make(map[NetworkSID]*utils.Client) - opsman.clients[L1] = l1Client - opsman.clients[L2] = l2Client - return opsman, err + clients := make(map[NetworkSID]*utils.Client) + clients[L1] = l1Client + clients[L2] = l2Client + return &Manager{ + cfg: cfg, + ctx: ctx, + storage: st.(StorageInterface), + bridgetree: bt, + bridgeService: bService, + Clients: clients, + l1Ethman: l1Ethman, + l2Ethman: l2Ethman, + l2NativeToken: l2NativeToken, + rollupID: uint32(rollupID), + wETH: wETH, + }, nil } -// CheckL2Claim checks if the claim is already in the L2 network. -func (m *Manager) CheckL2Claim(ctx context.Context, networkID, depositCnt uint) error { +// CheckClaim checks if the claim is already in the network +func (m *Manager) CheckClaim(ctx context.Context, deposit *pb.Deposit) error { return operations.Poll(defaultInterval, defaultDeadline, func() (bool, error) { - _, err := m.storage.GetClaim(ctx, depositCnt, networkID, nil) + // Check that claim exist on GetClaims endpoint + req := pb.GetClaimsRequest{ + DestAddr: deposit.DestAddr, + } + claims, err := m.bridgeService.GetClaims(ctx, &req) if err != nil { - if err == gerror.ErrStorageNotFound { - return false, nil + return false, err + } + idx, succ := big.NewInt(0).SetString(deposit.GlobalIndex, 10) //nolint:gomnd + if !succ { + return false, errors.New("error setting big int") + } + mainnetFlag, rollupIndex, _, err := etherman.DecodeGlobalIndex(idx) + if err != nil { + return false, err + } + claimFound := false + var claimTxHash string + for _, c := range claims.Claims { + if c.Index == deposit.DepositCnt && c.MainnetFlag == mainnetFlag && c.RollupIndex == rollupIndex { + log.Debugf("deposit claimed with th hash: %s", c.TxHash) + claimFound = true + claimTxHash = c.TxHash + break } + } + if !claimFound { + return false, nil + } + + // Check that claim tx has been added on GetBridges response + reqB := &pb.GetBridgesRequest{ + DestAddr: deposit.DestAddr, + } + bridges, err := m.bridgeService.GetBridges(ctx, reqB) + if err != nil { return false, err } - return true, nil + claimFound = false + for _, d := range bridges.Deposits { + dIdx, succ := big.NewInt(0).SetString(deposit.GlobalIndex, 10) //nolint:gomnd + if !succ { + return false, errors.New("error setting big int") + } + dMainnetFlag, dRollupIndex, _, err := etherman.DecodeGlobalIndex(dIdx) + if err != nil { + return false, err + } + if d.DepositCnt == deposit.DepositCnt && dMainnetFlag == mainnetFlag && dRollupIndex == rollupIndex { + if d.ClaimTxHash == claimTxHash { + claimFound = true + break + } else { + return false, errors.New("claim tx not linked to the deposit") + } + } + } + return claimFound, nil + // TODO: get tx from RPC to assert that this is correct }) } @@ -147,7 +243,7 @@ func (m *Manager) CheckL2Claim(ctx context.Context, networkID, depositCnt uint) func (m *Manager) SendL1Deposit(ctx context.Context, tokenAddr common.Address, amount *big.Int, destNetwork uint32, destAddr *common.Address, ) error { - client := m.clients[L1] + client := m.Clients[L1] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L1]) if err != nil { return err @@ -171,7 +267,7 @@ func (m *Manager) SendL1Deposit(ctx context.Context, tokenAddr common.Address, a func (m *Manager) SendL2Deposit(ctx context.Context, tokenAddr common.Address, amount *big.Int, destNetwork uint32, destAddr *common.Address, ) error { - client := m.clients[L2] + client := m.Clients[L2] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L2]) if err != nil { return err @@ -193,7 +289,7 @@ func (m *Manager) SendL2Deposit(ctx context.Context, tokenAddr common.Address, a // SendL1BridgeMessage bridges a message from l1 to l2. func (m *Manager) SendL1BridgeMessage(ctx context.Context, destAddr common.Address, destNetwork uint32, amount *big.Int, metadata []byte, privKey *string) error { - client := m.clients[L1] + client := m.Clients[L1] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L1]) if err != nil { return err @@ -222,7 +318,7 @@ func (m *Manager) SendL1BridgeMessage(ctx context.Context, destAddr common.Addre // SendL2BridgeMessage bridges a message from l2 to l1. func (m *Manager) SendL2BridgeMessage(ctx context.Context, destAddr common.Address, destNetwork uint32, amount *big.Int, metadata []byte) error { - client := m.clients[L2] + client := m.Clients[L2] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L2]) if err != nil { return err @@ -296,7 +392,7 @@ func (m *Manager) Setup() error { func (m *Manager) AddFunds(ctx context.Context) error { // Eth client log.Infof("Connecting to l1") - client := m.clients[L1] + client := m.Clients[L1] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L1]) if err != nil { return err @@ -394,7 +490,7 @@ func (m *Manager) startNetwork() error { return err } // Wait network to be ready - return poll(defaultInterval, defaultDeadline, networkUpCondition) + return poll(defaultInterval, defaultDeadline, m.networkUpCondition) } func stopNetwork() error { @@ -412,7 +508,7 @@ func (m *Manager) startZKEVMNode() error { return err } // Wait zkevm node to be ready - return poll(defaultInterval, defaultDeadline, zkevmNodeUpCondition) + return poll(defaultInterval, defaultDeadline, m.zkevmNodeUpCondition) } func stopZKEVMNode() error { @@ -467,10 +563,10 @@ func StopBridge() error { // CheckAccountBalance checks the balance by address func (m *Manager) CheckAccountBalance(ctx context.Context, network NetworkSID, account *common.Address) (*big.Int, error) { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { - return big.NewInt(0), nil + return nil, err } if account == nil { @@ -478,14 +574,14 @@ func (m *Manager) CheckAccountBalance(ctx context.Context, network NetworkSID, a } balance, err := client.BalanceAt(ctx, *account, nil) if err != nil { - return big.NewInt(0), nil + return nil, err } return balance, nil } // CheckAccountTokenBalance checks the balance by address func (m *Manager) CheckAccountTokenBalance(ctx context.Context, network NetworkSID, tokenAddr common.Address, account *common.Address) (*big.Int, error) { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { return big.NewInt(0), nil @@ -534,11 +630,11 @@ func (m *Manager) GetClaimData(ctx context.Context, networkID, depositCount uint // GetBridgeInfoByDestAddr gets the bridge info func (m *Manager) GetBridgeInfoByDestAddr(ctx context.Context, addr *common.Address) ([]*pb.Deposit, error) { - auth, err := m.clients[L2].GetSigner(ctx, accHexPrivateKeys[L2]) - if err != nil { - return []*pb.Deposit{}, err - } if addr == nil { + auth, err := m.Clients[L2].GetSigner(ctx, accHexPrivateKeys[L2]) + if err != nil { + return []*pb.Deposit{}, err + } addr = &auth.From } req := pb.GetBridgesRequest{ @@ -553,18 +649,23 @@ func (m *Manager) GetBridgeInfoByDestAddr(ctx context.Context, addr *common.Addr // SendL1Claim send an L1 claim func (m *Manager) SendL1Claim(ctx context.Context, deposit *pb.Deposit, smtProof, smtRollupProof [mtHeight][32]byte, globalExitRoot *etherman.GlobalExitRoot) error { - client := m.clients[L1] + client := m.Clients[L1] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L1]) if err != nil { return err } - return client.SendClaim(ctx, deposit, smtProof, smtRollupProof, globalExitRoot, auth) + err = client.SendClaim(ctx, deposit, smtProof, smtRollupProof, globalExitRoot, auth) + if err != nil { + return err + } + + return m.CheckClaim(ctx, deposit) } // SendL2Claim send an L2 claim func (m *Manager) SendL2Claim(ctx context.Context, deposit *pb.Deposit, smtProof, smtRollupProof [mtHeight][32]byte, globalExitRoot *etherman.GlobalExitRoot) error { - client := m.clients[L2] + client := m.Clients[L2] auth, err := client.GetSigner(ctx, accHexPrivateKeys[L2]) if err != nil { return err @@ -586,8 +687,8 @@ func (m *Manager) GetLatestGlobalExitRootFromL1(ctx context.Context) (*etherman. // GetCurrentGlobalExitRootFromSmc reads the globalexitroot from the smc func (m *Manager) GetCurrentGlobalExitRootFromSmc(ctx context.Context) (*etherman.GlobalExitRoot, error) { - client := m.clients[L1] - br, err := polygonzkevmbridge.NewPolygonzkevmbridge(common.HexToAddress(l1BridgeAddr), client) + client := m.Clients[L1] + br, err := polygonzkevmbridge.NewPolygonzkevmbridge(common.HexToAddress(L1BridgeAddr), client) if err != nil { return nil, err } @@ -615,7 +716,7 @@ func (m *Manager) GetCurrentGlobalExitRootFromSmc(ctx context.Context) (*etherma // DeployERC20 deploys erc20 smc func (m *Manager) DeployERC20(ctx context.Context, name, symbol string, network NetworkSID) (common.Address, *ERC20.ERC20, error) { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { return common.Address{}, nil, err @@ -626,7 +727,7 @@ func (m *Manager) DeployERC20(ctx context.Context, name, symbol string, network // DeployBridgeMessageReceiver deploys the brdige message receiver smc. func (m *Manager) DeployBridgeMessageReceiver(ctx context.Context, network NetworkSID) (common.Address, error) { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { return common.Address{}, err @@ -637,15 +738,15 @@ func (m *Manager) DeployBridgeMessageReceiver(ctx context.Context, network Netwo // MintERC20 mint erc20 tokens func (m *Manager) MintERC20(ctx context.Context, erc20Addr common.Address, amount *big.Int, network NetworkSID) error { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { return err } - var bridgeAddress = l1BridgeAddr + var bridgeAddress = L1BridgeAddr if network == L2 { - bridgeAddress = l2BridgeAddr + bridgeAddress = L2BridgeAddr } err = client.ApproveERC20(ctx, erc20Addr, common.HexToAddress(bridgeAddress), amount, auth) @@ -656,9 +757,30 @@ func (m *Manager) MintERC20(ctx context.Context, erc20Addr common.Address, amoun return client.MintERC20(ctx, erc20Addr, amount, auth) } +// MintPOL mint POL tokens +func (m *Manager) MintPOL(ctx context.Context, erc20Addr common.Address, amount *big.Int, network NetworkSID) error { + client := m.Clients[network] + auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) + if err != nil { + return err + } + + var bridgeAddress = L1BridgeAddr + if network == L2 { + bridgeAddress = L2BridgeAddr + } + + err = client.ApproveERC20(ctx, erc20Addr, common.HexToAddress(bridgeAddress), amount, auth) + if err != nil { + return err + } + + return client.MintPOL(ctx, erc20Addr, amount, auth) +} + // ApproveERC20 approves erc20 tokens func (m *Manager) ApproveERC20(ctx context.Context, erc20Addr, bridgeAddr common.Address, amount *big.Int, network NetworkSID) error { - client := m.clients[network] + client := m.Clients[network] auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) if err != nil { return err @@ -670,7 +792,11 @@ func (m *Manager) ApproveERC20(ctx context.Context, erc20Addr, bridgeAddr common func (m *Manager) GetTokenWrapped(ctx context.Context, originNetwork uint, originalTokenAddr common.Address, isCreated bool) (*etherman.TokenWrapped, error) { if isCreated { if err := operations.Poll(defaultInterval, defaultDeadline, func() (bool, error) { - wrappedToken, err := m.storage.GetTokenWrapped(ctx, originNetwork, originalTokenAddr, nil) + req := &pb.GetTokenWrappedRequest{ + OrigTokenAddr: originalTokenAddr.Hex(), + OrigNet: uint32(originNetwork), + } + wrappedToken, err := m.bridgeService.GetTokenWrapped(ctx, req) if err != nil { return false, err } @@ -710,3 +836,117 @@ func (m *Manager) WaitExitRootToBeSynced(ctx context.Context, orgExitRoot *ether return exitRoot.ExitRoots[tID] != orgExitRoot.ExitRoots[tID], nil }) } + +func (m *Manager) GetRollupID() (uint32, error) { + return m.Clients[L2].GetRollupID() +} + +func (m *Manager) GetRollupNativeToken() common.Address { + return m.l2NativeToken +} + +func (m *Manager) GetBalances( + ctx context.Context, + originNet uint32, + originAddr, l1Holder, l2Holder common.Address, +) (l1Balance, l2Balance *big.Int, err error) { + l1Balance, err = m.GetL1Balance(ctx, originNet, originAddr, l1Holder) + if err != nil { + return + } + l2Balance, err = m.GetL2Balance(ctx, originNet, originAddr, l2Holder) + return +} + +func (m *Manager) GetL1Balance( + ctx context.Context, + originNet uint32, + originAddr, holder common.Address, +) (*big.Int, error) { + zeroAddrr := common.Address{} + if originNet == 0 { + if originAddr == zeroAddrr { + return m.CheckAccountBalance(ctx, L1, &holder) + } else { + return m.CheckAccountTokenBalance(ctx, L1, originAddr, &holder) + } + } else { + tokenWrapped, err := m.l1Ethman.GetTokenWrappedAddress(originNet, originAddr) + if err == etherman.ErrTokenNotCreated { + return big.NewInt(0), nil + } else if err != nil { + return nil, err + } + return m.CheckAccountTokenBalance(ctx, L1, tokenWrapped, &holder) + } +} + +func (m *Manager) GetL2Balance( + ctx context.Context, + originNet uint32, + originAddr, holder common.Address, +) (*big.Int, error) { + zeroAddr := common.Address{} + if originNet == 0 { + if originAddr == m.l2NativeToken { + // Token was created on L1, and it's also the native token on L2 + // Ether is a special case where the addr is 0x00...0, but in this case it's also 0x00...0 on L2 + return m.CheckAccountBalance(ctx, L2, &holder) + } else if originAddr == zeroAddr { + // ETH is not the native token on L2, special wETH case + return m.CheckAccountTokenBalance(ctx, L2, m.wETH, &holder) + } + } + var rollupAddr common.Address + rollupID := m.l2Ethman.GetRollupID() + if originNet == uint32(rollupID) { + rollupAddr = originAddr + } else { + // If the token is not created on L1 or in this rollup, it's needed to calculate + // the addr of the token on the rollup + tokenWrapped, err := m.l2Ethman.GetTokenWrappedAddress(originNet, originAddr) + if err == etherman.ErrTokenNotCreated { + return big.NewInt(0), nil + } else if err != nil { + return nil, err + } + rollupAddr = tokenWrapped + } + return m.CheckAccountTokenBalance(ctx, L2, rollupAddr, &holder) +} + +func (m *Manager) GetTokenAddr(network NetworkSID, originNetwork uint32, originAddr common.Address) (common.Address, error) { + zeroAddr := common.Address{} + if network == L1 { + if originNetwork == 0 { + return originAddr, nil + } + return m.l1Ethman.GetTokenWrappedAddress(originNetwork, originAddr) + } else if network == L2 { + rollupID := m.l2Ethman.GetRollupID() + if originNetwork == 0 { + if originAddr == m.l2NativeToken { + return zeroAddr, nil + } else if originAddr == zeroAddr && m.l2NativeToken != zeroAddr { + return m.wETH, nil + } + } + if originNetwork == uint32(rollupID) { + return originAddr, nil + } + return m.l2Ethman.GetTokenWrappedAddress(originNetwork, originAddr) + } else { + return common.Address{}, errors.New("unexpected network") + } +} + +// ERC20Transfer send tokens +func (m *Manager) ERC20Transfer(ctx context.Context, erc20Addr, to common.Address, amount *big.Int, network NetworkSID) error { + client := m.Clients[network] + auth, err := client.GetSigner(ctx, accHexPrivateKeys[network]) + if err != nil { + return err + } + + return client.ERC20Transfer(ctx, erc20Addr, to, amount, auth) +} diff --git a/test/operations/mockserver.go b/test/operations/mockserver.go index 192300ba..6ffe1b0a 100644 --- a/test/operations/mockserver.go +++ b/test/operations/mockserver.go @@ -44,6 +44,6 @@ func RunMockServer(dbType string, height uint8, networks []uint) (*bridgectrl.Br MaxPageLimit: 100, //nolint:gomnd BridgeVersion: "v1", } - bridgeService := server.NewBridgeService(cfg, btCfg.Height, networks, store, rollupID) + bridgeService := server.NewBridgeService(cfg, btCfg.Height, networks, store, 1) return bt, store, server.RunServer(cfg, bridgeService) } diff --git a/test/operations/wait.go b/test/operations/wait.go index eaf02187..e5c4d5e3 100644 --- a/test/operations/wait.go +++ b/test/operations/wait.go @@ -40,8 +40,8 @@ func WaitGRPCHealthy(address string) error { return ops.WaitGRPCHealthy(address) } -func networkUpCondition() (bool, error) { - return ops.NodeUpCondition(l1NetworkURL) +func (m *Manager) networkUpCondition() (bool, error) { + return ops.NodeUpCondition(m.cfg.L1NetworkURL) } func proverUpCondition() (bool, error) { @@ -49,8 +49,8 @@ func proverUpCondition() (bool, error) { // return ops.ProverUpCondition() } -func zkevmNodeUpCondition() (done bool, err error) { - return ops.NodeUpCondition(l2NetworkURL) +func (m *Manager) zkevmNodeUpCondition() (done bool, err error) { + return ops.NodeUpCondition(m.cfg.L2NetworkURL) } func bridgeUpCondition() (done bool, err error) { diff --git a/test/scripts/initialClaim/main.go b/test/scripts/initialClaim/main.go index 0321b8a5..879f56d4 100644 --- a/test/scripts/initialClaim/main.go +++ b/test/scripts/initialClaim/main.go @@ -91,18 +91,18 @@ func main() { log.Fatal("error converting metadata to bytes. Error: ", err) } e := etherman.Deposit{ - LeafType: uint8(bridgeData.LeafType), - OriginalNetwork: uint(bridgeData.OrigNet), - OriginalAddress: common.HexToAddress(bridgeData.OrigAddr), - Amount: a, - DestinationNetwork: uint(bridgeData.DestNet), - DestinationAddress: common.HexToAddress(bridgeData.DestAddr), - DepositCount: uint(bridgeData.DepositCnt), - BlockNumber: bridgeData.BlockNum, - NetworkID: uint(bridgeData.NetworkId), - TxHash: common.HexToHash(bridgeData.TxHash), - Metadata: metadata, - ReadyForClaim: bridgeData.ReadyForClaim, + LeafType: uint8(bridgeData.LeafType), + OriginalTokenNetwork: uint(bridgeData.OrigNet), + OriginalTokenAddress: common.HexToAddress(bridgeData.OrigAddr), + Amount: a, + DestinationNetwork: uint(bridgeData.DestNet), + DestinationAddress: common.HexToAddress(bridgeData.DestAddr), + DepositCount: uint(bridgeData.DepositCnt), + BlockNumber: bridgeData.BlockNum, + OriginNetwork: uint(bridgeData.NetworkId), + TxHash: common.HexToHash(bridgeData.TxHash), + Metadata: metadata, + ReadyForClaim: bridgeData.ReadyForClaim, } // Connect to ethereum node ethClient, err := ethclient.Dial(l1NetworkURL) diff --git a/utils/client.go b/utils/client.go index a319b738..0141a12f 100644 --- a/utils/client.go +++ b/utils/client.go @@ -14,6 +14,7 @@ import ( "github.com/0xPolygonHermez/zkevm-bridge-service/etherman" "github.com/0xPolygonHermez/zkevm-bridge-service/log" "github.com/0xPolygonHermez/zkevm-bridge-service/test/mocksmartcontracts/BridgeMessageReceiver" + "github.com/0xPolygonHermez/zkevm-bridge-service/test/mocksmartcontracts/erc20permitmock" zkevmtypes "github.com/0xPolygonHermez/zkevm-node/config/types" "github.com/0xPolygonHermez/zkevm-node/encoding" "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonzkevmbridge" @@ -155,6 +156,34 @@ func (c *Client) MintERC20(ctx context.Context, erc20Addr common.Address, amount return WaitTxToBeMined(ctx, c.Client, tx, txMinedTimeoutLimit) } +// ERC20Transfer send tokens. +func (c *Client) ERC20Transfer(ctx context.Context, erc20Addr, to common.Address, amount *big.Int, auth *bind.TransactOpts) error { + erc20sc, err := ERC20.NewERC20(erc20Addr, c.Client) + if err != nil { + return err + } + tx, err := erc20sc.Transfer(auth, to, amount) + if err != nil { + return err + } + const txMinedTimeoutLimit = 60 * time.Second + return WaitTxToBeMined(ctx, c.Client, tx, txMinedTimeoutLimit) +} + +// MintPOL mint POL tokens. +func (c *Client) MintPOL(ctx context.Context, polAddr common.Address, amount *big.Int, auth *bind.TransactOpts) error { + pol, err := erc20permitmock.NewErc20permitmock(polAddr, c.Client) + if err != nil { + return err + } + tx, err := pol.Mint(auth, auth.From, amount) + if err != nil { + return err + } + const txMinedTimeoutLimit = 60 * time.Second + return WaitTxToBeMined(ctx, c.Client, tx, txMinedTimeoutLimit) +} + // SendBridgeAsset sends a bridge asset transaction. func (c *Client) SendBridgeAsset(ctx context.Context, tokenAddr common.Address, amount *big.Int, destNetwork uint32, destAddr *common.Address, metadata []byte, auth *bind.TransactOpts, @@ -203,14 +232,14 @@ func (c *Client) BuildSendClaim(ctx context.Context, deposit *etherman.Deposit, tx *types.Transaction err error ) - mainnetFlag := deposit.NetworkID == 0 + mainnetFlag := deposit.OriginNetwork == 0 rollupIndex := rollupID - 1 localExitRootIndex := deposit.DepositCount globalIndex := etherman.GenerateGlobalIndex(mainnetFlag, rollupIndex, localExitRootIndex) if deposit.LeafType == uint8(LeafTypeAsset) { - tx, err = c.bridge.ClaimAsset(&opts, smtProof, smtRollupProof, globalIndex, globalExitRoot.ExitRoots[0], globalExitRoot.ExitRoots[1], uint32(deposit.OriginalNetwork), deposit.OriginalAddress, uint32(deposit.DestinationNetwork), deposit.DestinationAddress, deposit.Amount, deposit.Metadata) + tx, err = c.bridge.ClaimAsset(&opts, smtProof, smtRollupProof, globalIndex, globalExitRoot.ExitRoots[0], globalExitRoot.ExitRoots[1], uint32(deposit.OriginalTokenNetwork), deposit.OriginalTokenAddress, uint32(deposit.DestinationNetwork), deposit.DestinationAddress, deposit.Amount, deposit.Metadata) } else if deposit.LeafType == uint8(LeafTypeMessage) { - tx, err = c.bridge.ClaimMessage(&opts, smtProof, smtRollupProof, globalIndex, globalExitRoot.ExitRoots[0], globalExitRoot.ExitRoots[1], uint32(deposit.OriginalNetwork), deposit.OriginalAddress, uint32(deposit.DestinationNetwork), deposit.DestinationAddress, deposit.Amount, deposit.Metadata) + tx, err = c.bridge.ClaimMessage(&opts, smtProof, smtRollupProof, globalIndex, globalExitRoot.ExitRoots[0], globalExitRoot.ExitRoots[1], uint32(deposit.OriginalTokenNetwork), deposit.OriginalTokenAddress, uint32(deposit.DestinationNetwork), deposit.DestinationAddress, deposit.Amount, deposit.Metadata) } if err != nil { txHash := "" @@ -249,9 +278,15 @@ func (c *Client) SendClaim(ctx context.Context, deposit *pb.Deposit, smtProof [m // wait transfer to be mined const txTimeout = 60 * time.Second return WaitTxToBeMined(ctx, c.Client, tx, txTimeout) + + // TODO: assert that bridge service adds the claim as expected to the DB } // WaitTxToBeMined waits until a tx is mined or forged. func WaitTxToBeMined(ctx context.Context, client *ethclient.Client, tx *types.Transaction, timeout time.Duration) error { return ops.WaitTxToBeMined(ctx, client, tx, timeout) } + +func (c *Client) GetRollupID() (uint32, error) { + return c.bridge.NetworkID(nil) +}