diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml deleted file mode 100644 index f7713932e..000000000 --- a/.github/workflows/oracle.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Oracle - -on: - push: - branches: - - main - paths: - - "oracle/**" - - ".github/workflows/oracle.yaml" - pull_request: - paths: - - "build/**" - - "bindings/**" - - "node/**" - - "oracle/**" - - ".github/workflows/oracle.yaml" - -defaults: - run: - working-directory: "oracle" - -jobs: - check: - if: github.event.pull_request.draft == false - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.22.x - - name: Lint - run: | - rm -rf $HOME/.cache/golangci-lint - make lint - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: 1.22.x - - name: Run build - run: make build - - name: Run tests - run: make test diff --git a/.gitmodules b/.gitmodules index 3b72cbd03..9c1d87aeb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "go-ethereum"] path = go-ethereum url = https://github.com/morph-l2/go-ethereum.git -branch = main +branch = features/coinbase diff --git a/Makefile b/Makefile index d695d2cfd..885b3df6d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################## update dependencies #################### -ETHEREUM_TARGET_VERSION := v1.10.14-0.20250218031646-de5160c106de +ETHEREUM_TARGET_VERSION := v1.10.14-0.20250507031230-2fbc3c0550c3 TENDERMINT_TARGET_VERSION := v0.3.2-0.20250115141431-c84dfe5c8533 ETHEREUM_MODULE_NAME := github.com/morph-l2/go-ethereum @@ -28,7 +28,6 @@ update_all_mod: @$(MAKE) update_mod MODULE=node @$(MAKE) update_mod MODULE=ops/l2-genesis @$(MAKE) update_mod MODULE=ops/tools - @$(MAKE) update_mod MODULE=oracle @$(MAKE) update_mod MODULE=tx-submitter @@ -63,7 +62,6 @@ lint-go: make -C node lint make -C ops/l2-genesis lint make -C ops/tools lint - make -C oracle lint make -C tx-submitter lint .PHONY: lint-go @@ -86,7 +84,6 @@ fmt-go: cd $(PWD)/node/ && go mod tidy cd $(PWD)/ops/l2-genesis/ && go mod tidy cd $(PWD)/ops/tools/ && go mod tidy - cd $(PWD)/oracle/ && go mod tidy cd $(PWD)/tx-submitter/ && go mod tidy find . -name '*.go' -type f -not -path "./go-ethereum*" -not -name '*.pb.go' | xargs gofmt -w -s find . -name '*.go' -type f -not -path "./go-ethereum*" -not -name '*.pb.go' | xargs misspell -w @@ -128,7 +125,7 @@ go-ubuntu-builder: ################## devnet 4 nodes #################### -devnet-up: submodules go-ubuntu-builder +devnet-up: go-ubuntu-builder python3 ops/devnet-morph/main.py --polyrepo-dir=. .PHONY: devnet-up diff --git a/MakefileEks.mk b/MakefileEks.mk index 0b935d10a..45693662d 100644 --- a/MakefileEks.mk +++ b/MakefileEks.mk @@ -70,29 +70,6 @@ build-bk-prod-morph-prod-mainnet-to-morph-shadow-proving: start-bk-prod-morph-prod-mainnet-to-morph-shadow-proving: /data/secret-manager-wrapper ./shadow-proving -# staking-oracle -# mainnet -build-bk-prod-morph-prod-mainnet-to-morph-staking-oracle: - if [ ! -d dist ]; then mkdir -p dist; fi - env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o oracle/staking-oracle ./oracle/cmd/staking-oracle - cp oracle/staking-oracle dist/ - aws s3 cp s3://morph-0582-morph-technical-department-mainnet-data/morph-setup/secret-manager-wrapper.tar.gz ./ - tar -xvzf secret-manager-wrapper.tar.gz - -start-bk-prod-morph-prod-mainnet-to-morph-staking-oracle: - /data/secret-manager-wrapper ./staking-oracle - -# qanet -build-bk-test-morph-test-qanet-to-morph-staking-oracle-qanet: - if [ ! -d dist ]; then mkdir -p dist; fi - env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o oracle/staking-oracle ./oracle/cmd/staking-oracle - cp oracle/staking-oracle dist/ - aws s3 cp s3://morph-7637-morph-technical-department-qanet-data/morph-setup/secret-manager-wrapper.tar.gz ./ - tar -xvzf secret-manager-wrapper.tar.gz - -start-bk-test-morph-test-qanet-to-morph-staking-oracle-qanet: - /data/secret-manager-wrapper ./staking-oracle - # gas-oracle # testnet @@ -143,16 +120,4 @@ build-bk-prod-morph-prod-testnet-to-morph-shadow-proving-holesky: tar -xvzf secret-manager-wrapper.tar.gz start-bk-prod-morph-prod-testnet-to-morph-shadow-proving-holesky: - /data/secret-manager-wrapper ./shadow-proving - -# staking-oracle -# testnet -build-bk-prod-morph-prod-testnet-to-morph-staking-oracle-holesky: - if [ ! -d dist ]; then mkdir -p dist; fi - env GO111MODULE=on CGO_LDFLAGS="-ldl" CGO_ENABLED=1 go build -v $(LDFLAGS) -o oracle/staking-oracle ./oracle/cmd/staking-oracle - cp oracle/staking-oracle dist/ - aws s3 cp s3://morph-0582-morph-technical-department-testnet-data/testnet/holesky/morph-setup/secret-manager-wrapper.tar.gz ./ - tar -xvzf secret-manager-wrapper.tar.gz - -start-bk-prod-morph-prod-testnet-to-morph-staking-oracle-holesky: - /data/secret-manager-wrapper ./staking-oracle \ No newline at end of file + /data/secret-manager-wrapper ./shadow-proving \ No newline at end of file diff --git a/bindings/Makefile b/bindings/Makefile index 80655a0c0..792d23ed7 100644 --- a/bindings/Makefile +++ b/bindings/Makefile @@ -29,8 +29,6 @@ bindings: \ l2-gov-bindings \ l2-sequencer-bindings \ l2-staking-bindings \ - l2-distribute-bindings \ - l2-record-bindings \ l2-eth-gateway-bindings \ l2-standard-erc20-gateway-bindings \ l2-gateway-router-bindings \ @@ -126,10 +124,6 @@ l2-sequencer-bindings: compile ./gen_bindings.sh contracts/l2/staking/Sequencer.sol:Sequencer $(pkg) l2-staking-bindings: compile ./gen_bindings.sh contracts/l2/staking/L2Staking.sol:L2Staking $(pkg) -l2-distribute-bindings: compile - ./gen_bindings.sh contracts/l2/staking/Distribute.sol:Distribute $(pkg) -l2-record-bindings: compile - ./gen_bindings.sh contracts/l2/staking/Record.sol:Record $(pkg) # Gateways l2-eth-gateway-bindings: compile @@ -191,7 +185,7 @@ more: compile-forge go run ./gen/main.go \ -artifacts ../contracts/artifacts \ -out ./bindings \ - -contracts ProxyAdmin,TransparentUpgradeableProxy,L1MessageQueueWithGasPriceOracle,L1USDCGateway,L1Staking,L1CrossDomainMessenger,L1StandardERC20Gateway,L1ETHGateway,L1ERC20Gateway,L1GatewayRouter,L1WETHGateway,L1LidoGateway,Rollup,MultipleVersionRollupVerifier,L2CrossDomainMessenger,GasPriceOracle,L2ToL1MessagePasser,L2TxFeeVault,Sequencer,Gov,Distribute,L2Staking,Record,L2ETHGateway,L2StandardERC20Gateway,L2GatewayRouter,L2WETHGateway,L2ERC20Gateway,L2ERC721Gateway,L2ERC1155Gateway,L2LidoGateway,MorphToken,MorphStandardERC20,MorphStandardERC20Factory,WrappedEther,L2USDCGateway,EnforcedTxGateway,L1ERC721Gateway,L1ERC1155Gateway,L1ReverseCustomGateway,L2WithdrawLockERC20Gateway,L2ReverseCustomGateway,Whitelist,ZkEvmVerifierV1,L2WstETHToken \ + -contracts ProxyAdmin,TransparentUpgradeableProxy,L1MessageQueueWithGasPriceOracle,L1USDCGateway,L1Staking,L1CrossDomainMessenger,L1StandardERC20Gateway,L1ETHGateway,L1ERC20Gateway,L1GatewayRouter,L1WETHGateway,L1LidoGateway,Rollup,MultipleVersionRollupVerifier,L2CrossDomainMessenger,GasPriceOracle,L2ToL1MessagePasser,L2TxFeeVault,Sequencer,Gov,L2Staking,L2ETHGateway,L2StandardERC20Gateway,L2GatewayRouter,L2WETHGateway,L2ERC20Gateway,L2ERC721Gateway,L2ERC1155Gateway,L2LidoGateway,MorphToken,MorphStandardERC20,MorphStandardERC20Factory,WrappedEther,L2USDCGateway,EnforcedTxGateway,L1ERC721Gateway,L1ERC1155Gateway,L1ReverseCustomGateway,L2WithdrawLockERC20Gateway,L2ReverseCustomGateway,Whitelist,ZkEvmVerifierV1,L2WstETHToken \ -package bindings mkdir: diff --git a/bindings/bin/distribute_deployed.hex b/bindings/bin/distribute_deployed.hex deleted file mode 100644 index f8c4dfac1..000000000 --- a/bindings/bin/distribute_deployed.hex +++ /dev/null @@ -1 +0,0 @@ -0x608060405234801561000f575f80fd5b5060043610610163575f3560e01c8063a766c529116100c7578063cd4281d01161007d578063d557714111610063578063d55771411461033e578063de6ac93314610365578063f2fde38b14610388575f80fd5b8063cd4281d014610304578063cdd0c50e1461032b575f80fd5b8063b809af0f116100ad578063b809af0f146102b6578063bf2dca0a146102c9578063c4d66de8146102f1575f80fd5b8063a766c5291461027b578063ac2ac640146102a3575f80fd5b8063807de4431161011c578063921ae9b811610102578063921ae9b8146102245780639889be5114610247578063996cba6814610268575f80fd5b8063807de443146101d45780638da5cb5b14610213575f80fd5b80635cf20c7b1161014c5780635cf20c7b146101a6578063715018a6146101b95780637f683ee3146101c1575f80fd5b8063273d8e82146101675780634eedab3214610191575b5f80fd5b61017a610175366004612537565b61039b565b6040516101889291906125c2565b60405180910390f35b6101a461019f3660046125ef565b610729565b005b6101a46101b43660046125ef565b6107c7565b6101a46109c3565b6101a46101cf366004612617565b6109d6565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610188565b6033546001600160a01b03166101fb565b610237610232366004612537565b610c1c565b6040516101889493929190612656565b61025a6102553660046126d5565b610f59565b604051908152602001610188565b6101a4610276366004612706565b611230565b61025a610289366004612537565b6001600160a01b03165f9081526067602052604090205490565b6101a46102b1366004612537565b611355565b6101a46102c436600461274c565b61149e565b61025a6102d7366004612537565b6001600160a01b03165f9081526068602052604090205490565b6101a46102ff366004612537565b6115dc565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6101a46103393660046127f3565b6117a6565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6103786103733660046126d5565b611b06565b6040519015158152602001610188565b6101a4610396366004612537565b611b31565b6001600160a01b0381165f90815260696020526040812060609182916103c090611bc1565b9050805f0361043c5760405162461bcd60e51b815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f672072657761726400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8067ffffffffffffffff8111156104555761045561288f565b60405190808252806020026020018201604052801561047e578160200160208202803683370190505b5092508067ffffffffffffffff81111561049a5761049a61288f565b6040519080825280602002602001820160405280156104c3578160200160208202803683370190505b5091505f5b6001600160a01b0385165f9081526069602052604090206104e890611bc1565b811015610722576001600160a01b0385165f9081526069602052604081206105109083611bca565b6001600160a01b038088165f908152606960209081526040808320938516835260039093019052908120549192509081908190805b6065548110156106bf576001600160a01b038087165f9081526066602090815260408083208584528252808320938f168352600490930190522054156105b9576001600160a01b038087165f9081526066602090815260408083208584528252808320938f16835260049093019052205492505b6001600160a01b0386165f9081526066602090815260408083208484529091529020600101541561060d576001600160a01b0386165f90815260666020908152604080832084845290915290206001015493505b6001600160a01b0386165f908152606660209081526040808320848452909152902054849061063d9085906128e9565b6106479190612900565b6106519086612938565b6001600160a01b03808d165f908152606960209081526040808320938b16835260029093019052205490955060ff1680156106b357506001600160a01b03808c165f908152606960209081526040808320938a16835260049093019052205481145b6106bf57600101610545565b50848987815181106106d3576106d361294b565b60200260200101906001600160a01b031690816001600160a01b031681525050838887815181106107065761070661294b565b60209081029190910101525050600190930192506104c8915050565b5050915091565b610731611bdc565b6001600160a01b0382165f908152606760205260409020545b8181116107a8576001600160a01b0383165f908152606660209081526040808320848452909152812081815560018101829055906002820181818161078f82826124ee565b50505050505080806107a090612978565b91505061074a565b6001600160a01b039092165f9081526067602052604090209190915550565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461083f5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6065545f036108905760405162461bcd60e51b815260206004820152600e60248201527f6e6f74206d696e746564207965740000000000000000000000000000000000006044820152606401610433565b5f8115806108ab575060016065546108a891906129af565b82115b6108b557816108c4565b60016065546108c491906129af565b90505f805b6001600160a01b0385165f9081526069602052604090206108e990611bc1565b8110156109ac576001600160a01b0385165f90815260696020526040812081906109139084611bca565b6001600160a01b0388165f9081526069602052604090209091506109379082611c36565b801561096b57506001600160a01b038088165f90815260696020908152604080832093851683526003909301905220548510155b15610992575f8061097d838a89611c57565b909250905061098c8287612938565b95509250505b816109a557826109a181612978565b9350505b50506108c9565b5080156109bd576109bd84826120b2565b50505050565b6109cb611bdc565b6109d45f612308565b565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610a4e5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0384165f9081526066602090815260408083208584529091529020600101819055811580610aaa57506001600160a01b038084165f908152606960209081526040808320938816835260039093019052205482145b15610b8f576001600160a01b0384165f9081526066602090815260408083208584529091529020610ade9060020184612371565b506001600160a01b038085165f90815260666020908152604080832086845282528083209387168352600490930181528282208290556069905220610b239085612371565b506001600160a01b038381165f908152606960209081526040808320938816835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560038401825280832083905560049093019052908120556109bd565b6001600160a01b038084165f9081526069602090815260408083209388168352600290930190522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155610bed90836129af565b6001600160a01b038085165f908152606960209081526040808320938916835260049093019052205550505050565b6001600160a01b0381165f908152606960205260408120606091829182918291610c4590611bc1565b90505f8167ffffffffffffffff811115610c6157610c6161288f565b604051908082528060200260200182016040528015610c8a578160200160208202803683370190505b5090505f8267ffffffffffffffff811115610ca757610ca761288f565b604051908082528060200260200182016040528015610cd0578160200160208202803683370190505b5090505f8367ffffffffffffffff811115610ced57610ced61288f565b604051908082528060200260200182016040528015610d16578160200160208202803683370190505b5090505f8467ffffffffffffffff811115610d3357610d3361288f565b604051908082528060200260200182016040528015610d5c578160200160208202803683370190505b5090505f5b85811015610f48576001600160a01b038b165f908152606960205260409020610d8a9082611bca565b858281518110610d9c57610d9c61294b565b60200260200101906001600160a01b031690816001600160a01b03168152505060695f8c6001600160a01b03166001600160a01b031681526020019081526020015f206002015f868381518110610df557610df561294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f9054906101000a900460ff16848281518110610e3b57610e3b61294b565b9115156020928302919091018201526001600160a01b038c165f908152606990915260408120865160039091019190879084908110610e7c57610e7c61294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054838281518110610eb657610eb661294b565b60200260200101818152505060695f8c6001600160a01b03166001600160a01b031681526020019081526020015f206004015f868381518110610efb57610efb61294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054828281518110610f3557610f3561294b565b6020908102919091010152600101610d61565b509299919850965090945092505050565b6001600160a01b0381165f908152606960205260408120610f7990611bc1565b5f03610fed5760405162461bcd60e51b815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f67207265776172640000000000000000000000000000000000000000000000006064820152608401610433565b6001600160a01b0382165f90815260696020526040902061100e9084611c36565b61107f5760405162461bcd60e51b8152602060048201526024808201527f6e6f2072656d61696e696e6720726577617264206f66207468652064656c656760448201527f61746565000000000000000000000000000000000000000000000000000000006064820152608401610433565b6001600160a01b038083165f9081526069602090815260408083209387168352600390930190529081205481905b606554811015611227576001600160a01b038087165f9081526066602090815260408083208584528252808320938916835260049093019052205415611121576001600160a01b038087165f9081526066602090815260408083208584528252808320938916835260049093019052205491505b6001600160a01b0386165f90815260666020908152604080832084845290915290206001015415611175576001600160a01b0386165f90815260666020908152604080832084845290915290206001015492505b6001600160a01b0386165f90815260666020908152604080832084845290915290205483906111a59084906128e9565b6111af9190612900565b6111b99085612938565b6001600160a01b038087165f908152606960209081526040808320938b16835260029093019052205490945060ff16801561121b57506001600160a01b038086165f908152606960209081526040808320938a16835260049093019052205481145b611227576001016110ad565b50505092915050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146112a85760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6065545f036112f95760405162461bcd60e51b815260206004820152600e60248201527f6e6f74206d696e746564207965740000000000000000000000000000000000006044820152606401610433565b5f8115806113145750600160655461131191906129af565b82115b61131e578161132d565b600160655461132d91906129af565b90505f61133b858584611c57565b509050801561134e5761134e84826120b2565b5050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146113cd5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0381165f908152606860205260409020546114315760405162461bcd60e51b815260206004820152601660248201527f6e6f20636f6d6d697373696f6e20746f20636c61696d000000000000000000006044820152606401610433565b6001600160a01b0381165f908152606860205260408120805491905561145782826120b2565b816001600160a01b03167f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e4118260405161149291815260200190565b60405180910390a25050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146115165760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0386165f90815260666020908152604080832087845290915290206001810183905561154c9060020186612385565b506001600160a01b038087165f90815260666020908152604080832088845282528083209389168352600490930190522083905580156115d4576001600160a01b0385165f9081526069602052604090206115a79087612385565b506001600160a01b038086165f908152606960209081526040808320938a16835260039093019052208490555b505050505050565b5f54610100900460ff16158080156115fa57505f54600160ff909116105b806116135750303b15801561161357505f5460ff166001145b6116855760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610433565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156116e1575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0382166117375760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e6572206164647265737300000000000000000000006044820152606401610433565b61174082612308565b80156117a2575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461181e5760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f776564000000006044820152606401610433565b60658054905f61182d83612978565b919050555086600160655461184291906129af565b1461188f5760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642065706f636820696e646578000000000000000000000000006044820152606401610433565b828514801561189d57508085145b6118e95760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642064617461206c656e677468000000000000000000000000006044820152606401610433565b5f5b85811015611afc578484828181106119055761190561294b565b9050602002013560665f8989858181106119215761192161294b565b90506020020160208101906119369190612537565b6001600160a01b0316815260208082019290925260409081015f9081208c82529092528120919091556066908888848181106119745761197461294b565b90506020020160208101906119899190612537565b6001600160a01b0316815260208082019290925260409081015f9081208b82529092529020600101541580156119be57505f88115b15611a7f5760665f8888848181106119d8576119d861294b565b90506020020160208101906119ed9190612537565b6001600160a01b03166001600160a01b031681526020019081526020015f205f60018a611a1a91906129af565b81526020019081526020015f206001015460665f898985818110611a4057611a4061294b565b9050602002016020810190611a559190612537565b6001600160a01b0316815260208082019290925260409081015f9081208c82529092529020600101555b828282818110611a9157611a9161294b565b9050602002013560685f898985818110611aad57611aad61294b565b9050602002016020810190611ac29190612537565b6001600160a01b03166001600160a01b031681526020019081526020015f205f828254611aef9190612938565b90915550506001016118eb565b5050505050505050565b6001600160a01b0382165f908152606960205260408120611b279083611c36565b1590505b92915050565b611b39611bdc565b6001600160a01b038116611bb55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610433565b611bbe81612308565b50565b5f611b2b825490565b5f611bd58383612399565b9392505050565b6033546001600160a01b031633146109d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610433565b6001600160a01b0381165f9081526001830160205260408120541515611bd5565b6001600160a01b0382165f9081526069602052604081208190611c7a9086611c36565b611cc65760405162461bcd60e51b815260206004820152601360248201527f6e6f2072656d61696e696e6720726577617264000000000000000000000000006044820152606401610433565b6001600160a01b038085165f9081526069602090815260408083209389168352600390930190522054831015611d3e5760405162461bcd60e51b815260206004820152601260248201527f616c6c2072657761726420636c61696d656400000000000000000000000000006044820152606401610433565b6001600160a01b038085165f9081526069602090815260408083209389168352600390930190529081205481905b858111611f7f576001600160a01b038089165f9081526066602090815260408083208584528252808320938b16835260049093019052205415611ddd576001600160a01b038089165f9081526066602090815260408083208584528252808320938b16835260049093019052205491505b6001600160a01b0388165f90815260666020908152604080832084845290915290206001015415611e31576001600160a01b0388165f90815260666020908152604080832084845290915290206001015492505b6001600160a01b0388165f9081526066602090815260408083208484529091529020548390611e619084906128e9565b611e6b9190612900565b611e759086612938565b6001600160a01b038089165f908152606960209081526040808320938d16835260029093019052205490955060ff168015611ed757506001600160a01b038088165f908152606960209081526040808320938c16835260049093019052205481145b15611f6d576001600160a01b0387165f90815260696020526040902060019450611f019089612371565b506001600160a01b038781165f908152606960209081526040808320938c16835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556003840182528083208390556004909301905290812055611f7f565b80611f7781612978565b915050611d6c565b50611f8b856001612938565b6001600160a01b038088165f908152606960209081526040808320938c16835260039093018152828220939093556066909252812090611fcc876001612938565b81526020019081526020015f206004015f876001600160a01b03166001600160a01b031681526020019081526020015f20545f03612052576001600160a01b0387165f9081526066602052604081208291612028886001612938565b815260208082019290925260409081015f9081206001600160a01b038b1682526004019092529020555b866001600160a01b0316866001600160a01b03167f7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb40487876040516120a0929190918252602082015260400190565b60405180910390a35050935093915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561212f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215391906129c2565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af11580156121dd573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061220191906129d9565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561227f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122a391906129c2565b90505f831180156122bc5750826122ba82846129af565b145b6109bd5760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610433565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611bd5836001600160a01b0384166123bf565b5f611bd5836001600160a01b0384166124a2565b5f825f0182815481106123ae576123ae61294b565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015612499575f6123e16001836129af565b85549091505f906123f4906001906129af565b9050818114612453575f865f0182815481106124125761241261294b565b905f5260205f200154905080875f0184815481106124325761243261294b565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080612464576124646129f4565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050611b2b565b5f915050611b2b565b5f8181526001830160205260408120546124e757508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155611b2b565b505f611b2b565b5080545f8255905f5260205f2090810190611bbe91905b80821115612518575f8155600101612505565b5090565b80356001600160a01b0381168114612532575f80fd5b919050565b5f60208284031215612547575f80fd5b611bd58261251c565b5f815180845260208085019450602084015f5b838110156125885781516001600160a01b031687529582019590820190600101612563565b509495945050505050565b5f815180845260208085019450602084015f5b83811015612588578151875295820195908201906001016125a6565b604081525f6125d46040830185612550565b82810360208401526125e68185612593565b95945050505050565b5f8060408385031215612600575f80fd5b6126098361251c565b946020939093013593505050565b5f805f806080858703121561262a575f80fd5b6126338561251c565b93506126416020860161251c565b93969395505050506040820135916060013590565b608081525f6126686080830187612550565b8281036020848101919091528651808352878201928201905f5b818110156126a0578451151583529383019391830191600101612682565b505084810360408601526126b48188612593565b9250505082810360608401526126ca8185612593565b979650505050505050565b5f80604083850312156126e6575f80fd5b6126ef8361251c565b91506126fd6020840161251c565b90509250929050565b5f805f60608486031215612718575f80fd5b6127218461251c565b925061272f6020850161251c565b9150604084013590509250925092565b8015158114611bbe575f80fd5b5f805f805f8060c08789031215612761575f80fd5b61276a8761251c565b95506127786020880161251c565b945060408701359350606087013592506080870135915060a087013561279d8161273f565b809150509295509295509295565b5f8083601f8401126127bb575f80fd5b50813567ffffffffffffffff8111156127d2575f80fd5b6020830191508360208260051b85010111156127ec575f80fd5b9250929050565b5f805f805f805f6080888a031215612809575f80fd5b87359650602088013567ffffffffffffffff80821115612827575f80fd5b6128338b838c016127ab565b909850965060408a013591508082111561284b575f80fd5b6128578b838c016127ab565b909650945060608a013591508082111561286f575f80fd5b5061287c8a828b016127ab565b989b979a50959850939692959293505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417611b2b57611b2b6128bc565b5f82612933577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b80820180821115611b2b57611b2b6128bc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036129a8576129a86128bc565b5060010190565b81810381811115611b2b57611b2b6128bc565b5f602082840312156129d2575f80fd5b5051919050565b5f602082840312156129e9575f80fd5b8151611bd58161273f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea164736f6c6343000818000a diff --git a/bindings/bin/gov_deployed.hex b/bindings/bin/gov_deployed.hex index bd4d5d5dd..b9c469b2a 100644 --- a/bindings/bin/gov_deployed.hex +++ b/bindings/bin/gov_deployed.hex @@ -1 +1 @@ -0x608060405234801561000f575f80fd5b5060043610610184575f3560e01c8063807de443116100dd578063b511328d11610088578063e5aec99511610063578063e5aec995146103b0578063f2fde38b146103b9578063f92ad219146103cc575f80fd5b8063b511328d14610356578063d5cc89ba14610394578063d7693075146103a7575f80fd5b80638e21d5fb116100b85780638e21d5fb146102dd57806396dea93614610304578063a83d07371461034d575f80fd5b8063807de4431461026a57806385963052146102b65780638da5cb5b146102bf575f80fd5b806349c1a5811161013d578063715018a611610118578063715018a61461022757806374c260cf1461022f57806377c7938014610261575f80fd5b806349c1a581146101e85780635bcfadb51461020b578063639661901461021e575f80fd5b8063132002fc1161016d578063132002fc146101b0578063237a4b96146101cc5780634428c1a4146101df575f80fd5b80630121b93f146101885780630d61b5191461019d575b5f80fd5b61019b610196366004611764565b6103df565b005b61019b6101ab366004611764565b610727565b6101b9606b5481565b6040519081526020015b60405180910390f35b6101b96101da36600461177b565b6107db565b6101b9606a5481565b6101fb6101f63660046117b2565b610acb565b60405190151581526020016101c3565b61019b610219366004611764565b610aeb565b6101b9606c5481565b61019b610bba565b61024261023d366004611764565b610bcd565b60408051931515845291151560208401521515908201526060016101c3565b6101b960675481565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c3565b6101b960655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610291565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b610332610312366004611764565b606e6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101c3565b6101b960715481565b61037f610364366004611764565b606f6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101c3565b61019b6103a2366004611764565b610d25565b6101b9606d5481565b6101b960695481565b61019b6103c73660046117e0565b610e38565b61019b6103da366004611802565b610ed5565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610484573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104a89190611842565b9050806104fc5760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b606c5482111561054e5760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b607154821161059f5760405162461bcd60e51b815260206004820152601260248201527f657870697265642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b606d548210156105f15760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104f3565b5f828152606f60205260409020805460019091015460ff1680610612575080155b8061061c57504281105b156106695760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104f3565b610680335f858152607060205260409020906112a3565b156106f35760405162461bcd60e51b815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c000000000000000000000000000000000000000000000060648201526084016104f3565b61070a335f858152607060205260409020906112d1565b50610714836112f2565b156107225761072283611429565b505050565b5f8061073283610bcd565b509150915081156107855760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104f3565b806107d25760405162461bcd60e51b815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e207061737365642079657460448201526064016104f3565b61072283611429565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610881573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108a59190611842565b9050806108f45760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064016104f3565b82604001355f036109475760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f636800000000000000000000000060448201526064016104f3565b82351515806109595750602083013515155b6109a55760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104f3565b606c8054905f6109b48361188e565b9091555050606c545f908152606e6020526040902083906109ec82828135815560208201356001820155604082013560028201555050565b9050506040518060400160405280606b5442610a0891906118c5565b81525f6020918201819052606c548152606f82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905533606c54604080518635815260208088013590820152818701359181019190915273ffffffffffffffffffffffffffffffffffffffff92909216917f66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac6420849060600160405180910390a35050606c54919050565b5f828152607060205260408120610ae290836112a3565b90505b92915050565b610af361160d565b5f81118015610b045750606b548114155b610b755760405162461bcd60e51b8152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016104f3565b606b80549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610bc261160d565b610bcb5f611674565b565b5f805f606c54841115610c225760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b607154841015610c745760405162461bcd60e51b815260206004820152601060248201527f657870697265642070726f706f73616c0000000000000000000000000000000060448201526064016104f3565b606d54841015610cc65760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104f3565b6071548403610cdd57506001915081905080610d1e565b5f848152606f602052604090206001810154905460ff909116908180610d01575080155b80610d0b57504281105b610d14876112f2565b8394509450945050505b9193909250565b6071548110610d9c5760405162461bcd60e51b815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c000060648201526084016104f3565b606d545b818111610e26575f818152606e6020908152604080832083815560018082018590556002909101849055606f83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560709091528120908181610e0f8282611736565b505050508080610e1e9061188e565b915050610da0565b50610e328160016118c5565b606d5550565b610e4061160d565b73ffffffffffffffffffffffffffffffffffffffff8116610ec95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104f3565b610ed281611674565b50565b5f54610100900460ff1615808015610ef357505f54600160ff909116105b80610f0c5750303b158015610f0c57505f5460ff166001145b610f7e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104f3565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff861661103d5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016104f3565b5f851161108c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e60448201526064016104f3565b5f82116110db5760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f636800000000000000000000000060448201526064016104f3565b831515806110e857508215155b6111345760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104f3565b61113d86611674565b606b85905560658490556067839055606982905542606a55604080515f8152602081018790527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018690527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018590527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a1604080515f8152602081018490527f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a1801561129b575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001830160205260408120541515610ae2565b5f610ae28373ffffffffffffffffffffffffffffffffffffffff84166116ea565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa15801561135c573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526113a19190810190611915565b90505f805b8251811015611406576113eb8382815181106113c4576113c46119f3565b602002602001015160705f8881526020019081526020015f206112a390919063ffffffff16565b156113fe576113fb8260016118c5565b91505b6001016113a6565b506003825160026114179190611a20565b6114219190611a37565b109392505050565b60718190555f818152606e60205260409020546065541461149d57606580545f838152606e60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b9161149391848252602082015260400190565b60405180910390a1505b5f818152606e60205260409020600101546067541461151257606780545f838152606e60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa69706265699161150891848252602082015260400190565b60405180910390a1505b5f818152606e60205260409020600201546069541461158657606980545f838152606e6020908152604091829020600201805490945542606a55925481518381529384015290917f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a1505b5f818152606f6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556065546067546069548451928352928201529182015281907fd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c9060600160405180910390a250565b60335473ffffffffffffffffffffffffffffffffffffffff163314610bcb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81815260018301602052604081205461172f57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610ae5565b505f610ae5565b5080545f8255905f5260205f2090810190610ed291905b80821115611760575f815560010161174d565b5090565b5f60208284031215611774575f80fd5b5035919050565b5f6060828403121561178b575f80fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610ed2575f80fd5b5f80604083850312156117c3575f80fd5b8235915060208301356117d581611791565b809150509250929050565b5f602082840312156117f0575f80fd5b81356117fb81611791565b9392505050565b5f805f805f60a08688031215611816575f80fd5b853561182181611791565b97602087013597506040870135966060810135965060800135945092505050565b5f60208284031215611852575f80fd5b815180151581146117fb575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118be576118be611861565b5060010190565b80820180821115610ae557610ae5611861565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b805161191081611791565b919050565b5f6020808385031215611926575f80fd5b825167ffffffffffffffff8082111561193d575f80fd5b818501915085601f830112611950575f80fd5b815181811115611962576119626118d8565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156119a5576119a56118d8565b6040529182528482019250838101850191888311156119c2575f80fd5b938501935b828510156119e7576119d885611905565b845293850193928501926119c7565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8082028115828204841417610ae557610ae5611861565b5f82611a6a577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a +0x608060405234801561000f575f80fd5b506004361061016e575f3560e01c8063807de443116100d2578063a83d073711610088578063d5cc89ba11610063578063d5cc89ba1461037a578063d76930751461038d578063f2fde38b14610396575f80fd5b8063a83d073714610320578063acfd4cd814610329578063b511328d1461033c575f80fd5b80638da5cb5b116100b85780638da5cb5b146102a05780638e21d5fb146102be57806396dea936146102e5575f80fd5b8063807de4431461024b5780638596305214610297575f80fd5b80635bcfadb511610127578063715018a61161010d578063715018a61461020857806374c260cf1461021057806377c7938014610242575f80fd5b80635bcfadb5146101ec57806363966190146101ff575f80fd5b8063132002fc11610157578063132002fc1461019a57806349c1a581146101b65780634ec81af1146101d9575f80fd5b80630121b93f146101725780630d61b51914610187575b5f80fd5b6101856101803660046115a5565b6103a9565b005b6101856101953660046115a5565b6106f1565b6101a360675481565b6040519081526020015b60405180910390f35b6101c96101c43660046115dd565b6107a5565b60405190151581526020016101ad565b6101856101e736600461160b565b6107c5565b6101856101fa3660046115a5565b610b01565b6101a360685481565b610185610bd0565b61022361021e3660046115a5565b610be3565b60408051931515845291151560208401521515908201526060016101ad565b6101a360665481565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ad565b6101a360655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610272565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b61030b6102f33660046115a5565b606a6020525f90815260409020805460019091015482565b604080519283526020830191909152016101ad565b6101a3606d5481565b6101a3610337366004611643565b610d3b565b61036561034a3660046115a5565b606b6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101ad565b6101856103883660046115a5565b610fb6565b6101a360695481565b6101856103a4366004611659565b6110c1565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa15801561044e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610472919061167b565b9050806104c65760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b6068548211156105185760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b606d5482116105695760405162461bcd60e51b815260206004820152601260248201527f657870697265642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b6069548210156105bb5760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104bd565b5f828152606b60205260409020805460019091015460ff16806105dc575080155b806105e657504281105b156106335760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104bd565b61064a335f858152606c602052604090209061115e565b156106bd5760405162461bcd60e51b815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c000000000000000000000000000000000000000000000060648201526084016104bd565b6106d4335f858152606c602052604090209061118c565b506106de836111ad565b156106ec576106ec836112e4565b505050565b5f806106fc83610be3565b5091509150811561074f5760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104bd565b8061079c5760405162461bcd60e51b815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e207061737365642079657460448201526064016104bd565b6106ec836112e4565b5f828152606c602052604081206107bc908361115e565b90505b92915050565b5f54610100900460ff16158080156107e357505f54600160ff909116105b806107fc5750303b1580156107fc57505f5460ff166001145b61086e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104bd565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156108ca575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff851661092d5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016104bd565b5f841161097c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e60448201526064016104bd565b8215158061098957508115155b6109d55760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104bd565b6109de8561144e565b606784905560658390556066829055604080515f8152602081018690527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018590527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018490527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a18015610afa575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b610b096114c4565b5f81118015610b1a57506067548114155b610b8b5760405162461bcd60e51b8152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016104bd565b606780549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610bd86114c4565b610be15f61144e565b565b5f805f606854841115610c385760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b606d54841015610c8a5760405162461bcd60e51b815260206004820152601060248201527f657870697265642070726f706f73616c0000000000000000000000000000000060448201526064016104bd565b606954841015610cdc5760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104bd565b606d548403610cf357506001915081905080610d34565b5f848152606b602052604090206001810154905460ff909116908180610d17575080155b80610d2157504281105b610d2a876111ad565b8394509450945050505b9193909250565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610de1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e05919061167b565b905080610e545760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064016104bd565b8235151580610e665750602083013515155b610eb25760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104bd565b60688054905f610ec1836116c7565b90915550506068545f908152606a602090815260409091208435815590840135600182015550604051806040016040528060675442610f0091906116fe565b81525f60209182018190526068548152606b82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790553360685460408051863581526020808801359082015273ffffffffffffffffffffffffffffffffffffffff93909316927fd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39910160405180910390a35050606854919050565b606d54811061102d5760405162461bcd60e51b815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c000060648201526084016104bd565b6069545b8181116110af575f818152606a602090815260408083208381556001908101849055606b83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055606c90915281209081816110988282611577565b5050505080806110a7906116c7565b915050611031565b506110bb8160016116fe565b60695550565b6110c96114c4565b73ffffffffffffffffffffffffffffffffffffffff81166111525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104bd565b61115b8161144e565b50565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260018301602052604081205415156107bc565b5f6107bc8373ffffffffffffffffffffffffffffffffffffffff841661152b565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa158015611217573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261125c919081019061174e565b90505f805b82518110156112c1576112a683828151811061127f5761127f61182c565b6020026020010151606c5f8881526020019081526020015f2061115e90919063ffffffff16565b156112b9576112b68260016116fe565b91505b600101611261565b506003825160026112d29190611859565b6112dc9190611870565b109392505050565b606d8190555f818152606a60205260409020546065541461135857606580545f838152606a60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b9161134e91848252602082015260400190565b60405180910390a1505b5f818152606a6020526040902060010154606654146113cd57606680545f838152606a60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569916113c391848252602082015260400190565b60405180910390a1505b5f818152606b6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905560655460665483519182529181019190915282917f3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9910160405180910390a250565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610be15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104bd565b5f81815260018301602052604081205461157057508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556107bf565b505f6107bf565b5080545f8255905f5260205f209081019061115b91905b808211156115a1575f815560010161158e565b5090565b5f602082840312156115b5575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461115b575f80fd5b5f80604083850312156115ee575f80fd5b823591506020830135611600816115bc565b809150509250929050565b5f805f806080858703121561161e575f80fd5b8435611629816115bc565b966020860135965060408601359560600135945092505050565b5f60408284031215611653575f80fd5b50919050565b5f60208284031215611669575f80fd5b8135611674816115bc565b9392505050565b5f6020828403121561168b575f80fd5b81518015158114611674575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036116f7576116f761169a565b5060010190565b808201808211156107bf576107bf61169a565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b8051611749816115bc565b919050565b5f602080838503121561175f575f80fd5b825167ffffffffffffffff80821115611776575f80fd5b818501915085601f830112611789575f80fd5b81518181111561179b5761179b611711565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156117de576117de611711565b6040529182528482019250838101850191888311156117fb575f80fd5b938501935b82851015611820576118118561173e565b84529385019392850192611800565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820281158282048414176107bf576107bf61169a565b5f826118a3577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a diff --git a/bindings/bin/l2staking_deployed.hex b/bindings/bin/l2staking_deployed.hex index c99442dd3..fc4f397db 100644 --- a/bindings/bin/l2staking_deployed.hex +++ b/bindings/bin/l2staking_deployed.hex @@ -1 +1 @@ -0x608060405234801561000f575f80fd5b50600436106102ec575f3560e01c8063746c8ae111610192578063affed0e0116100e8578063e10911b111610093578063f2fde38b1161006e578063f2fde38b146106cf578063fad99f98146106e2578063fc6facc6146106ea575f80fd5b8063e10911b11461069e578063ed70b343146106a6578063f0261bc2146106c6575f80fd5b8063cce6cf9f116100c3578063cce6cf9f14610643578063d31d83d914610656578063d557714114610677575f80fd5b8063affed0e0146105f1578063b5d2e0dc146105fa578063c64814dd14610619575f80fd5b80638da5cb5b1161014857806391bd43a41161012357806391bd43a41461059e578063927ede2d146105bd57806396ab994d146105e4575f80fd5b80638da5cb5b146105445780638e21d5fb146105555780639168ae721461057c575f80fd5b80637b05afb5116101785780637b05afb5146104db578063831cfb58146104fa57806384d7d1d414610521575f80fd5b8063746c8ae1146104cb57806376671808146104d3575f80fd5b80633b8024211161024757806343352d61116101fd57806346cdc18a116101d857806346cdc18a146104a85780637046529b146104b0578063715018a6146104c3575f80fd5b806343352d611461047a578063439162b514610482578063459598a214610495575f80fd5b80633cb747bf1161022d5780633cb747bf146104065780633d9353fe1461044057806340b5c83714610467575f80fd5b80633b802421146103ea5780633c323a1b146103f3575f80fd5b8063174e31c4116102a75780632e787be3116102825780632e787be3146103ae57806330158eea146103b75780633385ccc2146103d7575f80fd5b8063174e31c41461037f57806319fac8fd146103925780632cc138be146103a5575f80fd5b80630eb573af116102d75780630eb573af1461032b5780630f3b70591461033e57806312a3e94714610376575f80fd5b806243b758146102f05780629c6f0c14610316575b5f80fd5b6103036102fe36600461465b565b6106fd565b6040519081526020015b60405180910390f35b610329610324366004614676565b610723565b005b6103296103393660046146c0565b610901565b61035161034c3660046146d7565b610a14565b604080516001600160a01b03909416845260208401929092529082015260600161030d565b610303609a5481565b61032961038d3660046146d7565b610a5c565b6103296103a03660046146c0565b610bd4565b61030360985481565b61030360995481565b6103ca6103c5366004614749565b610cf6565b60405161030d91906147e9565b6103296103e536600461465b565b610f1d565b610303609c5481565b6103296104013660046146d7565b611557565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161030d565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b6103296104753660046146c0565b611be6565b6103ca611cf9565b61032961049036600461488f565b611f15565b6104286104a33660046146c0565b612446565b609d54610303565b6103296104be366004614676565b61246e565b6103296125c8565b6103296125db565b6103036128cb565b6103036104e936600461465b565b60a06020525f908152604090205481565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b61053461052f36600461465b565b61293f565b604051901515815260200161030d565b6033546001600160a01b0316610428565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b61058f61058a36600461465b565b612969565b60405161030d939291906148fd565b6103036105ac36600461465b565b60a16020525f908152604090205481565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b6097546105349060ff1681565b61030360a55481565b61030361060836600461465b565b609e6020525f908152604090205481565b61030361062736600461492d565b60a360209081525f928352604080842090915290825290205481565b610329610651366004614959565b612a1b565b6106696106643660046149a1565b612f87565b60405161030d929190614a16565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b610329613115565b6106b96106b436600461465b565b613499565b60405161030d9190614a36565b610303609b5481565b6103296106dd36600461465b565b61352f565b6103296135bc565b6103296106f8366004614959565b61366a565b6001600160a01b0381165f90815260a26020526040812061071d90613a35565b92915050565b61072b613a3e565b8160a55481146107825760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064015b60405180910390fd5b61078d836001614ac4565b60a555609e5f6107a0602085018561465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20545f0361084257609d6107d5602084018461465b565b81546001810183555f9283526020808420909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609d5491609e916108289086018661465b565b6001600160a01b0316815260208101919091526040015f20555b81609f5f610853602084018461465b565b6001600160a01b0316815260208101919091526040015f206108758282614bf4565b506108859050602083018361465b565b6001600160a01b03167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d60208401356108c16040860186614ad7565b6040516108d093929190614d5b565b60405180910390a260975460ff161580156108ef5750609954609d5411155b156108fc576108fc613a98565b505050565b610909613a3e565b5f8111801561091a57506099548114155b61098c5760405162461bcd60e51b815260206004820152602260248201527f696e76616c6964206e65772073657175656e63657220736574206d617820736960448201527f7a650000000000000000000000000000000000000000000000000000000000006064820152608401610779565b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff166109e157609d546109e5565b609c545b90505f60995482106109f9576099546109fb565b815b9050609b548114610a0e57610a0e613a98565b50505050565b60a4602052815f5260405f208181548110610a2d575f80fd5b5f9182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b610a64613c18565b6001600160a01b038216610b1a576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016635cf20c7b336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044015f604051808303815f87803b158015610aff575f80fd5b505af1158015610b11573d5f803e3d5ffd5b50505050610bc6565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663996cba6883336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064015f604051808303815f87803b158015610baf575f80fd5b505af1158015610bc1573d5f803e3d5ffd5b505050505b610bd06001606555565b5050565b335f908152609e6020526040902054610c2f5760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79207374616b657220616c6c6f776564000000000000000000000000006044820152606401610779565b6014811115610c805760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420636f6d6d697373696f6e00000000000000000000000000006044820152606401610779565b335f90815260a06020526040812082905560975460ff16610ca1575f610cb4565b610ca96128cb565b610cb4906001614ac4565b604080518481526020810183905291925033917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a25050565b60605f8267ffffffffffffffff811115610d1257610d12614b38565b604051908082528060200260200182016040528015610d5e57816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081610d305790505b5090505f5b83811015610f15576040518060600160405280609f5f888886818110610d8b57610d8b614dae565b9050602002016020810190610da0919061465b565b6001600160a01b03908116825260208083019390935260409091015f908120549091168352910190609f90888886818110610ddd57610ddd614dae565b9050602002016020810190610df2919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20600101548152602001609f5f888886818110610e2f57610e2f614dae565b9050602002016020810190610e44919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f206002018054610e7190614b65565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9d90614b65565b8015610ee85780601f10610ebf57610100808354040283529160200191610ee8565b820191905f5260205f20905b815481529060010190602001808311610ecb57829003601f168201915b5050505050815250828281518110610f0257610f02614dae565b6020908102919091010152600101610d63565b509392505050565b610f25613c18565b6001600160a01b0381165f90815260a360209081526040808320338452909152902054610f945760405162461bcd60e51b815260206004820152601660248201527f7374616b696e6720616d6f756e74206973207a65726f000000000000000000006044820152606401610779565b6001600160a01b0381165f908152609e60205260408120546097549015919060ff16610fc0575f610fd3565b610fc86128cb565b610fd3906001614ac4565b6097549091505f9060ff168015610fe8575082155b610ff25781610fff565b609a54610fff9083614ac4565b604080516060810182526001600160a01b038781168083525f81815260a36020908152858220338084528183528784208054848901908152888a018b815283875260a486528a87208054600180820183559189528789208c51600390920201805473ffffffffffffffffffffffffffffffffffffffff191691909b16178a558251908a015551600290980197909755908452908252829055925191815260a1909252928120805494955091936110b6908490614ddb565b90915550506001600160a01b0385165f90815260a2602052604090206110dc9033613c78565b506001600160a01b0385165f908152609e602052604090205484158015611105575060975460ff165b80156111125750609c5481105b15611373576001600160a01b0386165f908152609e602052604081205461113b90600190614ddb565b90505b6001609c5461114d9190614ddb565b8110156113715760a15f609d838154811061116a5761116a614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a190609d61119f856001614ac4565b815481106111af576111af614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115611369575f609d82815481106111ed576111ed614dae565b5f918252602090912001546001600160a01b03169050609d611210836001614ac4565b8154811061122057611220614dae565b5f91825260209091200154609d80546001600160a01b03909216918490811061124b5761124b614dae565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609d61128e846001614ac4565b8154811061129e5761129e614dae565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556112de826001614ac4565b609e5f609d85815481106112f4576112f4614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055611323826002614ac4565b609e5f609d611333866001614ac4565b8154811061134357611343614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b60010161113e565b505b8415801561139657506001600160a01b0386165f90815260a16020526040902054155b156113b3576001609c5f8282546113ad9190614ddb565b90915550505b6001600160a01b038681165f81815260a160205260408082205481517f7f683ee30000000000000000000000000000000000000000000000000000000081526004810194909452336024850152604484018990526064840152517f000000000000000000000000000000000000000000000000000000000000000090931692637f683ee392608480820193929182900301818387803b158015611454575f80fd5b505af1158015611466573d5f803e3d5ffd5b505050506114713390565b6001600160a01b0316866001600160a01b03167f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c846020015187876040516114cc939291909283526020830191909152604082015260600190565b60405180910390a3841580156114e4575060975460ff165b80156114f25750609b548111155b80156115385750609b546001600160a01b0387165f908152609e602052604090205411806115385750609c546001600160a01b0387165f908152609e6020526040902054115b1561154557611545613a98565b50505050506115546001606555565b50565b6001600160a01b0382165f908152609e602052604090205482906115bd5760405162461bcd60e51b815260206004820152600a60248201527f6e6f74207374616b6572000000000000000000000000000000000000000000006044820152606401610779565b6115c5613c18565b5f82116116145760405162461bcd60e51b815260206004820152601460248201527f696e76616c6964207374616b6520616d6f756e740000000000000000000000006044820152606401610779565b61161e3384613c93565b1561166b5760405162461bcd60e51b815260206004820152601660248201527f756e64656c65676174696f6e20756e636c61696d6564000000000000000000006044820152606401610779565b6001600160a01b0383165f90815260a3602090815260408083203384529091529020546116e95761169c3384613d1c565b156116e95760405162461bcd60e51b815260206004820152601060248201527f72657761726420756e636c61696d6564000000000000000000000000000000006044820152606401610779565b6001600160a01b0383165f90815260a1602052604081208054849290611710908490614ac4565b90915550506001600160a01b0383165f90815260a36020908152604080832033845290915281208054849290611747908490614ac4565b90915550506001600160a01b0383165f90815260a26020526040902061176d9033613dd1565b506001600160a01b0383165f90815260a160205260409020548290036117a5576001609c5f82825461179f9190614ac4565b90915550505b6001600160a01b0383165f908152609e602052604090205460975460ff1680156117cf5750600181115b15611a15575f6117e0600183614ddb565b90505b8015611a135760a15f609d6117f9600185614ddb565b8154811061180957611809614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f205460a15f609d848154811061185a5761185a614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115611a01575f609d611892600184614ddb565b815481106118a2576118a2614dae565b5f91825260209091200154609d80546001600160a01b03909216925090839081106118cf576118cf614dae565b5f918252602090912001546001600160a01b0316609d6118f0600185614ddb565b8154811061190057611900614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609d838154811061193f5761193f614dae565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609e90609d611986600185614ddb565b8154811061199657611996614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020556119c5826001614ac4565b609e5f609d85815481106119db576119db614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b80611a0b81614dee565b9150506117e3565b505b6097545f9060ff16611a27575f611a3a565b611a2f6128cb565b611a3a906001614ac4565b6001600160a01b0386165f81815260a36020908152604080832033808552908352928190205481519081529182018990528181018590525193945090927fc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d09181900360600190a36001600160a01b038581165f81815260a360209081526040808320338085528184528285205486865260a18552838620548287529290945282517fb809af0f000000000000000000000000000000000000000000000000000000008152600481019690965260248601526044850187905260648501839052608485015290881460a4840152517f00000000000000000000000000000000000000000000000000000000000000009093169263b809af0f9260c480820193929182900301818387803b158015611b6e575f80fd5b505af1158015611b80573d5f803e3d5ffd5b50505050611b95611b8e3390565b3086613de5565b60975460ff168015611ba85750609b5482115b8015611bcd57506099546001600160a01b0386165f908152609e602052604090205411155b15611bda57611bda613a98565b50506108fc6001606555565b611bee613a3e565b60975460ff1615611c415760405162461bcd60e51b815260206004820152601660248201527f72657761726420616c72656164792073746172746564000000000000000000006044820152606401610779565b4281118015611c5a5750611c586201518082614e30565b155b8015611c6857506098548114155b611cb45760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d65000000000000006044820152606401610779565b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609d546060905f9067ffffffffffffffff811115611d1957611d19614b38565b604051908082528060200260200182016040528015611d6557816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611d375790505b5090505f5b609d54811015611f0f576040518060600160405280609f5f609d8581548110611d9557611d95614dae565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409092018120549092168352609d80549390910192609f92919086908110611de157611de1614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f20600101548152602001609f5f609d8581548110611e3a57611e3a614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400190206002018054611e6b90614b65565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9790614b65565b8015611ee25780601f10611eb957610100808354040283529160200191611ee2565b820191905f5260205f20905b815481529060010190602001808311611ec557829003601f168201915b5050505050815250828281518110611efc57611efc614dae565b6020908102919091010152600101611d6a565b50919050565b5f54610100900460ff1615808015611f3357505f54600160ff909116105b80611f4c5750303b158015611f4c57505f5460ff166001145b611fbe5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610779565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561201a575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0387166120705760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e6572206164647265737300000000000000000000006044820152606401610779565b5f86116120e55760405162461bcd60e51b815260206004820152602260248201527f73657175656e6365727353697a65206d7573742067726561746572207468616e60448201527f20300000000000000000000000000000000000000000000000000000000000006064820152608401610779565b5f85116121345760405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420756e64656c65676174654c6f636b45706f636873000000006044820152606401610779565b428411801561214d575061214b6201518085614e30565b155b6121995760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d65000000000000006044820152606401610779565b816121e65760405162461bcd60e51b815260206004820152601760248201527f696e76616c696420696e697469616c207374616b6572730000000000000000006044820152606401610779565b6121ef87614096565b6121f76140f4565b6099869055609a8590556098849055609b8290555f5b609b548110156123685783838281811061222957612229614dae565b905060200281019061223b9190614e43565b609f5f86868581811061225057612250614dae565b90506020028101906122629190614e43565b61227090602081019061465b565b6001600160a01b0316815260208101919091526040015f206122928282614bf4565b905050609d8484838181106122a9576122a9614dae565b90506020028101906122bb9190614e43565b6122c990602081019061465b565b8154600180820184555f938452602090932001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055612312908290614ac4565b609e5f86868581811061232757612327614dae565b90506020028101906123399190614e43565b61234790602081019061465b565b6001600160a01b0316815260208101919091526040015f205560010161220d565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a1801561243d575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609d8181548110612455575f80fd5b5f918252602090912001546001600160a01b0316905081565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561255657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015612527573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061254b9190614e7f565b6001600160a01b0316145b61072b5760405162461bcd60e51b815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401610779565b6125d0613a3e565b6125d95f614096565b565b6125e3613a3e565b60985442101561265a5760405162461bcd60e51b8152602060048201526024808201527f63616e2774207374617274206265666f7265207265776172642073746172742060448201527f74696d65000000000000000000000000000000000000000000000000000000006064820152608401610779565b5f609c54116126ab5760405162461bcd60e51b815260206004820152600e60248201527f6e6f6e652063616e6469646174650000000000000000000000000000000000006044820152606401610779565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609d54811015612868575f5b8181101561285f5760a15f609d838154811061270457612704614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f205460a15f609d858154811061275557612755614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115612857575f609d828154811061279357612793614dae565b5f91825260209091200154609d80546001600160a01b03909216925090849081106127c0576127c0614dae565b5f91825260209091200154609d80546001600160a01b0390921691849081106127eb576127eb614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609d848154811061282a5761282a614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550505b6001016126e6565b506001016126da565b505f5b609d548110156128c257612880816001614ac4565b609e5f609d848154811061289657612896614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205560010161286b565b506125d9613a98565b5f60985442101561291e5760405162461bcd60e51b815260206004820152601960248201527f726577617264206973206e6f74207374617274656420796574000000000000006044820152606401610779565b62015180609854426129309190614ddb565b61293a9190614e9a565b905090565b6001600160a01b0381165f90815260a360209081526040808320338452909152812054151561071d565b609f6020525f90815260409020805460018201546002830180546001600160a01b0390931693919261299a90614b65565b80601f01602080910402602001604051908101604052809291908181526020018280546129c690614b65565b8015612a115780601f106129e857610100808354040283529160200191612a11565b820191905f5260205f20905b8154815290600101906020018083116129f457829003601f168201915b5050505050905083565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612b0357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ad4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612af89190614e7f565b6001600160a01b0316145b612b755760405162461bcd60e51b815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401610779565b8260a5548114612bc75760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610779565b612bd2846001614ac4565b60a5555f805b83811015612f3857609b54609e5f878785818110612bf857612bf8614dae565b9050602002016020810190612c0d919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411612c3757600191505b5f609e5f878785818110612c4d57612c4d614dae565b9050602002016020810190612c62919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115612eba575f6001609e5f888886818110612ca057612ca0614dae565b9050602002016020810190612cb5919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f2054612cdf9190614ddb565b90505b609d54612cf190600190614ddb565b811015612dc357609d612d05826001614ac4565b81548110612d1557612d15614dae565b5f91825260209091200154609d80546001600160a01b039092169183908110612d4057612d40614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609e5f609d8481548110612d8357612d83614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400181208054909190612db6908490614ddb565b9091555050600101612ce2565b50609d805480612dd557612dd5614ead565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609e90868684818110612e1a57612e1a614dae565b9050602002016020810190612e2f919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a15f878785818110612e6757612e67614dae565b9050602002016020810190612e7c919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115612eba576001609c5f828254612eb49190614ddb565b90915550505b609f5f868684818110612ecf57612ecf614dae565b9050602002016020810190612ee4919061465b565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590612f2e60028301826145fd565b5050600101612bd8565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f618484604051612f6a929190614eda565b60405180910390a18015612f8057612f80613a98565b5050505050565b5f60605f8411612fd95760405162461bcd60e51b815260206004820152601160248201527f696e76616c696420706167652073697a650000000000000000000000000000006044820152606401610779565b6001600160a01b0385165f90815260a260205260409020612ff990613a35565b91508367ffffffffffffffff81111561301457613014614b38565b60405190808252806020026020018201604052801561303d578160200160208202803683370190505b5090505f61304b8486614f27565b90505f600161305a8682614ac4565b6130649088614f27565b61306e9190614ddb565b905061307b600185614ddb565b8111156130905761308d600185614ddb565b90505b815f5b828211613109576130c7826130a781614f3e565b6001600160a01b038c165f90815260a26020526040902090945090614178565b85826130d281614f3e565b9350815181106130e4576130e4614dae565b60200260200101906001600160a01b031690816001600160a01b031681525050613093565b50505050935093915050565b61311d613c18565b335f90815260a46020526040812054815b818110156134335760975460ff16158061317e575061314b6128cb565b335f90815260a46020526040902080548390811061316b5761316b614dae565b905f5260205f2090600302016002015411155b1561342157335f90815260a4602052604090208054829081106131a3576131a3614dae565b905f5260205f20906003020160010154836131be9190614ac4565b335f90815260a46020526040812080549295509091839081106131e3576131e3614dae565b5f91825260208220600390910201546001600160a01b0316915060a4816132073390565b6001600160a01b03166001600160a01b031681526020019081526020015f20838154811061323757613237614dae565b905f5260205f2090600302016002015490505f60a45f6132543390565b6001600160a01b03166001600160a01b031681526020019081526020015f20848154811061328457613284614dae565b905f5260205f2090600302016001015490506001856132a39190614ddb565b84101561336857335f90815260a4602052604090206132c3600187614ddb565b815481106132d3576132d3614dae565b905f5260205f20906003020160a45f6132e93390565b6001600160a01b03166001600160a01b031681526020019081526020015f20858154811061331957613319614dae565b5f91825260209091208254600390920201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091178155600180830154908201556002918201549101555b335f90815260a46020526040902080548061338557613385614ead565b5f8281526020812060035f1990930192830201805473ffffffffffffffffffffffffffffffffffffffff19168155600181810183905560029091019190915591556133d09086614ddb565b604080518481526020810184905291965033916001600160a01b038616917f921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6910160405180910390a350505061312e565b61342c816001614ac4565b905061312e565b505f82116134835760405162461bcd60e51b815260206004820152601760248201527f6e6f204d6f72706820746f6b656e20746f20636c61696d0000000000000000006044820152606401610779565b61348d3383614183565b50506125d96001606555565b6001600160a01b0381165f90815260a460209081526040808320805482518185028101850190935280835260609492939192909184015b82821015613524575f848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016134d0565b505050509050919050565b613537613a3e565b6001600160a01b0381166135b35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610779565b61155481614096565b6135c4613c18565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663ac2ac640336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0390911660048201526024015f604051808303815f87803b15801561364a575f80fd5b505af115801561365c573d5f803e3d5ffd5b505050506125d96001606555565b613672613a3e565b8260a55481146136c45760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610779565b6136cf846001614ac4565b60a5555f805b83811015612f3857609b54609e5f8787858181106136f5576136f5614dae565b905060200201602081019061370a919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541161373457600191505b5f609e5f87878581811061374a5761374a614dae565b905060200201602081019061375f919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156139b7575f6001609e5f88888681811061379d5761379d614dae565b90506020020160208101906137b2919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20546137dc9190614ddb565b90505b609d546137ee90600190614ddb565b8110156138c057609d613802826001614ac4565b8154811061381257613812614dae565b5f91825260209091200154609d80546001600160a01b03909216918390811061383d5761383d614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609e5f609d848154811061388057613880614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001812080549091906138b3908490614ddb565b90915550506001016137df565b50609d8054806138d2576138d2614ead565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609e9086868481811061391757613917614dae565b905060200201602081019061392c919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a15f87878581811061396457613964614dae565b9050602002016020810190613979919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156139b7576001609c5f8282546139b19190614ddb565b90915550505b609f5f8686848181106139cc576139cc614dae565b90506020020160208101906139e1919061465b565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590613a2b60028301826145fd565b50506001016136d5565b5f61071d825490565b6033546001600160a01b031633146125d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b60995460975460ff1615613abc57609954609c541015613ab75750609c545b613acd565b609954609d541015613acd5750609d545b5f8167ffffffffffffffff811115613ae757613ae7614b38565b604051908082528060200260200182016040528015613b10578160200160208202803683370190505b5090505f5b82811015613b7d57609d8181548110613b3057613b30614dae565b905f5260205f20015f9054906101000a90046001600160a01b0316828281518110613b5d57613b5d614dae565b6001600160a01b0390921660209283029190910190910152600101613b15565b506040517f9b8201a40000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639b8201a490613be3908490600401614f56565b5f604051808303815f87803b158015613bfa575f80fd5b505af1158015613c0c573d5f803e3d5ffd5b50509151609b55505050565b600260655403613c6a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610779565b6002606555565b6001606555565b5f613c8c836001600160a01b03841661442c565b9392505050565b5f805b6001600160a01b0384165f90815260a46020526040902054811015613d13576001600160a01b038481165f90815260a46020526040902080549185169183908110613ce357613ce3614dae565b5f9182526020909120600390910201546001600160a01b031603613d0b57600191505061071d565b600101613c96565b505f9392505050565b6040517fde6ac9330000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015282811660248301525f917f00000000000000000000000000000000000000000000000000000000000000009091169063de6ac93390604401602060405180830381865afa158015613da5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613dc99190614f68565b159392505050565b5f613c8c836001600160a01b03841661450f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015613e66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e8a9190614f87565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015613f1c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613f409190614f68565b613f8c5760405162461bcd60e51b815260206004820152601360248201527f7472616e7366657246726f6d206661696c6564000000000000000000000000006044820152606401610779565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa15801561400d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140319190614f87565b90505f8311801561404a5750826140488383614ddb565b145b612f805760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610779565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166141705760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610779565b6125d961455b565b5f613c8c83836145d7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614204573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142289190614f87565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af11580156142b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142d69190614f68565b6143225760405162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206661696c656400000000000000000000000000000000006044820152606401610779565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa1580156143a3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906143c79190614f87565b90505f831180156143e05750826143de8383614ddb565b145b610a0e5760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610779565b5f8181526001830160205260408120548015614506575f61444e600183614ddb565b85549091505f9061446190600190614ddb565b90508181146144c0575f865f01828154811061447f5761447f614dae565b905f5260205f200154905080875f01848154811061449f5761449f614dae565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806144d1576144d1614ead565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061071d565b5f91505061071d565b5f81815260018301602052604081205461455457508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561071d565b505f61071d565b5f54610100900460ff16613c715760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610779565b5f825f0182815481106145ec576145ec614dae565b905f5260205f200154905092915050565b50805461460990614b65565b5f825580601f10614618575050565b601f0160209004905f5260205f209081019061155491905b80821115614643575f8155600101614630565b5090565b6001600160a01b0381168114611554575f80fd5b5f6020828403121561466b575f80fd5b8135613c8c81614647565b5f8060408385031215614687575f80fd5b82359150602083013567ffffffffffffffff8111156146a4575f80fd5b8301606081860312156146b5575f80fd5b809150509250929050565b5f602082840312156146d0575f80fd5b5035919050565b5f80604083850312156146e8575f80fd5b82356146f381614647565b946020939093013593505050565b5f8083601f840112614711575f80fd5b50813567ffffffffffffffff811115614728575f80fd5b6020830191508360208260051b8501011115614742575f80fd5b9250929050565b5f806020838503121561475a575f80fd5b823567ffffffffffffffff811115614770575f80fd5b61477c85828601614701565b90969095509350505050565b5f81518084525f5b818110156147ac57602081850181015186830182015201614790565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b83811015614881578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0018552815180516001600160a01b031684528781015188850152860151606087850181905261486d81860183614788565b968901969450505090860190600101614810565b509098975050505050505050565b5f805f805f8060a087890312156148a4575f80fd5b86356148af81614647565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff8111156148df575f80fd5b6148eb89828a01614701565b979a9699509497509295939492505050565b6001600160a01b0384168152826020820152606060408201525f6149246060830184614788565b95945050505050565b5f806040838503121561493e575f80fd5b823561494981614647565b915060208301356146b581614647565b5f805f6040848603121561496b575f80fd5b83359250602084013567ffffffffffffffff811115614988575f80fd5b61499486828701614701565b9497909650939450505050565b5f805f606084860312156149b3575f80fd5b83356149be81614647565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b83811015614a0b5781516001600160a01b0316875295820195908201906001016149e6565b509495945050505050565b828152604060208201525f614a2e60408301846149d3565b949350505050565b602080825282518282018190525f919060409081850190868401855b82811015614a8a57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101614a52565b5091979650505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561071d5761071d614a97565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614b0a575f80fd5b83018035915067ffffffffffffffff821115614b24575f80fd5b602001915036819003821315614742575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c90821680614b7957607f821691505b602082108103611f0f577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f8211156108fc57805f5260205f20601f840160051c81016020851015614bd55750805b601f840160051c820191505b81811015612f80575f8155600101614be1565b8135614bff81614647565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112614c6b575f80fd5b8501803567ffffffffffffffff811115614c83575f80fd5b8036038483011315614c93575f80fd5b614ca781614ca18554614b65565b85614bb0565b5f601f821160018114614cda575f8315614cc357508382018601355b5f19600385901b1c1916600184901b178555614d50565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b82811015614d2657868501890135825593880193908901908801614d07565b5084821015614d44575f1960f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8181038181111561071d5761071d614a97565b5f81614dfc57614dfc614a97565b505f190190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82614e3e57614e3e614e03565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112614e75575f80fd5b9190910192915050565b5f60208284031215614e8f575f80fd5b8151613c8c81614647565b5f82614ea857614ea8614e03565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015614f1c578235614f0181614647565b6001600160a01b031682529183019190830190600101614eee565b509695505050505050565b808202811582820484141761071d5761071d614a97565b5f5f198203614f4f57614f4f614a97565b5060010190565b602081525f613c8c60208301846149d3565b5f60208284031215614f78575f80fd5b81518015158114613c8c575f80fd5b5f60208284031215614f97575f80fd5b505191905056fea164736f6c6343000818000a +0x608060405234801561000f575f80fd5b506004361061034f575f3560e01c806376671808116101be578063affed0e0116100fe578063eefecafd1161009e578063fad99f9811610079578063fad99f98146107f3578063fc6facc6146107fb578063fe3488841461080e578063ff4840cd1461082d575f80fd5b8063eefecafd146107ce578063f0261bc2146107d7578063f2fde38b146107e0575f80fd5b8063bf2dca0a116100d9578063bf2dca0a14610748578063cce6cf9f14610773578063d31d83d914610786578063d5577141146107a7575f80fd5b8063affed0e0146106f2578063b5d2e0dc146106fb578063b7a587bf1461071a575f80fd5b80638e21d5fb11610169578063927ede2d11610144578063927ede2d1461069857806396ab994d146106bf5780639d51c3b9146106cc578063a61bb764146106df575f80fd5b80638e21d5fb1461063c5780639168ae721461066357806391c05b0b14610685575f80fd5b8063831cfb5811610199578063831cfb58146105e157806384d7d1d4146106085780638da5cb5b1461062b575f80fd5b806376671808146105a05780637b05afb5146105a85780637c7e8bd2146105ce575f80fd5b80633434735f11610294578063459598a2116102345780636bd8f8041161020f5780636bd8f8041461056a5780637046529b1461057d578063715018a614610590578063746c8ae114610598575f80fd5b8063459598a21461053c57806346cdc18a1461054f5780634d99dd1614610557575f80fd5b80633cb747bf1161026f5780633cb747bf146104e857806340b5c8371461050e57806343352d6114610521578063439162b514610529575f80fd5b80633434735f146104765780633b2713c5146104b55780633b802421146104df575f80fd5b806313f22527116102ff578063201018fb116102da578063201018fb146104315780632cc138be146104445780632e787be31461044d57806330158eea14610456575f80fd5b806313f22527146103d057806319fac8fd146103e35780631d5611b8146103f6575f80fd5b80630321731c1161032f5780630321731c146103a15780630eb573af146103b457806312a3e947146103c7575f80fd5b806243b758146103535780629c6f0c14610379578063026e402b1461038e575b5f80fd5b6103666103613660046155b7565b610840565b6040519081526020015b60405180910390f35b61038c6103873660046155d2565b610866565b005b61038c61039c36600461561c565b610a29565b6103666103af3660046155b7565b610fcd565b61038c6103c2366004615646565b611007565b610366609a5481565b6103666103de3660046155b7565b6110dc565b61038c6103f1366004615646565b6111a4565b61041c6104043660046155b7565b60a36020525f90815260409020805460019091015482565b60408051928352602083019190915201610370565b61036661043f366004615646565b61129d565b61036660985481565b61036660995481565b6104696104643660046156a5565b611487565b6040516103709190615745565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610370565b6103666104c33660046157eb565b60a460209081525f928352604080842090915290825290205481565b610366609c5481565b7f000000000000000000000000000000000000000000000000000000000000000061049d565b61038c61051c366004615646565b6116ae565b610469611795565b61038c610537366004615817565b6119b1565b61049d61054a366004615646565b611e72565b609e54610366565b61038c61056536600461561c565b611e9a565b61038c610578366004615885565b6125e0565b61038c61058b3660046155d2565b6130e5565b61038c613259565b61038c61326c565b6103666134fa565b61041c6105b63660046155b7565b60a16020525f90815260409020805460019091015482565b6103666105dc3660046155b7565b613558565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61061b6106163660046155b7565b613575565b6040519015158152602001610370565b6033546001600160a01b031661049d565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6106766106713660046155b7565b61359f565b604051610370939291906158c3565b61038c610693366004615646565b613651565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b60975461061b9060ff1681565b6103666106da3660046157eb565b6138ca565b6103666106ed36600461561c565b6138dc565b610366609d5481565b6103666107093660046155b7565b609f6020525f908152604090205481565b61072d61072836600461561c565b613a14565b60408051825181526020928301519281019290925201610370565b6103666107563660046155b7565b6001600160a01b03165f90815260a1602052604090206001015490565b61038c6107813660046158f3565b613a75565b61079961079436600461593b565b613fd7565b6040516103709291906159b0565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61036660aa5481565b610366609b5481565b61038c6107ee3660046155b7565b61414f565b61038c6141f9565b61038c6108093660046158f3565b6142ab565b61036661081c3660046155b7565b60ab6020525f908152604090205481565b61038c61083b3660046155b7565b614659565b6001600160a01b0381165f90815260a2602052604081206108609061470e565b92915050565b61086e614717565b81609d5481146108aa576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b58360016159fd565b609d55609f5f6108c860208501856155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20545f0361096a57609e6108fd60208401846155b7565b81546001810183555f9283526020808420909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609e5491609f91610950908601866155b7565b6001600160a01b0316815260208101919091526040015f20555b8160a05f61097b60208401846155b7565b6001600160a01b0316815260208101919091526040015f2061099d8282615b2d565b506109ad905060208301836155b7565b6001600160a01b03167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d60208401356109e96040860186615a10565b6040516109f893929190615c94565b60405180910390a260975460ff16158015610a175750609954609e5411155b15610a2457610a2461478b565b505050565b6001600160a01b0382165f908152609f6020526040812054839103610a7a576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a8261490b565b815f03610abb576040517f608294ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610adc336001600160a01b0385165f90815260a2602052604090209061497e565b5060975460ff16610b6e576001600160a01b0383165f90815260a46020908152604080832033845290915281208054849290610b199084906159fd565b90915550506001600160a01b0383165f90815260a3602052604081208054849290610b459084906159fd565b90915550506001600160a01b0383165f90815260a3602052604090208054600190910155610c8a565b6001600160a01b0383165f90815260a3602090815260408083206001810154905460a48452828520338652909352908320549092829003610be5576001600160a01b0386165f81815260a460209081526040808320338452825280832089905592825260a390522060018101869055859055610c86565b81610bf08487615ce7565b610bfa9190615d2b565b610c0490826159fd565b6001600160a01b0387165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054879290610c459084906159fd565b90915550829050610c568487615ce7565b610c609190615d2b565b610c6a90846159fd565b6001600160a01b0387165f90815260a360205260409020600101555b5050505b6001600160a01b0383165f90815260a36020526040902054829003610cc1576001609c5f828254610cbb91906159fd565b90915550505b6001600160a01b0383165f908152609f602052604090205460975460ff168015610ceb5750600181115b15610f20575f610cfc600183615d3e565b90505b8015610f1e5760a35f609e610d15600185615d3e565b81548110610d2557610d25615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a39290919085908110610d6557610d65615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115610f0c575f609e610d9d600184615d3e565b81548110610dad57610dad615d51565b5f91825260209091200154609e80546001600160a01b0390921692509083908110610dda57610dda615d51565b5f918252602090912001546001600160a01b0316609e610dfb600185615d3e565b81548110610e0b57610e0b615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e8381548110610e4a57610e4a615d51565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609f90609e610e91600185615d3e565b81548110610ea157610ea1615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055610ed08260016159fd565b609f5f609e8581548110610ee657610ee6615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b80610f1681615d7e565b915050610cff565b505b6001600160a01b0384165f81815260a360209081526040918290205482518781529182015281513393927f24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04928290030190a3610f7d333085614992565b60975460ff168015610f905750609b5481115b8015610fb557506099546001600160a01b0385165f908152609f602052604090205411155b15610fc257610fc261478b565b50610a246001606555565b6001600160a01b0381165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b03610860565b61100f614717565b80158061101d575060995481145b15611054576040517f383a648e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff166110a957609e546110ad565b609c545b90505f60995482106110c1576099546110c3565b815b9050609b5481146110d6576110d661478b565b50505050565b6001600160a01b0381165f90815260a66020526040812054609754600f82810b700100000000000000000000000000000000909304900b919091039060ff166111255792915050565b5f5b8181101561119d576001600160a01b0384165f90815260a6602052604081206111509083614c1e565b5f81815260a5602090815260409182902082518084019093528054835260010154908201819052919250906111836134fa565b1015611193575090949350505050565b5050600101611127565b5092915050565b335f818152609f602052604081205490036111eb576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6014821115611226576040517f6e11528c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a1602081815260408084208054825180840184528981526001830180548287019081529789905295855251909155935190925581518681529081018390529192917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a2505050565b5f6112a661490b565b6112ee60a65f335b6001600160a01b03166001600160a01b031681526020019081526020015f2054600f81810b700100000000000000000000000000000000909204900b0390565b5f03611326576040517f5f013ef800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81158061133d575061133a60a65f336112ae565b82115b6113475781611353565b61135360a65f336112ae565b91505f5b82156113fd57335f90815260a66020526040812061137490614cb3565b5f81815260a5602090815260409182902082518084019093528054835260010154908201526097549192509060ff1680156113b9575080602001516113b76134fa565b105b156113c55750506113fd565b335f90815260a6602052604090206113dc90614d2b565b5080516113e990846159fd565b92506113f485615d7e565b94505050611357565b805f03611436576040517f3cc5dedc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611441335b82614de6565b60405181815233907fcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb39060200160405180910390a290506114826001606555565b919050565b60605f8267ffffffffffffffff8111156114a3576114a3615a71565b6040519080825280602002602001820160405280156114ef57816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816114c15790505b5090505f5b838110156116a657604051806060016040528060a05f88888681811061151c5761151c615d51565b905060200201602081019061153191906155b7565b6001600160a01b03908116825260208083019390935260409091015f90812054909116835291019060a09088888681811061156e5761156e615d51565b905060200201602081019061158391906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f2060010154815260200160a05f8888868181106115c0576115c0615d51565b90506020020160208101906115d591906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20600201805461160290615a9e565b80601f016020809104026020016040519081016040528092919081815260200182805461162e90615a9e565b80156116795780601f1061165057610100808354040283529160200191611679565b820191905f5260205f20905b81548152906001019060200180831161165c57829003601f168201915b505050505081525082828151811061169357611693615d51565b60209081029190910101526001016114f4565b509392505050565b6116b6614717565b60975460ff16156116f3576040517fbd51da0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428111158061170d575061170a6201518082615d93565b15155b80611719575060985481145b15611750576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609e546060905f9067ffffffffffffffff8111156117b5576117b5615a71565b60405190808252806020026020018201604052801561180157816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816117d35790505b5090505f5b609e548110156119ab57604051806060016040528060a05f609e858154811061183157611831615d51565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409092018120549092168352609e8054939091019260a09291908690811061187d5761187d615d51565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f2060010154815260200160a05f609e85815481106118d6576118d6615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020600201805461190790615a9e565b80601f016020809104026020016040519081016040528092919081815260200182805461193390615a9e565b801561197e5780601f106119555761010080835404028352916020019161197e565b820191905f5260205f20905b81548152906001019060200180831161196157829003601f168201915b505050505081525082828151811061199857611998615d51565b6020908102919091010152600101611806565b50919050565b5f54610100900460ff16158080156119cf57505f54600160ff909116105b806119e85750303b1580156119e857505f5460ff166001145b611a79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611ad5575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b038716611b15576040517fee77070400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b855f03611b4e576040517f2da55d0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845f03611b87576040517f7d8ad8a800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4284111580611ba15750611b9e6201518085615d93565b15155b15611bd8576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003611c12576040517fbb01aad100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c1b87615063565b611c236150c1565b6099869055609a8590556098849055609b8290555f5b609b54811015611d9457838382818110611c5557611c55615d51565b9050602002810190611c679190615da6565b60a05f868685818110611c7c57611c7c615d51565b9050602002810190611c8e9190615da6565b611c9c9060208101906155b7565b6001600160a01b0316815260208101919091526040015f20611cbe8282615b2d565b905050609e848483818110611cd557611cd5615d51565b9050602002810190611ce79190615da6565b611cf59060208101906155b7565b8154600180820184555f938452602090932001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055611d3e9082906159fd565b609f5f868685818110611d5357611d53615d51565b9050602002810190611d659190615da6565b611d739060208101906155b7565b6001600160a01b0316815260208101919091526040015f2055600101611c39565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a18015611e69575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609e8181548110611e81575f80fd5b5f918252602090912001546001600160a01b0316905081565b611ea261490b565b5f611ead833361515f565b9050805f03611ee8576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81811015611f22576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8215611f2f5782611f31565b815b6001600160a01b0385165f908152609f6020526040812054609754929350159160ff16611f5e575f611f6c565b609a54611f6c9060016159fd565b60408051808201909152848152602081018290529091505f33611f8e336151e5565b60405160609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208301526034820152605401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301205f81815260a590935291205490915015612042576040517fdeeb052700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81815260a560209081526040808320855181558583015160019182015533845260a68352818420805470010000000000000000000000000000000090819004600f0b8087528284019095529290942085905583546fffffffffffffffffffffffffffffffff90811693909101160217905560975460ff16612145576001600160a01b0388165f90815260a460209081526040808320338452909152812080548792906120f0908490615d3e565b90915550506001600160a01b0388165f90815260a360205260408120805487929061211c908490615d3e565b90915550506001600160a01b0388165f90815260a360205260409020805460019091015561221a565b6001600160a01b0388165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612181848a615ce7565b61218b9190615d2b565b6121959082615d3e565b6001600160a01b038c165f81815260a46020908152604080832033845282528083209490945591815260a390915290812080548a92906121d6908490615d3e565b909155508290506121e7848a615ce7565b6121f19190615d2b565b6121fb9084615d3e565b6001600160a01b038c165f90815260a360205260409020600101555050505b6001600160a01b0388165f908152609f602052604090205484158015612242575060975460ff165b801561224f5750609c5481105b156124b0576001600160a01b0389165f908152609f602052604081205461227890600190615d3e565b90505b6001609c5461228a9190615d3e565b8110156124ae5760a35f609e83815481106122a7576122a7615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a390609e6122dc8560016159fd565b815481106122ec576122ec615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205411156124a6575f609e828154811061232a5761232a615d51565b5f918252602090912001546001600160a01b03169050609e61234d8360016159fd565b8154811061235d5761235d615d51565b5f91825260209091200154609e80546001600160a01b03909216918490811061238857612388615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609e6123cb8460016159fd565b815481106123db576123db615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905561241b8260016159fd565b609f5f609e858154811061243157612431615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020556124608260026159fd565b609f5f609e6124708660016159fd565b8154811061248057612480615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b60010161227b565b505b841580156124d357506001600160a01b0389165f90815260a36020526040902054155b156124f0576001609c5f8282546124ea9190615d3e565b90915550505b6001600160a01b0389165f90815260a360205260409020543360408051898152602081018490529081018790526001600160a01b03918216918c16907f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c9060600160405180910390a385158015612569575060975460ff165b80156125775750609b548211155b80156125bd5750609b546001600160a01b038b165f908152609f602052604090205411806125bd5750609c546001600160a01b038b165f908152609f6020526040902054115b156125ca576125ca61478b565b50505050505050506125dc6001606555565b5050565b6001600160a01b0383165f908152609f6020526040812054849103612631576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f908152609f6020526040812054849103612682576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61268a61490b565b5f612695863361515f565b90506126a1863361515f565b5f036126d9576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836126e4873361515f565b101561271c576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8415612729578461272b565b815b6001600160a01b0388165f908152609f6020526040812054609754929350909190159060ff166127dc576001600160a01b0389165f90815260a46020908152604080832033845290915281208054859290612787908490615d3e565b90915550506001600160a01b0389165f90815260a36020526040812080548592906127b3908490615d3e565b90915550506001600160a01b0389165f90815260a36020526040902080546001909101556128b1565b6001600160a01b0389165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612818848c615ce7565b6128229190615d2b565b61282c9082615d3e565b6001600160a01b038d165f81815260a46020908152604080832033845282528083209490945591815260a3909152908120805488929061286d908490615d3e565b9091555082905061287e848c615ce7565b6128889190615d2b565b6128929084615d3e565b6001600160a01b038d165f90815260a360205260409020600101555050505b6001600160a01b0389165f908152609f6020526040902054811580156128d9575060975460ff165b80156128e65750609c5481105b15612b47576001600160a01b038a165f908152609f602052604081205461290f90600190615d3e565b90505b6001609c546129219190615d3e565b811015612b455760a35f609e838154811061293e5761293e615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a390609e6129738560016159fd565b8154811061298357612983615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115612b3d575f609e82815481106129c1576129c1615d51565b5f918252602090912001546001600160a01b03169050609e6129e48360016159fd565b815481106129f4576129f4615d51565b5f91825260209091200154609e80546001600160a01b039092169184908110612a1f57612a1f615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609e612a628460016159fd565b81548110612a7257612a72615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055612ab28260016159fd565b609f5f609e8581548110612ac857612ac8615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055612af78260026159fd565b609f5f609e612b078660016159fd565b81548110612b1757612b17615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b600101612912565b505b81158015612b6a57506001600160a01b038a165f90815260a36020526040902054155b15612b87576001609c5f828254612b819190615d3e565b90915550505b81158015612b97575060975460ff165b8015612ba55750609b548111155b8015612beb5750609b546001600160a01b038b165f908152609f60205260409020541180612beb5750609c546001600160a01b038b165f908152609f6020526040902054115b15612bf557600192505b612c16336001600160a01b038b165f90815260a2602052604090209061497e565b5060975460ff16612ca8576001600160a01b0389165f90815260a46020908152604080832033845290915281208054869290612c539084906159fd565b90915550506001600160a01b0389165f90815260a3602052604081208054869290612c7f9084906159fd565b90915550506001600160a01b0389165f90815260a3602052604090208054600190910155612d7d565b6001600160a01b0389165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612ce4848d615ce7565b612cee9190615d2b565b612cf890826159fd565b6001600160a01b038d165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054899290612d399084906159fd565b90915550829050612d4a848d615ce7565b612d549190615d2b565b612d5e90846159fd565b6001600160a01b038d165f90815260a360205260409020600101555050505b6001600160a01b0389165f90815260a36020526040902054849003612db4576001609c5f828254612dae91906159fd565b90915550505b506001600160a01b0388165f908152609f602052604090205460975460ff168015612ddf5750600181115b15613014575f612df0600183615d3e565b90505b80156130125760a35f609e612e09600185615d3e565b81548110612e1957612e19615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a39290919085908110612e5957612e59615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115613000575f609e612e91600184615d3e565b81548110612ea157612ea1615d51565b5f91825260209091200154609e80546001600160a01b0390921692509083908110612ece57612ece615d51565b5f918252602090912001546001600160a01b0316609e612eef600185615d3e565b81548110612eff57612eff615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e8381548110612f3e57612f3e615d51565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609f90609e612f85600185615d3e565b81548110612f9557612f95615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055612fc48260016159fd565b609f5f609e8581548110612fda57612fda615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b8061300a81615d7e565b915050612df3565b505b60975460ff1680156130275750609b5481115b801561304c57506099546001600160a01b038a165f908152609f602052604090205411155b1561305657600192505b82156130645761306461478b565b6001600160a01b038a81165f81815260a36020908152604080832054948e16808452928190205481518a8152928301869052908201819052923392917ffdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b49060600160405180910390a4505050505050506130de6001606555565b5050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156131cd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa15801561319e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131c29190615de2565b6001600160a01b0316145b61086e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611a70565b613261614717565b61326a5f615063565b565b613274614717565b6098544210156132b0576040517f080bb11a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609c545f036132eb576040517fd7d776cb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609e54811015613497575f5b8181101561348e5760a35f609e838154811061334457613344615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a3929091908690811061338457613384615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115613486575f609e82815481106133c2576133c2615d51565b5f91825260209091200154609e80546001600160a01b03909216925090849081106133ef576133ef615d51565b5f91825260209091200154609e80546001600160a01b03909216918490811061341a5761341a615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e848154811061345957613459615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550505b600101613326565b5060010161331a565b505f5b609e548110156134f1576134af8160016159fd565b609f5f609e84815481106134c5576134c5615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205560010161349a565b5061326a61478b565b5f609854421015613537576040517fd021716f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62015180609854426135499190615d3e565b6135539190615d2b565b905090565b6001600160a01b0381165f90815260a76020526040812054610860565b6001600160a01b0381165f90815260a4602090815260408083203384529091528120541515610860565b60a06020525f90815260409020805460018201546002830180546001600160a01b039093169391926135d090615a9e565b80601f01602080910402602001604051908101604052809291908181526020018280546135fc90615a9e565b80156136475780601f1061361e57610100808354040283529160200191613647565b820191905f5260205f20905b81548152906001019060200180831161362a57829003601f168201915b5050505050905083565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146136b3576040517f4032cbb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60aa5415613852575f5b6136c760a861470e565b811015613850575f60a1816136dd60a88561520a565b6001600160a01b0316815260208101919091526040015f9081205460aa5490925060ab8261370c60a88761520a565b6001600160a01b0316815260208101919091526040015f205461372f9086615ce7565b6137399190615d2b565b90505f60646137488484615ce7565b6137529190615d2b565b90505f61375f8284615d3e565b90508160a15f61377060a88961520a565b6001600160a01b03166001600160a01b031681526020019081526020015f206001015f8282546137a091906159fd565b9091555081905060a35f6137b560a88961520a565b6001600160a01b03166001600160a01b031681526020019081526020015f205f015f8282546137e491906159fd565b909155506137f5905060a88661520a565b6001600160a01b03167f60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d88284604051613838929190918252602082015260400190565b60405180910390a25050600190920191506136bd9050565b505b5f61385d60a861470e565b90505f5b818110156138c15760ab5f61387760a88261520a565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90556138b86138b05f60a861520a90919063ffffffff16565b60a890615215565b50600101613861565b50505f60aa5550565b5f6138d5838361515f565b9392505050565b6001600160a01b0382165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b035f0361391e57505f610860565b81158061395e57506001600160a01b0383165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b0382115b613968578161399e565b6001600160a01b0383165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b035b91505f805b838110156116a6576001600160a01b0385165f90815260a6602052604081206139cc9083614c1e565b5f81815260a56020908152604091829020825180840190935280548084526001909101549183019190915291925090613a0590856159fd565b935050508060010190506139a3565b604080518082019091525f80825260208201526001600160a01b0383165f90815260a660205260408120613a489084614c1e565b5f90815260a560209081526040918290208251808401909352805483526001015490820152949350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015613b5d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b529190615de2565b6001600160a01b0316145b613be9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611a70565b82609d548114613c25576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613c308460016159fd565b609d555f805b83811015613f8f57609b54609f5f878785818110613c5657613c56615d51565b9050602002016020810190613c6b91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205411613c9557600191505b5f609f5f878785818110613cab57613cab615d51565b9050602002016020810190613cc091906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115613f11575f6001609f5f888886818110613cfe57613cfe615d51565b9050602002016020810190613d1391906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f2054613d3d9190615d3e565b90505b609e54613d4f90600190615d3e565b811015613e2157609e613d638260016159fd565b81548110613d7357613d73615d51565b5f91825260209091200154609e80546001600160a01b039092169183908110613d9e57613d9e615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609f5f609e8481548110613de157613de1615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400181208054909190613e14908490615d3e565b9091555050600101613d40565b50609e805480613e3357613e33615dfd565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609f90868684818110613e7857613e78615d51565b9050602002016020810190613e8d91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a35f878785818110613ec557613ec5615d51565b9050602002016020810190613eda91906155b7565b6001600160a01b0316815260208101919091526040015f20541115613f11576001609c5f828254613f0b9190615d3e565b90915550505b60a05f868684818110613f2657613f26615d51565b9050602002016020810190613f3b91906155b7565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590613f85600283018261555d565b5050600101613c36565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f618484604051613fc1929190615e2a565b60405180910390a180156130de576130de61478b565b5f6060835f03614013576040517f89076b3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385165f90815260a2602052604090206140339061470e565b91508367ffffffffffffffff81111561404e5761404e615a71565b604051908082528060200260200182016040528015614077578160200160208202803683370190505b5090505f6140858486615ce7565b90505f600161409486826159fd565b61409e9088615ce7565b6140a89190615d3e565b90506140b5600185615d3e565b8111156140ca576140c7600185615d3e565b90505b815f5b82821161414357614101826140e181615e77565b6001600160a01b038c165f90815260a2602052604090209094509061520a565b858261410c81615e77565b93508151811061411e5761411e615d51565b60200260200101906001600160a01b031690816001600160a01b0316815250506140cd565b50505050935093915050565b614157614717565b6001600160a01b0381166141ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401611a70565b6141f681615063565b50565b61420161490b565b335f90815260a16020526040812060010154900361424b576040517f5426dfcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a16020526040812060010180549190559061426b9061143b565b60405181815233907f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e4119060200160405180910390a25061326a6001606555565b6142b3614717565b82609d5481146142ef576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142fa8460016159fd565b609d555f805b83811015613f8f57609b54609f5f87878581811061432057614320615d51565b905060200201602081019061433591906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20541161435f57600191505b5f609f5f87878581811061437557614375615d51565b905060200201602081019061438a91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156145db575f6001609f5f8888868181106143c8576143c8615d51565b90506020020160208101906143dd91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20546144079190615d3e565b90505b609e5461441990600190615d3e565b8110156144eb57609e61442d8260016159fd565b8154811061443d5761443d615d51565b5f91825260209091200154609e80546001600160a01b03909216918390811061446857614468615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609f5f609e84815481106144ab576144ab615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812080549091906144de908490615d3e565b909155505060010161440a565b50609e8054806144fd576144fd615dfd565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609f9086868481811061454257614542615d51565b905060200201602081019061455791906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a35f87878581811061458f5761458f615d51565b90506020020160208101906145a491906155b7565b6001600160a01b0316815260208101919091526040015f205411156145db576001609c5f8282546145d59190615d3e565b90915550505b60a05f8686848181106145f0576145f0615d51565b905060200201602081019061460591906155b7565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff19168155600181018290559061464f600283018261555d565b5050600101614300565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146146bb576040517f52d033bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6146c660a88261497e565b50600160aa5f8282546146d991906159fd565b90915550506001600160a01b0381165f90815260ab602052604081208054600192906147069084906159fd565b909155505050565b5f610860825490565b6033546001600160a01b0316331461326a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611a70565b60995460975460ff16156147af57609954609c5410156147aa5750609c545b6147c0565b609954609e5410156147c05750609e545b5f8167ffffffffffffffff8111156147da576147da615a71565b604051908082528060200260200182016040528015614803578160200160208202803683370190505b5090505f5b8281101561487057609e818154811061482357614823615d51565b905f5260205f20015f9054906101000a90046001600160a01b031682828151811061485057614850615d51565b6001600160a01b0390921660209283029190910190910152600101614808565b506040517f9b8201a40000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639b8201a4906148d6908490600401615e8f565b5f604051808303815f87803b1580156148ed575f80fd5b505af11580156148ff573d5f803e3d5ffd5b50509151609b55505050565b600260655403614977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611a70565b6002606555565b5f6138d5836001600160a01b038416615229565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614a379190615ea1565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015614ac9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614aed9190615eb8565b614b23576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614bc89190615ea1565b9050821580614be0575082614bdd8383615d3e565b14155b156130de576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606555565b5f80614c40614c2c84615275565b8554614c3b9190600f0b615ed7565b61532a565b84549091507001000000000000000000000000000000009004600f90810b9082900b12614c99576040517fb4120f1400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f0b5f9081526001939093016020525050604090205490565b5f614cda8254600f81810b700100000000000000000000000000000000909204900b131590565b15614d11576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f9081526001909101602052604090205490565b5f614d528254600f81810b700100000000000000000000000000000000909204900b131590565b15614d89576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f818152600180840160205260408220805492905583547fffffffffffffffffffffffffffffffff000000000000000000000000000000001692016fffffffffffffffffffffffffffffffff169190911790915590565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614e67573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614e8b9190615ea1565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af1158015614f15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614f399190615eb8565b614f6f576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614ff0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906150149190615ea1565b905082158061502c5750826150298383615d3e565b14155b156110d6576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff16615157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611a70565b61326a6153be565b6001600160a01b038083165f90815260a460209081526040808320938516835292905290812054156151dd576001600160a01b038084165f81815260a360208181526040808420600181015460a48452828620978a168652968352908420549490935252546151ce9190615ce7565b6151d89190615d2b565b6138d5565b505f92915050565b6001600160a01b0381165f90815260a7602052604090208054600181018255906119ab565b5f6138d58383615454565b5f6138d5836001600160a01b03841661547a565b5f81815260018301602052604081205461526e57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610860565b505f610860565b5f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115615326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e743235360000000000000000000000000000000000000000000000006064820152608401611a70565b5090565b80600f81900b8114611482576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401611a70565b5f54610100900460ff16614c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611a70565b5f825f01828154811061546957615469615d51565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015615554575f61549c600183615d3e565b85549091505f906154af90600190615d3e565b905081811461550e575f865f0182815481106154cd576154cd615d51565b905f5260205f200154905080875f0184815481106154ed576154ed615d51565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061551f5761551f615dfd565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610860565b5f915050610860565b50805461556990615a9e565b5f825580601f10615578575050565b601f0160209004905f5260205f20908101906141f691905b80821115615326575f8155600101615590565b6001600160a01b03811681146141f6575f80fd5b5f602082840312156155c7575f80fd5b81356138d5816155a3565b5f80604083850312156155e3575f80fd5b82359150602083013567ffffffffffffffff811115615600575f80fd5b830160608186031215615611575f80fd5b809150509250929050565b5f806040838503121561562d575f80fd5b8235615638816155a3565b946020939093013593505050565b5f60208284031215615656575f80fd5b5035919050565b5f8083601f84011261566d575f80fd5b50813567ffffffffffffffff811115615684575f80fd5b6020830191508360208260051b850101111561569e575f80fd5b9250929050565b5f80602083850312156156b6575f80fd5b823567ffffffffffffffff8111156156cc575f80fd5b6156d88582860161565d565b90969095509350505050565b5f81518084525f5b81811015615708576020818501810151868301820152016156ec565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b838110156157dd578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0018552815180516001600160a01b03168452878101518885015286015160608785018190526157c9818601836156e4565b96890196945050509086019060010161576c565b509098975050505050505050565b5f80604083850312156157fc575f80fd5b8235615807816155a3565b91506020830135615611816155a3565b5f805f805f8060a0878903121561582c575f80fd5b8635615837816155a3565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115615867575f80fd5b61587389828a0161565d565b979a9699509497509295939492505050565b5f805f60608486031215615897575f80fd5b83356158a2816155a3565b925060208401356158b2816155a3565b929592945050506040919091013590565b6001600160a01b0384168152826020820152606060408201525f6158ea60608301846156e4565b95945050505050565b5f805f60408486031215615905575f80fd5b83359250602084013567ffffffffffffffff811115615922575f80fd5b61592e8682870161565d565b9497909650939450505050565b5f805f6060848603121561594d575f80fd5b8335615958816155a3565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b838110156159a55781516001600160a01b031687529582019590820190600101615980565b509495945050505050565b828152604060208201525f6159c8604083018461596d565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610860576108606159d0565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112615a43575f80fd5b83018035915067ffffffffffffffff821115615a5d575f80fd5b60200191503681900382131561569e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c90821680615ab257607f821691505b6020821081036119ab577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f821115610a2457805f5260205f20601f840160051c81016020851015615b0e5750805b601f840160051c820191505b818110156130de575f8155600101615b1a565b8135615b38816155a3565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112615ba4575f80fd5b8501803567ffffffffffffffff811115615bbc575f80fd5b8036038483011315615bcc575f80fd5b615be081615bda8554615a9e565b85615ae9565b5f601f821160018114615c13575f8315615bfc57508382018601355b5f19600385901b1c1916600184901b178555615c89565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b82811015615c5f57868501890135825593880193908901908801615c40565b5084821015615c7d575f1960f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b8082028115828204841417610860576108606159d0565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82615d3957615d39615cfe565b500490565b81810381811115610860576108606159d0565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81615d8c57615d8c6159d0565b505f190190565b5f82615da157615da1615cfe565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112615dd8575f80fd5b9190910192915050565b5f60208284031215615df2575f80fd5b81516138d5816155a3565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015615e6c578235615e51816155a3565b6001600160a01b031682529183019190830190600101615e3e565b509695505050505050565b5f5f198203615e8857615e886159d0565b5060010190565b602081525f6138d5602083018461596d565b5f60208284031215615eb1575f80fd5b5051919050565b5f60208284031215615ec8575f80fd5b815180151581146138d5575f80fd5b8082018281125f831280158216821582161715615ef657615ef66159d0565b50509291505056fea164736f6c6343000818000a diff --git a/bindings/bin/morphtoken_deployed.hex b/bindings/bin/morphtoken_deployed.hex index 77b8c97a8..ea4f4a938 100644 --- a/bindings/bin/morphtoken_deployed.hex +++ b/bindings/bin/morphtoken_deployed.hex @@ -1 +1 @@ -0x608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e8578063a29bfb2c11610093578063c553f7b31161006e578063c553f7b3146103c5578063cd4281d0146103cd578063dd62ed3e146103f4578063f2fde38b14610439575f80fd5b8063a29bfb2c1461038c578063a457c2d71461039f578063a9059cbb146103b2575f80fd5b80638da5cb5b116100c35780638da5cb5b14610347578063944fa7461461036557806395d89b4114610384575f80fd5b8063715018a614610305578063748231321461030d578063807de44314610320575f80fd5b8063395093511161014857806342966c681161012357806342966c681461028f5780636d0c4a26146102a257806370a08231146102d0575f80fd5b8063395093511461021b5780633d9353fe1461022e578063405abb411461027a575f80fd5b806318160ddd1161017857806318160ddd146101f157806323b872dd146101f9578063313ce5671461020c575f80fd5b806306fdde031461019e578063095ea7b3146101bc5780630b88a984146101df575b5f80fd5b6101a661044c565b6040516101b391906115d5565b60405180910390f35b6101cf6101ca366004611667565b6104dc565b60405190151581526020016101b3565b606c545b6040519081526020016101b3565b6067546101e3565b6101cf61020736600461168f565b6104f5565b604051601281526020016101b3565b6101cf610229366004611667565b610518565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b3565b61028d6102883660046116c8565b610563565b005b61028d61029d3660046116e8565b61075e565b6102b56102b03660046116e8565b6107c2565b604080518251815260209283015192810192909252016101b3565b6101e36102de3660046116ff565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61028d610819565b61028d61031b3660046117f3565b61082c565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610255565b6101e36103733660046116e8565b5f908152606b602052604090205490565b6101a6610a68565b61028d61039a3660046116e8565b610a77565b6101cf6103ad366004611667565b610dbb565b6101cf6103c0366004611667565b610e4b565b606a546101e3565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b6101e3610402366004611873565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61028d6104473660046116ff565b610e58565b60606065805461045b906118a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610487906118a4565b80156104d25780601f106104a9576101008083540402835291602001916104d2565b820191905f5260205f20905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b5f336104e9818585610ef2565b60019150505b92915050565b5f33610502858285611026565b61050d8585856110e2565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104e9908290869061055e908790611922565b610ef2565b61056b611297565b606a805483919061057e90600190611935565b8154811061058e5761058e611948565b905f5260205f2090600202015f0154036106155760405162461bcd60e51b815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f737420726174650000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b606a805461062590600190611935565b8154811061063557610635611948565b905f5260205f2090600202016001015481116106b95760405162461bcd60e51b815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f72650000000000000000000000000000606482015260840161060c565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b610766611297565b5f81116107b55760405162461bcd60e51b815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f00000000000000000000604482015260640161060c565b6107bf33826112fe565b50565b604080518082019091525f8082526020820152606a82815481106107e8576107e8611948565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b610821611297565b61082a5f611486565b565b5f54610100900460ff161580801561084a57505f54600160ff909116105b806108635750303b15801561086357505f5460ff166001145b6108d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060c565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610931575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b606561093d87826119c1565b50606661094a86826119c1565b5061095584846114fc565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909101556109d284611486565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610a60575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60606066805461045b906118a4565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614610afc5760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f77656400000000604482015260640161060c565b807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8a9190611ad9565b11610bfd5760405162461bcd60e51b815260206004820152602b60248201527f746865207370656369666965642074696d6520686173206e6f7420796574206260448201527f65656e2072656163686564000000000000000000000000000000000000000000606482015260840161060c565b606c54811015610c4f5760405162461bcd60e51b815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e7465640000000000000000000000604482015260640161060c565b606c545b818111610da9575f606a5f81548110610c6e57610c6e611948565b5f9182526020822060029091020154606a54909250610c8f90600190611935565b90505b8015610cfc5782606a8281548110610cac57610cac611948565b905f5260205f2090600202016001015411610cea57606a8181548110610cd457610cd4611948565b905f5260205f2090600202015f01549150610cfc565b80610cf481611af0565b915050610c92565b505f662386f26fc1000082606754610d149190611b24565b610d1e9190611b3b565b5f848152606b602052604090208190559050610d5a7f0000000000000000000000000000000000000000000000000000000000000000826114fc565b827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa32782604051610d8c91815260200190565b60405180910390a250508080610da190611b73565b915050610c53565b50610db5816001611922565b606c5550565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610e3e5760405162461bcd60e51b815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f0000604482015260640161060c565b61050d8286868403610ef2565b5f336104e98185856110e2565b610e60611297565b73ffffffffffffffffffffffffffffffffffffffff8116610ee95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161060c565b6107bf81611486565b73ffffffffffffffffffffffffffffffffffffffff8316610f555760405162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f2061646472657373000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8216610fb85760405162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f20616464726573730000000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110dc57818110156110cf5760405162461bcd60e51b815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e636500000000000000000000604482015260640161060c565b6110dc8484848403610ef2565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166111455760405162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f20616464726573730000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff82166111a85760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f206164647265737300000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff83165f908152606860205260409020548181101561121d5760405162461bcd60e51b815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112899086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff16331461082a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff82166113875760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161060c565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156114225760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161060c565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101611019565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b73ffffffffffffffffffffffffffffffffffffffff821661155f5760405162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f20616464726573730000000000000000604482015260640161060c565b8060675f8282546115709190611922565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f602080835283518060208501525f5b81811015611601578581018301518582016040015282016115e5565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611662575f80fd5b919050565b5f8060408385031215611678575f80fd5b6116818361163f565b946020939093013593505050565b5f805f606084860312156116a1575f80fd5b6116aa8461163f565b92506116b86020850161163f565b9150604084013590509250925092565b5f80604083850312156116d9575f80fd5b50508035926020909101359150565b5f602082840312156116f8575f80fd5b5035919050565b5f6020828403121561170f575f80fd5b6117188261163f565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f83011261175b575f80fd5b813567ffffffffffffffff808211156117765761177661171f565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156117bc576117bc61171f565b816040528381528660208588010111156117d4575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a08688031215611807575f80fd5b853567ffffffffffffffff8082111561181e575f80fd5b61182a89838a0161174c565b9650602088013591508082111561183f575f80fd5b5061184c8882890161174c565b94505061185b6040870161163f565b94979396509394606081013594506080013592915050565b5f8060408385031215611884575f80fd5b61188d8361163f565b915061189b6020840161163f565b90509250929050565b600181811c908216806118b857607f821691505b6020821081036118ef577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156104ef576104ef6118f5565b818103818111156104ef576104ef6118f5565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b601f8211156119bc57805f5260205f20601f840160051c8101602085101561199a5750805b601f840160051c820191505b818110156119b9575f81556001016119a6565b50505b505050565b815167ffffffffffffffff8111156119db576119db61171f565b6119ef816119e984546118a4565b84611975565b602080601f831160018114611a41575f8415611a0b5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610a60565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611a8d57888601518255948401946001909101908401611a6e565b5085821015611ac957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215611ae9575f80fd5b5051919050565b5f81611afe57611afe6118f5565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b80820281158282048414176104ef576104ef6118f5565b5f82611b6e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ba357611ba36118f5565b506001019056fea164736f6c6343000818000a +0x608060405234801561000f575f80fd5b506004361061018f575f3560e01c806370a08231116100dd57806395d89b4111610088578063c553f7b311610063578063c553f7b3146103af578063dd62ed3e146103b7578063f2fde38b146103fc575f80fd5b806395d89b4114610381578063a457c2d714610389578063a9059cbb1461039c575f80fd5b8063807de443116100b8578063807de4431461031d5780638da5cb5b14610344578063944fa74614610362575f80fd5b806370a08231146102cd578063715018a614610302578063748231321461030a575f80fd5b8063313ce5671161013d578063405abb4111610118578063405abb411461027957806342966c681461028c5780636d0c4a261461029f575f80fd5b8063313ce5671461020b5780633434735f1461021a5780633950935114610266575f80fd5b80630b88a9841161016d5780630b88a984146101de57806318160ddd146101f057806323b872dd146101f8575f80fd5b806303d9c2e31461019357806306fdde031461019d578063095ea7b3146101bb575b5f80fd5b61019b61040f565b005b6101a5610869565b6040516101b291906116a9565b60405180910390f35b6101ce6101c936600461173b565b6108f9565b60405190151581526020016101b2565b606c545b6040519081526020016101b2565b6067546101e2565b6101ce610206366004611763565b610912565b604051601281526020016101b2565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b6101ce61027436600461173b565b610935565b61019b61028736600461179c565b610980565b61019b61029a3660046117bc565b610b76565b6102b26102ad3660046117bc565b610bda565b604080518251815260209283015192810192909252016101b2565b6101e26102db3660046117d3565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61019b610c31565b61019b6103183660046118c7565b610c44565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610241565b6101e26103703660046117bc565b5f908152606b602052604090205490565b6101a5610e80565b6101ce61039736600461173b565b610e8f565b6101ce6103aa36600461173b565b610f1f565b606a546101e2565b6101e26103c5366004611947565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61019b61040a3660046117d3565b610f2c565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146104995760405162461bcd60e51b815260206004820152601b60248201527f6f6e6c792073797374656d206164647265737320616c6c6f776564000000000060448201526064015b60405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610503573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105279190611978565b116105745760405162461bcd60e51b815260206004820152601160248201527f6e6f20696e666c6174696f6e73207965740000000000000000000000000000006044820152606401610490565b5f60017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106049190611978565b61060e91906119bc565b9050606c548110156106625760405162461bcd60e51b815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e74656400000000000000000000006044820152606401610490565b606c545b818111610857575f606a5f81548110610681576106816119cf565b5f9182526020822060029091020154606a549092506106a2906001906119bc565b90505b801561070f5782606a82815481106106bf576106bf6119cf565b905f5260205f20906002020160010154116106fd57606a81815481106106e7576106e76119cf565b905f5260205f2090600202015f0154915061070f565b80610707816119fc565b9150506106a5565b505f662386f26fc10000826067546107279190611a30565b6107319190611a47565b5f848152606b60205260409020819055905061076d7f000000000000000000000000000000000000000000000000000000000000000082610fc6565b6040517f91c05b0b000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906391c05b0b906024015f604051808303815f87803b1580156107f2575f80fd5b505af1158015610804573d5f803e3d5ffd5b50505050827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa3278260405161083a91815260200190565b60405180910390a25050808061084f90611a7f565b915050610666565b50610863816001611ab6565b606c5550565b60606065805461087890611ac9565b80601f01602080910402602001604051908101604052809291908181526020018280546108a490611ac9565b80156108ef5780601f106108c6576101008083540402835291602001916108ef565b820191905f5260205f20905b8154815290600101906020018083116108d257829003601f168201915b5050505050905090565b5f3361090681858561109f565b60019150505b92915050565b5f3361091f8582856111d3565b61092a85858561128f565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610906908290869061097b908790611ab6565b61109f565b610988611444565b606a805483919061099b906001906119bc565b815481106109ab576109ab6119cf565b905f5260205f2090600202015f015403610a2d5760405162461bcd60e51b815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f73742072617465000000000000000000000000000000000000000000000000006064820152608401610490565b606a8054610a3d906001906119bc565b81548110610a4d57610a4d6119cf565b905f5260205f209060020201600101548111610ad15760405162461bcd60e51b815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f726500000000000000000000000000006064820152608401610490565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b610b7e611444565b5f8111610bcd5760405162461bcd60e51b815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f000000000000000000006044820152606401610490565b610bd733826114ab565b50565b604080518082019091525f8082526020820152606a8281548110610c0057610c006119cf565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b610c39611444565b610c425f611633565b565b5f54610100900460ff1615808015610c6257505f54600160ff909116105b80610c7b5750303b158015610c7b57505f5460ff166001145b610ced5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d49575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6065610d558782611b66565b506066610d628682611b66565b50610d6d8484610fc6565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5290910155610dea84611633565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610e78575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60606066805461087890611ac9565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610f125760405162461bcd60e51b815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f00006044820152606401610490565b61092a828686840361109f565b5f3361090681858561128f565b610f34611444565b73ffffffffffffffffffffffffffffffffffffffff8116610fbd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610490565b610bd781611633565b73ffffffffffffffffffffffffffffffffffffffff82166110295760405162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610490565b8060675f82825461103a9190611ab6565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff83166111025760405162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f20616464726573730000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166111655760405162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f206164647265737300000000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611289578181101561127c5760405162461bcd60e51b815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e6365000000000000000000006044820152606401610490565b611289848484840361109f565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166112f25760405162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166113555760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260686020526040902054818110156113ca5760405162461bcd60e51b815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114369086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166115345760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610490565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156115cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610490565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016111c6565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f602080835283518060208501525f5b818110156116d5578581018301518582016040015282016116b9565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611736575f80fd5b919050565b5f806040838503121561174c575f80fd5b61175583611713565b946020939093013593505050565b5f805f60608486031215611775575f80fd5b61177e84611713565b925061178c60208501611713565b9150604084013590509250925092565b5f80604083850312156117ad575f80fd5b50508035926020909101359150565b5f602082840312156117cc575f80fd5b5035919050565b5f602082840312156117e3575f80fd5b6117ec82611713565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f83011261182f575f80fd5b813567ffffffffffffffff8082111561184a5761184a6117f3565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611890576118906117f3565b816040528381528660208588010111156118a8575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a086880312156118db575f80fd5b853567ffffffffffffffff808211156118f2575f80fd5b6118fe89838a01611820565b96506020880135915080821115611913575f80fd5b5061192088828901611820565b94505061192f60408701611713565b94979396509394606081013594506080013592915050565b5f8060408385031215611958575f80fd5b61196183611713565b915061196f60208401611713565b90509250929050565b5f60208284031215611988575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181038181111561090c5761090c61198f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81611a0a57611a0a61198f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b808202811582820484141761090c5761090c61198f565b5f82611a7a577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611aaf57611aaf61198f565b5060010190565b8082018082111561090c5761090c61198f565b600181811c90821680611add57607f821691505b602082108103611b14577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b601f821115611b6157805f5260205f20601f840160051c81016020851015611b3f5750805b601f840160051c820191505b81811015611b5e575f8155600101611b4b565b50505b505050565b815167ffffffffffffffff811115611b8057611b806117f3565b611b9481611b8e8454611ac9565b84611b1a565b602080601f831160018114611be6575f8415611bb05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610e78565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611c3257888601518255948401946001909101908401611c13565b5085821015611c6e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000818000a diff --git a/bindings/bin/record_deployed.hex b/bindings/bin/record_deployed.hex deleted file mode 100644 index 084d14f48..000000000 --- a/bindings/bin/record_deployed.hex +++ /dev/null @@ -1 +0,0 @@ -0x608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e85780638e21d5fb11610093578063cb6293e81161006e578063cb6293e8146104e3578063d557714114610503578063f2fde38b1461052a578063fe49dbc91461053d575f80fd5b80638e21d5fb146103f1578063a24231e814610418578063a795f409146104a8575f80fd5b80637dc0d1d0116100c35780637dc0d1d01461038c578063807de443146103ac5780638da5cb5b146103d3575f80fd5b8063715018a6146102c25780637828a905146102ca57806378f908e1146102f1575f80fd5b806341ed047f116101485780634e3ca406116101235780634e3ca4061461026f57806364b4abe31461028f5780636ea0396e146102af575f80fd5b806341ed047f14610240578063484f8d0f146102535780634c69c00f1461025c575f80fd5b80631794bb3c116101785780631794bb3c146101d85780632fbf6487146101eb5780633d9353fe146101f4575f80fd5b80630776c0f71461019e57806310c9873f146101ba5780631511e1b1146101cf575b5f80fd5b6101a7606c5481565b6040519081526020015b60405180910390f35b6101cd6101c83660046125b9565b610550565b005b6101a760695481565b6101cd6101e63660046125f8565b610676565b6101a7606b5481565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b1565b6101cd61024e366004612631565b61096c565b6101a7606a5481565b6101cd61026a3660046126a0565b610cab565b61028261027d3660046126c0565b610d5d565b6040516101b191906126e0565b6102a261029d3660046126c0565b610ef5565b6040516101b19190612763565b6101cd6102bd3660046127e3565b611096565b6101cd611d98565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61034a6102ff3660046125b9565b60666020525f9081526040902080546001820154600283015460038401546004850154600590950154939473ffffffffffffffffffffffffffffffffffffffff909316939192909186565b6040805196875273ffffffffffffffffffffffffffffffffffffffff9095166020870152938501929092526060840152608083015260a082015260c0016101b1565b60655461021b9073ffffffffffffffffffffffffffffffffffffffff1681565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff1661021b565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61046b6104263660046125b9565b60676020525f908152604090208054600182015460028301546003840154600490940154929373ffffffffffffffffffffffffffffffffffffffff9092169290919085565b6040805195865273ffffffffffffffffffffffffffffffffffffffff9094166020860152928401919091526060830152608082015260a0016101b1565b6104ce6104b63660046125b9565b60686020525f90815260409020805460019091015482565b604080519283526020830191909152016101b1565b6104f66104f13660046126c0565b611dab565b6040516101b1919061287a565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b6101cd6105383660046126a0565b61205f565b6101cd61054b3660046129a8565b6120fc565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105d25760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064015b60405180910390fd5b606c54156106225760405162461bcd60e51b815260206004820152600b60248201527f616c72656164792073657400000000000000000000000000000000000000000060448201526064016105c9565b5f81116106715760405162461bcd60e51b815260206004820152601460248201527f696e76616c6964206c617465737420626c6f636b00000000000000000000000060448201526064016105c9565b606c55565b5f54610100900460ff161580801561069457505f54600160ff909116105b806106ad5750303b1580156106ad57505f5460ff166001145b61071f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105c9565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561077b575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff84166107de5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016105c9565b815f036108535760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964206e657874206261746368207375626d697373696f6e20696e60448201527f646578000000000000000000000000000000000000000000000000000000000060648201526084016105c9565b73ffffffffffffffffffffffffffffffffffffffff83166108b65760405162461bcd60e51b815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105c9565b6108bf84612407565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851617905560698290558015610966575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109e95760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b80610a365760405162461bcd60e51b815260206004820152601760248201527f656d707479206261746368207375626d697373696f6e7300000000000000000060448201526064016105c9565b5f5b81811015610c575780606954610a4e9190612a32565b838383818110610a6057610a60612a4b565b905060c002015f013514610ab65760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b6040518060c00160405280848484818110610ad357610ad3612a4b565b905060c002015f01358152602001848484818110610af357610af3612a4b565b905060c002016020016020810190610b0b91906126a0565b73ffffffffffffffffffffffffffffffffffffffff168152602001848484818110610b3857610b38612a4b565b905060c00201604001358152602001848484818110610b5957610b59612a4b565b905060c00201606001358152602001848484818110610b7a57610b7a612a4b565b905060c00201608001358152602001848484818110610b9b57610b9b612a4b565b905060c0020160a0013581525060665f858585818110610bbd57610bbd612a4b565b60c002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155908301516002830155606083015160038301556080830151600483015560a09092015160059091015501610a38565b506069546040518281527f1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e9060200160405180910390a28181905060695f828254610ca29190612a32565b90915550505050565b610cb361247d565b73ffffffffffffffffffffffffffffffffffffffff8116610d165760405162461bcd60e51b815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105c9565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606082821015610daf5760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b610db98383612a78565b610dc4906001612a32565b67ffffffffffffffff811115610ddc57610ddc612a8b565b604051908082528060200260200182016040528015610e5057816020015b610e3d6040518060a001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81525090565b815260200190600190039081610dfa5790505b509050825b828111610eee575f81815260676020908152604091829020825160a08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff16928101929092526002810154928201929092526003820154606082015260049091015460808201528251839083908110610ed057610ed0612a4b565b60200260200101819052508080610ee690612ab8565b915050610e55565b5092915050565b606082821015610f475760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b610f518383612a78565b610f5c906001612a32565b67ffffffffffffffff811115610f7457610f74612a8b565b604051908082528060200260200182016040528015610fee57816020015b610fdb6040518060c001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f81525090565b815260200190600190039081610f925790505b509050825b828111610eee575f81815260666020908152604091829020825160c08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff1692810192909252600281015492820192909252600382015460608201526004820154608082015260059091015460a0820152825183908390811061107857611078612a4b565b6020026020010181905250808061108e90612ab8565b915050610ff3565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111135760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b806111605760405162461bcd60e51b815260206004820152601360248201527f656d707479207265776172642065706f6368730000000000000000000000000060448201526064016105c9565b5f606c54116111b15760405162461bcd60e51b815260206004820152601960248201527f737461727420626c6f636b2073686f756c64206265207365740000000000000060448201526064016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561121a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061123e9190612aef565b606b5460019061124f908490612a32565b6112599190612a78565b106112cb5760405162461bcd60e51b8152602060048201526024808201527f756e66696e69736865642065706f6368732063616e6e6f742062652075706c6f60448201527f616465640000000000000000000000000000000000000000000000000000000060648201526084016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a29bfb2c600184849050606b5461131a9190612a32565b6113249190612a78565b6040518263ffffffff1660e01b815260040161134291815260200190565b5f604051808303815f87803b158015611359575f80fd5b505af115801561136b573d5f803e3d5ffd5b505f9250829150505b82811015611d2d575f84848381811061138f5761138f612a4b565b90506020028101906113a19190612b06565b6113af906040810190612b42565b905090505f8585848181106113c6576113c6612a4b565b90506020028101906113d89190612b06565b606b54903591506113ea908490612a32565b81146114385760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642065706f636820696e6465780000000000000000000000000060448201526064016105c9565b8186868581811061144b5761144b612a4b565b905060200281019061145d9190612b06565b61146b906060810190612b42565b90501480156114ac57508186868581811061148857611488612a4b565b905060200281019061149a9190612b06565b6114a8906080810190612b42565b9050145b80156114ea5750818686858181106114c6576114c6612a4b565b90506020028101906114d89190612b06565b6114e69060a0810190612b42565b9050145b6115365760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642064617461206c656e6774680000000000000000000000000060448201526064016105c9565b85858481811061154857611548612a4b565b905060200281019061155a9190612b06565b611568906020013585612a32565b93506040518060c0016040528082815260200187878681811061158d5761158d612a4b565b905060200281019061159f9190612b06565b6020013581526020018787868181106115ba576115ba612a4b565b90506020028101906115cc9190612b06565b6115da906040810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061162257611622612a4b565b90506020028101906116349190612b06565b611642906060810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061168a5761168a612a4b565b905060200281019061169c9190612b06565b6116aa906080810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152505050908252506020018787868181106116f2576116f2612a4b565b90506020028101906117049190612b06565b6117129060a0810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f920182905250939094525050838152606860209081526040918290208451815584820151600182015591840151805192935061177d92600285019291909101906124e4565b506060820151805161179991600384019160209091019061256c565b50608082015180516117b591600484019160209091019061256c565b5060a082015180516117d191600584019160209091019061256c565b50506040517f944fa746000000000000000000000000000000000000000000000000000000008152600481018390525f91507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063944fa74690602401602060405180830381865afa15801561185f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118839190612aef565b90505f805f8567ffffffffffffffff8111156118a1576118a1612a8b565b6040519080825280602002602001820160405280156118ca578160200160208202803683370190505b5090505f8667ffffffffffffffff8111156118e7576118e7612a8b565b604051908082528060200260200182016040528015611910578160200160208202803683370190505b5090505f5b87811015611b915760148c8c8b81811061193157611931612a4b565b90506020028101906119439190612b06565b6119519060a0810190612b42565b8381811061196157611961612a4b565b9050602002013511156119b65760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642073657175656e6365727320636f6d6d697373696f6e00000060448201526064016105c9565b8b8b8a8181106119c8576119c8612a4b565b90506020028101906119da9190612b06565b6119e8906080810190612b42565b828181106119f8576119f8612a4b565b9050602002013584611a0a9190612a32565b93508b8b8a818110611a1e57611a1e612a4b565b9050602002810190611a309190612b06565b611a3e906060810190612b42565b82818110611a4e57611a4e612a4b565b9050602002013585611a609190612a32565b94505f6305f5e1008d8d8c818110611a7a57611a7a612a4b565b9050602002810190611a8c9190612b06565b611a9a906080810190612b42565b84818110611aaa57611aaa612a4b565b9050602002013588611abc9190612bad565b611ac69190612bc4565b905060648d8d8c818110611adc57611adc612a4b565b9050602002810190611aee9190612b06565b611afc9060a0810190612b42565b84818110611b0c57611b0c612a4b565b9050602002013582611b1e9190612bad565b611b289190612bc4565b838381518110611b3a57611b3a612a4b565b602002602001018181525050828281518110611b5857611b58612a4b565b602002602001015181611b6b9190612a78565b848381518110611b7d57611b7d612a4b565b602090810291909101015250600101611915565b508a8a89818110611ba457611ba4612a4b565b9050602002810190611bb69190612b06565b602001358414611c085760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642073657175656e6365727320626c6f636b730000000000000060448201526064016105c9565b6305f5e100831115611c5c5760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642073657175656e6365727320726174696f730000000000000060448201526064016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cdd0c50e878d8d8c818110611cab57611cab612a4b565b9050602002810190611cbd9190612b06565b611ccb906040810190612b42565b86866040518663ffffffff1660e01b8152600401611ced959493929190612bfc565b5f604051808303815f87803b158015611d04575f80fd5b505af1158015611d16573d5f803e3d5ffd5b505060019099019850611374975050505050505050565b50606b546040518381527f4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea9060200160405180910390a280606c5f828254611d759190612a32565b9091555050606b80548391905f90611d8e908490612a32565b9091555050505050565b611da061247d565b611da95f612407565b565b606082821015611dfd5760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b611e078383612a78565b611e12906001612a32565b67ffffffffffffffff811115611e2a57611e2a612a8b565b604051908082528060200260200182016040528015611e9257816020015b611e7f6040518060c001604052805f81526020015f8152602001606081526020016060815260200160608152602001606081525090565b815260200190600190039081611e485790505b509050825b828111610eee575f81815260686020908152604091829020825160c0810184528154815260018201548184015260028201805485518186028101860187528181529295939493860193830182828015611f2457602002820191905f5260205f20905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611ef9575b5050505050815260200160038201805480602002602001604051908101604052809291908181526020018280548015611f7a57602002820191905f5260205f20905b815481526020019060010190808311611f66575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020018280548015611fd057602002820191905f5260205f20905b815481526020019060010190808311611fbc575b505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561202657602002820191905f5260205f20905b815481526020019060010190808311612012575b50505050508152505082828151811061204157612041612a4b565b6020026020010181905250808061205790612ab8565b915050611e97565b61206761247d565b73ffffffffffffffffffffffffffffffffffffffff81166120f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105c9565b6120f981612407565b50565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121795760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b806121c65760405162461bcd60e51b815260206004820152601360248201527f656d70747920726f6c6c75702065706f6368730000000000000000000000000060448201526064016105c9565b5f5b818110156123bc5780606a546121de9190612a32565b8383838181106121f0576121f0612a4b565b905060a002015f0135146122465760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b6040518060a0016040528084848481811061226357612263612a4b565b905060a002015f0135815260200184848481811061228357612283612a4b565b905060a00201602001602081019061229b91906126a0565b73ffffffffffffffffffffffffffffffffffffffff1681526020018484848181106122c8576122c8612a4b565b905060a002016040013581526020018484848181106122e9576122e9612a4b565b905060a0020160600135815260200184848481811061230a5761230a612a4b565b905060a002016080013581525060675f85858581811061232c5761232c612a4b565b60a002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9093169290921790915590830151600283015560608301516003830155608090920151600490910155016121c8565b50606a546040518281527f0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed29929299060200160405180910390a281819050606a5f828254610ca29190612a32565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611da95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105c9565b828054828255905f5260205f2090810192821561255c579160200282015b8281111561255c57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612502565b506125689291506125a5565b5090565b828054828255905f5260205f2090810192821561255c579160200282015b8281111561255c57825182559160200191906001019061258a565b5b80821115612568575f81556001016125a6565b5f602082840312156125c9575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146125f3575f80fd5b919050565b5f805f6060848603121561260a575f80fd5b612613846125d0565b9250612621602085016125d0565b9150604084013590509250925092565b5f8060208385031215612642575f80fd5b823567ffffffffffffffff80821115612659575f80fd5b818501915085601f83011261266c575f80fd5b81358181111561267a575f80fd5b86602060c08302850101111561268e575f80fd5b60209290920196919550909350505050565b5f602082840312156126b0575f80fd5b6126b9826125d0565b9392505050565b5f80604083850312156126d1575f80fd5b50508035926020909101359150565b602080825282518282018190525f919060409081850190868401855b82811015612756578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016126fc565b5091979650505050505050565b602080825282518282018190525f919060409081850190868401855b82811015612756578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080808201519086015260a0908101519085015260c0909301929085019060010161277f565b5f80602083850312156127f4575f80fd5b823567ffffffffffffffff8082111561280b575f80fd5b818501915085601f83011261281e575f80fd5b81358181111561282c575f80fd5b8660208260051b850101111561268e575f80fd5b5f815180845260208085019450602084015f5b8381101561286f57815187529582019590820190600101612853565b509495945050505050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b8381101561299a578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc001855281518051845287810151888501528681015160c0888601819052815190860181905260e08601918a01905f905b8082101561293357825173ffffffffffffffffffffffffffffffffffffffff168452928b0192918b0191600191909101906128fd565b5050506060808301518683038288015261294d8382612840565b92505050608080830151868303828801526129688382612840565b9250505060a080830151925085820381870152506129868183612840565b9689019694505050908601906001016128a1565b509098975050505050505050565b5f80602083850312156129b9575f80fd5b823567ffffffffffffffff808211156129d0575f80fd5b818501915085601f8301126129e3575f80fd5b8135818111156129f1575f80fd5b86602060a08302850101111561268e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115612a4557612a45612a05565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115612a4557612a45612a05565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612ae857612ae8612a05565b5060010190565b5f60208284031215612aff575f80fd5b5051919050565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612b38575f80fd5b9190910192915050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612b75575f80fd5b83018035915067ffffffffffffffff821115612b8f575f80fd5b6020019150600581901b3603821315612ba6575f80fd5b9250929050565b8082028115828204841417612a4557612a45612a05565b5f82612bf7577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b858152608060208083018290529082018590525f90869060a08401835b88811015612c525773ffffffffffffffffffffffffffffffffffffffff612c3f856125d0565b1682529282019290820190600101612c19565b508481036040860152612c658188612840565b925050508281036060840152612c7b8185612840565b9897505050505050505056fea164736f6c6343000818000a diff --git a/bindings/bindings/distribute.go b/bindings/bindings/distribute.go deleted file mode 100644 index 3632a94b0..000000000 --- a/bindings/bindings/distribute.go +++ /dev/null @@ -1,1327 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/morph-l2/go-ethereum" - "github.com/morph-l2/go-ethereum/accounts/abi" - "github.com/morph-l2/go-ethereum/accounts/abi/bind" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/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 -) - -// DistributeMetaData contains all meta data concerning the Distribute contract. -var DistributeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"CommissionClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"upToEpoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"RewardClaimed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MORPH_TOKEN_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECORD_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetEpochIndex\",\"type\":\"uint256\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetEpochIndex\",\"type\":\"uint256\"}],\"name\":\"claimAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"claimCommission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetEpochIndex\",\"type\":\"uint256\"}],\"name\":\"cleanDistributions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"isRewardClaimed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"claimed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"newDelegation\",\"type\":\"bool\"}],\"name\":\"notifyDelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"}],\"name\":\"notifyUndelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"queryAllUnclaimed\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"delegatees\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rewards\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"queryAllUnclaimedEpochs\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"\",\"type\":\"bool[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"queryOldestDistribution\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"queryUnclaimed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"queryUnclaimedCommission\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"sequencers\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"delegatorRewards\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"commissionsAmount\",\"type\":\"uint256[]\"}],\"name\":\"updateEpochReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60e060405234801562000010575f80fd5b5073530000000000000000000000000000000000001360805273530000000000000000000000000000000000001560a05273530000000000000000000000000000000000001260c0526200006362000069565b62000127565b5f54610100900460ff1615620000d55760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161462000125575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160a05160c051612a2e620001915f395f818161030901526117a901525f81816101d9015281816107ca015281816109d9015281816112330152818161135801526114a101525f8181610343015281816120e20152818161219501526122320152612a2e5ff3fe608060405234801561000f575f80fd5b5060043610610163575f3560e01c8063a766c529116100c7578063cd4281d01161007d578063d557714111610063578063d55771411461033e578063de6ac93314610365578063f2fde38b14610388575f80fd5b8063cd4281d014610304578063cdd0c50e1461032b575f80fd5b8063b809af0f116100ad578063b809af0f146102b6578063bf2dca0a146102c9578063c4d66de8146102f1575f80fd5b8063a766c5291461027b578063ac2ac640146102a3575f80fd5b8063807de4431161011c578063921ae9b811610102578063921ae9b8146102245780639889be5114610247578063996cba6814610268575f80fd5b8063807de443146101d45780638da5cb5b14610213575f80fd5b80635cf20c7b1161014c5780635cf20c7b146101a6578063715018a6146101b95780637f683ee3146101c1575f80fd5b8063273d8e82146101675780634eedab3214610191575b5f80fd5b61017a610175366004612537565b61039b565b6040516101889291906125c2565b60405180910390f35b6101a461019f3660046125ef565b610729565b005b6101a46101b43660046125ef565b6107c7565b6101a46109c3565b6101a46101cf366004612617565b6109d6565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610188565b6033546001600160a01b03166101fb565b610237610232366004612537565b610c1c565b6040516101889493929190612656565b61025a6102553660046126d5565b610f59565b604051908152602001610188565b6101a4610276366004612706565b611230565b61025a610289366004612537565b6001600160a01b03165f9081526067602052604090205490565b6101a46102b1366004612537565b611355565b6101a46102c436600461274c565b61149e565b61025a6102d7366004612537565b6001600160a01b03165f9081526068602052604090205490565b6101a46102ff366004612537565b6115dc565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6101a46103393660046127f3565b6117a6565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6103786103733660046126d5565b611b06565b6040519015158152602001610188565b6101a4610396366004612537565b611b31565b6001600160a01b0381165f90815260696020526040812060609182916103c090611bc1565b9050805f0361043c5760405162461bcd60e51b815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f672072657761726400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8067ffffffffffffffff8111156104555761045561288f565b60405190808252806020026020018201604052801561047e578160200160208202803683370190505b5092508067ffffffffffffffff81111561049a5761049a61288f565b6040519080825280602002602001820160405280156104c3578160200160208202803683370190505b5091505f5b6001600160a01b0385165f9081526069602052604090206104e890611bc1565b811015610722576001600160a01b0385165f9081526069602052604081206105109083611bca565b6001600160a01b038088165f908152606960209081526040808320938516835260039093019052908120549192509081908190805b6065548110156106bf576001600160a01b038087165f9081526066602090815260408083208584528252808320938f168352600490930190522054156105b9576001600160a01b038087165f9081526066602090815260408083208584528252808320938f16835260049093019052205492505b6001600160a01b0386165f9081526066602090815260408083208484529091529020600101541561060d576001600160a01b0386165f90815260666020908152604080832084845290915290206001015493505b6001600160a01b0386165f908152606660209081526040808320848452909152902054849061063d9085906128e9565b6106479190612900565b6106519086612938565b6001600160a01b03808d165f908152606960209081526040808320938b16835260029093019052205490955060ff1680156106b357506001600160a01b03808c165f908152606960209081526040808320938a16835260049093019052205481145b6106bf57600101610545565b50848987815181106106d3576106d361294b565b60200260200101906001600160a01b031690816001600160a01b031681525050838887815181106107065761070661294b565b60209081029190910101525050600190930192506104c8915050565b5050915091565b610731611bdc565b6001600160a01b0382165f908152606760205260409020545b8181116107a8576001600160a01b0383165f908152606660209081526040808320848452909152812081815560018101829055906002820181818161078f82826124ee565b50505050505080806107a090612978565b91505061074a565b6001600160a01b039092165f9081526067602052604090209190915550565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461083f5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6065545f036108905760405162461bcd60e51b815260206004820152600e60248201527f6e6f74206d696e746564207965740000000000000000000000000000000000006044820152606401610433565b5f8115806108ab575060016065546108a891906129af565b82115b6108b557816108c4565b60016065546108c491906129af565b90505f805b6001600160a01b0385165f9081526069602052604090206108e990611bc1565b8110156109ac576001600160a01b0385165f90815260696020526040812081906109139084611bca565b6001600160a01b0388165f9081526069602052604090209091506109379082611c36565b801561096b57506001600160a01b038088165f90815260696020908152604080832093851683526003909301905220548510155b15610992575f8061097d838a89611c57565b909250905061098c8287612938565b95509250505b816109a557826109a181612978565b9350505b50506108c9565b5080156109bd576109bd84826120b2565b50505050565b6109cb611bdc565b6109d45f612308565b565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614610a4e5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0384165f9081526066602090815260408083208584529091529020600101819055811580610aaa57506001600160a01b038084165f908152606960209081526040808320938816835260039093019052205482145b15610b8f576001600160a01b0384165f9081526066602090815260408083208584529091529020610ade9060020184612371565b506001600160a01b038085165f90815260666020908152604080832086845282528083209387168352600490930181528282208290556069905220610b239085612371565b506001600160a01b038381165f908152606960209081526040808320938816835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560038401825280832083905560049093019052908120556109bd565b6001600160a01b038084165f9081526069602090815260408083209388168352600290930190522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155610bed90836129af565b6001600160a01b038085165f908152606960209081526040808320938916835260049093019052205550505050565b6001600160a01b0381165f908152606960205260408120606091829182918291610c4590611bc1565b90505f8167ffffffffffffffff811115610c6157610c6161288f565b604051908082528060200260200182016040528015610c8a578160200160208202803683370190505b5090505f8267ffffffffffffffff811115610ca757610ca761288f565b604051908082528060200260200182016040528015610cd0578160200160208202803683370190505b5090505f8367ffffffffffffffff811115610ced57610ced61288f565b604051908082528060200260200182016040528015610d16578160200160208202803683370190505b5090505f8467ffffffffffffffff811115610d3357610d3361288f565b604051908082528060200260200182016040528015610d5c578160200160208202803683370190505b5090505f5b85811015610f48576001600160a01b038b165f908152606960205260409020610d8a9082611bca565b858281518110610d9c57610d9c61294b565b60200260200101906001600160a01b031690816001600160a01b03168152505060695f8c6001600160a01b03166001600160a01b031681526020019081526020015f206002015f868381518110610df557610df561294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f205f9054906101000a900460ff16848281518110610e3b57610e3b61294b565b9115156020928302919091018201526001600160a01b038c165f908152606990915260408120865160039091019190879084908110610e7c57610e7c61294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054838281518110610eb657610eb661294b565b60200260200101818152505060695f8c6001600160a01b03166001600160a01b031681526020019081526020015f206004015f868381518110610efb57610efb61294b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f2054828281518110610f3557610f3561294b565b6020908102919091010152600101610d61565b509299919850965090945092505050565b6001600160a01b0381165f908152606960205260408120610f7990611bc1565b5f03610fed5760405162461bcd60e51b815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f67207265776172640000000000000000000000000000000000000000000000006064820152608401610433565b6001600160a01b0382165f90815260696020526040902061100e9084611c36565b61107f5760405162461bcd60e51b8152602060048201526024808201527f6e6f2072656d61696e696e6720726577617264206f66207468652064656c656760448201527f61746565000000000000000000000000000000000000000000000000000000006064820152608401610433565b6001600160a01b038083165f9081526069602090815260408083209387168352600390930190529081205481905b606554811015611227576001600160a01b038087165f9081526066602090815260408083208584528252808320938916835260049093019052205415611121576001600160a01b038087165f9081526066602090815260408083208584528252808320938916835260049093019052205491505b6001600160a01b0386165f90815260666020908152604080832084845290915290206001015415611175576001600160a01b0386165f90815260666020908152604080832084845290915290206001015492505b6001600160a01b0386165f90815260666020908152604080832084845290915290205483906111a59084906128e9565b6111af9190612900565b6111b99085612938565b6001600160a01b038087165f908152606960209081526040808320938b16835260029093019052205490945060ff16801561121b57506001600160a01b038086165f908152606960209081526040808320938a16835260049093019052205481145b611227576001016110ad565b50505092915050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146112a85760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6065545f036112f95760405162461bcd60e51b815260206004820152600e60248201527f6e6f74206d696e746564207965740000000000000000000000000000000000006044820152606401610433565b5f8115806113145750600160655461131191906129af565b82115b61131e578161132d565b600160655461132d91906129af565b90505f61133b858584611c57565b509050801561134e5761134e84826120b2565b5050505050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146113cd5760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0381165f908152606860205260409020546114315760405162461bcd60e51b815260206004820152601660248201527f6e6f20636f6d6d697373696f6e20746f20636c61696d000000000000000000006044820152606401610433565b6001600160a01b0381165f908152606860205260408120805491905561145782826120b2565b816001600160a01b03167f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e4118260405161149291815260200190565b60405180910390a25050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146115165760405162461bcd60e51b815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f7765646044820152606401610433565b6001600160a01b0386165f90815260666020908152604080832087845290915290206001810183905561154c9060020186612385565b506001600160a01b038087165f90815260666020908152604080832088845282528083209389168352600490930190522083905580156115d4576001600160a01b0385165f9081526069602052604090206115a79087612385565b506001600160a01b038086165f908152606960209081526040808320938a16835260039093019052208490555b505050505050565b5f54610100900460ff16158080156115fa57505f54600160ff909116105b806116135750303b15801561161357505f5460ff166001145b6116855760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610433565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156116e1575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0382166117375760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e6572206164647265737300000000000000000000006044820152606401610433565b61174082612308565b80156117a2575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461181e5760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f776564000000006044820152606401610433565b60658054905f61182d83612978565b919050555086600160655461184291906129af565b1461188f5760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642065706f636820696e646578000000000000000000000000006044820152606401610433565b828514801561189d57508085145b6118e95760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642064617461206c656e677468000000000000000000000000006044820152606401610433565b5f5b85811015611afc578484828181106119055761190561294b565b9050602002013560665f8989858181106119215761192161294b565b90506020020160208101906119369190612537565b6001600160a01b0316815260208082019290925260409081015f9081208c82529092528120919091556066908888848181106119745761197461294b565b90506020020160208101906119899190612537565b6001600160a01b0316815260208082019290925260409081015f9081208b82529092529020600101541580156119be57505f88115b15611a7f5760665f8888848181106119d8576119d861294b565b90506020020160208101906119ed9190612537565b6001600160a01b03166001600160a01b031681526020019081526020015f205f60018a611a1a91906129af565b81526020019081526020015f206001015460665f898985818110611a4057611a4061294b565b9050602002016020810190611a559190612537565b6001600160a01b0316815260208082019290925260409081015f9081208c82529092529020600101555b828282818110611a9157611a9161294b565b9050602002013560685f898985818110611aad57611aad61294b565b9050602002016020810190611ac29190612537565b6001600160a01b03166001600160a01b031681526020019081526020015f205f828254611aef9190612938565b90915550506001016118eb565b5050505050505050565b6001600160a01b0382165f908152606960205260408120611b279083611c36565b1590505b92915050565b611b39611bdc565b6001600160a01b038116611bb55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610433565b611bbe81612308565b50565b5f611b2b825490565b5f611bd58383612399565b9392505050565b6033546001600160a01b031633146109d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610433565b6001600160a01b0381165f9081526001830160205260408120541515611bd5565b6001600160a01b0382165f9081526069602052604081208190611c7a9086611c36565b611cc65760405162461bcd60e51b815260206004820152601360248201527f6e6f2072656d61696e696e6720726577617264000000000000000000000000006044820152606401610433565b6001600160a01b038085165f9081526069602090815260408083209389168352600390930190522054831015611d3e5760405162461bcd60e51b815260206004820152601260248201527f616c6c2072657761726420636c61696d656400000000000000000000000000006044820152606401610433565b6001600160a01b038085165f9081526069602090815260408083209389168352600390930190529081205481905b858111611f7f576001600160a01b038089165f9081526066602090815260408083208584528252808320938b16835260049093019052205415611ddd576001600160a01b038089165f9081526066602090815260408083208584528252808320938b16835260049093019052205491505b6001600160a01b0388165f90815260666020908152604080832084845290915290206001015415611e31576001600160a01b0388165f90815260666020908152604080832084845290915290206001015492505b6001600160a01b0388165f9081526066602090815260408083208484529091529020548390611e619084906128e9565b611e6b9190612900565b611e759086612938565b6001600160a01b038089165f908152606960209081526040808320938d16835260029093019052205490955060ff168015611ed757506001600160a01b038088165f908152606960209081526040808320938c16835260049093019052205481145b15611f6d576001600160a01b0387165f90815260696020526040902060019450611f019089612371565b506001600160a01b038781165f908152606960209081526040808320938c16835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556003840182528083208390556004909301905290812055611f7f565b80611f7781612978565b915050611d6c565b50611f8b856001612938565b6001600160a01b038088165f908152606960209081526040808320938c16835260039093018152828220939093556066909252812090611fcc876001612938565b81526020019081526020015f206004015f876001600160a01b03166001600160a01b031681526020019081526020015f20545f03612052576001600160a01b0387165f9081526066602052604081208291612028886001612938565b815260208082019290925260409081015f9081206001600160a01b038b1682526004019092529020555b866001600160a01b0316866001600160a01b03167f7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb40487876040516120a0929190918252602082015260400190565b60405180910390a35050935093915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561212f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215391906129c2565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af11580156121dd573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061220191906129d9565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561227f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122a391906129c2565b90505f831180156122bc5750826122ba82846129af565b145b6109bd5760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610433565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611bd5836001600160a01b0384166123bf565b5f611bd5836001600160a01b0384166124a2565b5f825f0182815481106123ae576123ae61294b565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015612499575f6123e16001836129af565b85549091505f906123f4906001906129af565b9050818114612453575f865f0182815481106124125761241261294b565b905f5260205f200154905080875f0184815481106124325761243261294b565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080612464576124646129f4565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050611b2b565b5f915050611b2b565b5f8181526001830160205260408120546124e757508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155611b2b565b505f611b2b565b5080545f8255905f5260205f2090810190611bbe91905b80821115612518575f8155600101612505565b5090565b80356001600160a01b0381168114612532575f80fd5b919050565b5f60208284031215612547575f80fd5b611bd58261251c565b5f815180845260208085019450602084015f5b838110156125885781516001600160a01b031687529582019590820190600101612563565b509495945050505050565b5f815180845260208085019450602084015f5b83811015612588578151875295820195908201906001016125a6565b604081525f6125d46040830185612550565b82810360208401526125e68185612593565b95945050505050565b5f8060408385031215612600575f80fd5b6126098361251c565b946020939093013593505050565b5f805f806080858703121561262a575f80fd5b6126338561251c565b93506126416020860161251c565b93969395505050506040820135916060013590565b608081525f6126686080830187612550565b8281036020848101919091528651808352878201928201905f5b818110156126a0578451151583529383019391830191600101612682565b505084810360408601526126b48188612593565b9250505082810360608401526126ca8185612593565b979650505050505050565b5f80604083850312156126e6575f80fd5b6126ef8361251c565b91506126fd6020840161251c565b90509250929050565b5f805f60608486031215612718575f80fd5b6127218461251c565b925061272f6020850161251c565b9150604084013590509250925092565b8015158114611bbe575f80fd5b5f805f805f8060c08789031215612761575f80fd5b61276a8761251c565b95506127786020880161251c565b945060408701359350606087013592506080870135915060a087013561279d8161273f565b809150509295509295509295565b5f8083601f8401126127bb575f80fd5b50813567ffffffffffffffff8111156127d2575f80fd5b6020830191508360208260051b85010111156127ec575f80fd5b9250929050565b5f805f805f805f6080888a031215612809575f80fd5b87359650602088013567ffffffffffffffff80821115612827575f80fd5b6128338b838c016127ab565b909850965060408a013591508082111561284b575f80fd5b6128578b838c016127ab565b909650945060608a013591508082111561286f575f80fd5b5061287c8a828b016127ab565b989b979a50959850939692959293505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082028115828204841417611b2b57611b2b6128bc565b5f82612933577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b80820180821115611b2b57611b2b6128bc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036129a8576129a86128bc565b5060010190565b81810381811115611b2b57611b2b6128bc565b5f602082840312156129d2575f80fd5b5051919050565b5f602082840312156129e9575f80fd5b8151611bd58161273f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea164736f6c6343000818000a", -} - -// DistributeABI is the input ABI used to generate the binding from. -// Deprecated: Use DistributeMetaData.ABI instead. -var DistributeABI = DistributeMetaData.ABI - -// DistributeBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use DistributeMetaData.Bin instead. -var DistributeBin = DistributeMetaData.Bin - -// DeployDistribute deploys a new Ethereum contract, binding an instance of Distribute to it. -func DeployDistribute(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Distribute, error) { - parsed, err := DistributeMetaData.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(DistributeBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Distribute{DistributeCaller: DistributeCaller{contract: contract}, DistributeTransactor: DistributeTransactor{contract: contract}, DistributeFilterer: DistributeFilterer{contract: contract}}, nil -} - -// Distribute is an auto generated Go binding around an Ethereum contract. -type Distribute struct { - DistributeCaller // Read-only binding to the contract - DistributeTransactor // Write-only binding to the contract - DistributeFilterer // Log filterer for contract events -} - -// DistributeCaller is an auto generated read-only Go binding around an Ethereum contract. -type DistributeCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DistributeTransactor is an auto generated write-only Go binding around an Ethereum contract. -type DistributeTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DistributeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type DistributeFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DistributeSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type DistributeSession struct { - Contract *Distribute // 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 -} - -// DistributeCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type DistributeCallerSession struct { - Contract *DistributeCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// DistributeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type DistributeTransactorSession struct { - Contract *DistributeTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// DistributeRaw is an auto generated low-level Go binding around an Ethereum contract. -type DistributeRaw struct { - Contract *Distribute // Generic contract binding to access the raw methods on -} - -// DistributeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type DistributeCallerRaw struct { - Contract *DistributeCaller // Generic read-only contract binding to access the raw methods on -} - -// DistributeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type DistributeTransactorRaw struct { - Contract *DistributeTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewDistribute creates a new instance of Distribute, bound to a specific deployed contract. -func NewDistribute(address common.Address, backend bind.ContractBackend) (*Distribute, error) { - contract, err := bindDistribute(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Distribute{DistributeCaller: DistributeCaller{contract: contract}, DistributeTransactor: DistributeTransactor{contract: contract}, DistributeFilterer: DistributeFilterer{contract: contract}}, nil -} - -// NewDistributeCaller creates a new read-only instance of Distribute, bound to a specific deployed contract. -func NewDistributeCaller(address common.Address, caller bind.ContractCaller) (*DistributeCaller, error) { - contract, err := bindDistribute(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &DistributeCaller{contract: contract}, nil -} - -// NewDistributeTransactor creates a new write-only instance of Distribute, bound to a specific deployed contract. -func NewDistributeTransactor(address common.Address, transactor bind.ContractTransactor) (*DistributeTransactor, error) { - contract, err := bindDistribute(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &DistributeTransactor{contract: contract}, nil -} - -// NewDistributeFilterer creates a new log filterer instance of Distribute, bound to a specific deployed contract. -func NewDistributeFilterer(address common.Address, filterer bind.ContractFilterer) (*DistributeFilterer, error) { - contract, err := bindDistribute(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &DistributeFilterer{contract: contract}, nil -} - -// bindDistribute binds a generic wrapper to an already deployed contract. -func bindDistribute(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := DistributeMetaData.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 (_Distribute *DistributeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Distribute.Contract.DistributeCaller.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 (_Distribute *DistributeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Distribute.Contract.DistributeTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Distribute *DistributeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Distribute.Contract.DistributeTransactor.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 (_Distribute *DistributeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Distribute.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 (_Distribute *DistributeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Distribute.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Distribute *DistributeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Distribute.Contract.contract.Transact(opts, method, params...) -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Distribute *DistributeCaller) L2STAKINGCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "L2_STAKING_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Distribute *DistributeSession) L2STAKINGCONTRACT() (common.Address, error) { - return _Distribute.Contract.L2STAKINGCONTRACT(&_Distribute.CallOpts) -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Distribute *DistributeCallerSession) L2STAKINGCONTRACT() (common.Address, error) { - return _Distribute.Contract.L2STAKINGCONTRACT(&_Distribute.CallOpts) -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Distribute *DistributeCaller) MORPHTOKENCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "MORPH_TOKEN_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Distribute *DistributeSession) MORPHTOKENCONTRACT() (common.Address, error) { - return _Distribute.Contract.MORPHTOKENCONTRACT(&_Distribute.CallOpts) -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Distribute *DistributeCallerSession) MORPHTOKENCONTRACT() (common.Address, error) { - return _Distribute.Contract.MORPHTOKENCONTRACT(&_Distribute.CallOpts) -} - -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. -// -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_Distribute *DistributeCaller) RECORDCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "RECORD_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. -// -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_Distribute *DistributeSession) RECORDCONTRACT() (common.Address, error) { - return _Distribute.Contract.RECORDCONTRACT(&_Distribute.CallOpts) -} - -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. -// -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_Distribute *DistributeCallerSession) RECORDCONTRACT() (common.Address, error) { - return _Distribute.Contract.RECORDCONTRACT(&_Distribute.CallOpts) -} - -// IsRewardClaimed is a free data retrieval call binding the contract method 0xde6ac933. -// -// Solidity: function isRewardClaimed(address delegator, address delegatee) view returns(bool claimed) -func (_Distribute *DistributeCaller) IsRewardClaimed(opts *bind.CallOpts, delegator common.Address, delegatee common.Address) (bool, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "isRewardClaimed", delegator, delegatee) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsRewardClaimed is a free data retrieval call binding the contract method 0xde6ac933. -// -// Solidity: function isRewardClaimed(address delegator, address delegatee) view returns(bool claimed) -func (_Distribute *DistributeSession) IsRewardClaimed(delegator common.Address, delegatee common.Address) (bool, error) { - return _Distribute.Contract.IsRewardClaimed(&_Distribute.CallOpts, delegator, delegatee) -} - -// IsRewardClaimed is a free data retrieval call binding the contract method 0xde6ac933. -// -// Solidity: function isRewardClaimed(address delegator, address delegatee) view returns(bool claimed) -func (_Distribute *DistributeCallerSession) IsRewardClaimed(delegator common.Address, delegatee common.Address) (bool, error) { - return _Distribute.Contract.IsRewardClaimed(&_Distribute.CallOpts, delegator, delegatee) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Distribute *DistributeCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Distribute *DistributeSession) Owner() (common.Address, error) { - return _Distribute.Contract.Owner(&_Distribute.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Distribute *DistributeCallerSession) Owner() (common.Address, error) { - return _Distribute.Contract.Owner(&_Distribute.CallOpts) -} - -// QueryAllUnclaimed is a free data retrieval call binding the contract method 0x273d8e82. -// -// Solidity: function queryAllUnclaimed(address delegator) view returns(address[] delegatees, uint256[] rewards) -func (_Distribute *DistributeCaller) QueryAllUnclaimed(opts *bind.CallOpts, delegator common.Address) (struct { - Delegatees []common.Address - Rewards []*big.Int -}, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "queryAllUnclaimed", delegator) - - outstruct := new(struct { - Delegatees []common.Address - Rewards []*big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.Delegatees = *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - outstruct.Rewards = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) - - return *outstruct, err - -} - -// QueryAllUnclaimed is a free data retrieval call binding the contract method 0x273d8e82. -// -// Solidity: function queryAllUnclaimed(address delegator) view returns(address[] delegatees, uint256[] rewards) -func (_Distribute *DistributeSession) QueryAllUnclaimed(delegator common.Address) (struct { - Delegatees []common.Address - Rewards []*big.Int -}, error) { - return _Distribute.Contract.QueryAllUnclaimed(&_Distribute.CallOpts, delegator) -} - -// QueryAllUnclaimed is a free data retrieval call binding the contract method 0x273d8e82. -// -// Solidity: function queryAllUnclaimed(address delegator) view returns(address[] delegatees, uint256[] rewards) -func (_Distribute *DistributeCallerSession) QueryAllUnclaimed(delegator common.Address) (struct { - Delegatees []common.Address - Rewards []*big.Int -}, error) { - return _Distribute.Contract.QueryAllUnclaimed(&_Distribute.CallOpts, delegator) -} - -// QueryAllUnclaimedEpochs is a free data retrieval call binding the contract method 0x921ae9b8. -// -// Solidity: function queryAllUnclaimedEpochs(address delegator) view returns(address[], bool[], uint256[], uint256[]) -func (_Distribute *DistributeCaller) QueryAllUnclaimedEpochs(opts *bind.CallOpts, delegator common.Address) ([]common.Address, []bool, []*big.Int, []*big.Int, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "queryAllUnclaimedEpochs", delegator) - - if err != nil { - return *new([]common.Address), *new([]bool), *new([]*big.Int), *new([]*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) - out1 := *abi.ConvertType(out[1], new([]bool)).(*[]bool) - out2 := *abi.ConvertType(out[2], new([]*big.Int)).(*[]*big.Int) - out3 := *abi.ConvertType(out[3], new([]*big.Int)).(*[]*big.Int) - - return out0, out1, out2, out3, err - -} - -// QueryAllUnclaimedEpochs is a free data retrieval call binding the contract method 0x921ae9b8. -// -// Solidity: function queryAllUnclaimedEpochs(address delegator) view returns(address[], bool[], uint256[], uint256[]) -func (_Distribute *DistributeSession) QueryAllUnclaimedEpochs(delegator common.Address) ([]common.Address, []bool, []*big.Int, []*big.Int, error) { - return _Distribute.Contract.QueryAllUnclaimedEpochs(&_Distribute.CallOpts, delegator) -} - -// QueryAllUnclaimedEpochs is a free data retrieval call binding the contract method 0x921ae9b8. -// -// Solidity: function queryAllUnclaimedEpochs(address delegator) view returns(address[], bool[], uint256[], uint256[]) -func (_Distribute *DistributeCallerSession) QueryAllUnclaimedEpochs(delegator common.Address) ([]common.Address, []bool, []*big.Int, []*big.Int, error) { - return _Distribute.Contract.QueryAllUnclaimedEpochs(&_Distribute.CallOpts, delegator) -} - -// QueryOldestDistribution is a free data retrieval call binding the contract method 0xa766c529. -// -// Solidity: function queryOldestDistribution(address delegatee) view returns(uint256 epochIndex) -func (_Distribute *DistributeCaller) QueryOldestDistribution(opts *bind.CallOpts, delegatee common.Address) (*big.Int, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "queryOldestDistribution", delegatee) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// QueryOldestDistribution is a free data retrieval call binding the contract method 0xa766c529. -// -// Solidity: function queryOldestDistribution(address delegatee) view returns(uint256 epochIndex) -func (_Distribute *DistributeSession) QueryOldestDistribution(delegatee common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryOldestDistribution(&_Distribute.CallOpts, delegatee) -} - -// QueryOldestDistribution is a free data retrieval call binding the contract method 0xa766c529. -// -// Solidity: function queryOldestDistribution(address delegatee) view returns(uint256 epochIndex) -func (_Distribute *DistributeCallerSession) QueryOldestDistribution(delegatee common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryOldestDistribution(&_Distribute.CallOpts, delegatee) -} - -// QueryUnclaimed is a free data retrieval call binding the contract method 0x9889be51. -// -// Solidity: function queryUnclaimed(address delegatee, address delegator) view returns(uint256 reward) -func (_Distribute *DistributeCaller) QueryUnclaimed(opts *bind.CallOpts, delegatee common.Address, delegator common.Address) (*big.Int, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "queryUnclaimed", delegatee, delegator) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// QueryUnclaimed is a free data retrieval call binding the contract method 0x9889be51. -// -// Solidity: function queryUnclaimed(address delegatee, address delegator) view returns(uint256 reward) -func (_Distribute *DistributeSession) QueryUnclaimed(delegatee common.Address, delegator common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryUnclaimed(&_Distribute.CallOpts, delegatee, delegator) -} - -// QueryUnclaimed is a free data retrieval call binding the contract method 0x9889be51. -// -// Solidity: function queryUnclaimed(address delegatee, address delegator) view returns(uint256 reward) -func (_Distribute *DistributeCallerSession) QueryUnclaimed(delegatee common.Address, delegator common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryUnclaimed(&_Distribute.CallOpts, delegatee, delegator) -} - -// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. -// -// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) -func (_Distribute *DistributeCaller) QueryUnclaimedCommission(opts *bind.CallOpts, delegatee common.Address) (*big.Int, error) { - var out []interface{} - err := _Distribute.contract.Call(opts, &out, "queryUnclaimedCommission", delegatee) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. -// -// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) -func (_Distribute *DistributeSession) QueryUnclaimedCommission(delegatee common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryUnclaimedCommission(&_Distribute.CallOpts, delegatee) -} - -// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. -// -// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) -func (_Distribute *DistributeCallerSession) QueryUnclaimedCommission(delegatee common.Address) (*big.Int, error) { - return _Distribute.Contract.QueryUnclaimedCommission(&_Distribute.CallOpts, delegatee) -} - -// Claim is a paid mutator transaction binding the contract method 0x996cba68. -// -// Solidity: function claim(address delegatee, address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactor) Claim(opts *bind.TransactOpts, delegatee common.Address, delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "claim", delegatee, delegator, targetEpochIndex) -} - -// Claim is a paid mutator transaction binding the contract method 0x996cba68. -// -// Solidity: function claim(address delegatee, address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeSession) Claim(delegatee common.Address, delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.Claim(&_Distribute.TransactOpts, delegatee, delegator, targetEpochIndex) -} - -// Claim is a paid mutator transaction binding the contract method 0x996cba68. -// -// Solidity: function claim(address delegatee, address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactorSession) Claim(delegatee common.Address, delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.Claim(&_Distribute.TransactOpts, delegatee, delegator, targetEpochIndex) -} - -// ClaimAll is a paid mutator transaction binding the contract method 0x5cf20c7b. -// -// Solidity: function claimAll(address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactor) ClaimAll(opts *bind.TransactOpts, delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "claimAll", delegator, targetEpochIndex) -} - -// ClaimAll is a paid mutator transaction binding the contract method 0x5cf20c7b. -// -// Solidity: function claimAll(address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeSession) ClaimAll(delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.ClaimAll(&_Distribute.TransactOpts, delegator, targetEpochIndex) -} - -// ClaimAll is a paid mutator transaction binding the contract method 0x5cf20c7b. -// -// Solidity: function claimAll(address delegator, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactorSession) ClaimAll(delegator common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.ClaimAll(&_Distribute.TransactOpts, delegator, targetEpochIndex) -} - -// ClaimCommission is a paid mutator transaction binding the contract method 0xac2ac640. -// -// Solidity: function claimCommission(address delegatee) returns() -func (_Distribute *DistributeTransactor) ClaimCommission(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "claimCommission", delegatee) -} - -// ClaimCommission is a paid mutator transaction binding the contract method 0xac2ac640. -// -// Solidity: function claimCommission(address delegatee) returns() -func (_Distribute *DistributeSession) ClaimCommission(delegatee common.Address) (*types.Transaction, error) { - return _Distribute.Contract.ClaimCommission(&_Distribute.TransactOpts, delegatee) -} - -// ClaimCommission is a paid mutator transaction binding the contract method 0xac2ac640. -// -// Solidity: function claimCommission(address delegatee) returns() -func (_Distribute *DistributeTransactorSession) ClaimCommission(delegatee common.Address) (*types.Transaction, error) { - return _Distribute.Contract.ClaimCommission(&_Distribute.TransactOpts, delegatee) -} - -// CleanDistributions is a paid mutator transaction binding the contract method 0x4eedab32. -// -// Solidity: function cleanDistributions(address delegatee, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactor) CleanDistributions(opts *bind.TransactOpts, delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "cleanDistributions", delegatee, targetEpochIndex) -} - -// CleanDistributions is a paid mutator transaction binding the contract method 0x4eedab32. -// -// Solidity: function cleanDistributions(address delegatee, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeSession) CleanDistributions(delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.CleanDistributions(&_Distribute.TransactOpts, delegatee, targetEpochIndex) -} - -// CleanDistributions is a paid mutator transaction binding the contract method 0x4eedab32. -// -// Solidity: function cleanDistributions(address delegatee, uint256 targetEpochIndex) returns() -func (_Distribute *DistributeTransactorSession) CleanDistributions(delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.CleanDistributions(&_Distribute.TransactOpts, delegatee, targetEpochIndex) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _owner) returns() -func (_Distribute *DistributeTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "initialize", _owner) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _owner) returns() -func (_Distribute *DistributeSession) Initialize(_owner common.Address) (*types.Transaction, error) { - return _Distribute.Contract.Initialize(&_Distribute.TransactOpts, _owner) -} - -// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. -// -// Solidity: function initialize(address _owner) returns() -func (_Distribute *DistributeTransactorSession) Initialize(_owner common.Address) (*types.Transaction, error) { - return _Distribute.Contract.Initialize(&_Distribute.TransactOpts, _owner) -} - -// NotifyDelegation is a paid mutator transaction binding the contract method 0xb809af0f. -// -// Solidity: function notifyDelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 amount, uint256 totalAmount, bool newDelegation) returns() -func (_Distribute *DistributeTransactor) NotifyDelegation(opts *bind.TransactOpts, delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, amount *big.Int, totalAmount *big.Int, newDelegation bool) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "notifyDelegation", delegatee, delegator, effectiveEpoch, amount, totalAmount, newDelegation) -} - -// NotifyDelegation is a paid mutator transaction binding the contract method 0xb809af0f. -// -// Solidity: function notifyDelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 amount, uint256 totalAmount, bool newDelegation) returns() -func (_Distribute *DistributeSession) NotifyDelegation(delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, amount *big.Int, totalAmount *big.Int, newDelegation bool) (*types.Transaction, error) { - return _Distribute.Contract.NotifyDelegation(&_Distribute.TransactOpts, delegatee, delegator, effectiveEpoch, amount, totalAmount, newDelegation) -} - -// NotifyDelegation is a paid mutator transaction binding the contract method 0xb809af0f. -// -// Solidity: function notifyDelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 amount, uint256 totalAmount, bool newDelegation) returns() -func (_Distribute *DistributeTransactorSession) NotifyDelegation(delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, amount *big.Int, totalAmount *big.Int, newDelegation bool) (*types.Transaction, error) { - return _Distribute.Contract.NotifyDelegation(&_Distribute.TransactOpts, delegatee, delegator, effectiveEpoch, amount, totalAmount, newDelegation) -} - -// NotifyUndelegation is a paid mutator transaction binding the contract method 0x7f683ee3. -// -// Solidity: function notifyUndelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 totalAmount) returns() -func (_Distribute *DistributeTransactor) NotifyUndelegation(opts *bind.TransactOpts, delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, totalAmount *big.Int) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "notifyUndelegation", delegatee, delegator, effectiveEpoch, totalAmount) -} - -// NotifyUndelegation is a paid mutator transaction binding the contract method 0x7f683ee3. -// -// Solidity: function notifyUndelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 totalAmount) returns() -func (_Distribute *DistributeSession) NotifyUndelegation(delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, totalAmount *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.NotifyUndelegation(&_Distribute.TransactOpts, delegatee, delegator, effectiveEpoch, totalAmount) -} - -// NotifyUndelegation is a paid mutator transaction binding the contract method 0x7f683ee3. -// -// Solidity: function notifyUndelegation(address delegatee, address delegator, uint256 effectiveEpoch, uint256 totalAmount) returns() -func (_Distribute *DistributeTransactorSession) NotifyUndelegation(delegatee common.Address, delegator common.Address, effectiveEpoch *big.Int, totalAmount *big.Int) (*types.Transaction, error) { - return _Distribute.Contract.NotifyUndelegation(&_Distribute.TransactOpts, delegatee, delegator, effectiveEpoch, totalAmount) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Distribute *DistributeTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Distribute *DistributeSession) RenounceOwnership() (*types.Transaction, error) { - return _Distribute.Contract.RenounceOwnership(&_Distribute.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Distribute *DistributeTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Distribute.Contract.RenounceOwnership(&_Distribute.TransactOpts) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Distribute *DistributeTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Distribute *DistributeSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Distribute.Contract.TransferOwnership(&_Distribute.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Distribute *DistributeTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Distribute.Contract.TransferOwnership(&_Distribute.TransactOpts, newOwner) -} - -// UpdateEpochReward is a paid mutator transaction binding the contract method 0xcdd0c50e. -// -// Solidity: function updateEpochReward(uint256 epochIndex, address[] sequencers, uint256[] delegatorRewards, uint256[] commissionsAmount) returns() -func (_Distribute *DistributeTransactor) UpdateEpochReward(opts *bind.TransactOpts, epochIndex *big.Int, sequencers []common.Address, delegatorRewards []*big.Int, commissionsAmount []*big.Int) (*types.Transaction, error) { - return _Distribute.contract.Transact(opts, "updateEpochReward", epochIndex, sequencers, delegatorRewards, commissionsAmount) -} - -// UpdateEpochReward is a paid mutator transaction binding the contract method 0xcdd0c50e. -// -// Solidity: function updateEpochReward(uint256 epochIndex, address[] sequencers, uint256[] delegatorRewards, uint256[] commissionsAmount) returns() -func (_Distribute *DistributeSession) UpdateEpochReward(epochIndex *big.Int, sequencers []common.Address, delegatorRewards []*big.Int, commissionsAmount []*big.Int) (*types.Transaction, error) { - return _Distribute.Contract.UpdateEpochReward(&_Distribute.TransactOpts, epochIndex, sequencers, delegatorRewards, commissionsAmount) -} - -// UpdateEpochReward is a paid mutator transaction binding the contract method 0xcdd0c50e. -// -// Solidity: function updateEpochReward(uint256 epochIndex, address[] sequencers, uint256[] delegatorRewards, uint256[] commissionsAmount) returns() -func (_Distribute *DistributeTransactorSession) UpdateEpochReward(epochIndex *big.Int, sequencers []common.Address, delegatorRewards []*big.Int, commissionsAmount []*big.Int) (*types.Transaction, error) { - return _Distribute.Contract.UpdateEpochReward(&_Distribute.TransactOpts, epochIndex, sequencers, delegatorRewards, commissionsAmount) -} - -// DistributeCommissionClaimedIterator is returned from FilterCommissionClaimed and is used to iterate over the raw logs and unpacked data for CommissionClaimed events raised by the Distribute contract. -type DistributeCommissionClaimedIterator struct { - Event *DistributeCommissionClaimed // 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 *DistributeCommissionClaimedIterator) 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(DistributeCommissionClaimed) - 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(DistributeCommissionClaimed) - 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 *DistributeCommissionClaimedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DistributeCommissionClaimedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DistributeCommissionClaimed represents a CommissionClaimed event raised by the Distribute contract. -type DistributeCommissionClaimed struct { - Delegatee common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCommissionClaimed is a free log retrieval operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. -// -// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) -func (_Distribute *DistributeFilterer) FilterCommissionClaimed(opts *bind.FilterOpts, delegatee []common.Address) (*DistributeCommissionClaimedIterator, error) { - - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } - - logs, sub, err := _Distribute.contract.FilterLogs(opts, "CommissionClaimed", delegateeRule) - if err != nil { - return nil, err - } - return &DistributeCommissionClaimedIterator{contract: _Distribute.contract, event: "CommissionClaimed", logs: logs, sub: sub}, nil -} - -// WatchCommissionClaimed is a free log subscription operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. -// -// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) -func (_Distribute *DistributeFilterer) WatchCommissionClaimed(opts *bind.WatchOpts, sink chan<- *DistributeCommissionClaimed, delegatee []common.Address) (event.Subscription, error) { - - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } - - logs, sub, err := _Distribute.contract.WatchLogs(opts, "CommissionClaimed", delegateeRule) - 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(DistributeCommissionClaimed) - if err := _Distribute.contract.UnpackLog(event, "CommissionClaimed", 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 -} - -// ParseCommissionClaimed is a log parse operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. -// -// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) -func (_Distribute *DistributeFilterer) ParseCommissionClaimed(log types.Log) (*DistributeCommissionClaimed, error) { - event := new(DistributeCommissionClaimed) - if err := _Distribute.contract.UnpackLog(event, "CommissionClaimed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// DistributeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Distribute contract. -type DistributeInitializedIterator struct { - Event *DistributeInitialized // 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 *DistributeInitializedIterator) 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(DistributeInitialized) - 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(DistributeInitialized) - 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 *DistributeInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DistributeInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DistributeInitialized represents a Initialized event raised by the Distribute contract. -type DistributeInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Distribute *DistributeFilterer) FilterInitialized(opts *bind.FilterOpts) (*DistributeInitializedIterator, error) { - - logs, sub, err := _Distribute.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &DistributeInitializedIterator{contract: _Distribute.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Distribute *DistributeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *DistributeInitialized) (event.Subscription, error) { - - logs, sub, err := _Distribute.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(DistributeInitialized) - if err := _Distribute.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Distribute *DistributeFilterer) ParseInitialized(log types.Log) (*DistributeInitialized, error) { - event := new(DistributeInitialized) - if err := _Distribute.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// DistributeOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Distribute contract. -type DistributeOwnershipTransferredIterator struct { - Event *DistributeOwnershipTransferred // 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 *DistributeOwnershipTransferredIterator) 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(DistributeOwnershipTransferred) - 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(DistributeOwnershipTransferred) - 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 *DistributeOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DistributeOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DistributeOwnershipTransferred represents a OwnershipTransferred event raised by the Distribute contract. -type DistributeOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Distribute *DistributeFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*DistributeOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Distribute.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &DistributeOwnershipTransferredIterator{contract: _Distribute.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Distribute *DistributeFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *DistributeOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Distribute.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(DistributeOwnershipTransferred) - if err := _Distribute.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Distribute *DistributeFilterer) ParseOwnershipTransferred(log types.Log) (*DistributeOwnershipTransferred, error) { - event := new(DistributeOwnershipTransferred) - if err := _Distribute.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// DistributeRewardClaimedIterator is returned from FilterRewardClaimed and is used to iterate over the raw logs and unpacked data for RewardClaimed events raised by the Distribute contract. -type DistributeRewardClaimedIterator struct { - Event *DistributeRewardClaimed // 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 *DistributeRewardClaimedIterator) 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(DistributeRewardClaimed) - 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(DistributeRewardClaimed) - 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 *DistributeRewardClaimedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DistributeRewardClaimedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DistributeRewardClaimed represents a RewardClaimed event raised by the Distribute contract. -type DistributeRewardClaimed struct { - Delegator common.Address - Delegatee common.Address - UpToEpoch *big.Int - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRewardClaimed is a free log retrieval operation binding the contract event 0x7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb404. -// -// Solidity: event RewardClaimed(address indexed delegator, address indexed delegatee, uint256 upToEpoch, uint256 amount) -func (_Distribute *DistributeFilterer) FilterRewardClaimed(opts *bind.FilterOpts, delegator []common.Address, delegatee []common.Address) (*DistributeRewardClaimedIterator, error) { - - var delegatorRule []interface{} - for _, delegatorItem := range delegator { - delegatorRule = append(delegatorRule, delegatorItem) - } - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } - - logs, sub, err := _Distribute.contract.FilterLogs(opts, "RewardClaimed", delegatorRule, delegateeRule) - if err != nil { - return nil, err - } - return &DistributeRewardClaimedIterator{contract: _Distribute.contract, event: "RewardClaimed", logs: logs, sub: sub}, nil -} - -// WatchRewardClaimed is a free log subscription operation binding the contract event 0x7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb404. -// -// Solidity: event RewardClaimed(address indexed delegator, address indexed delegatee, uint256 upToEpoch, uint256 amount) -func (_Distribute *DistributeFilterer) WatchRewardClaimed(opts *bind.WatchOpts, sink chan<- *DistributeRewardClaimed, delegator []common.Address, delegatee []common.Address) (event.Subscription, error) { - - var delegatorRule []interface{} - for _, delegatorItem := range delegator { - delegatorRule = append(delegatorRule, delegatorItem) - } - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } - - logs, sub, err := _Distribute.contract.WatchLogs(opts, "RewardClaimed", delegatorRule, delegateeRule) - 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(DistributeRewardClaimed) - if err := _Distribute.contract.UnpackLog(event, "RewardClaimed", 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 -} - -// ParseRewardClaimed is a log parse operation binding the contract event 0x7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb404. -// -// Solidity: event RewardClaimed(address indexed delegator, address indexed delegatee, uint256 upToEpoch, uint256 amount) -func (_Distribute *DistributeFilterer) ParseRewardClaimed(log types.Log) (*DistributeRewardClaimed, error) { - event := new(DistributeRewardClaimed) - if err := _Distribute.contract.UnpackLog(event, "RewardClaimed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/bindings/bindings/distribute_more.go b/bindings/bindings/distribute_more.go deleted file mode 100644 index decb59f62..000000000 --- a/bindings/bindings/distribute_more.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "encoding/json" - - "morph-l2/bindings/solc" -) - -const DistributeStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1011_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1010_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"mintedEpochCount\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"distributions\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_mapping(t_address,t_mapping(t_uint256,t_struct(Distribution)1013_storage))\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"oldestDistribution\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"commissions\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/Distribute.sol:Distribute\",\"label\":\"unclaimed\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_mapping(t_address,t_struct(Unclaimed)1015_storage)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_bytes32)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"bytes32[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1010_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1011_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_bool)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e bool)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_bool\"},\"t_mapping(t_address,t_mapping(t_uint256,t_struct(Distribution)1013_storage))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(uint256 =\u003e struct IDistribute.Distribution))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_uint256,t_struct(Distribution)1013_storage)\"},\"t_mapping(t_address,t_struct(Unclaimed)1015_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct IDistribute.Unclaimed)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Unclaimed)1015_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_mapping(t_bytes32,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_uint256\"},\"t_mapping(t_uint256,t_struct(Distribution)1013_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IDistribute.Distribution)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(Distribution)1013_storage\"},\"t_struct(AddressSet)1012_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.AddressSet\",\"numberOfBytes\":\"64\"},\"t_struct(Distribution)1013_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IDistribute.Distribution\",\"numberOfBytes\":\"160\"},\"t_struct(Set)1014_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.Set\",\"numberOfBytes\":\"64\"},\"t_struct(Unclaimed)1015_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IDistribute.Unclaimed\",\"numberOfBytes\":\"160\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" - -var DistributeStorageLayout = new(solc.StorageLayout) - -var DistributeDeployedBin = "0x608060405234801561000f575f80fd5b5060043610610163575f3560e01c8063a766c529116100c7578063cd4281d01161007d578063d557714111610063578063d557714114610372578063de6ac93314610399578063f2fde38b146103bc575f80fd5b8063cd4281d014610338578063cdd0c50e1461035f575f80fd5b8063b809af0f116100ad578063b809af0f146102dd578063bf2dca0a146102f0578063c4d66de814610325575f80fd5b8063a766c52914610295578063ac2ac640146102ca575f80fd5b8063807de4431161011c578063921ae9b811610102578063921ae9b81461023e5780639889be5114610261578063996cba6814610282575f80fd5b8063807de443146101d45780638da5cb5b14610220575f80fd5b80635cf20c7b1161014c5780635cf20c7b146101a6578063715018a6146101b95780637f683ee3146101c1575f80fd5b8063273d8e82146101675780634eedab3214610191575b5f80fd5b61017a610175366004612cc8565b6103cf565b604051610188929190612d60565b60405180910390f35b6101a461019f366004612d8d565b610820565b005b6101a46101b4366004612d8d565b6108e5565b6101a4610b56565b6101a46101cf366004612db5565b610b69565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610188565b60335473ffffffffffffffffffffffffffffffffffffffff166101fb565b61025161024c366004612cc8565b610e31565b6040516101889493929190612df4565b61027461026f366004612e73565b611231565b604051908152602001610188565b6101a4610290366004612ea4565b6115be565b6102746102a3366004612cc8565b73ffffffffffffffffffffffffffffffffffffffff165f9081526067602052604090205490565b6101a46102d8366004612cc8565b611724565b6101a46102eb366004612eea565b6118d5565b6102746102fe366004612cc8565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b6101a4610333366004612cc8565b611a6e565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6101a461036d366004612f91565b611c79565b6101fb7f000000000000000000000000000000000000000000000000000000000000000081565b6103ac6103a7366004612e73565b61208f565b6040519015158152602001610188565b6101a46103ca366004612cc8565b6120c7565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260696020526040812060609182916104019061217e565b9050805f03610497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f672072657761726400000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b8067ffffffffffffffff8111156104b0576104b061302d565b6040519080825280602002602001820160405280156104d9578160200160208202803683370190505b5092508067ffffffffffffffff8111156104f5576104f561302d565b60405190808252806020026020018201604052801561051e578160200160208202803683370190505b5091505f5b73ffffffffffffffffffffffffffffffffffffffff85165f9081526069602052604090206105509061217e565b8110156108195773ffffffffffffffffffffffffffffffffffffffff85165f9081526069602052604081206105859083612187565b73ffffffffffffffffffffffffffffffffffffffff8088165f908152606960209081526040808320938516835260039093019052908120549192509081908190805b60655481101561079c5773ffffffffffffffffffffffffffffffffffffffff8087165f9081526066602090815260408083208584528252808320938f168352600490930190522054156106555773ffffffffffffffffffffffffffffffffffffffff8087165f9081526066602090815260408083208584528252808320938f16835260049093019052205492505b73ffffffffffffffffffffffffffffffffffffffff86165f908152606660209081526040808320848452909152902060010154156106c35773ffffffffffffffffffffffffffffffffffffffff86165f90815260666020908152604080832084845290915290206001015493505b73ffffffffffffffffffffffffffffffffffffffff86165f9081526066602090815260408083208484529091529020548490610700908590613087565b61070a919061309e565b61071490866130d6565b73ffffffffffffffffffffffffffffffffffffffff808d165f908152606960209081526040808320938b16835260029093019052205490955060ff168015610790575073ffffffffffffffffffffffffffffffffffffffff808c165f908152606960209081526040808320938a16835260049093019052205481145b61079c576001016105c7565b50848987815181106107b0576107b06130e9565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050838887815181106107fd576107fd6130e9565b6020908102919091010152505060019093019250610523915050565b5050915091565b610828612199565b73ffffffffffffffffffffffffffffffffffffffff82165f908152606760205260409020545b8181116108b95773ffffffffffffffffffffffffffffffffffffffff83165f90815260666020908152604080832084845290915281208181556001810182905590600282018181816108a08282612c72565b50505050505080806108b190613116565b91505061084e565b73ffffffffffffffffffffffffffffffffffffffff9092165f9081526067602052604090209190915550565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f776564604482015260640161048e565b6065545f036109ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f6e6f74206d696e74656420796574000000000000000000000000000000000000604482015260640161048e565b5f811580610a0a57506001606554610a07919061314d565b82115b610a145781610a23565b6001606554610a23919061314d565b90505f805b73ffffffffffffffffffffffffffffffffffffffff85165f908152606960205260409020610a559061217e565b811015610b3f5773ffffffffffffffffffffffffffffffffffffffff85165f9081526069602052604081208190610a8c9084612187565b73ffffffffffffffffffffffffffffffffffffffff88165f908152606960205260409020909150610abd908261221a565b8015610afe575073ffffffffffffffffffffffffffffffffffffffff8088165f90815260696020908152604080832093851683526003909301905220548510155b15610b25575f80610b10838a89612248565b9092509050610b1f82876130d6565b95509250505b81610b385782610b3481613116565b9350505b5050610a28565b508015610b5057610b5084826127ce565b50505050565b610b5e612199565b610b675f612a65565b565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614610c08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f776564604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff84165f9081526066602090815260408083208584529091529020600101819055811580610c7e575073ffffffffffffffffffffffffffffffffffffffff8084165f908152606960209081526040808320938816835260039093019052205482145b15610d8a5773ffffffffffffffffffffffffffffffffffffffff84165f9081526066602090815260408083208584529091529020610cbf9060020184612adb565b5073ffffffffffffffffffffffffffffffffffffffff8085165f90815260666020908152604080832086845282528083209387168352600490930181528282208290556069905220610d119085612adb565b5073ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938816835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556003840182528083208390556004909301905290812055610b50565b73ffffffffffffffffffffffffffffffffffffffff8084165f9081526069602090815260408083209388168352600290930190522080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001908117909155610df5908361314d565b73ffffffffffffffffffffffffffffffffffffffff8085165f908152606960209081526040808320938916835260049093019052205550505050565b73ffffffffffffffffffffffffffffffffffffffff81165f908152606960205260408120606091829182918291610e679061217e565b90505f8167ffffffffffffffff811115610e8357610e8361302d565b604051908082528060200260200182016040528015610eac578160200160208202803683370190505b5090505f8267ffffffffffffffff811115610ec957610ec961302d565b604051908082528060200260200182016040528015610ef2578160200160208202803683370190505b5090505f8367ffffffffffffffff811115610f0f57610f0f61302d565b604051908082528060200260200182016040528015610f38578160200160208202803683370190505b5090505f8467ffffffffffffffff811115610f5557610f5561302d565b604051908082528060200260200182016040528015610f7e578160200160208202803683370190505b5090505f5b858110156112205773ffffffffffffffffffffffffffffffffffffffff8b165f908152606960205260409020610fb99082612187565b858281518110610fcb57610fcb6130e9565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060695f8c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206002015f868381518110611058576110586130e9565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168482815181106110b8576110b86130e9565b91151560209283029190910182015273ffffffffffffffffffffffffffffffffffffffff8c165f908152606990915260408120865160039091019190879084908110611106576111066130e9565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205483828151811061115a5761115a6130e9565b60200260200101818152505060695f8c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206004015f8683815181106111b9576111b96130e9565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205482828151811061120d5761120d6130e9565b6020908102919091010152600101610f83565b509299919850965090945092505050565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260696020526040812061125e9061217e565b5f036112ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f696e76616c69642064656c656761746f72206f72206e6f2072656d61696e696e60448201527f6720726577617264000000000000000000000000000000000000000000000000606482015260840161048e565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260696020526040902061131a908461221a565b6113a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f6e6f2072656d61696e696e6720726577617264206f66207468652064656c656760448201527f6174656500000000000000000000000000000000000000000000000000000000606482015260840161048e565b73ffffffffffffffffffffffffffffffffffffffff8083165f9081526069602090815260408083209387168352600390930190529081205481905b6065548110156115b55773ffffffffffffffffffffffffffffffffffffffff8087165f908152606660209081526040808320858452825280832093891683526004909301905220541561146e5773ffffffffffffffffffffffffffffffffffffffff8087165f9081526066602090815260408083208584528252808320938916835260049093019052205491505b73ffffffffffffffffffffffffffffffffffffffff86165f908152606660209081526040808320848452909152902060010154156114dc5773ffffffffffffffffffffffffffffffffffffffff86165f90815260666020908152604080832084845290915290206001015492505b73ffffffffffffffffffffffffffffffffffffffff86165f9081526066602090815260408083208484529091529020548390611519908490613087565b611523919061309e565b61152d90856130d6565b73ffffffffffffffffffffffffffffffffffffffff8087165f908152606960209081526040808320938b16835260029093019052205490945060ff1680156115a9575073ffffffffffffffffffffffffffffffffffffffff8086165f908152606960209081526040808320938a16835260049093019052205481145b6115b5576001016113e0565b50505092915050565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff161461165d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f776564604482015260640161048e565b6065545f036116c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f6e6f74206d696e74656420796574000000000000000000000000000000000000604482015260640161048e565b5f8115806116e3575060016065546116e0919061314d565b82115b6116ed57816116fc565b60016065546116fc919061314d565b90505f61170a858584612248565b509050801561171d5761171d84826127ce565b5050505050565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146117c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f776564604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526068602052604090205461184e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6e6f20636f6d6d697373696f6e20746f20636c61696d00000000000000000000604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff81165f908152606860205260408120805491905561188182826127ce565b8173ffffffffffffffffffffffffffffffffffffffff167f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411826040516118c991815260200190565b60405180910390a25050565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614611974576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6f6e6c79206c32207374616b696e6720636f6e747261637420616c6c6f776564604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff86165f9081526066602090815260408083208784529091529020600181018390556119b79060020186612afc565b5073ffffffffffffffffffffffffffffffffffffffff8087165f9081526066602090815260408083208884528252808320938916835260049093019052208390558015611a665773ffffffffffffffffffffffffffffffffffffffff85165f908152606960205260409020611a2c9087612afc565b5073ffffffffffffffffffffffffffffffffffffffff8086165f908152606960209081526040808320938a16835260039093019052208490555b505050505050565b5f54610100900460ff1615808015611a8c57505f54600160ff909116105b80611aa55750303b158015611aa557505f5460ff166001145b611b31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161048e565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611b8d575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8216611c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c6964206f776e657220616464726573730000000000000000000000604482015260640161048e565b611c1382612a65565b8015611c75575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614611d18576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f77656400000000604482015260640161048e565b60658054905f611d2783613116565b9190505550866001606554611d3c919061314d565b14611da3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642065706f636820696e64657800000000000000000000000000604482015260640161048e565b8285148015611db157508085145b611e17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642064617461206c656e67746800000000000000000000000000604482015260640161048e565b5f5b8581101561208557848482818110611e3357611e336130e9565b9050602002013560665f898985818110611e4f57611e4f6130e9565b9050602002016020810190611e649190612cc8565b73ffffffffffffffffffffffffffffffffffffffff16815260208082019290925260409081015f9081208c8252909252812091909155606690888884818110611eaf57611eaf6130e9565b9050602002016020810190611ec49190612cc8565b73ffffffffffffffffffffffffffffffffffffffff16815260208082019290925260409081015f9081208b8252909252902060010154158015611f0657505f88115b15611fee5760665f888884818110611f2057611f206130e9565b9050602002016020810190611f359190612cc8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f60018a611f7c919061314d565b81526020019081526020015f206001015460665f898985818110611fa257611fa26130e9565b9050602002016020810190611fb79190612cc8565b73ffffffffffffffffffffffffffffffffffffffff16815260208082019290925260409081015f9081208c82529092529020600101555b828282818110612000576120006130e9565b9050602002013560685f89898581811061201c5761201c6130e9565b90506020020160208101906120319190612cc8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461207891906130d6565b9091555050600101611e19565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff82165f9081526069602052604081206120bd908361221a565b1590505b92915050565b6120cf612199565b73ffffffffffffffffffffffffffffffffffffffff8116612172576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161048e565b61217b81612a65565b50565b5f6120c1825490565b5f6121928383612b1d565b9392505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610b67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001830160205260408120541515612192565b73ffffffffffffffffffffffffffffffffffffffff82165f9081526069602052604081208190612278908661221a565b6122de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6e6f2072656d61696e696e672072657761726400000000000000000000000000604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff8085165f908152606960209081526040808320938916835260039093019052205483101561237d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f616c6c2072657761726420636c61696d65640000000000000000000000000000604482015260640161048e565b73ffffffffffffffffffffffffffffffffffffffff8085165f9081526069602090815260408083209389168352600390930190529081205481905b8581116126405773ffffffffffffffffffffffffffffffffffffffff8089165f9081526066602090815260408083208584528252808320938b168352600490930190522054156124435773ffffffffffffffffffffffffffffffffffffffff8089165f9081526066602090815260408083208584528252808320938b16835260049093019052205491505b73ffffffffffffffffffffffffffffffffffffffff88165f908152606660209081526040808320848452909152902060010154156124b15773ffffffffffffffffffffffffffffffffffffffff88165f90815260666020908152604080832084845290915290206001015492505b73ffffffffffffffffffffffffffffffffffffffff88165f90815260666020908152604080832084845290915290205483906124ee908490613087565b6124f8919061309e565b61250290866130d6565b73ffffffffffffffffffffffffffffffffffffffff8089165f908152606960209081526040808320938d16835260029093019052205490955060ff16801561257e575073ffffffffffffffffffffffffffffffffffffffff8088165f908152606960209081526040808320938c16835260049093019052205481145b1561262e5773ffffffffffffffffffffffffffffffffffffffff87165f908152606960205260409020600194506125b59089612adb565b5073ffffffffffffffffffffffffffffffffffffffff8781165f908152606960209081526040808320938c16835260028401825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556003840182528083208390556004909301905290812055612640565b8061263881613116565b9150506123b8565b5061264c8560016130d6565b73ffffffffffffffffffffffffffffffffffffffff8088165f908152606960209081526040808320938c1683526003909301815282822093909355606690925281209061269a8760016130d6565b81526020019081526020015f206004015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20545f036127545773ffffffffffffffffffffffffffffffffffffffff87165f908152606660205260408120829161271d8860016130d6565b815260208082019290925260409081015f90812073ffffffffffffffffffffffffffffffffffffffff8b1682526004019092529020555b8673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f7a84a08b02c91f3c62d572853f966fc799bbd121e8ad7833a4494ab8dcfcb40487876040516127bc929190918252602082015260400190565b60405180910390a35050935093915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612858573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061287c9190613160565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af1158015612913573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129379190613177565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156129c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129e69190613160565b90505f831180156129ff5750826129fd828461314d565b145b610b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c65640000000000604482015260640161048e565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f6121928373ffffffffffffffffffffffffffffffffffffffff8416612b43565b5f6121928373ffffffffffffffffffffffffffffffffffffffff8416612c26565b5f825f018281548110612b3257612b326130e9565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015612c1d575f612b6560018361314d565b85549091505f90612b789060019061314d565b9050818114612bd7575f865f018281548110612b9657612b966130e9565b905f5260205f200154905080875f018481548110612bb657612bb66130e9565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080612be857612be8613192565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506120c1565b5f9150506120c1565b5f818152600183016020526040812054612c6b57508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556120c1565b505f6120c1565b5080545f8255905f5260205f209081019061217b91905b80821115612c9c575f8155600101612c89565b5090565b803573ffffffffffffffffffffffffffffffffffffffff81168114612cc3575f80fd5b919050565b5f60208284031215612cd8575f80fd5b61219282612ca0565b5f815180845260208085019450602084015f5b83811015612d2657815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612cf4565b509495945050505050565b5f815180845260208085019450602084015f5b83811015612d2657815187529582019590820190600101612d44565b604081525f612d726040830185612ce1565b8281036020840152612d848185612d31565b95945050505050565b5f8060408385031215612d9e575f80fd5b612da783612ca0565b946020939093013593505050565b5f805f8060808587031215612dc8575f80fd5b612dd185612ca0565b9350612ddf60208601612ca0565b93969395505050506040820135916060013590565b608081525f612e066080830187612ce1565b8281036020848101919091528651808352878201928201905f5b81811015612e3e578451151583529383019391830191600101612e20565b50508481036040860152612e528188612d31565b925050508281036060840152612e688185612d31565b979650505050505050565b5f8060408385031215612e84575f80fd5b612e8d83612ca0565b9150612e9b60208401612ca0565b90509250929050565b5f805f60608486031215612eb6575f80fd5b612ebf84612ca0565b9250612ecd60208501612ca0565b9150604084013590509250925092565b801515811461217b575f80fd5b5f805f805f8060c08789031215612eff575f80fd5b612f0887612ca0565b9550612f1660208801612ca0565b945060408701359350606087013592506080870135915060a0870135612f3b81612edd565b809150509295509295509295565b5f8083601f840112612f59575f80fd5b50813567ffffffffffffffff811115612f70575f80fd5b6020830191508360208260051b8501011115612f8a575f80fd5b9250929050565b5f805f805f805f6080888a031215612fa7575f80fd5b87359650602088013567ffffffffffffffff80821115612fc5575f80fd5b612fd18b838c01612f49565b909850965060408a0135915080821115612fe9575f80fd5b612ff58b838c01612f49565b909650945060608a013591508082111561300d575f80fd5b5061301a8a828b01612f49565b989b979a50959850939692959293505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820281158282048414176120c1576120c161305a565b5f826130d1577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b808201808211156120c1576120c161305a565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131465761314661305a565b5060010190565b818103818111156120c1576120c161305a565b5f60208284031215613170575f80fd5b5051919050565b5f60208284031215613187575f80fd5b815161219281612edd565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffdfea164736f6c6343000818000a" - -func init() { - if err := json.Unmarshal([]byte(DistributeStorageLayoutJSON), DistributeStorageLayout); err != nil { - panic(err) - } - - layouts["Distribute"] = DistributeStorageLayout - deployedBytecodes["Distribute"] = DistributeDeployedBin -} diff --git a/bindings/bindings/gov.go b/bindings/bindings/gov.go index 464d964eb..335997f3c 100644 --- a/bindings/bindings/gov.go +++ b/bindings/bindings/gov.go @@ -33,13 +33,12 @@ var ( type IGovProposalData struct { BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int } // GovMetaData contains all meta data concerning the Gov contract. var GovMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBatchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBatchBlockInterval\",\"type\":\"uint256\"}],\"name\":\"BatchBlockIntervalUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBatchTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBatchTimeout\",\"type\":\"uint256\"}],\"name\":\"BatchTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rollupEpoch\",\"type\":\"uint256\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rollupEpoch\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"odlRollupEpoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRollupEpoch\",\"type\":\"uint256\"}],\"name\":\"RollupEpochUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalVotingDuration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalVotingDuration\",\"type\":\"uint256\"}],\"name\":\"VotingDurationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchBlockInterval\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deleteTo\",\"type\":\"uint256\"}],\"name\":\"cleanUpExpiredProposals\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupEpoch\",\"type\":\"uint256\"}],\"internalType\":\"structIGov.ProposalData\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"createProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentProposalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"executeProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_votingDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_batchTimeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_rollupEpoch\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"isVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestExecutedProposalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupEpoch\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalInfos\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expirationTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"executed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rollupEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rollupEpochUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_votingDuration\",\"type\":\"uint256\"}],\"name\":\"setVotingDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"undeletedProposalStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60c060405234801561000f575f80fd5b5073530000000000000000000000000000000000001560805273530000000000000000000000000000000000001760a05261004861004d565b610109565b5f54610100900460ff16156100b85760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811614610107575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160a051611a7c61013f5f395f81816102e2015281816103f7015281816107f401526112f601525f61026f0152611a7c5ff3fe608060405234801561000f575f80fd5b5060043610610184575f3560e01c8063807de443116100dd578063b511328d11610088578063e5aec99511610063578063e5aec995146103b0578063f2fde38b146103b9578063f92ad219146103cc575f80fd5b8063b511328d14610356578063d5cc89ba14610394578063d7693075146103a7575f80fd5b80638e21d5fb116100b85780638e21d5fb146102dd57806396dea93614610304578063a83d07371461034d575f80fd5b8063807de4431461026a57806385963052146102b65780638da5cb5b146102bf575f80fd5b806349c1a5811161013d578063715018a611610118578063715018a61461022757806374c260cf1461022f57806377c7938014610261575f80fd5b806349c1a581146101e85780635bcfadb51461020b578063639661901461021e575f80fd5b8063132002fc1161016d578063132002fc146101b0578063237a4b96146101cc5780634428c1a4146101df575f80fd5b80630121b93f146101885780630d61b5191461019d575b5f80fd5b61019b610196366004611764565b6103df565b005b61019b6101ab366004611764565b610727565b6101b9606b5481565b6040519081526020015b60405180910390f35b6101b96101da36600461177b565b6107db565b6101b9606a5481565b6101fb6101f63660046117b2565b610acb565b60405190151581526020016101c3565b61019b610219366004611764565b610aeb565b6101b9606c5481565b61019b610bba565b61024261023d366004611764565b610bcd565b60408051931515845291151560208401521515908201526060016101c3565b6101b960675481565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c3565b6101b960655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610291565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b610332610312366004611764565b606e6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101c3565b6101b960715481565b61037f610364366004611764565b606f6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101c3565b61019b6103a2366004611764565b610d25565b6101b9606d5481565b6101b960695481565b61019b6103c73660046117e0565b610e38565b61019b6103da366004611802565b610ed5565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610484573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104a89190611842565b9050806104fc5760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b606c5482111561054e5760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b607154821161059f5760405162461bcd60e51b815260206004820152601260248201527f657870697265642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b606d548210156105f15760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104f3565b5f828152606f60205260409020805460019091015460ff1680610612575080155b8061061c57504281105b156106695760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104f3565b610680335f858152607060205260409020906112a3565b156106f35760405162461bcd60e51b815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c000000000000000000000000000000000000000000000060648201526084016104f3565b61070a335f858152607060205260409020906112d1565b50610714836112f2565b156107225761072283611429565b505050565b5f8061073283610bcd565b509150915081156107855760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104f3565b806107d25760405162461bcd60e51b815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e207061737365642079657460448201526064016104f3565b61072283611429565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610881573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108a59190611842565b9050806108f45760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064016104f3565b82604001355f036109475760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f636800000000000000000000000060448201526064016104f3565b82351515806109595750602083013515155b6109a55760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104f3565b606c8054905f6109b48361188e565b9091555050606c545f908152606e6020526040902083906109ec82828135815560208201356001820155604082013560028201555050565b9050506040518060400160405280606b5442610a0891906118c5565b81525f6020918201819052606c548152606f82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905533606c54604080518635815260208088013590820152818701359181019190915273ffffffffffffffffffffffffffffffffffffffff92909216917f66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac6420849060600160405180910390a35050606c54919050565b5f828152607060205260408120610ae290836112a3565b90505b92915050565b610af361160d565b5f81118015610b045750606b548114155b610b755760405162461bcd60e51b8152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016104f3565b606b80549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610bc261160d565b610bcb5f611674565b565b5f805f606c54841115610c225760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104f3565b607154841015610c745760405162461bcd60e51b815260206004820152601060248201527f657870697265642070726f706f73616c0000000000000000000000000000000060448201526064016104f3565b606d54841015610cc65760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104f3565b6071548403610cdd57506001915081905080610d1e565b5f848152606f602052604090206001810154905460ff909116908180610d01575080155b80610d0b57504281105b610d14876112f2565b8394509450945050505b9193909250565b6071548110610d9c5760405162461bcd60e51b815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c000060648201526084016104f3565b606d545b818111610e26575f818152606e6020908152604080832083815560018082018590556002909101849055606f83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560709091528120908181610e0f8282611736565b505050508080610e1e9061188e565b915050610da0565b50610e328160016118c5565b606d5550565b610e4061160d565b73ffffffffffffffffffffffffffffffffffffffff8116610ec95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104f3565b610ed281611674565b50565b5f54610100900460ff1615808015610ef357505f54600160ff909116105b80610f0c5750303b158015610f0c57505f5460ff166001145b610f7e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104f3565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff861661103d5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016104f3565b5f851161108c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e60448201526064016104f3565b5f82116110db5760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f636800000000000000000000000060448201526064016104f3565b831515806110e857508215155b6111345760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104f3565b61113d86611674565b606b85905560658490556067839055606982905542606a55604080515f8152602081018790527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018690527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018590527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a1604080515f8152602081018490527f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a1801561129b575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001830160205260408120541515610ae2565b5f610ae28373ffffffffffffffffffffffffffffffffffffffff84166116ea565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa15801561135c573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526113a19190810190611915565b90505f805b8251811015611406576113eb8382815181106113c4576113c46119f3565b602002602001015160705f8881526020019081526020015f206112a390919063ffffffff16565b156113fe576113fb8260016118c5565b91505b6001016113a6565b506003825160026114179190611a20565b6114219190611a37565b109392505050565b60718190555f818152606e60205260409020546065541461149d57606580545f838152606e60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b9161149391848252602082015260400190565b60405180910390a1505b5f818152606e60205260409020600101546067541461151257606780545f838152606e60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa69706265699161150891848252602082015260400190565b60405180910390a1505b5f818152606e60205260409020600201546069541461158657606980545f838152606e6020908152604091829020600201805490945542606a55925481518381529384015290917f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a1505b5f818152606f6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556065546067546069548451928352928201529182015281907fd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c9060600160405180910390a250565b60335473ffffffffffffffffffffffffffffffffffffffff163314610bcb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81815260018301602052604081205461172f57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610ae5565b505f610ae5565b5080545f8255905f5260205f2090810190610ed291905b80821115611760575f815560010161174d565b5090565b5f60208284031215611774575f80fd5b5035919050565b5f6060828403121561178b575f80fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610ed2575f80fd5b5f80604083850312156117c3575f80fd5b8235915060208301356117d581611791565b809150509250929050565b5f602082840312156117f0575f80fd5b81356117fb81611791565b9392505050565b5f805f805f60a08688031215611816575f80fd5b853561182181611791565b97602087013597506040870135966060810135965060800135945092505050565b5f60208284031215611852575f80fd5b815180151581146117fb575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118be576118be611861565b5060010190565b80820180821115610ae557610ae5611861565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b805161191081611791565b919050565b5f6020808385031215611926575f80fd5b825167ffffffffffffffff8082111561193d575f80fd5b818501915085601f830112611950575f80fd5b815181811115611962576119626118d8565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156119a5576119a56118d8565b6040529182528482019250838101850191888311156119c2575f80fd5b938501935b828510156119e7576119d885611905565b845293850193928501926119c7565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8082028115828204841417610ae557610ae5611861565b5f82611a6a577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBatchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBatchBlockInterval\",\"type\":\"uint256\"}],\"name\":\"BatchBlockIntervalUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBatchTimeout\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBatchTimeout\",\"type\":\"uint256\"}],\"name\":\"BatchTimeoutUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalVotingDuration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalVotingDuration\",\"type\":\"uint256\"}],\"name\":\"VotingDurationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchBlockInterval\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchTimeout\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"deleteTo\",\"type\":\"uint256\"}],\"name\":\"cleanUpExpiredProposals\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"}],\"internalType\":\"structIGov.ProposalData\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"createProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentProposalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"executeProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_votingDuration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_batchTimeout\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"isVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestExecutedProposalID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"batchBlockInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"batchTimeout\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalInfos\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expirationTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"executed\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"proposalStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_votingDuration\",\"type\":\"uint256\"}],\"name\":\"setVotingDuration\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"undeletedProposalStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalID\",\"type\":\"uint256\"}],\"name\":\"vote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60c060405234801561000f575f80fd5b5073530000000000000000000000000000000000001560805273530000000000000000000000000000000000001760a05261004861004d565b610109565b5f54610100900460ff16156100b85760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff90811614610107575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160a0516118b561013f5f395f81816102c3015281816103c101528181610d5401526111b101525f61025001526118b55ff3fe608060405234801561000f575f80fd5b506004361061016e575f3560e01c8063807de443116100d2578063a83d073711610088578063d5cc89ba11610063578063d5cc89ba1461037a578063d76930751461038d578063f2fde38b14610396575f80fd5b8063a83d073714610320578063acfd4cd814610329578063b511328d1461033c575f80fd5b80638da5cb5b116100b85780638da5cb5b146102a05780638e21d5fb146102be57806396dea936146102e5575f80fd5b8063807de4431461024b5780638596305214610297575f80fd5b80635bcfadb511610127578063715018a61161010d578063715018a61461020857806374c260cf1461021057806377c7938014610242575f80fd5b80635bcfadb5146101ec57806363966190146101ff575f80fd5b8063132002fc11610157578063132002fc1461019a57806349c1a581146101b65780634ec81af1146101d9575f80fd5b80630121b93f146101725780630d61b51914610187575b5f80fd5b6101856101803660046115a5565b6103a9565b005b6101856101953660046115a5565b6106f1565b6101a360675481565b6040519081526020015b60405180910390f35b6101c96101c43660046115dd565b6107a5565b60405190151581526020016101ad565b6101856101e736600461160b565b6107c5565b6101856101fa3660046115a5565b610b01565b6101a360685481565b610185610bd0565b61022361021e3660046115a5565b610be3565b60408051931515845291151560208401521515908201526060016101ad565b6101a360665481565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ad565b6101a360655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610272565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b61030b6102f33660046115a5565b606a6020525f90815260409020805460019091015482565b604080519283526020830191909152016101ad565b6101a3606d5481565b6101a3610337366004611643565b610d3b565b61036561034a3660046115a5565b606b6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101ad565b6101856103883660046115a5565b610fb6565b6101a360695481565b6101856103a4366004611659565b6110c1565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa15801561044e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610472919061167b565b9050806104c65760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b6068548211156105185760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b606d5482116105695760405162461bcd60e51b815260206004820152601260248201527f657870697265642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b6069548210156105bb5760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104bd565b5f828152606b60205260409020805460019091015460ff16806105dc575080155b806105e657504281105b156106335760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104bd565b61064a335f858152606c602052604090209061115e565b156106bd5760405162461bcd60e51b815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c000000000000000000000000000000000000000000000060648201526084016104bd565b6106d4335f858152606c602052604090209061118c565b506106de836111ad565b156106ec576106ec836112e4565b505050565b5f806106fc83610be3565b5091509150811561074f5760405162461bcd60e51b815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104bd565b8061079c5760405162461bcd60e51b815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e207061737365642079657460448201526064016104bd565b6106ec836112e4565b5f828152606c602052604081206107bc908361115e565b90505b92915050565b5f54610100900460ff16158080156107e357505f54600160ff909116105b806107fc5750303b1580156107fc57505f5460ff166001145b61086e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104bd565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156108ca575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff851661092d5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016104bd565b5f841161097c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e60448201526064016104bd565b8215158061098957508115155b6109d55760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104bd565b6109de8561144e565b606784905560658390556066829055604080515f8152602081018690527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018590527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018490527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a18015610afa575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b610b096114c4565b5f81118015610b1a57506067548114155b610b8b5760405162461bcd60e51b8152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016104bd565b606780549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610bd86114c4565b610be15f61144e565b565b5f805f606854841115610c385760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104bd565b606d54841015610c8a5760405162461bcd60e51b815260206004820152601060248201527f657870697265642070726f706f73616c0000000000000000000000000000000060448201526064016104bd565b606954841015610cdc5760405162461bcd60e51b815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104bd565b606d548403610cf357506001915081905080610d34565b5f848152606b602052604090206001810154905460ff909116908180610d17575080155b80610d2157504281105b610d2a876111ad565b8394509450945050505b9193909250565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610de1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e05919061167b565b905080610e545760405162461bcd60e51b815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064016104bd565b8235151580610e665750602083013515155b610eb25760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104bd565b60688054905f610ec1836116c7565b90915550506068545f908152606a602090815260409091208435815590840135600182015550604051806040016040528060675442610f0091906116fe565b81525f60209182018190526068548152606b82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790553360685460408051863581526020808801359082015273ffffffffffffffffffffffffffffffffffffffff93909316927fd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39910160405180910390a35050606854919050565b606d54811061102d5760405162461bcd60e51b815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c000060648201526084016104bd565b6069545b8181116110af575f818152606a602090815260408083208381556001908101849055606b83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055606c90915281209081816110988282611577565b5050505080806110a7906116c7565b915050611031565b506110bb8160016116fe565b60695550565b6110c96114c4565b73ffffffffffffffffffffffffffffffffffffffff81166111525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104bd565b61115b8161144e565b50565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260018301602052604081205415156107bc565b5f6107bc8373ffffffffffffffffffffffffffffffffffffffff841661152b565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa158015611217573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261125c919081019061174e565b90505f805b82518110156112c1576112a683828151811061127f5761127f61182c565b6020026020010151606c5f8881526020019081526020015f2061115e90919063ffffffff16565b156112b9576112b68260016116fe565b91505b600101611261565b506003825160026112d29190611859565b6112dc9190611870565b109392505050565b606d8190555f818152606a60205260409020546065541461135857606580545f838152606a60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b9161134e91848252602082015260400190565b60405180910390a1505b5f818152606a6020526040902060010154606654146113cd57606680545f838152606a60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569916113c391848252602082015260400190565b60405180910390a1505b5f818152606b6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905560655460665483519182529181019190915282917f3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9910160405180910390a250565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610be15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104bd565b5f81815260018301602052604081205461157057508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556107bf565b505f6107bf565b5080545f8255905f5260205f209081019061115b91905b808211156115a1575f815560010161158e565b5090565b5f602082840312156115b5575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461115b575f80fd5b5f80604083850312156115ee575f80fd5b823591506020830135611600816115bc565b809150509250929050565b5f805f806080858703121561161e575f80fd5b8435611629816115bc565b966020860135965060408601359560600135945092505050565b5f60408284031215611653575f80fd5b50919050565b5f60208284031215611669575f80fd5b8135611674816115bc565b9392505050565b5f6020828403121561168b575f80fd5b81518015158114611674575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036116f7576116f761169a565b5060010190565b808201808211156107bf576107bf61169a565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b8051611749816115bc565b919050565b5f602080838503121561175f575f80fd5b825167ffffffffffffffff80821115611776575f80fd5b818501915085601f830112611789575f80fd5b81518181111561179b5761179b611711565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156117de576117de611711565b6040529182528482019250838101850191888311156117fb575f80fd5b938501935b82851015611820576118118561173e565b84529385019392850192611800565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820281158282048414176107bf576107bf61169a565b5f826118a3577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a", } // GovABI is the input ABI used to generate the binding from. @@ -459,11 +458,10 @@ func (_Gov *GovCallerSession) Owner() (common.Address, error) { // ProposalData is a free data retrieval call binding the contract method 0x96dea936. // -// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovCaller) ProposalData(opts *bind.CallOpts, proposalID *big.Int) (struct { BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int }, error) { var out []interface{} err := _Gov.contract.Call(opts, &out, "proposalData", proposalID) @@ -471,7 +469,6 @@ func (_Gov *GovCaller) ProposalData(opts *bind.CallOpts, proposalID *big.Int) (s outstruct := new(struct { BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int }) if err != nil { return *outstruct, err @@ -479,7 +476,6 @@ func (_Gov *GovCaller) ProposalData(opts *bind.CallOpts, proposalID *big.Int) (s outstruct.BatchBlockInterval = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) outstruct.BatchTimeout = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - outstruct.RollupEpoch = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) return *outstruct, err @@ -487,22 +483,20 @@ func (_Gov *GovCaller) ProposalData(opts *bind.CallOpts, proposalID *big.Int) (s // ProposalData is a free data retrieval call binding the contract method 0x96dea936. // -// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovSession) ProposalData(proposalID *big.Int) (struct { BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int }, error) { return _Gov.Contract.ProposalData(&_Gov.CallOpts, proposalID) } // ProposalData is a free data retrieval call binding the contract method 0x96dea936. // -// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: function proposalData(uint256 proposalID) view returns(uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovCallerSession) ProposalData(proposalID *big.Int) (struct { BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int }, error) { return _Gov.Contract.ProposalData(&_Gov.CallOpts, proposalID) } @@ -585,68 +579,6 @@ func (_Gov *GovCallerSession) ProposalStatus(proposalID *big.Int) (bool, bool, b return _Gov.Contract.ProposalStatus(&_Gov.CallOpts, proposalID) } -// RollupEpoch is a free data retrieval call binding the contract method 0xe5aec995. -// -// Solidity: function rollupEpoch() view returns(uint256) -func (_Gov *GovCaller) RollupEpoch(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Gov.contract.Call(opts, &out, "rollupEpoch") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// RollupEpoch is a free data retrieval call binding the contract method 0xe5aec995. -// -// Solidity: function rollupEpoch() view returns(uint256) -func (_Gov *GovSession) RollupEpoch() (*big.Int, error) { - return _Gov.Contract.RollupEpoch(&_Gov.CallOpts) -} - -// RollupEpoch is a free data retrieval call binding the contract method 0xe5aec995. -// -// Solidity: function rollupEpoch() view returns(uint256) -func (_Gov *GovCallerSession) RollupEpoch() (*big.Int, error) { - return _Gov.Contract.RollupEpoch(&_Gov.CallOpts) -} - -// RollupEpochUpdateTime is a free data retrieval call binding the contract method 0x4428c1a4. -// -// Solidity: function rollupEpochUpdateTime() view returns(uint256) -func (_Gov *GovCaller) RollupEpochUpdateTime(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Gov.contract.Call(opts, &out, "rollupEpochUpdateTime") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// RollupEpochUpdateTime is a free data retrieval call binding the contract method 0x4428c1a4. -// -// Solidity: function rollupEpochUpdateTime() view returns(uint256) -func (_Gov *GovSession) RollupEpochUpdateTime() (*big.Int, error) { - return _Gov.Contract.RollupEpochUpdateTime(&_Gov.CallOpts) -} - -// RollupEpochUpdateTime is a free data retrieval call binding the contract method 0x4428c1a4. -// -// Solidity: function rollupEpochUpdateTime() view returns(uint256) -func (_Gov *GovCallerSession) RollupEpochUpdateTime() (*big.Int, error) { - return _Gov.Contract.RollupEpochUpdateTime(&_Gov.CallOpts) -} - // UndeletedProposalStart is a free data retrieval call binding the contract method 0xd7693075. // // Solidity: function undeletedProposalStart() view returns(uint256) @@ -730,23 +662,23 @@ func (_Gov *GovTransactorSession) CleanUpExpiredProposals(deleteTo *big.Int) (*t return _Gov.Contract.CleanUpExpiredProposals(&_Gov.TransactOpts, deleteTo) } -// CreateProposal is a paid mutator transaction binding the contract method 0x237a4b96. +// CreateProposal is a paid mutator transaction binding the contract method 0xacfd4cd8. // -// Solidity: function createProposal((uint256,uint256,uint256) proposal) returns(uint256) +// Solidity: function createProposal((uint256,uint256) proposal) returns(uint256) func (_Gov *GovTransactor) CreateProposal(opts *bind.TransactOpts, proposal IGovProposalData) (*types.Transaction, error) { return _Gov.contract.Transact(opts, "createProposal", proposal) } -// CreateProposal is a paid mutator transaction binding the contract method 0x237a4b96. +// CreateProposal is a paid mutator transaction binding the contract method 0xacfd4cd8. // -// Solidity: function createProposal((uint256,uint256,uint256) proposal) returns(uint256) +// Solidity: function createProposal((uint256,uint256) proposal) returns(uint256) func (_Gov *GovSession) CreateProposal(proposal IGovProposalData) (*types.Transaction, error) { return _Gov.Contract.CreateProposal(&_Gov.TransactOpts, proposal) } -// CreateProposal is a paid mutator transaction binding the contract method 0x237a4b96. +// CreateProposal is a paid mutator transaction binding the contract method 0xacfd4cd8. // -// Solidity: function createProposal((uint256,uint256,uint256) proposal) returns(uint256) +// Solidity: function createProposal((uint256,uint256) proposal) returns(uint256) func (_Gov *GovTransactorSession) CreateProposal(proposal IGovProposalData) (*types.Transaction, error) { return _Gov.Contract.CreateProposal(&_Gov.TransactOpts, proposal) } @@ -772,25 +704,25 @@ func (_Gov *GovTransactorSession) ExecuteProposal(proposalID *big.Int) (*types.T return _Gov.Contract.ExecuteProposal(&_Gov.TransactOpts, proposalID) } -// Initialize is a paid mutator transaction binding the contract method 0xf92ad219. +// Initialize is a paid mutator transaction binding the contract method 0x4ec81af1. // -// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout, uint256 _rollupEpoch) returns() -func (_Gov *GovTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int, _rollupEpoch *big.Int) (*types.Transaction, error) { - return _Gov.contract.Transact(opts, "initialize", _owner, _votingDuration, _batchBlockInterval, _batchTimeout, _rollupEpoch) +// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout) returns() +func (_Gov *GovTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int) (*types.Transaction, error) { + return _Gov.contract.Transact(opts, "initialize", _owner, _votingDuration, _batchBlockInterval, _batchTimeout) } -// Initialize is a paid mutator transaction binding the contract method 0xf92ad219. +// Initialize is a paid mutator transaction binding the contract method 0x4ec81af1. // -// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout, uint256 _rollupEpoch) returns() -func (_Gov *GovSession) Initialize(_owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int, _rollupEpoch *big.Int) (*types.Transaction, error) { - return _Gov.Contract.Initialize(&_Gov.TransactOpts, _owner, _votingDuration, _batchBlockInterval, _batchTimeout, _rollupEpoch) +// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout) returns() +func (_Gov *GovSession) Initialize(_owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int) (*types.Transaction, error) { + return _Gov.Contract.Initialize(&_Gov.TransactOpts, _owner, _votingDuration, _batchBlockInterval, _batchTimeout) } -// Initialize is a paid mutator transaction binding the contract method 0xf92ad219. +// Initialize is a paid mutator transaction binding the contract method 0x4ec81af1. // -// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout, uint256 _rollupEpoch) returns() -func (_Gov *GovTransactorSession) Initialize(_owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int, _rollupEpoch *big.Int) (*types.Transaction, error) { - return _Gov.Contract.Initialize(&_Gov.TransactOpts, _owner, _votingDuration, _batchBlockInterval, _batchTimeout, _rollupEpoch) +// Solidity: function initialize(address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, uint256 _batchTimeout) returns() +func (_Gov *GovTransactorSession) Initialize(_owner common.Address, _votingDuration *big.Int, _batchBlockInterval *big.Int, _batchTimeout *big.Int) (*types.Transaction, error) { + return _Gov.Contract.Initialize(&_Gov.TransactOpts, _owner, _votingDuration, _batchBlockInterval, _batchTimeout) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -1507,13 +1439,12 @@ type GovProposalCreated struct { Creator common.Address BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterProposalCreated is a free log retrieval operation binding the contract event 0x66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac642084. +// FilterProposalCreated is a free log retrieval operation binding the contract event 0xd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39. // -// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) FilterProposalCreated(opts *bind.FilterOpts, proposalID []*big.Int, creator []common.Address) (*GovProposalCreatedIterator, error) { var proposalIDRule []interface{} @@ -1532,9 +1463,9 @@ func (_Gov *GovFilterer) FilterProposalCreated(opts *bind.FilterOpts, proposalID return &GovProposalCreatedIterator{contract: _Gov.contract, event: "ProposalCreated", logs: logs, sub: sub}, nil } -// WatchProposalCreated is a free log subscription operation binding the contract event 0x66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac642084. +// WatchProposalCreated is a free log subscription operation binding the contract event 0xd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39. // -// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) WatchProposalCreated(opts *bind.WatchOpts, sink chan<- *GovProposalCreated, proposalID []*big.Int, creator []common.Address) (event.Subscription, error) { var proposalIDRule []interface{} @@ -1578,9 +1509,9 @@ func (_Gov *GovFilterer) WatchProposalCreated(opts *bind.WatchOpts, sink chan<- }), nil } -// ParseProposalCreated is a log parse operation binding the contract event 0x66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac642084. +// ParseProposalCreated is a log parse operation binding the contract event 0xd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39. // -// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalCreated(uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) ParseProposalCreated(log types.Log) (*GovProposalCreated, error) { event := new(GovProposalCreated) if err := _Gov.contract.UnpackLog(event, "ProposalCreated", log); err != nil { @@ -1662,13 +1593,12 @@ type GovProposalExecuted struct { ProposalID *big.Int BatchBlockInterval *big.Int BatchTimeout *big.Int - RollupEpoch *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterProposalExecuted is a free log retrieval operation binding the contract event 0xd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c. +// FilterProposalExecuted is a free log retrieval operation binding the contract event 0x3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9. // -// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) FilterProposalExecuted(opts *bind.FilterOpts, proposalID []*big.Int) (*GovProposalExecutedIterator, error) { var proposalIDRule []interface{} @@ -1683,9 +1613,9 @@ func (_Gov *GovFilterer) FilterProposalExecuted(opts *bind.FilterOpts, proposalI return &GovProposalExecutedIterator{contract: _Gov.contract, event: "ProposalExecuted", logs: logs, sub: sub}, nil } -// WatchProposalExecuted is a free log subscription operation binding the contract event 0xd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c. +// WatchProposalExecuted is a free log subscription operation binding the contract event 0x3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9. // -// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) WatchProposalExecuted(opts *bind.WatchOpts, sink chan<- *GovProposalExecuted, proposalID []*big.Int) (event.Subscription, error) { var proposalIDRule []interface{} @@ -1725,9 +1655,9 @@ func (_Gov *GovFilterer) WatchProposalExecuted(opts *bind.WatchOpts, sink chan<- }), nil } -// ParseProposalExecuted is a log parse operation binding the contract event 0xd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c. +// ParseProposalExecuted is a log parse operation binding the contract event 0x3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9. // -// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) +// Solidity: event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout) func (_Gov *GovFilterer) ParseProposalExecuted(log types.Log) (*GovProposalExecuted, error) { event := new(GovProposalExecuted) if err := _Gov.contract.UnpackLog(event, "ProposalExecuted", log); err != nil { @@ -1737,141 +1667,6 @@ func (_Gov *GovFilterer) ParseProposalExecuted(log types.Log) (*GovProposalExecu return event, nil } -// GovRollupEpochUpdatedIterator is returned from FilterRollupEpochUpdated and is used to iterate over the raw logs and unpacked data for RollupEpochUpdated events raised by the Gov contract. -type GovRollupEpochUpdatedIterator struct { - Event *GovRollupEpochUpdated // 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 *GovRollupEpochUpdatedIterator) 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(GovRollupEpochUpdated) - 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(GovRollupEpochUpdated) - 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 *GovRollupEpochUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *GovRollupEpochUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// GovRollupEpochUpdated represents a RollupEpochUpdated event raised by the Gov contract. -type GovRollupEpochUpdated struct { - OdlRollupEpoch *big.Int - NewRollupEpoch *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRollupEpochUpdated is a free log retrieval operation binding the contract event 0x9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f. -// -// Solidity: event RollupEpochUpdated(uint256 odlRollupEpoch, uint256 newRollupEpoch) -func (_Gov *GovFilterer) FilterRollupEpochUpdated(opts *bind.FilterOpts) (*GovRollupEpochUpdatedIterator, error) { - - logs, sub, err := _Gov.contract.FilterLogs(opts, "RollupEpochUpdated") - if err != nil { - return nil, err - } - return &GovRollupEpochUpdatedIterator{contract: _Gov.contract, event: "RollupEpochUpdated", logs: logs, sub: sub}, nil -} - -// WatchRollupEpochUpdated is a free log subscription operation binding the contract event 0x9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f. -// -// Solidity: event RollupEpochUpdated(uint256 odlRollupEpoch, uint256 newRollupEpoch) -func (_Gov *GovFilterer) WatchRollupEpochUpdated(opts *bind.WatchOpts, sink chan<- *GovRollupEpochUpdated) (event.Subscription, error) { - - logs, sub, err := _Gov.contract.WatchLogs(opts, "RollupEpochUpdated") - 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(GovRollupEpochUpdated) - if err := _Gov.contract.UnpackLog(event, "RollupEpochUpdated", 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 -} - -// ParseRollupEpochUpdated is a log parse operation binding the contract event 0x9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f. -// -// Solidity: event RollupEpochUpdated(uint256 odlRollupEpoch, uint256 newRollupEpoch) -func (_Gov *GovFilterer) ParseRollupEpochUpdated(log types.Log) (*GovRollupEpochUpdated, error) { - event := new(GovRollupEpochUpdated) - if err := _Gov.contract.UnpackLog(event, "RollupEpochUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - // GovVotingDurationUpdatedIterator is returned from FilterVotingDurationUpdated and is used to iterate over the raw logs and unpacked data for VotingDurationUpdated events raised by the Gov contract. type GovVotingDurationUpdatedIterator struct { Event *GovVotingDurationUpdated // Event containing the contract specifics and raw log diff --git a/bindings/bindings/gov_more.go b/bindings/bindings/gov_more.go index dd15ac15a..9d4132f9a 100644 --- a/bindings/bindings/gov_more.go +++ b/bindings/bindings/gov_more.go @@ -9,11 +9,11 @@ import ( "morph-l2/bindings/solc" ) -const GovStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1019_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1018_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"batchBlockInterval\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"batchMaxBytes\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"batchTimeout\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_uint256\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"maxChunks\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"rollupEpoch\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_uint256\"},{\"astId\":1010,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"rollupEpochUpdateTime\",\"offset\":0,\"slot\":\"106\",\"type\":\"t_uint256\"},{\"astId\":1011,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"votingDuration\",\"offset\":0,\"slot\":\"107\",\"type\":\"t_uint256\"},{\"astId\":1012,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"currentProposalID\",\"offset\":0,\"slot\":\"108\",\"type\":\"t_uint256\"},{\"astId\":1013,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"undeletedProposalStart\",\"offset\":0,\"slot\":\"109\",\"type\":\"t_uint256\"},{\"astId\":1014,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"proposalData\",\"offset\":0,\"slot\":\"110\",\"type\":\"t_mapping(t_uint256,t_struct(ProposalData)1021_storage)\"},{\"astId\":1015,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"proposalInfos\",\"offset\":0,\"slot\":\"111\",\"type\":\"t_mapping(t_uint256,t_struct(ProposalInfo)1022_storage)\"},{\"astId\":1016,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"votes\",\"offset\":0,\"slot\":\"112\",\"type\":\"t_mapping(t_uint256,t_struct(AddressSet)1020_storage)\"},{\"astId\":1017,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"latestExecutedProposalID\",\"offset\":0,\"slot\":\"113\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_bytes32)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"bytes32[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1018_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1019_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_uint256\"},\"t_mapping(t_uint256,t_struct(AddressSet)1020_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct EnumerableSetUpgradeable.AddressSet)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(AddressSet)1020_storage\"},\"t_mapping(t_uint256,t_struct(ProposalData)1021_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IGov.ProposalData)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(ProposalData)1021_storage\"},\"t_mapping(t_uint256,t_struct(ProposalInfo)1022_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IGov.ProposalInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(ProposalInfo)1022_storage\"},\"t_struct(AddressSet)1020_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.AddressSet\",\"numberOfBytes\":\"64\"},\"t_struct(ProposalData)1021_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IGov.ProposalData\",\"numberOfBytes\":\"96\"},\"t_struct(ProposalInfo)1022_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IGov.ProposalInfo\",\"numberOfBytes\":\"64\"},\"t_struct(Set)1023_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.Set\",\"numberOfBytes\":\"64\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" +const GovStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1015_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1014_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"batchBlockInterval\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"batchTimeout\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_uint256\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"votingDuration\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_uint256\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"currentProposalID\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"undeletedProposalStart\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_uint256\"},{\"astId\":1010,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"proposalData\",\"offset\":0,\"slot\":\"106\",\"type\":\"t_mapping(t_uint256,t_struct(ProposalData)1017_storage)\"},{\"astId\":1011,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"proposalInfos\",\"offset\":0,\"slot\":\"107\",\"type\":\"t_mapping(t_uint256,t_struct(ProposalInfo)1018_storage)\"},{\"astId\":1012,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"votes\",\"offset\":0,\"slot\":\"108\",\"type\":\"t_mapping(t_uint256,t_struct(AddressSet)1016_storage)\"},{\"astId\":1013,\"contract\":\"contracts/l2/staking/Gov.sol:Gov\",\"label\":\"latestExecutedProposalID\",\"offset\":0,\"slot\":\"109\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_bytes32)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"bytes32[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1014_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1015_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_mapping(t_bytes32,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_uint256\"},\"t_mapping(t_uint256,t_struct(AddressSet)1016_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct EnumerableSetUpgradeable.AddressSet)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(AddressSet)1016_storage\"},\"t_mapping(t_uint256,t_struct(ProposalData)1017_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IGov.ProposalData)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(ProposalData)1017_storage\"},\"t_mapping(t_uint256,t_struct(ProposalInfo)1018_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IGov.ProposalInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(ProposalInfo)1018_storage\"},\"t_struct(AddressSet)1016_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.AddressSet\",\"numberOfBytes\":\"64\"},\"t_struct(ProposalData)1017_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IGov.ProposalData\",\"numberOfBytes\":\"64\"},\"t_struct(ProposalInfo)1018_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IGov.ProposalInfo\",\"numberOfBytes\":\"64\"},\"t_struct(Set)1019_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.Set\",\"numberOfBytes\":\"64\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" var GovStorageLayout = new(solc.StorageLayout) -var GovDeployedBin = "0x608060405234801561000f575f80fd5b5060043610610184575f3560e01c8063807de443116100dd578063b511328d11610088578063e5aec99511610063578063e5aec995146103b0578063f2fde38b146103b9578063f92ad219146103cc575f80fd5b8063b511328d14610356578063d5cc89ba14610394578063d7693075146103a7575f80fd5b80638e21d5fb116100b85780638e21d5fb146102dd57806396dea93614610304578063a83d07371461034d575f80fd5b8063807de4431461026a57806385963052146102b65780638da5cb5b146102bf575f80fd5b806349c1a5811161013d578063715018a611610118578063715018a61461022757806374c260cf1461022f57806377c7938014610261575f80fd5b806349c1a581146101e85780635bcfadb51461020b578063639661901461021e575f80fd5b8063132002fc1161016d578063132002fc146101b0578063237a4b96146101cc5780634428c1a4146101df575f80fd5b80630121b93f146101885780630d61b5191461019d575b5f80fd5b61019b6101963660046119ba565b6103df565b005b61019b6101ab3660046119ba565b6107c3565b6101b9606b5481565b6040519081526020015b60405180910390f35b6101b96101da3660046119d1565b6108ab565b6101b9606a5481565b6101fb6101f6366004611a08565b610be9565b60405190151581526020016101c3565b61019b6102193660046119ba565b610c09565b6101b9606c5481565b61019b610cf2565b61024261023d3660046119ba565b610d05565b60408051931515845291151560208401521515908201526060016101c3565b6101b960675481565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c3565b6101b960655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610291565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6103326103123660046119ba565b606e6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101c3565b6101b960715481565b61037f6103643660046119ba565b606f6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101c3565b61019b6103a23660046119ba565b610eab565b6101b9606d5481565b6101b960695481565b61019b6103c7366004611a36565b610fd8565b61019b6103da366004611a58565b61108f565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610484573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104a89190611a98565b905080610516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b606c54821115610582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c49440000000000000000000000000000604482015260640161050d565b60715482116105ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f657870697265642070726f706f73616c49440000000000000000000000000000604482015260640161050d565b606d54821015610659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f70726f706f73616c207072756e65640000000000000000000000000000000000604482015260640161050d565b5f828152606f60205260409020805460019091015460ff168061067a575080155b8061068457504281105b156106eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f766f74696e672068617320656e64656400000000000000000000000000000000604482015260640161050d565b610702335f858152607060205260409020906114df565b1561078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c0000000000000000000000000000000000000000000000606482015260840161050d565b6107a6335f8581526070602052604090209061150d565b506107b08361152e565b156107be576107be83611665565b505050565b5f806107ce83610d05565b5091509150811561083b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f766f74696e672068617320656e64656400000000000000000000000000000000604482015260640161050d565b806108a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e2070617373656420796574604482015260640161050d565b6107be83611665565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610951573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109759190611a98565b9050806109de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f77656400000000000000000000604482015260640161050d565b82604001355f03610a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f6368000000000000000000000000604482015260640161050d565b8235151580610a5d5750602083013515155b610ac3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420626174636820706172616d73000000000000000000000000604482015260640161050d565b606c8054905f610ad283611ae4565b9091555050606c545f908152606e602052604090208390610b0a82828135815560208201356001820155604082013560028201555050565b9050506040518060400160405280606b5442610b269190611b1b565b81525f6020918201819052606c548152606f82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905533606c54604080518635815260208088013590820152818701359181019190915273ffffffffffffffffffffffffffffffffffffffff92909216917f66e5b37817dfa9935ab8e631ce7774a2e773d56cc8ea6815ac65f1fbac6420849060600160405180910390a35050606c54919050565b5f828152607060205260408120610c0090836114df565b90505b92915050565b610c11611849565b5f81118015610c225750606b548114155b610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e00000000000000000000000000000000000000000000000000000000606482015260840161050d565b606b80549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610cfa611849565b610d035f6118ca565b565b5f805f606c54841115610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c49440000000000000000000000000000604482015260640161050d565b607154841015610de0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f657870697265642070726f706f73616c00000000000000000000000000000000604482015260640161050d565b606d54841015610e4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f70726f706f73616c207072756e65640000000000000000000000000000000000604482015260640161050d565b6071548403610e6357506001915081905080610ea4565b5f848152606f602052604090206001810154905460ff909116908180610e87575080155b80610e9157504281105b610e9a8761152e565b8394509450945050505b9193909250565b6071548110610f3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c0000606482015260840161050d565b606d545b818111610fc6575f818152606e6020908152604080832083815560018082018590556002909101849055606f83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905560709091528120908181610faf828261198c565b505050508080610fbe90611ae4565b915050610f40565b50610fd2816001611b1b565b606d5550565b610fe0611849565b73ffffffffffffffffffffffffffffffffffffffff8116611083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161050d565b61108c816118ca565b50565b5f54610100900460ff16158080156110ad57505f54600160ff909116105b806110c65750303b1580156110c657505f5460ff166001145b611152576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161050d565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156111ae575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff861661122b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c6964206f776e657220616464726573730000000000000000000000604482015260640161050d565b5f8511611294576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e604482015260640161050d565b5f82116112fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420726f6c6c75702065706f6368000000000000000000000000604482015260640161050d565b8315158061130a57508215155b611370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420626174636820706172616d73000000000000000000000000604482015260640161050d565b611379866118ca565b606b85905560658490556067839055606982905542606a55604080515f8152602081018790527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018690527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018590527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a1604080515f8152602081018490527f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a180156114d7575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b73ffffffffffffffffffffffffffffffffffffffff81165f9081526001830160205260408120541515610c00565b5f610c008373ffffffffffffffffffffffffffffffffffffffff8416611940565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa158015611598573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526115dd9190810190611b6b565b90505f805b82518110156116425761162783828151811061160057611600611c49565b602002602001015160705f8881526020019081526020015f206114df90919063ffffffff16565b1561163a57611637826001611b1b565b91505b6001016115e2565b506003825160026116539190611c76565b61165d9190611c8d565b109392505050565b60718190555f818152606e6020526040902054606554146116d957606580545f838152606e60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b916116cf91848252602082015260400190565b60405180910390a1505b5f818152606e60205260409020600101546067541461174e57606780545f838152606e60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa69706265699161174491848252602082015260400190565b60405180910390a1505b5f818152606e6020526040902060020154606954146117c257606980545f838152606e6020908152604091829020600201805490945542606a55925481518381529384015290917f9b20ee151d057f4f3ece7fdf4ca1370cf143f181760e7712b722572f2dcba88f910160405180910390a1505b5f818152606f6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690911790556065546067546069548451928352928201529182015281907fd31188695e1c2a2d02b755e14fa986aca41d391c337437b9159eaed8347e7f1c9060600160405180910390a250565b60335473ffffffffffffffffffffffffffffffffffffffff163314610d03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161050d565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f81815260018301602052604081205461198557508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610c03565b505f610c03565b5080545f8255905f5260205f209081019061108c91905b808211156119b6575f81556001016119a3565b5090565b5f602082840312156119ca575f80fd5b5035919050565b5f606082840312156119e1575f80fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461108c575f80fd5b5f8060408385031215611a19575f80fd5b823591506020830135611a2b816119e7565b809150509250929050565b5f60208284031215611a46575f80fd5b8135611a51816119e7565b9392505050565b5f805f805f60a08688031215611a6c575f80fd5b8535611a77816119e7565b97602087013597506040870135966060810135965060800135945092505050565b5f60208284031215611aa8575f80fd5b81518015158114611a51575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b1457611b14611ab7565b5060010190565b80820180821115610c0357610c03611ab7565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b8051611b66816119e7565b919050565b5f6020808385031215611b7c575f80fd5b825167ffffffffffffffff80821115611b93575f80fd5b818501915085601f830112611ba6575f80fd5b815181811115611bb857611bb8611b2e565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611bfb57611bfb611b2e565b604052918252848201925083810185019188831115611c18575f80fd5b938501935b82851015611c3d57611c2e85611b5b565b84529385019392850192611c1d565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8082028115828204841417610c0357610c03611ab7565b5f82611cc0577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a" +var GovDeployedBin = "0x608060405234801561000f575f80fd5b506004361061016e575f3560e01c8063807de443116100d2578063a83d073711610088578063d5cc89ba11610063578063d5cc89ba1461037a578063d76930751461038d578063f2fde38b14610396575f80fd5b8063a83d073714610320578063acfd4cd814610329578063b511328d1461033c575f80fd5b80638da5cb5b116100b85780638da5cb5b146102a05780638e21d5fb146102be57806396dea936146102e5575f80fd5b8063807de4431461024b5780638596305214610297575f80fd5b80635bcfadb511610127578063715018a61161010d578063715018a61461020857806374c260cf1461021057806377c7938014610242575f80fd5b80635bcfadb5146101ec57806363966190146101ff575f80fd5b8063132002fc11610157578063132002fc1461019a57806349c1a581146101b65780634ec81af1146101d9575f80fd5b80630121b93f146101725780630d61b51914610187575b5f80fd5b6101856101803660046117c7565b6103a9565b005b6101856101953660046117c7565b61078d565b6101a360675481565b6040519081526020015b60405180910390f35b6101c96101c43660046117ff565b610875565b60405190151581526020016101ad565b6101856101e736600461182d565b610895565b6101856101fa3660046117c7565b610c39565b6101a360685481565b610185610d22565b61022361021e3660046117c7565b610d35565b60408051931515845291151560208401521515908201526060016101ad565b6101a360665481565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ad565b6101a360655481565b60335473ffffffffffffffffffffffffffffffffffffffff16610272565b6102727f000000000000000000000000000000000000000000000000000000000000000081565b61030b6102f33660046117c7565b606a6020525f90815260409020805460019091015482565b604080519283526020830191909152016101ad565b6101a3606d5481565b6101a3610337366004611865565b610edb565b61036561034a3660046117c7565b606b6020525f90815260409020805460019091015460ff1682565b604080519283529015156020830152016101ad565b6101856103883660046117c7565b61118a565b6101a360695481565b6101856103a436600461187b565b6112af565b5f73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa15801561044e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610472919061189d565b9050806104e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064015b60405180910390fd5b60685482111561054c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104d7565b606d5482116105b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f657870697265642070726f706f73616c4944000000000000000000000000000060448201526064016104d7565b606954821015610623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104d7565b5f828152606b60205260409020805460019091015460ff1680610644575080155b8061064e57504281105b156106b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104d7565b6106cc335f858152606c6020526040902090611366565b15610759576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f73657175656e63657220616c726561647920766f74656420666f72207468697360448201527f2070726f706f73616c000000000000000000000000000000000000000000000060648201526084016104d7565b610770335f858152606c6020526040902090611394565b5061077a836113b5565b1561078857610788836114ec565b505050565b5f8061079883610d35565b50915091508115610805576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f766f74696e672068617320656e6465640000000000000000000000000000000060448201526064016104d7565b8061086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f70726f706f73616c20686173206e6f74206265656e207061737365642079657460448201526064016104d7565b610788836114ec565b5f828152606c6020526040812061088c9083611366565b90505b92915050565b5f54610100900460ff16158080156108b357505f54600160ff909116105b806108cc5750303b1580156108cc57505f5460ff166001145b610958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104d7565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156109b4575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8516610a31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016104d7565b5f8411610a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f696e76616c69642070726f706f73616c20766f74696e67206475726174696f6e60448201526064016104d7565b82151580610aa757508115155b610b0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104d7565b610b1685611656565b606784905560658390556066829055604080515f8152602081018690527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a1604080515f8152602081018590527fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b910160405180910390a1604080515f8152602081018490527fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569910160405180910390a18015610c32575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b610c416116cc565b5f81118015610c5257506067548114155b610cdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f696e76616c6964206e65772070726f706f73616c20766f74696e67206475726160448201527f74696f6e0000000000000000000000000000000000000000000000000000000060648201526084016104d7565b606780549082905560408051828152602081018490527ffe810823e41a0cf27003f3eac9c17098028ba0aece75bd9783a8da7f75fb3aa3910160405180910390a15050565b610d2a6116cc565b610d335f611656565b565b5f805f606854841115610da4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642070726f706f73616c4944000000000000000000000000000060448201526064016104d7565b606d54841015610e10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f657870697265642070726f706f73616c0000000000000000000000000000000060448201526064016104d7565b606954841015610e7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f70726f706f73616c207072756e6564000000000000000000000000000000000060448201526064016104d7565b606d548403610e9357506001915081905080610ed4565b5f848152606b602052604090206001810154905460ff909116908180610eb7575080155b80610ec157504281105b610eca876113b5565b8394509450945050505b9193909250565b5f8073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016636d46e987336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa158015610f81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fa5919061189d565b90508061100e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f6f6e6c792073657175656e63657220616c6c6f7765640000000000000000000060448201526064016104d7565b82351515806110205750602083013515155b611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c696420626174636820706172616d7300000000000000000000000060448201526064016104d7565b60688054905f611095836118e9565b90915550506068545f908152606a6020908152604090912084358155908401356001820155506040518060400160405280606754426110d49190611920565b81525f60209182018190526068548152606b82526040902082518155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790553360685460408051863581526020808801359082015273ffffffffffffffffffffffffffffffffffffffff93909316927fd38d9a9a102af286aea1cbcadb8aab8446a90859626389db3710ed4fea4c2c39910160405180910390a35050606854919050565b606d54811061121b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f6f6e6c7920616c6c6f7720746f2064656c657465207468652070726f706f736160448201527f6c206265666f72206c6174657374207061737365642070726f706f73616c000060648201526084016104d7565b6069545b81811161129d575f818152606a602090815260408083208381556001908101849055606b83528184208481550180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055606c90915281209081816112868282611799565b505050508080611295906118e9565b91505061121f565b506112a9816001611920565b60695550565b6112b76116cc565b73ffffffffffffffffffffffffffffffffffffffff811661135a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104d7565b61136381611656565b50565b73ffffffffffffffffffffffffffffffffffffffff81165f908152600183016020526040812054151561088c565b5f61088c8373ffffffffffffffffffffffffffffffffffffffff841661174d565b5f807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166377d7dffb6040518163ffffffff1660e01b81526004015f60405180830381865afa15801561141f573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114649190810190611970565b90505f805b82518110156114c9576114ae83828151811061148757611487611a4e565b6020026020010151606c5f8881526020019081526020015f2061136690919063ffffffff16565b156114c1576114be826001611920565b91505b600101611469565b506003825160026114da9190611a7b565b6114e49190611a92565b109392505050565b606d8190555f818152606a60205260409020546065541461156057606580545f838152606a60205260409081902054928390555190917fa044538eba1b21d23eb13fa35811ca9d1d7ff9ef1c81ee4dc594fca08412531b9161155691848252602082015260400190565b60405180910390a1505b5f818152606a6020526040902060010154606654146115d557606680545f838152606a60205260409081902060010154928390555190917fab2cb47d396c5d12c082ac9b6512d332af2767ca8e1fa5bcef40fa6970626569916115cb91848252602082015260400190565b60405180910390a1505b5f818152606b6020908152604091829020600190810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909117905560655460665483519182529181019190915282917f3842d9e8746c3c1b0c5e717a88df9c9ae97f2f8c0e01e42dce160aafdb3840e9910160405180910390a250565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610d33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104d7565b5f81815260018301602052604081205461179257508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561088f565b505f61088f565b5080545f8255905f5260205f209081019061136391905b808211156117c3575f81556001016117b0565b5090565b5f602082840312156117d7575f80fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611363575f80fd5b5f8060408385031215611810575f80fd5b823591506020830135611822816117de565b809150509250929050565b5f805f8060808587031215611840575f80fd5b843561184b816117de565b966020860135965060408601359560600135945092505050565b5f60408284031215611875575f80fd5b50919050565b5f6020828403121561188b575f80fd5b8135611896816117de565b9392505050565b5f602082840312156118ad575f80fd5b81518015158114611896575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611919576119196118bc565b5060010190565b8082018082111561088f5761088f6118bc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b805161196b816117de565b919050565b5f6020808385031215611981575f80fd5b825167ffffffffffffffff80821115611998575f80fd5b818501915085601f8301126119ab575f80fd5b8151818111156119bd576119bd611933565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611a0057611a00611933565b604052918252848201925083810185019188831115611a1d575f80fd5b938501935b82851015611a4257611a3385611960565b84529385019392850192611a22565b98975050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b808202811582820484141761088f5761088f6118bc565b5f82611ac5577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea164736f6c6343000818000a" func init() { if err := json.Unmarshal([]byte(GovStorageLayoutJSON), GovStorageLayout); err != nil { diff --git a/bindings/bindings/l2staking.go b/bindings/bindings/l2staking.go index 504c15bdb..c4036241d 100644 --- a/bindings/bindings/l2staking.go +++ b/bindings/bindings/l2staking.go @@ -29,9 +29,8 @@ var ( _ = abi.ConvertType ) -// IL2StakingUndelegation is an auto generated low-level Go binding around an user-defined struct. -type IL2StakingUndelegation struct { - Delegatee common.Address +// IL2StakingUndelegateRequest is an auto generated low-level Go binding around an user-defined struct. +type IL2StakingUndelegateRequest struct { Amount *big.Int UnlockEpoch *big.Int } @@ -45,8 +44,8 @@ type TypesStakerInfo struct { // L2StakingMetaData contains all meta data concerning the L2Staking contract. var L2StakingMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_otherStaking\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"percentage\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"epochEffective\",\"type\":\"uint256\"}],\"name\":\"CommissionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"effectiveEpoch\",\"type\":\"uint256\"}],\"name\":\"Delegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"RewardStartTimeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newSize\",\"type\":\"uint256\"}],\"name\":\"SequencerSetMaxSizeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"name\":\"StakerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"stakerAddresses\",\"type\":\"address[]\"}],\"name\":\"StakerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"effectiveEpoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"}],\"name\":\"Undelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UndelegationClaimed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DISTRIBUTE_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MESSENGER\",\"outputs\":[{\"internalType\":\"contractICrossDomainMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MORPH_TOKEN_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OTHER_STAKING\",\"outputs\":[{\"internalType\":\"contractStaking\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo\",\"name\":\"add\",\"type\":\"tuple\"}],\"name\":\"addStaker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"candidateNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimCommission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetEpochIndex\",\"type\":\"uint256\"}],\"name\":\"claimReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimUndelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"commissions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"delegateStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"delegations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo\",\"name\":\"add\",\"type\":\"tuple\"}],\"name\":\"emergencyAddStaker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"remove\",\"type\":\"address[]\"}],\"name\":\"emergencyRemoveStakers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"}],\"name\":\"getAllDelegatorsInPagination\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"delegatorsTotalNumber\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"delegatorsInPage\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"getDelegatorsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakerAddressesLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakers\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_stakerAddresses\",\"type\":\"address[]\"}],\"name\":\"getStakesInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"getUndelegations\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"}],\"internalType\":\"structIL2Staking.Undelegation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_sequencersMaxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_undelegateLockEpochs\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_rewardStartTime\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"_stakers\",\"type\":\"tuple[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"isStakingTo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSequencerSetSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"remove\",\"type\":\"address[]\"}],\"name\":\"removeStakers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardStarted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencerSetMaxSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commission\",\"type\":\"uint256\"}],\"name\":\"setCommissionRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"stakerAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakerDelegations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalDelegationAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakerRankings\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ranking\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakers\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"undelegateLockEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"undelegateStake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"undelegations\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_rewardStartTime\",\"type\":\"uint256\"}],\"name\":\"updateRewardStartTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_sequencerSetMaxSize\",\"type\":\"uint256\"}],\"name\":\"updateSequencerSetMaxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x61012060405234801562000011575f80fd5b506040516200514b3803806200514b8339810160408190526200003491620000a7565b7353000000000000000000000000000000000000076080526001600160a01b031660a05273530000000000000000000000000000000000001360c05273530000000000000000000000000000000000001760e05273530000000000000000000000000000000000001461010052620000d6565b5f60208284031215620000b8575f80fd5b81516001600160a01b0381168114620000cf575f80fd5b9392505050565b60805160a05160c05160e05161010051614fab620001a05f395f818161044501528181610a7c01528181610b240152818161140f01528181611b29015281816135ce0152613d5e01525f818161055a0152613bae01525f818161067c01528181613e1f01528181613ed401528181613fc6015281816141bd0152818161426a015261435c01525f81816104ff015281816124a30152612a5001525f8181610408015281816105c201528181612479015281816124cd01528181612a260152612a7a0152614fab5ff3fe608060405234801561000f575f80fd5b50600436106102ec575f3560e01c8063746c8ae111610192578063affed0e0116100e8578063e10911b111610093578063f2fde38b1161006e578063f2fde38b146106cf578063fad99f98146106e2578063fc6facc6146106ea575f80fd5b8063e10911b11461069e578063ed70b343146106a6578063f0261bc2146106c6575f80fd5b8063cce6cf9f116100c3578063cce6cf9f14610643578063d31d83d914610656578063d557714114610677575f80fd5b8063affed0e0146105f1578063b5d2e0dc146105fa578063c64814dd14610619575f80fd5b80638da5cb5b1161014857806391bd43a41161012357806391bd43a41461059e578063927ede2d146105bd57806396ab994d146105e4575f80fd5b80638da5cb5b146105445780638e21d5fb146105555780639168ae721461057c575f80fd5b80637b05afb5116101785780637b05afb5146104db578063831cfb58146104fa57806384d7d1d414610521575f80fd5b8063746c8ae1146104cb57806376671808146104d3575f80fd5b80633b8024211161024757806343352d61116101fd57806346cdc18a116101d857806346cdc18a146104a85780637046529b146104b0578063715018a6146104c3575f80fd5b806343352d611461047a578063439162b514610482578063459598a214610495575f80fd5b80633cb747bf1161022d5780633cb747bf146104065780633d9353fe1461044057806340b5c83714610467575f80fd5b80633b802421146103ea5780633c323a1b146103f3575f80fd5b8063174e31c4116102a75780632e787be3116102825780632e787be3146103ae57806330158eea146103b75780633385ccc2146103d7575f80fd5b8063174e31c41461037f57806319fac8fd146103925780632cc138be146103a5575f80fd5b80630eb573af116102d75780630eb573af1461032b5780630f3b70591461033e57806312a3e94714610376575f80fd5b806243b758146102f05780629c6f0c14610316575b5f80fd5b6103036102fe36600461465b565b6106fd565b6040519081526020015b60405180910390f35b610329610324366004614676565b610723565b005b6103296103393660046146c0565b610901565b61035161034c3660046146d7565b610a14565b604080516001600160a01b03909416845260208401929092529082015260600161030d565b610303609a5481565b61032961038d3660046146d7565b610a5c565b6103296103a03660046146c0565b610bd4565b61030360985481565b61030360995481565b6103ca6103c5366004614749565b610cf6565b60405161030d91906147e9565b6103296103e536600461465b565b610f1d565b610303609c5481565b6103296104013660046146d7565b611557565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161030d565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b6103296104753660046146c0565b611be6565b6103ca611cf9565b61032961049036600461488f565b611f15565b6104286104a33660046146c0565b612446565b609d54610303565b6103296104be366004614676565b61246e565b6103296125c8565b6103296125db565b6103036128cb565b6103036104e936600461465b565b60a06020525f908152604090205481565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b61053461052f36600461465b565b61293f565b604051901515815260200161030d565b6033546001600160a01b0316610428565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b61058f61058a36600461465b565b612969565b60405161030d939291906148fd565b6103036105ac36600461465b565b60a16020525f908152604090205481565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b6097546105349060ff1681565b61030360a55481565b61030361060836600461465b565b609e6020525f908152604090205481565b61030361062736600461492d565b60a360209081525f928352604080842090915290825290205481565b610329610651366004614959565b612a1b565b6106696106643660046149a1565b612f87565b60405161030d929190614a16565b6104287f000000000000000000000000000000000000000000000000000000000000000081565b610329613115565b6106b96106b436600461465b565b613499565b60405161030d9190614a36565b610303609b5481565b6103296106dd36600461465b565b61352f565b6103296135bc565b6103296106f8366004614959565b61366a565b6001600160a01b0381165f90815260a26020526040812061071d90613a35565b92915050565b61072b613a3e565b8160a55481146107825760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064015b60405180910390fd5b61078d836001614ac4565b60a555609e5f6107a0602085018561465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20545f0361084257609d6107d5602084018461465b565b81546001810183555f9283526020808420909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609d5491609e916108289086018661465b565b6001600160a01b0316815260208101919091526040015f20555b81609f5f610853602084018461465b565b6001600160a01b0316815260208101919091526040015f206108758282614bf4565b506108859050602083018361465b565b6001600160a01b03167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d60208401356108c16040860186614ad7565b6040516108d093929190614d5b565b60405180910390a260975460ff161580156108ef5750609954609d5411155b156108fc576108fc613a98565b505050565b610909613a3e565b5f8111801561091a57506099548114155b61098c5760405162461bcd60e51b815260206004820152602260248201527f696e76616c6964206e65772073657175656e63657220736574206d617820736960448201527f7a650000000000000000000000000000000000000000000000000000000000006064820152608401610779565b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff166109e157609d546109e5565b609c545b90505f60995482106109f9576099546109fb565b815b9050609b548114610a0e57610a0e613a98565b50505050565b60a4602052815f5260405f208181548110610a2d575f80fd5b5f9182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b610a64613c18565b6001600160a01b038216610b1a576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016635cf20c7b336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602481018490526044015f604051808303815f87803b158015610aff575f80fd5b505af1158015610b11573d5f803e3d5ffd5b50505050610bc6565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663996cba6883336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018490526064015f604051808303815f87803b158015610baf575f80fd5b505af1158015610bc1573d5f803e3d5ffd5b505050505b610bd06001606555565b5050565b335f908152609e6020526040902054610c2f5760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79207374616b657220616c6c6f776564000000000000000000000000006044820152606401610779565b6014811115610c805760405162461bcd60e51b815260206004820152601260248201527f696e76616c696420636f6d6d697373696f6e00000000000000000000000000006044820152606401610779565b335f90815260a06020526040812082905560975460ff16610ca1575f610cb4565b610ca96128cb565b610cb4906001614ac4565b604080518481526020810183905291925033917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a25050565b60605f8267ffffffffffffffff811115610d1257610d12614b38565b604051908082528060200260200182016040528015610d5e57816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081610d305790505b5090505f5b83811015610f15576040518060600160405280609f5f888886818110610d8b57610d8b614dae565b9050602002016020810190610da0919061465b565b6001600160a01b03908116825260208083019390935260409091015f908120549091168352910190609f90888886818110610ddd57610ddd614dae565b9050602002016020810190610df2919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20600101548152602001609f5f888886818110610e2f57610e2f614dae565b9050602002016020810190610e44919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f206002018054610e7190614b65565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9d90614b65565b8015610ee85780601f10610ebf57610100808354040283529160200191610ee8565b820191905f5260205f20905b815481529060010190602001808311610ecb57829003601f168201915b5050505050815250828281518110610f0257610f02614dae565b6020908102919091010152600101610d63565b509392505050565b610f25613c18565b6001600160a01b0381165f90815260a360209081526040808320338452909152902054610f945760405162461bcd60e51b815260206004820152601660248201527f7374616b696e6720616d6f756e74206973207a65726f000000000000000000006044820152606401610779565b6001600160a01b0381165f908152609e60205260408120546097549015919060ff16610fc0575f610fd3565b610fc86128cb565b610fd3906001614ac4565b6097549091505f9060ff168015610fe8575082155b610ff25781610fff565b609a54610fff9083614ac4565b604080516060810182526001600160a01b038781168083525f81815260a36020908152858220338084528183528784208054848901908152888a018b815283875260a486528a87208054600180820183559189528789208c51600390920201805473ffffffffffffffffffffffffffffffffffffffff191691909b16178a558251908a015551600290980197909755908452908252829055925191815260a1909252928120805494955091936110b6908490614ddb565b90915550506001600160a01b0385165f90815260a2602052604090206110dc9033613c78565b506001600160a01b0385165f908152609e602052604090205484158015611105575060975460ff165b80156111125750609c5481105b15611373576001600160a01b0386165f908152609e602052604081205461113b90600190614ddb565b90505b6001609c5461114d9190614ddb565b8110156113715760a15f609d838154811061116a5761116a614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a190609d61119f856001614ac4565b815481106111af576111af614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115611369575f609d82815481106111ed576111ed614dae565b5f918252602090912001546001600160a01b03169050609d611210836001614ac4565b8154811061122057611220614dae565b5f91825260209091200154609d80546001600160a01b03909216918490811061124b5761124b614dae565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609d61128e846001614ac4565b8154811061129e5761129e614dae565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03929092169190911790556112de826001614ac4565b609e5f609d85815481106112f4576112f4614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055611323826002614ac4565b609e5f609d611333866001614ac4565b8154811061134357611343614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b60010161113e565b505b8415801561139657506001600160a01b0386165f90815260a16020526040902054155b156113b3576001609c5f8282546113ad9190614ddb565b90915550505b6001600160a01b038681165f81815260a160205260408082205481517f7f683ee30000000000000000000000000000000000000000000000000000000081526004810194909452336024850152604484018990526064840152517f000000000000000000000000000000000000000000000000000000000000000090931692637f683ee392608480820193929182900301818387803b158015611454575f80fd5b505af1158015611466573d5f803e3d5ffd5b505050506114713390565b6001600160a01b0316866001600160a01b03167f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c846020015187876040516114cc939291909283526020830191909152604082015260600190565b60405180910390a3841580156114e4575060975460ff165b80156114f25750609b548111155b80156115385750609b546001600160a01b0387165f908152609e602052604090205411806115385750609c546001600160a01b0387165f908152609e6020526040902054115b1561154557611545613a98565b50505050506115546001606555565b50565b6001600160a01b0382165f908152609e602052604090205482906115bd5760405162461bcd60e51b815260206004820152600a60248201527f6e6f74207374616b6572000000000000000000000000000000000000000000006044820152606401610779565b6115c5613c18565b5f82116116145760405162461bcd60e51b815260206004820152601460248201527f696e76616c6964207374616b6520616d6f756e740000000000000000000000006044820152606401610779565b61161e3384613c93565b1561166b5760405162461bcd60e51b815260206004820152601660248201527f756e64656c65676174696f6e20756e636c61696d6564000000000000000000006044820152606401610779565b6001600160a01b0383165f90815260a3602090815260408083203384529091529020546116e95761169c3384613d1c565b156116e95760405162461bcd60e51b815260206004820152601060248201527f72657761726420756e636c61696d6564000000000000000000000000000000006044820152606401610779565b6001600160a01b0383165f90815260a1602052604081208054849290611710908490614ac4565b90915550506001600160a01b0383165f90815260a36020908152604080832033845290915281208054849290611747908490614ac4565b90915550506001600160a01b0383165f90815260a26020526040902061176d9033613dd1565b506001600160a01b0383165f90815260a160205260409020548290036117a5576001609c5f82825461179f9190614ac4565b90915550505b6001600160a01b0383165f908152609e602052604090205460975460ff1680156117cf5750600181115b15611a15575f6117e0600183614ddb565b90505b8015611a135760a15f609d6117f9600185614ddb565b8154811061180957611809614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f205460a15f609d848154811061185a5761185a614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115611a01575f609d611892600184614ddb565b815481106118a2576118a2614dae565b5f91825260209091200154609d80546001600160a01b03909216925090839081106118cf576118cf614dae565b5f918252602090912001546001600160a01b0316609d6118f0600185614ddb565b8154811061190057611900614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609d838154811061193f5761193f614dae565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609e90609d611986600185614ddb565b8154811061199657611996614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020556119c5826001614ac4565b609e5f609d85815481106119db576119db614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b80611a0b81614dee565b9150506117e3565b505b6097545f9060ff16611a27575f611a3a565b611a2f6128cb565b611a3a906001614ac4565b6001600160a01b0386165f81815260a36020908152604080832033808552908352928190205481519081529182018990528181018590525193945090927fc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d09181900360600190a36001600160a01b038581165f81815260a360209081526040808320338085528184528285205486865260a18552838620548287529290945282517fb809af0f000000000000000000000000000000000000000000000000000000008152600481019690965260248601526044850187905260648501839052608485015290881460a4840152517f00000000000000000000000000000000000000000000000000000000000000009093169263b809af0f9260c480820193929182900301818387803b158015611b6e575f80fd5b505af1158015611b80573d5f803e3d5ffd5b50505050611b95611b8e3390565b3086613de5565b60975460ff168015611ba85750609b5482115b8015611bcd57506099546001600160a01b0386165f908152609e602052604090205411155b15611bda57611bda613a98565b50506108fc6001606555565b611bee613a3e565b60975460ff1615611c415760405162461bcd60e51b815260206004820152601660248201527f72657761726420616c72656164792073746172746564000000000000000000006044820152606401610779565b4281118015611c5a5750611c586201518082614e30565b155b8015611c6857506098548114155b611cb45760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d65000000000000006044820152606401610779565b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609d546060905f9067ffffffffffffffff811115611d1957611d19614b38565b604051908082528060200260200182016040528015611d6557816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611d375790505b5090505f5b609d54811015611f0f576040518060600160405280609f5f609d8581548110611d9557611d95614dae565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409092018120549092168352609d80549390910192609f92919086908110611de157611de1614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f20600101548152602001609f5f609d8581548110611e3a57611e3a614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400190206002018054611e6b90614b65565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9790614b65565b8015611ee25780601f10611eb957610100808354040283529160200191611ee2565b820191905f5260205f20905b815481529060010190602001808311611ec557829003601f168201915b5050505050815250828281518110611efc57611efc614dae565b6020908102919091010152600101611d6a565b50919050565b5f54610100900460ff1615808015611f3357505f54600160ff909116105b80611f4c5750303b158015611f4c57505f5460ff166001145b611fbe5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610779565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561201a575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b0387166120705760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e6572206164647265737300000000000000000000006044820152606401610779565b5f86116120e55760405162461bcd60e51b815260206004820152602260248201527f73657175656e6365727353697a65206d7573742067726561746572207468616e60448201527f20300000000000000000000000000000000000000000000000000000000000006064820152608401610779565b5f85116121345760405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420756e64656c65676174654c6f636b45706f636873000000006044820152606401610779565b428411801561214d575061214b6201518085614e30565b155b6121995760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d65000000000000006044820152606401610779565b816121e65760405162461bcd60e51b815260206004820152601760248201527f696e76616c696420696e697469616c207374616b6572730000000000000000006044820152606401610779565b6121ef87614096565b6121f76140f4565b6099869055609a8590556098849055609b8290555f5b609b548110156123685783838281811061222957612229614dae565b905060200281019061223b9190614e43565b609f5f86868581811061225057612250614dae565b90506020028101906122629190614e43565b61227090602081019061465b565b6001600160a01b0316815260208101919091526040015f206122928282614bf4565b905050609d8484838181106122a9576122a9614dae565b90506020028101906122bb9190614e43565b6122c990602081019061465b565b8154600180820184555f938452602090932001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055612312908290614ac4565b609e5f86868581811061232757612327614dae565b90506020028101906123399190614e43565b61234790602081019061465b565b6001600160a01b0316815260208101919091526040015f205560010161220d565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a1801561243d575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609d8181548110612455575f80fd5b5f918252602090912001546001600160a01b0316905081565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561255657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015612527573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061254b9190614e7f565b6001600160a01b0316145b61072b5760405162461bcd60e51b815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401610779565b6125d0613a3e565b6125d95f614096565b565b6125e3613a3e565b60985442101561265a5760405162461bcd60e51b8152602060048201526024808201527f63616e2774207374617274206265666f7265207265776172642073746172742060448201527f74696d65000000000000000000000000000000000000000000000000000000006064820152608401610779565b5f609c54116126ab5760405162461bcd60e51b815260206004820152600e60248201527f6e6f6e652063616e6469646174650000000000000000000000000000000000006044820152606401610779565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609d54811015612868575f5b8181101561285f5760a15f609d838154811061270457612704614dae565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f205460a15f609d858154811061275557612755614dae565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115612857575f609d828154811061279357612793614dae565b5f91825260209091200154609d80546001600160a01b03909216925090849081106127c0576127c0614dae565b5f91825260209091200154609d80546001600160a01b0390921691849081106127eb576127eb614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609d848154811061282a5761282a614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550505b6001016126e6565b506001016126da565b505f5b609d548110156128c257612880816001614ac4565b609e5f609d848154811061289657612896614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205560010161286b565b506125d9613a98565b5f60985442101561291e5760405162461bcd60e51b815260206004820152601960248201527f726577617264206973206e6f74207374617274656420796574000000000000006044820152606401610779565b62015180609854426129309190614ddb565b61293a9190614e9a565b905090565b6001600160a01b0381165f90815260a360209081526040808320338452909152812054151561071d565b609f6020525f90815260409020805460018201546002830180546001600160a01b0390931693919261299a90614b65565b80601f01602080910402602001604051908101604052809291908181526020018280546129c690614b65565b8015612a115780601f106129e857610100808354040283529160200191612a11565b820191905f5260205f20905b8154815290600101906020018083116129f457829003601f168201915b5050505050905083565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612b0357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ad4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612af89190614e7f565b6001600160a01b0316145b612b755760405162461bcd60e51b815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401610779565b8260a5548114612bc75760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610779565b612bd2846001614ac4565b60a5555f805b83811015612f3857609b54609e5f878785818110612bf857612bf8614dae565b9050602002016020810190612c0d919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411612c3757600191505b5f609e5f878785818110612c4d57612c4d614dae565b9050602002016020810190612c62919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115612eba575f6001609e5f888886818110612ca057612ca0614dae565b9050602002016020810190612cb5919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f2054612cdf9190614ddb565b90505b609d54612cf190600190614ddb565b811015612dc357609d612d05826001614ac4565b81548110612d1557612d15614dae565b5f91825260209091200154609d80546001600160a01b039092169183908110612d4057612d40614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609e5f609d8481548110612d8357612d83614dae565b5f9182526020808320909101546001600160a01b0316835282019290925260400181208054909190612db6908490614ddb565b9091555050600101612ce2565b50609d805480612dd557612dd5614ead565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609e90868684818110612e1a57612e1a614dae565b9050602002016020810190612e2f919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a15f878785818110612e6757612e67614dae565b9050602002016020810190612e7c919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115612eba576001609c5f828254612eb49190614ddb565b90915550505b609f5f868684818110612ecf57612ecf614dae565b9050602002016020810190612ee4919061465b565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590612f2e60028301826145fd565b5050600101612bd8565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f618484604051612f6a929190614eda565b60405180910390a18015612f8057612f80613a98565b5050505050565b5f60605f8411612fd95760405162461bcd60e51b815260206004820152601160248201527f696e76616c696420706167652073697a650000000000000000000000000000006044820152606401610779565b6001600160a01b0385165f90815260a260205260409020612ff990613a35565b91508367ffffffffffffffff81111561301457613014614b38565b60405190808252806020026020018201604052801561303d578160200160208202803683370190505b5090505f61304b8486614f27565b90505f600161305a8682614ac4565b6130649088614f27565b61306e9190614ddb565b905061307b600185614ddb565b8111156130905761308d600185614ddb565b90505b815f5b828211613109576130c7826130a781614f3e565b6001600160a01b038c165f90815260a26020526040902090945090614178565b85826130d281614f3e565b9350815181106130e4576130e4614dae565b60200260200101906001600160a01b031690816001600160a01b031681525050613093565b50505050935093915050565b61311d613c18565b335f90815260a46020526040812054815b818110156134335760975460ff16158061317e575061314b6128cb565b335f90815260a46020526040902080548390811061316b5761316b614dae565b905f5260205f2090600302016002015411155b1561342157335f90815260a4602052604090208054829081106131a3576131a3614dae565b905f5260205f20906003020160010154836131be9190614ac4565b335f90815260a46020526040812080549295509091839081106131e3576131e3614dae565b5f91825260208220600390910201546001600160a01b0316915060a4816132073390565b6001600160a01b03166001600160a01b031681526020019081526020015f20838154811061323757613237614dae565b905f5260205f2090600302016002015490505f60a45f6132543390565b6001600160a01b03166001600160a01b031681526020019081526020015f20848154811061328457613284614dae565b905f5260205f2090600302016001015490506001856132a39190614ddb565b84101561336857335f90815260a4602052604090206132c3600187614ddb565b815481106132d3576132d3614dae565b905f5260205f20906003020160a45f6132e93390565b6001600160a01b03166001600160a01b031681526020019081526020015f20858154811061331957613319614dae565b5f91825260209091208254600390920201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091178155600180830154908201556002918201549101555b335f90815260a46020526040902080548061338557613385614ead565b5f8281526020812060035f1990930192830201805473ffffffffffffffffffffffffffffffffffffffff19168155600181810183905560029091019190915591556133d09086614ddb565b604080518481526020810184905291965033916001600160a01b038616917f921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6910160405180910390a350505061312e565b61342c816001614ac4565b905061312e565b505f82116134835760405162461bcd60e51b815260206004820152601760248201527f6e6f204d6f72706820746f6b656e20746f20636c61696d0000000000000000006044820152606401610779565b61348d3383614183565b50506125d96001606555565b6001600160a01b0381165f90815260a460209081526040808320805482518185028101850190935280835260609492939192909184015b82821015613524575f848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016134d0565b505050509050919050565b613537613a3e565b6001600160a01b0381166135b35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610779565b61155481614096565b6135c4613c18565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663ac2ac640336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b0390911660048201526024015f604051808303815f87803b15801561364a575f80fd5b505af115801561365c573d5f803e3d5ffd5b505050506125d96001606555565b613672613a3e565b8260a55481146136c45760405162461bcd60e51b815260206004820152600d60248201527f696e76616c6964206e6f6e6365000000000000000000000000000000000000006044820152606401610779565b6136cf846001614ac4565b60a5555f805b83811015612f3857609b54609e5f8787858181106136f5576136f5614dae565b905060200201602081019061370a919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20541161373457600191505b5f609e5f87878581811061374a5761374a614dae565b905060200201602081019061375f919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156139b7575f6001609e5f88888681811061379d5761379d614dae565b90506020020160208101906137b2919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f20546137dc9190614ddb565b90505b609d546137ee90600190614ddb565b8110156138c057609d613802826001614ac4565b8154811061381257613812614dae565b5f91825260209091200154609d80546001600160a01b03909216918390811061383d5761383d614dae565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609e5f609d848154811061388057613880614dae565b5f9182526020808320909101546001600160a01b03168352820192909252604001812080549091906138b3908490614ddb565b90915550506001016137df565b50609d8054806138d2576138d2614ead565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609e9086868481811061391757613917614dae565b905060200201602081019061392c919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a15f87878581811061396457613964614dae565b9050602002016020810190613979919061465b565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156139b7576001609c5f8282546139b19190614ddb565b90915550505b609f5f8686848181106139cc576139cc614dae565b90506020020160208101906139e1919061465b565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590613a2b60028301826145fd565b50506001016136d5565b5f61071d825490565b6033546001600160a01b031633146125d95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610779565b60995460975460ff1615613abc57609954609c541015613ab75750609c545b613acd565b609954609d541015613acd5750609d545b5f8167ffffffffffffffff811115613ae757613ae7614b38565b604051908082528060200260200182016040528015613b10578160200160208202803683370190505b5090505f5b82811015613b7d57609d8181548110613b3057613b30614dae565b905f5260205f20015f9054906101000a90046001600160a01b0316828281518110613b5d57613b5d614dae565b6001600160a01b0390921660209283029190910190910152600101613b15565b506040517f9b8201a40000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639b8201a490613be3908490600401614f56565b5f604051808303815f87803b158015613bfa575f80fd5b505af1158015613c0c573d5f803e3d5ffd5b50509151609b55505050565b600260655403613c6a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610779565b6002606555565b6001606555565b5f613c8c836001600160a01b03841661442c565b9392505050565b5f805b6001600160a01b0384165f90815260a46020526040902054811015613d13576001600160a01b038481165f90815260a46020526040902080549185169183908110613ce357613ce3614dae565b5f9182526020909120600390910201546001600160a01b031603613d0b57600191505061071d565b600101613c96565b505f9392505050565b6040517fde6ac9330000000000000000000000000000000000000000000000000000000081526001600160a01b03838116600483015282811660248301525f917f00000000000000000000000000000000000000000000000000000000000000009091169063de6ac93390604401602060405180830381865afa158015613da5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613dc99190614f68565b159392505050565b5f613c8c836001600160a01b03841661450f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015613e66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e8a9190614f87565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015613f1c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613f409190614f68565b613f8c5760405162461bcd60e51b815260206004820152601360248201527f7472616e7366657246726f6d206661696c6564000000000000000000000000006044820152606401610779565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa15801561400d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140319190614f87565b90505f8311801561404a5750826140488383614ddb565b145b612f805760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610779565b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff166141705760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610779565b6125d961455b565b5f613c8c83836145d7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614204573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142289190614f87565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af11580156142b2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142d69190614f68565b6143225760405162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206661696c656400000000000000000000000000000000006044820152606401610779565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa1580156143a3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906143c79190614f87565b90505f831180156143e05750826143de8383614ddb565b145b610a0e5760405162461bcd60e51b815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c656400000000006044820152606401610779565b5f8181526001830160205260408120548015614506575f61444e600183614ddb565b85549091505f9061446190600190614ddb565b90508181146144c0575f865f01828154811061447f5761447f614dae565b905f5260205f200154905080875f01848154811061449f5761449f614dae565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806144d1576144d1614ead565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061071d565b5f91505061071d565b5f81815260018301602052604081205461455457508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561071d565b505f61071d565b5f54610100900460ff16613c715760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610779565b5f825f0182815481106145ec576145ec614dae565b905f5260205f200154905092915050565b50805461460990614b65565b5f825580601f10614618575050565b601f0160209004905f5260205f209081019061155491905b80821115614643575f8155600101614630565b5090565b6001600160a01b0381168114611554575f80fd5b5f6020828403121561466b575f80fd5b8135613c8c81614647565b5f8060408385031215614687575f80fd5b82359150602083013567ffffffffffffffff8111156146a4575f80fd5b8301606081860312156146b5575f80fd5b809150509250929050565b5f602082840312156146d0575f80fd5b5035919050565b5f80604083850312156146e8575f80fd5b82356146f381614647565b946020939093013593505050565b5f8083601f840112614711575f80fd5b50813567ffffffffffffffff811115614728575f80fd5b6020830191508360208260051b8501011115614742575f80fd5b9250929050565b5f806020838503121561475a575f80fd5b823567ffffffffffffffff811115614770575f80fd5b61477c85828601614701565b90969095509350505050565b5f81518084525f5b818110156147ac57602081850181015186830182015201614790565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b83811015614881578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0018552815180516001600160a01b031684528781015188850152860151606087850181905261486d81860183614788565b968901969450505090860190600101614810565b509098975050505050505050565b5f805f805f8060a087890312156148a4575f80fd5b86356148af81614647565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff8111156148df575f80fd5b6148eb89828a01614701565b979a9699509497509295939492505050565b6001600160a01b0384168152826020820152606060408201525f6149246060830184614788565b95945050505050565b5f806040838503121561493e575f80fd5b823561494981614647565b915060208301356146b581614647565b5f805f6040848603121561496b575f80fd5b83359250602084013567ffffffffffffffff811115614988575f80fd5b61499486828701614701565b9497909650939450505050565b5f805f606084860312156149b3575f80fd5b83356149be81614647565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b83811015614a0b5781516001600160a01b0316875295820195908201906001016149e6565b509495945050505050565b828152604060208201525f614a2e60408301846149d3565b949350505050565b602080825282518282018190525f919060409081850190868401855b82811015614a8a57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101614a52565b5091979650505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561071d5761071d614a97565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614b0a575f80fd5b83018035915067ffffffffffffffff821115614b24575f80fd5b602001915036819003821315614742575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c90821680614b7957607f821691505b602082108103611f0f577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f8211156108fc57805f5260205f20601f840160051c81016020851015614bd55750805b601f840160051c820191505b81811015612f80575f8155600101614be1565b8135614bff81614647565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112614c6b575f80fd5b8501803567ffffffffffffffff811115614c83575f80fd5b8036038483011315614c93575f80fd5b614ca781614ca18554614b65565b85614bb0565b5f601f821160018114614cda575f8315614cc357508382018601355b5f19600385901b1c1916600184901b178555614d50565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b82811015614d2657868501890135825593880193908901908801614d07565b5084821015614d44575f1960f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8181038181111561071d5761071d614a97565b5f81614dfc57614dfc614a97565b505f190190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82614e3e57614e3e614e03565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112614e75575f80fd5b9190910192915050565b5f60208284031215614e8f575f80fd5b8151613c8c81614647565b5f82614ea857614ea8614e03565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015614f1c578235614f0181614647565b6001600160a01b031682529183019190830190600101614eee565b509695505050505050565b808202811582820484141761071d5761071d614a97565b5f5f198203614f4f57614f4f614a97565b5060010190565b602081525f613c8c60208301846149d3565b5f60208284031215614f78575f80fd5b81518015158114613c8c575f80fd5b5f60208284031215614f97575f80fd5b505191905056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_otherStaking\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"Empty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidCommissionRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidPageSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidSequencerSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrInvalidStartTime\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNoCandidate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNoClaimableUndelegateRequest\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNoCommission\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNoStakers\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNoUndelegateRequest\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrNotStaker\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrOnlyMorphTokenContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrOnlySystem\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrRequestExisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrRewardNotStarted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrRewardStarted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrStartTimeNotReached\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrZeroAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrZeroLockEpochs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrZeroSequencerSize\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrZeroShares\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"CommissionClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRate\",\"type\":\"uint256\"}],\"name\":\"CommissionUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegateeAmount\",\"type\":\"uint256\"}],\"name\":\"Delegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sequencer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegatorReward\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"commissionAmount\",\"type\":\"uint256\"}],\"name\":\"Distributed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegateeFrom\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegateeTo\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegateeAmountFrom\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegateeAmountTo\",\"type\":\"uint256\"}],\"name\":\"Redelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"RewardStartTimeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newSize\",\"type\":\"uint256\"}],\"name\":\"SequencerSetMaxSizeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"name\":\"StakerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"stakerAddresses\",\"type\":\"address[]\"}],\"name\":\"StakerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"delegateeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"}],\"name\":\"Undelegated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"UndelegationClaimed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MESSENGER\",\"outputs\":[{\"internalType\":\"contractICrossDomainMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MORPH_TOKEN_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OTHER_STAKING\",\"outputs\":[{\"internalType\":\"contractStaking\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SYSTEM_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo\",\"name\":\"add\",\"type\":\"tuple\"}],\"name\":\"addStaker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"candidateNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimCommission\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"claimUndelegation\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"claimableUndelegateRequest\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"commissions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentEpoch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"delegateeDelegations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"share\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"delegatorDelegations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"share\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"distribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo\",\"name\":\"add\",\"type\":\"tuple\"}],\"name\":\"emergencyAddStaker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"remove\",\"type\":\"address[]\"}],\"name\":\"emergencyRemoveStakers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"seequencer\",\"type\":\"address\"}],\"name\":\"epochSequencerBlocks\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"epochTotalBlocks\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"pageSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pageIndex\",\"type\":\"uint256\"}],\"name\":\"getAllDelegatorsInPagination\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"delegatorsTotalNumber\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"delegatorsInPage\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"getDelegatorsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakerAddressesLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStakers\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_stakerAddresses\",\"type\":\"address[]\"}],\"name\":\"getStakesInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_sequencersMaxSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_undelegateLockEpochs\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_rewardStartTime\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.StakerInfo[]\",\"name\":\"_stakers\",\"type\":\"tuple[]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"isStakingTo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSequencerSetSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"lockedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messenger\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"pendingUndelegateRequest\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"queryDelegationAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"queryUnclaimedCommission\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sequencerAddr\",\"type\":\"address\"}],\"name\":\"recordBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegateeFrom\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegateeTo\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"redelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"remove\",\"type\":\"address[]\"}],\"name\":\"removeStakers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardStartTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardStarted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sequencerSetMaxSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"}],\"name\":\"setCommissionRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"stakerAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakerRankings\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ranking\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakers\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"tmKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blsKey\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"undelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"undelegateLockEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"undelegateRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"unlockEpoch\",\"type\":\"uint256\"}],\"internalType\":\"structIL2Staking.UndelegateRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"}],\"name\":\"undelegateSequence\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_rewardStartTime\",\"type\":\"uint256\"}],\"name\":\"updateRewardStartTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_sequencerSetMaxSize\",\"type\":\"uint256\"}],\"name\":\"updateSequencerSetMaxSize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x61012060405234801562000011575f80fd5b506040516200608f3803806200608f8339810160408190526200003491620000a7565b7353000000000000000000000000000000000000076080526001600160a01b031660a05273530000000000000000000000000000000000001360c05273530000000000000000000000000000000000001760e05273530000000000000000000000000000000000002161010052620000d6565b5f60208284031215620000b8575f80fd5b81516001600160a01b0381168114620000cf575f80fd5b9392505050565b60805160a05160c05160e05161010051615f0b620001845f395f818161047b015261465c01525f818161064101526148a101525f81816107ac01528181613654015281816149cc01528181614a8101528181614b5d01528181614e2001528181614ecd0152614fa901525f81816105e60152818161311a0152613aaa01525f81816104ea0152818161069d015281816130f00152818161314401528181613a800152613ad40152615f0b5ff3fe608060405234801561000f575f80fd5b506004361061034f575f3560e01c806376671808116101be578063affed0e0116100fe578063eefecafd1161009e578063fad99f9811610079578063fad99f98146107f3578063fc6facc6146107fb578063fe3488841461080e578063ff4840cd1461082d575f80fd5b8063eefecafd146107ce578063f0261bc2146107d7578063f2fde38b146107e0575f80fd5b8063bf2dca0a116100d9578063bf2dca0a14610748578063cce6cf9f14610773578063d31d83d914610786578063d5577141146107a7575f80fd5b8063affed0e0146106f2578063b5d2e0dc146106fb578063b7a587bf1461071a575f80fd5b80638e21d5fb11610169578063927ede2d11610144578063927ede2d1461069857806396ab994d146106bf5780639d51c3b9146106cc578063a61bb764146106df575f80fd5b80638e21d5fb1461063c5780639168ae721461066357806391c05b0b14610685575f80fd5b8063831cfb5811610199578063831cfb58146105e157806384d7d1d4146106085780638da5cb5b1461062b575f80fd5b806376671808146105a05780637b05afb5146105a85780637c7e8bd2146105ce575f80fd5b80633434735f11610294578063459598a2116102345780636bd8f8041161020f5780636bd8f8041461056a5780637046529b1461057d578063715018a614610590578063746c8ae114610598575f80fd5b8063459598a21461053c57806346cdc18a1461054f5780634d99dd1614610557575f80fd5b80633cb747bf1161026f5780633cb747bf146104e857806340b5c8371461050e57806343352d6114610521578063439162b514610529575f80fd5b80633434735f146104765780633b2713c5146104b55780633b802421146104df575f80fd5b806313f22527116102ff578063201018fb116102da578063201018fb146104315780632cc138be146104445780632e787be31461044d57806330158eea14610456575f80fd5b806313f22527146103d057806319fac8fd146103e35780631d5611b8146103f6575f80fd5b80630321731c1161032f5780630321731c146103a15780630eb573af146103b457806312a3e947146103c7575f80fd5b806243b758146103535780629c6f0c14610379578063026e402b1461038e575b5f80fd5b6103666103613660046155b7565b610840565b6040519081526020015b60405180910390f35b61038c6103873660046155d2565b610866565b005b61038c61039c36600461561c565b610a29565b6103666103af3660046155b7565b610fcd565b61038c6103c2366004615646565b611007565b610366609a5481565b6103666103de3660046155b7565b6110dc565b61038c6103f1366004615646565b6111a4565b61041c6104043660046155b7565b60a36020525f90815260409020805460019091015482565b60408051928352602083019190915201610370565b61036661043f366004615646565b61129d565b61036660985481565b61036660995481565b6104696104643660046156a5565b611487565b6040516103709190615745565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610370565b6103666104c33660046157eb565b60a460209081525f928352604080842090915290825290205481565b610366609c5481565b7f000000000000000000000000000000000000000000000000000000000000000061049d565b61038c61051c366004615646565b6116ae565b610469611795565b61038c610537366004615817565b6119b1565b61049d61054a366004615646565b611e72565b609e54610366565b61038c61056536600461561c565b611e9a565b61038c610578366004615885565b6125e0565b61038c61058b3660046155d2565b6130e5565b61038c613259565b61038c61326c565b6103666134fa565b61041c6105b63660046155b7565b60a16020525f90815260409020805460019091015482565b6103666105dc3660046155b7565b613558565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61061b6106163660046155b7565b613575565b6040519015158152602001610370565b6033546001600160a01b031661049d565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6106766106713660046155b7565b61359f565b604051610370939291906158c3565b61038c610693366004615646565b613651565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b60975461061b9060ff1681565b6103666106da3660046157eb565b6138ca565b6103666106ed36600461561c565b6138dc565b610366609d5481565b6103666107093660046155b7565b609f6020525f908152604090205481565b61072d61072836600461561c565b613a14565b60408051825181526020928301519281019290925201610370565b6103666107563660046155b7565b6001600160a01b03165f90815260a1602052604090206001015490565b61038c6107813660046158f3565b613a75565b61079961079436600461593b565b613fd7565b6040516103709291906159b0565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61036660aa5481565b610366609b5481565b61038c6107ee3660046155b7565b61414f565b61038c6141f9565b61038c6108093660046158f3565b6142ab565b61036661081c3660046155b7565b60ab6020525f908152604090205481565b61038c61083b3660046155b7565b614659565b6001600160a01b0381165f90815260a2602052604081206108609061470e565b92915050565b61086e614717565b81609d5481146108aa576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108b58360016159fd565b609d55609f5f6108c860208501856155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20545f0361096a57609e6108fd60208401846155b7565b81546001810183555f9283526020808420909101805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609e5491609f91610950908601866155b7565b6001600160a01b0316815260208101919091526040015f20555b8160a05f61097b60208401846155b7565b6001600160a01b0316815260208101919091526040015f2061099d8282615b2d565b506109ad905060208301836155b7565b6001600160a01b03167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d60208401356109e96040860186615a10565b6040516109f893929190615c94565b60405180910390a260975460ff16158015610a175750609954609e5411155b15610a2457610a2461478b565b505050565b6001600160a01b0382165f908152609f6020526040812054839103610a7a576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a8261490b565b815f03610abb576040517f608294ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610adc336001600160a01b0385165f90815260a2602052604090209061497e565b5060975460ff16610b6e576001600160a01b0383165f90815260a46020908152604080832033845290915281208054849290610b199084906159fd565b90915550506001600160a01b0383165f90815260a3602052604081208054849290610b459084906159fd565b90915550506001600160a01b0383165f90815260a3602052604090208054600190910155610c8a565b6001600160a01b0383165f90815260a3602090815260408083206001810154905460a48452828520338652909352908320549092829003610be5576001600160a01b0386165f81815260a460209081526040808320338452825280832089905592825260a390522060018101869055859055610c86565b81610bf08487615ce7565b610bfa9190615d2b565b610c0490826159fd565b6001600160a01b0387165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054879290610c459084906159fd565b90915550829050610c568487615ce7565b610c609190615d2b565b610c6a90846159fd565b6001600160a01b0387165f90815260a360205260409020600101555b5050505b6001600160a01b0383165f90815260a36020526040902054829003610cc1576001609c5f828254610cbb91906159fd565b90915550505b6001600160a01b0383165f908152609f602052604090205460975460ff168015610ceb5750600181115b15610f20575f610cfc600183615d3e565b90505b8015610f1e5760a35f609e610d15600185615d3e565b81548110610d2557610d25615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a39290919085908110610d6557610d65615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115610f0c575f609e610d9d600184615d3e565b81548110610dad57610dad615d51565b5f91825260209091200154609e80546001600160a01b0390921692509083908110610dda57610dda615d51565b5f918252602090912001546001600160a01b0316609e610dfb600185615d3e565b81548110610e0b57610e0b615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e8381548110610e4a57610e4a615d51565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609f90609e610e91600185615d3e565b81548110610ea157610ea1615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055610ed08260016159fd565b609f5f609e8581548110610ee657610ee6615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b80610f1681615d7e565b915050610cff565b505b6001600160a01b0384165f81815260a360209081526040918290205482518781529182015281513393927f24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04928290030190a3610f7d333085614992565b60975460ff168015610f905750609b5481115b8015610fb557506099546001600160a01b0385165f908152609f602052604090205411155b15610fc257610fc261478b565b50610a246001606555565b6001600160a01b0381165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b03610860565b61100f614717565b80158061101d575060995481145b15611054576040517f383a648e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff166110a957609e546110ad565b609c545b90505f60995482106110c1576099546110c3565b815b9050609b5481146110d6576110d661478b565b50505050565b6001600160a01b0381165f90815260a66020526040812054609754600f82810b700100000000000000000000000000000000909304900b919091039060ff166111255792915050565b5f5b8181101561119d576001600160a01b0384165f90815260a6602052604081206111509083614c1e565b5f81815260a5602090815260409182902082518084019093528054835260010154908201819052919250906111836134fa565b1015611193575090949350505050565b5050600101611127565b5092915050565b335f818152609f602052604081205490036111eb576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6014821115611226576040517f6e11528c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a1602081815260408084208054825180840184528981526001830180548287019081529789905295855251909155935190925581518681529081018390529192917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a2505050565b5f6112a661490b565b6112ee60a65f335b6001600160a01b03166001600160a01b031681526020019081526020015f2054600f81810b700100000000000000000000000000000000909204900b0390565b5f03611326576040517f5f013ef800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81158061133d575061133a60a65f336112ae565b82115b6113475781611353565b61135360a65f336112ae565b91505f5b82156113fd57335f90815260a66020526040812061137490614cb3565b5f81815260a5602090815260409182902082518084019093528054835260010154908201526097549192509060ff1680156113b9575080602001516113b76134fa565b105b156113c55750506113fd565b335f90815260a6602052604090206113dc90614d2b565b5080516113e990846159fd565b92506113f485615d7e565b94505050611357565b805f03611436576040517f3cc5dedc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611441335b82614de6565b60405181815233907fcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb39060200160405180910390a290506114826001606555565b919050565b60605f8267ffffffffffffffff8111156114a3576114a3615a71565b6040519080825280602002602001820160405280156114ef57816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816114c15790505b5090505f5b838110156116a657604051806060016040528060a05f88888681811061151c5761151c615d51565b905060200201602081019061153191906155b7565b6001600160a01b03908116825260208083019390935260409091015f90812054909116835291019060a09088888681811061156e5761156e615d51565b905060200201602081019061158391906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f2060010154815260200160a05f8888868181106115c0576115c0615d51565b90506020020160208101906115d591906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20600201805461160290615a9e565b80601f016020809104026020016040519081016040528092919081815260200182805461162e90615a9e565b80156116795780601f1061165057610100808354040283529160200191611679565b820191905f5260205f20905b81548152906001019060200180831161165c57829003601f168201915b505050505081525082828151811061169357611693615d51565b60209081029190910101526001016114f4565b509392505050565b6116b6614717565b60975460ff16156116f3576040517fbd51da0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b428111158061170d575061170a6201518082615d93565b15155b80611719575060985481145b15611750576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609e546060905f9067ffffffffffffffff8111156117b5576117b5615a71565b60405190808252806020026020018201604052801561180157816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816117d35790505b5090505f5b609e548110156119ab57604051806060016040528060a05f609e858154811061183157611831615d51565b5f9182526020808320909101546001600160a01b0390811684528382019490945260409092018120549092168352609e8054939091019260a09291908690811061187d5761187d615d51565b905f5260205f20015f9054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020015f2060010154815260200160a05f609e85815481106118d6576118d6615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020600201805461190790615a9e565b80601f016020809104026020016040519081016040528092919081815260200182805461193390615a9e565b801561197e5780601f106119555761010080835404028352916020019161197e565b820191905f5260205f20905b81548152906001019060200180831161196157829003601f168201915b505050505081525082828151811061199857611998615d51565b6020908102919091010152600101611806565b50919050565b5f54610100900460ff16158080156119cf57505f54600160ff909116105b806119e85750303b1580156119e857505f5460ff166001145b611a79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611ad5575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6001600160a01b038716611b15576040517fee77070400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b855f03611b4e576040517f2da55d0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845f03611b87576040517f7d8ad8a800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4284111580611ba15750611b9e6201518085615d93565b15155b15611bd8576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003611c12576040517fbb01aad100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611c1b87615063565b611c236150c1565b6099869055609a8590556098849055609b8290555f5b609b54811015611d9457838382818110611c5557611c55615d51565b9050602002810190611c679190615da6565b60a05f868685818110611c7c57611c7c615d51565b9050602002810190611c8e9190615da6565b611c9c9060208101906155b7565b6001600160a01b0316815260208101919091526040015f20611cbe8282615b2d565b905050609e848483818110611cd557611cd5615d51565b9050602002810190611ce79190615da6565b611cf59060208101906155b7565b8154600180820184555f938452602090932001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055611d3e9082906159fd565b609f5f868685818110611d5357611d53615d51565b9050602002810190611d659190615da6565b611d739060208101906155b7565b6001600160a01b0316815260208101919091526040015f2055600101611c39565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a18015611e69575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609e8181548110611e81575f80fd5b5f918252602090912001546001600160a01b0316905081565b611ea261490b565b5f611ead833361515f565b9050805f03611ee8576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81811015611f22576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8215611f2f5782611f31565b815b6001600160a01b0385165f908152609f6020526040812054609754929350159160ff16611f5e575f611f6c565b609a54611f6c9060016159fd565b60408051808201909152848152602081018290529091505f33611f8e336151e5565b60405160609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208301526034820152605401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301205f81815260a590935291205490915015612042576040517fdeeb052700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81815260a560209081526040808320855181558583015160019182015533845260a68352818420805470010000000000000000000000000000000090819004600f0b8087528284019095529290942085905583546fffffffffffffffffffffffffffffffff90811693909101160217905560975460ff16612145576001600160a01b0388165f90815260a460209081526040808320338452909152812080548792906120f0908490615d3e565b90915550506001600160a01b0388165f90815260a360205260408120805487929061211c908490615d3e565b90915550506001600160a01b0388165f90815260a360205260409020805460019091015561221a565b6001600160a01b0388165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612181848a615ce7565b61218b9190615d2b565b6121959082615d3e565b6001600160a01b038c165f81815260a46020908152604080832033845282528083209490945591815260a390915290812080548a92906121d6908490615d3e565b909155508290506121e7848a615ce7565b6121f19190615d2b565b6121fb9084615d3e565b6001600160a01b038c165f90815260a360205260409020600101555050505b6001600160a01b0388165f908152609f602052604090205484158015612242575060975460ff165b801561224f5750609c5481105b156124b0576001600160a01b0389165f908152609f602052604081205461227890600190615d3e565b90505b6001609c5461228a9190615d3e565b8110156124ae5760a35f609e83815481106122a7576122a7615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a390609e6122dc8560016159fd565b815481106122ec576122ec615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205411156124a6575f609e828154811061232a5761232a615d51565b5f918252602090912001546001600160a01b03169050609e61234d8360016159fd565b8154811061235d5761235d615d51565b5f91825260209091200154609e80546001600160a01b03909216918490811061238857612388615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609e6123cb8460016159fd565b815481106123db576123db615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905561241b8260016159fd565b609f5f609e858154811061243157612431615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020556124608260026159fd565b609f5f609e6124708660016159fd565b8154811061248057612480615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b60010161227b565b505b841580156124d357506001600160a01b0389165f90815260a36020526040902054155b156124f0576001609c5f8282546124ea9190615d3e565b90915550505b6001600160a01b0389165f90815260a360205260409020543360408051898152602081018490529081018790526001600160a01b03918216918c16907f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c9060600160405180910390a385158015612569575060975460ff165b80156125775750609b548211155b80156125bd5750609b546001600160a01b038b165f908152609f602052604090205411806125bd5750609c546001600160a01b038b165f908152609f6020526040902054115b156125ca576125ca61478b565b50505050505050506125dc6001606555565b5050565b6001600160a01b0383165f908152609f6020526040812054849103612631576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383165f908152609f6020526040812054849103612682576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61268a61490b565b5f612695863361515f565b90506126a1863361515f565b5f036126d9576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836126e4873361515f565b101561271c576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8415612729578461272b565b815b6001600160a01b0388165f908152609f6020526040812054609754929350909190159060ff166127dc576001600160a01b0389165f90815260a46020908152604080832033845290915281208054859290612787908490615d3e565b90915550506001600160a01b0389165f90815260a36020526040812080548592906127b3908490615d3e565b90915550506001600160a01b0389165f90815260a36020526040902080546001909101556128b1565b6001600160a01b0389165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612818848c615ce7565b6128229190615d2b565b61282c9082615d3e565b6001600160a01b038d165f81815260a46020908152604080832033845282528083209490945591815260a3909152908120805488929061286d908490615d3e565b9091555082905061287e848c615ce7565b6128889190615d2b565b6128929084615d3e565b6001600160a01b038d165f90815260a360205260409020600101555050505b6001600160a01b0389165f908152609f6020526040902054811580156128d9575060975460ff165b80156128e65750609c5481105b15612b47576001600160a01b038a165f908152609f602052604081205461290f90600190615d3e565b90505b6001609c546129219190615d3e565b811015612b455760a35f609e838154811061293e5761293e615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040018120549060a390609e6129738560016159fd565b8154811061298357612983615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115612b3d575f609e82815481106129c1576129c1615d51565b5f918252602090912001546001600160a01b03169050609e6129e48360016159fd565b815481106129f4576129f4615d51565b5f91825260209091200154609e80546001600160a01b039092169184908110612a1f57612a1f615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905580609e612a628460016159fd565b81548110612a7257612a72615d51565b5f918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055612ab28260016159fd565b609f5f609e8581548110612ac857612ac8615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055612af78260026159fd565b609f5f609e612b078660016159fd565b81548110612b1757612b17615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b600101612912565b505b81158015612b6a57506001600160a01b038a165f90815260a36020526040902054155b15612b87576001609c5f828254612b819190615d3e565b90915550505b81158015612b97575060975460ff165b8015612ba55750609b548111155b8015612beb5750609b546001600160a01b038b165f908152609f60205260409020541180612beb5750609c546001600160a01b038b165f908152609f6020526040902054115b15612bf557600192505b612c16336001600160a01b038b165f90815260a2602052604090209061497e565b5060975460ff16612ca8576001600160a01b0389165f90815260a46020908152604080832033845290915281208054869290612c539084906159fd565b90915550506001600160a01b0389165f90815260a3602052604081208054869290612c7f9084906159fd565b90915550506001600160a01b0389165f90815260a3602052604090208054600190910155612d7d565b6001600160a01b0389165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612ce4848d615ce7565b612cee9190615d2b565b612cf890826159fd565b6001600160a01b038d165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054899290612d399084906159fd565b90915550829050612d4a848d615ce7565b612d549190615d2b565b612d5e90846159fd565b6001600160a01b038d165f90815260a360205260409020600101555050505b6001600160a01b0389165f90815260a36020526040902054849003612db4576001609c5f828254612dae91906159fd565b90915550505b506001600160a01b0388165f908152609f602052604090205460975460ff168015612ddf5750600181115b15613014575f612df0600183615d3e565b90505b80156130125760a35f609e612e09600185615d3e565b81548110612e1957612e19615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a39290919085908110612e5957612e59615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115613000575f609e612e91600184615d3e565b81548110612ea157612ea1615d51565b5f91825260209091200154609e80546001600160a01b0390921692509083908110612ece57612ece615d51565b5f918252602090912001546001600160a01b0316609e612eef600185615d3e565b81548110612eff57612eff615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e8381548110612f3e57612f3e615d51565b5f9182526020822001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0393909316929092179091558290609f90609e612f85600185615d3e565b81548110612f9557612f95615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055612fc48260016159fd565b609f5f609e8581548110612fda57612fda615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001902055505b8061300a81615d7e565b915050612df3565b505b60975460ff1680156130275750609b5481115b801561304c57506099546001600160a01b038a165f908152609f602052604090205411155b1561305657600192505b82156130645761306461478b565b6001600160a01b038a81165f81815260a36020908152604080832054948e16808452928190205481518a8152928301869052908201819052923392917ffdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b49060600160405180910390a4505050505050506130de6001606555565b5050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156131cd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa15801561319e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131c29190615de2565b6001600160a01b0316145b61086e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611a70565b613261614717565b61326a5f615063565b565b613274614717565b6098544210156132b0576040517f080bb11a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609c545f036132eb576040517fd7d776cb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609e54811015613497575f5b8181101561348e5760a35f609e838154811061334457613344615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812054609e8054919260a3929091908690811061338457613384615d51565b5f9182526020808320909101546001600160a01b031683528201929092526040019020541115613486575f609e82815481106133c2576133c2615d51565b5f91825260209091200154609e80546001600160a01b03909216925090849081106133ef576133ef615d51565b5f91825260209091200154609e80546001600160a01b03909216918490811061341a5761341a615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080609e848154811061345957613459615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550505b600101613326565b5060010161331a565b505f5b609e548110156134f1576134af8160016159fd565b609f5f609e84815481106134c5576134c5615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400190205560010161349a565b5061326a61478b565b5f609854421015613537576040517fd021716f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62015180609854426135499190615d3e565b6135539190615d2b565b905090565b6001600160a01b0381165f90815260a76020526040812054610860565b6001600160a01b0381165f90815260a4602090815260408083203384529091528120541515610860565b60a06020525f90815260409020805460018201546002830180546001600160a01b039093169391926135d090615a9e565b80601f01602080910402602001604051908101604052809291908181526020018280546135fc90615a9e565b80156136475780601f1061361e57610100808354040283529160200191613647565b820191905f5260205f20905b81548152906001019060200180831161362a57829003601f168201915b5050505050905083565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146136b3576040517f4032cbb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60aa5415613852575f5b6136c760a861470e565b811015613850575f60a1816136dd60a88561520a565b6001600160a01b0316815260208101919091526040015f9081205460aa5490925060ab8261370c60a88761520a565b6001600160a01b0316815260208101919091526040015f205461372f9086615ce7565b6137399190615d2b565b90505f60646137488484615ce7565b6137529190615d2b565b90505f61375f8284615d3e565b90508160a15f61377060a88961520a565b6001600160a01b03166001600160a01b031681526020019081526020015f206001015f8282546137a091906159fd565b9091555081905060a35f6137b560a88961520a565b6001600160a01b03166001600160a01b031681526020019081526020015f205f015f8282546137e491906159fd565b909155506137f5905060a88661520a565b6001600160a01b03167f60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d88284604051613838929190918252602082015260400190565b60405180910390a25050600190920191506136bd9050565b505b5f61385d60a861470e565b90505f5b818110156138c15760ab5f61387760a88261520a565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90556138b86138b05f60a861520a90919063ffffffff16565b60a890615215565b50600101613861565b50505f60aa5550565b5f6138d5838361515f565b9392505050565b6001600160a01b0382165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b035f0361391e57505f610860565b81158061395e57506001600160a01b0383165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b0382115b613968578161399e565b6001600160a01b0383165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b035b91505f805b838110156116a6576001600160a01b0385165f90815260a6602052604081206139cc9083614c1e565b5f81815260a56020908152604091829020825180840190935280548084526001909101549183019190915291925090613a0590856159fd565b935050508060010190506139a3565b604080518082019091525f80825260208201526001600160a01b0383165f90815260a660205260408120613a489084614c1e565b5f90815260a560209081526040918290208251808401909352805483526001015490820152949350505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015613b5d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b529190615de2565b6001600160a01b0316145b613be9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611a70565b82609d548114613c25576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613c308460016159fd565b609d555f805b83811015613f8f57609b54609f5f878785818110613c5657613c56615d51565b9050602002016020810190613c6b91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205411613c9557600191505b5f609f5f878785818110613cab57613cab615d51565b9050602002016020810190613cc091906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20541115613f11575f6001609f5f888886818110613cfe57613cfe615d51565b9050602002016020810190613d1391906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f2054613d3d9190615d3e565b90505b609e54613d4f90600190615d3e565b811015613e2157609e613d638260016159fd565b81548110613d7357613d73615d51565b5f91825260209091200154609e80546001600160a01b039092169183908110613d9e57613d9e615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609f5f609e8481548110613de157613de1615d51565b5f9182526020808320909101546001600160a01b0316835282019290925260400181208054909190613e14908490615d3e565b9091555050600101613d40565b50609e805480613e3357613e33615dfd565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609f90868684818110613e7857613e78615d51565b9050602002016020810190613e8d91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a35f878785818110613ec557613ec5615d51565b9050602002016020810190613eda91906155b7565b6001600160a01b0316815260208101919091526040015f20541115613f11576001609c5f828254613f0b9190615d3e565b90915550505b60a05f868684818110613f2657613f26615d51565b9050602002016020810190613f3b91906155b7565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff191681556001810182905590613f85600283018261555d565b5050600101613c36565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f618484604051613fc1929190615e2a565b60405180910390a180156130de576130de61478b565b5f6060835f03614013576040517f89076b3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385165f90815260a2602052604090206140339061470e565b91508367ffffffffffffffff81111561404e5761404e615a71565b604051908082528060200260200182016040528015614077578160200160208202803683370190505b5090505f6140858486615ce7565b90505f600161409486826159fd565b61409e9088615ce7565b6140a89190615d3e565b90506140b5600185615d3e565b8111156140ca576140c7600185615d3e565b90505b815f5b82821161414357614101826140e181615e77565b6001600160a01b038c165f90815260a2602052604090209094509061520a565b858261410c81615e77565b93508151811061411e5761411e615d51565b60200260200101906001600160a01b031690816001600160a01b0316815250506140cd565b50505050935093915050565b614157614717565b6001600160a01b0381166141ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401611a70565b6141f681615063565b50565b61420161490b565b335f90815260a16020526040812060010154900361424b576040517f5426dfcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a16020526040812060010180549190559061426b9061143b565b60405181815233907f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e4119060200160405180910390a25061326a6001606555565b6142b3614717565b82609d5481146142ef576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142fa8460016159fd565b609d555f805b83811015613f8f57609b54609f5f87878581811061432057614320615d51565b905060200201602081019061433591906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20541161435f57600191505b5f609f5f87878581811061437557614375615d51565b905060200201602081019061438a91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205411156145db575f6001609f5f8888868181106143c8576143c8615d51565b90506020020160208101906143dd91906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f20546144079190615d3e565b90505b609e5461441990600190615d3e565b8110156144eb57609e61442d8260016159fd565b8154811061443d5761443d615d51565b5f91825260209091200154609e80546001600160a01b03909216918390811061446857614468615d51565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506001609f5f609e84815481106144ab576144ab615d51565b5f9182526020808320909101546001600160a01b03168352820192909252604001812080549091906144de908490615d3e565b909155505060010161440a565b50609e8054806144fd576144fd615dfd565b5f8281526020812082015f19908101805473ffffffffffffffffffffffffffffffffffffffff19169055909101909155609f9086868481811061454257614542615d51565b905060200201602081019061455791906155b7565b6001600160a01b03166001600160a01b031681526020019081526020015f205f90555f60a35f87878581811061458f5761458f615d51565b90506020020160208101906145a491906155b7565b6001600160a01b0316815260208101919091526040015f205411156145db576001609c5f8282546145d59190615d3e565b90915550505b60a05f8686848181106145f0576145f0615d51565b905060200201602081019061460591906155b7565b6001600160a01b0316815260208101919091526040015f908120805473ffffffffffffffffffffffffffffffffffffffff19168155600181018290559061464f600283018261555d565b5050600101614300565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146146bb576040517f52d033bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6146c660a88261497e565b50600160aa5f8282546146d991906159fd565b90915550506001600160a01b0381165f90815260ab602052604081208054600192906147069084906159fd565b909155505050565b5f610860825490565b6033546001600160a01b0316331461326a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611a70565b60995460975460ff16156147af57609954609c5410156147aa5750609c545b6147c0565b609954609e5410156147c05750609e545b5f8167ffffffffffffffff8111156147da576147da615a71565b604051908082528060200260200182016040528015614803578160200160208202803683370190505b5090505f5b8281101561487057609e818154811061482357614823615d51565b905f5260205f20015f9054906101000a90046001600160a01b031682828151811061485057614850615d51565b6001600160a01b0390921660209283029190910190910152600101614808565b506040517f9b8201a40000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639b8201a4906148d6908490600401615e8f565b5f604051808303815f87803b1580156148ed575f80fd5b505af11580156148ff573d5f803e3d5ffd5b50509151609b55505050565b600260655403614977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611a70565b6002606555565b5f6138d5836001600160a01b038416615229565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614a379190615ea1565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015614ac9573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614aed9190615eb8565b614b23576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614ba4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614bc89190615ea1565b9050821580614be0575082614bdd8383615d3e565b14155b156130de576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606555565b5f80614c40614c2c84615275565b8554614c3b9190600f0b615ed7565b61532a565b84549091507001000000000000000000000000000000009004600f90810b9082900b12614c99576040517fb4120f1400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f0b5f9081526001939093016020525050604090205490565b5f614cda8254600f81810b700100000000000000000000000000000000909204900b131590565b15614d11576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f9081526001909101602052604090205490565b5f614d528254600f81810b700100000000000000000000000000000000909204900b131590565b15614d89576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f818152600180840160205260408220805492905583547fffffffffffffffffffffffffffffffff000000000000000000000000000000001692016fffffffffffffffffffffffffffffffff169190911790915590565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614e67573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614e8b9190615ea1565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af1158015614f15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614f399190615eb8565b614f6f576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614ff0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906150149190615ea1565b905082158061502c5750826150298383615d3e565b14155b156110d6576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b603380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff16615157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611a70565b61326a6153be565b6001600160a01b038083165f90815260a460209081526040808320938516835292905290812054156151dd576001600160a01b038084165f81815260a360208181526040808420600181015460a48452828620978a168652968352908420549490935252546151ce9190615ce7565b6151d89190615d2b565b6138d5565b505f92915050565b6001600160a01b0381165f90815260a7602052604090208054600181018255906119ab565b5f6138d58383615454565b5f6138d5836001600160a01b03841661547a565b5f81815260018301602052604081205461526e57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610860565b505f610860565b5f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115615326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e743235360000000000000000000000000000000000000000000000006064820152608401611a70565b5090565b80600f81900b8114611482576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401611a70565b5f54610100900460ff16614c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611a70565b5f825f01828154811061546957615469615d51565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015615554575f61549c600183615d3e565b85549091505f906154af90600190615d3e565b905081811461550e575f865f0182815481106154cd576154cd615d51565b905f5260205f200154905080875f0184815481106154ed576154ed615d51565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061551f5761551f615dfd565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610860565b5f915050610860565b50805461556990615a9e565b5f825580601f10615578575050565b601f0160209004905f5260205f20908101906141f691905b80821115615326575f8155600101615590565b6001600160a01b03811681146141f6575f80fd5b5f602082840312156155c7575f80fd5b81356138d5816155a3565b5f80604083850312156155e3575f80fd5b82359150602083013567ffffffffffffffff811115615600575f80fd5b830160608186031215615611575f80fd5b809150509250929050565b5f806040838503121561562d575f80fd5b8235615638816155a3565b946020939093013593505050565b5f60208284031215615656575f80fd5b5035919050565b5f8083601f84011261566d575f80fd5b50813567ffffffffffffffff811115615684575f80fd5b6020830191508360208260051b850101111561569e575f80fd5b9250929050565b5f80602083850312156156b6575f80fd5b823567ffffffffffffffff8111156156cc575f80fd5b6156d88582860161565d565b90969095509350505050565b5f81518084525f5b81811015615708576020818501810151868301820152016156ec565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b838110156157dd578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0018552815180516001600160a01b03168452878101518885015286015160608785018190526157c9818601836156e4565b96890196945050509086019060010161576c565b509098975050505050505050565b5f80604083850312156157fc575f80fd5b8235615807816155a3565b91506020830135615611816155a3565b5f805f805f8060a0878903121561582c575f80fd5b8635615837816155a3565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115615867575f80fd5b61587389828a0161565d565b979a9699509497509295939492505050565b5f805f60608486031215615897575f80fd5b83356158a2816155a3565b925060208401356158b2816155a3565b929592945050506040919091013590565b6001600160a01b0384168152826020820152606060408201525f6158ea60608301846156e4565b95945050505050565b5f805f60408486031215615905575f80fd5b83359250602084013567ffffffffffffffff811115615922575f80fd5b61592e8682870161565d565b9497909650939450505050565b5f805f6060848603121561594d575f80fd5b8335615958816155a3565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b838110156159a55781516001600160a01b031687529582019590820190600101615980565b509495945050505050565b828152604060208201525f6159c8604083018461596d565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115610860576108606159d0565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112615a43575f80fd5b83018035915067ffffffffffffffff821115615a5d575f80fd5b60200191503681900382131561569e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c90821680615ab257607f821691505b6020821081036119ab577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f821115610a2457805f5260205f20601f840160051c81016020851015615b0e5750805b601f840160051c820191505b818110156130de575f8155600101615b1a565b8135615b38816155a3565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112615ba4575f80fd5b8501803567ffffffffffffffff811115615bbc575f80fd5b8036038483011315615bcc575f80fd5b615be081615bda8554615a9e565b85615ae9565b5f601f821160018114615c13575f8315615bfc57508382018601355b5f19600385901b1c1916600184901b178555615c89565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b82811015615c5f57868501890135825593880193908901908801615c40565b5084821015615c7d575f1960f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b8082028115828204841417610860576108606159d0565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82615d3957615d39615cfe565b500490565b81810381811115610860576108606159d0565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81615d8c57615d8c6159d0565b505f190190565b5f82615da157615da1615cfe565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112615dd8575f80fd5b9190910192915050565b5f60208284031215615df2575f80fd5b81516138d5816155a3565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015615e6c578235615e51816155a3565b6001600160a01b031682529183019190830190600101615e3e565b509695505050505050565b5f5f198203615e8857615e886159d0565b5060010190565b602081525f6138d5602083018461596d565b5f60208284031215615eb1575f80fd5b5051919050565b5f60208284031215615ec8575f80fd5b815180151581146138d5575f80fd5b8082018281125f831280158216821582161715615ef657615ef66159d0565b50509291505056fea164736f6c6343000818000a", } // L2StakingABI is the input ABI used to generate the binding from. @@ -216,37 +215,6 @@ func (_L2Staking *L2StakingTransactorRaw) Transact(opts *bind.TransactOpts, meth return _L2Staking.Contract.contract.Transact(opts, method, params...) } -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_L2Staking *L2StakingCaller) DISTRIBUTECONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "DISTRIBUTE_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_L2Staking *L2StakingSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _L2Staking.Contract.DISTRIBUTECONTRACT(&_L2Staking.CallOpts) -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_L2Staking *L2StakingCallerSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _L2Staking.Contract.DISTRIBUTECONTRACT(&_L2Staking.CallOpts) -} - // MESSENGER is a free data retrieval call binding the contract method 0x927ede2d. // // Solidity: function MESSENGER() view returns(address) @@ -371,6 +339,37 @@ func (_L2Staking *L2StakingCallerSession) SEQUENCERCONTRACT() (common.Address, e return _L2Staking.Contract.SEQUENCERCONTRACT(&_L2Staking.CallOpts) } +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. +// +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_L2Staking *L2StakingCaller) SYSTEMADDRESS(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "SYSTEM_ADDRESS") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. +// +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_L2Staking *L2StakingSession) SYSTEMADDRESS() (common.Address, error) { + return _L2Staking.Contract.SYSTEMADDRESS(&_L2Staking.CallOpts) +} + +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. +// +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_L2Staking *L2StakingCallerSession) SYSTEMADDRESS() (common.Address, error) { + return _L2Staking.Contract.SYSTEMADDRESS(&_L2Staking.CallOpts) +} + // CandidateNumber is a free data retrieval call binding the contract method 0x3b802421. // // Solidity: function candidateNumber() view returns(uint256) @@ -402,12 +401,12 @@ func (_L2Staking *L2StakingCallerSession) CandidateNumber() (*big.Int, error) { return _L2Staking.Contract.CandidateNumber(&_L2Staking.CallOpts) } -// Commissions is a free data retrieval call binding the contract method 0x7b05afb5. +// ClaimableUndelegateRequest is a free data retrieval call binding the contract method 0x13f22527. // -// Solidity: function commissions(address staker) view returns(uint256 amount) -func (_L2Staking *L2StakingCaller) Commissions(opts *bind.CallOpts, staker common.Address) (*big.Int, error) { +// Solidity: function claimableUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCaller) ClaimableUndelegateRequest(opts *bind.CallOpts, delegator common.Address) (*big.Int, error) { var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "commissions", staker) + err := _L2Staking.contract.Call(opts, &out, "claimableUndelegateRequest", delegator) if err != nil { return *new(*big.Int), err @@ -419,17 +418,62 @@ func (_L2Staking *L2StakingCaller) Commissions(opts *bind.CallOpts, staker commo } +// ClaimableUndelegateRequest is a free data retrieval call binding the contract method 0x13f22527. +// +// Solidity: function claimableUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingSession) ClaimableUndelegateRequest(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.ClaimableUndelegateRequest(&_L2Staking.CallOpts, delegator) +} + +// ClaimableUndelegateRequest is a free data retrieval call binding the contract method 0x13f22527. +// +// Solidity: function claimableUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCallerSession) ClaimableUndelegateRequest(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.ClaimableUndelegateRequest(&_L2Staking.CallOpts, delegator) +} + // Commissions is a free data retrieval call binding the contract method 0x7b05afb5. // -// Solidity: function commissions(address staker) view returns(uint256 amount) -func (_L2Staking *L2StakingSession) Commissions(staker common.Address) (*big.Int, error) { +// Solidity: function commissions(address staker) view returns(uint256 rate, uint256 amount) +func (_L2Staking *L2StakingCaller) Commissions(opts *bind.CallOpts, staker common.Address) (struct { + Rate *big.Int + Amount *big.Int +}, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "commissions", staker) + + outstruct := new(struct { + Rate *big.Int + Amount *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Rate = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Amount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Commissions is a free data retrieval call binding the contract method 0x7b05afb5. +// +// Solidity: function commissions(address staker) view returns(uint256 rate, uint256 amount) +func (_L2Staking *L2StakingSession) Commissions(staker common.Address) (struct { + Rate *big.Int + Amount *big.Int +}, error) { return _L2Staking.Contract.Commissions(&_L2Staking.CallOpts, staker) } // Commissions is a free data retrieval call binding the contract method 0x7b05afb5. // -// Solidity: function commissions(address staker) view returns(uint256 amount) -func (_L2Staking *L2StakingCallerSession) Commissions(staker common.Address) (*big.Int, error) { +// Solidity: function commissions(address staker) view returns(uint256 rate, uint256 amount) +func (_L2Staking *L2StakingCallerSession) Commissions(staker common.Address) (struct { + Rate *big.Int + Amount *big.Int +}, error) { return _L2Staking.Contract.Commissions(&_L2Staking.CallOpts, staker) } @@ -464,12 +508,57 @@ func (_L2Staking *L2StakingCallerSession) CurrentEpoch() (*big.Int, error) { return _L2Staking.Contract.CurrentEpoch(&_L2Staking.CallOpts) } -// Delegations is a free data retrieval call binding the contract method 0xc64814dd. +// DelegateeDelegations is a free data retrieval call binding the contract method 0x1d5611b8. +// +// Solidity: function delegateeDelegations(address staker) view returns(uint256 amount, uint256 share) +func (_L2Staking *L2StakingCaller) DelegateeDelegations(opts *bind.CallOpts, staker common.Address) (struct { + Amount *big.Int + Share *big.Int +}, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "delegateeDelegations", staker) + + outstruct := new(struct { + Amount *big.Int + Share *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Amount = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Share = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// DelegateeDelegations is a free data retrieval call binding the contract method 0x1d5611b8. +// +// Solidity: function delegateeDelegations(address staker) view returns(uint256 amount, uint256 share) +func (_L2Staking *L2StakingSession) DelegateeDelegations(staker common.Address) (struct { + Amount *big.Int + Share *big.Int +}, error) { + return _L2Staking.Contract.DelegateeDelegations(&_L2Staking.CallOpts, staker) +} + +// DelegateeDelegations is a free data retrieval call binding the contract method 0x1d5611b8. +// +// Solidity: function delegateeDelegations(address staker) view returns(uint256 amount, uint256 share) +func (_L2Staking *L2StakingCallerSession) DelegateeDelegations(staker common.Address) (struct { + Amount *big.Int + Share *big.Int +}, error) { + return _L2Staking.Contract.DelegateeDelegations(&_L2Staking.CallOpts, staker) +} + +// DelegatorDelegations is a free data retrieval call binding the contract method 0x3b2713c5. // -// Solidity: function delegations(address staker, address delegator) view returns(uint256 amount) -func (_L2Staking *L2StakingCaller) Delegations(opts *bind.CallOpts, staker common.Address, delegator common.Address) (*big.Int, error) { +// Solidity: function delegatorDelegations(address staker, address delegator) view returns(uint256 share) +func (_L2Staking *L2StakingCaller) DelegatorDelegations(opts *bind.CallOpts, staker common.Address, delegator common.Address) (*big.Int, error) { var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "delegations", staker, delegator) + err := _L2Staking.contract.Call(opts, &out, "delegatorDelegations", staker, delegator) if err != nil { return *new(*big.Int), err @@ -481,18 +570,80 @@ func (_L2Staking *L2StakingCaller) Delegations(opts *bind.CallOpts, staker commo } -// Delegations is a free data retrieval call binding the contract method 0xc64814dd. +// DelegatorDelegations is a free data retrieval call binding the contract method 0x3b2713c5. // -// Solidity: function delegations(address staker, address delegator) view returns(uint256 amount) -func (_L2Staking *L2StakingSession) Delegations(staker common.Address, delegator common.Address) (*big.Int, error) { - return _L2Staking.Contract.Delegations(&_L2Staking.CallOpts, staker, delegator) +// Solidity: function delegatorDelegations(address staker, address delegator) view returns(uint256 share) +func (_L2Staking *L2StakingSession) DelegatorDelegations(staker common.Address, delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.DelegatorDelegations(&_L2Staking.CallOpts, staker, delegator) } -// Delegations is a free data retrieval call binding the contract method 0xc64814dd. +// DelegatorDelegations is a free data retrieval call binding the contract method 0x3b2713c5. // -// Solidity: function delegations(address staker, address delegator) view returns(uint256 amount) -func (_L2Staking *L2StakingCallerSession) Delegations(staker common.Address, delegator common.Address) (*big.Int, error) { - return _L2Staking.Contract.Delegations(&_L2Staking.CallOpts, staker, delegator) +// Solidity: function delegatorDelegations(address staker, address delegator) view returns(uint256 share) +func (_L2Staking *L2StakingCallerSession) DelegatorDelegations(staker common.Address, delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.DelegatorDelegations(&_L2Staking.CallOpts, staker, delegator) +} + +// EpochSequencerBlocks is a free data retrieval call binding the contract method 0xfe348884. +// +// Solidity: function epochSequencerBlocks(address seequencer) view returns(uint256) +func (_L2Staking *L2StakingCaller) EpochSequencerBlocks(opts *bind.CallOpts, seequencer common.Address) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "epochSequencerBlocks", seequencer) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EpochSequencerBlocks is a free data retrieval call binding the contract method 0xfe348884. +// +// Solidity: function epochSequencerBlocks(address seequencer) view returns(uint256) +func (_L2Staking *L2StakingSession) EpochSequencerBlocks(seequencer common.Address) (*big.Int, error) { + return _L2Staking.Contract.EpochSequencerBlocks(&_L2Staking.CallOpts, seequencer) +} + +// EpochSequencerBlocks is a free data retrieval call binding the contract method 0xfe348884. +// +// Solidity: function epochSequencerBlocks(address seequencer) view returns(uint256) +func (_L2Staking *L2StakingCallerSession) EpochSequencerBlocks(seequencer common.Address) (*big.Int, error) { + return _L2Staking.Contract.EpochSequencerBlocks(&_L2Staking.CallOpts, seequencer) +} + +// EpochTotalBlocks is a free data retrieval call binding the contract method 0xeefecafd. +// +// Solidity: function epochTotalBlocks() view returns(uint256) +func (_L2Staking *L2StakingCaller) EpochTotalBlocks(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "epochTotalBlocks") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EpochTotalBlocks is a free data retrieval call binding the contract method 0xeefecafd. +// +// Solidity: function epochTotalBlocks() view returns(uint256) +func (_L2Staking *L2StakingSession) EpochTotalBlocks() (*big.Int, error) { + return _L2Staking.Contract.EpochTotalBlocks(&_L2Staking.CallOpts) +} + +// EpochTotalBlocks is a free data retrieval call binding the contract method 0xeefecafd. +// +// Solidity: function epochTotalBlocks() view returns(uint256) +func (_L2Staking *L2StakingCallerSession) EpochTotalBlocks() (*big.Int, error) { + return _L2Staking.Contract.EpochTotalBlocks(&_L2Staking.CallOpts) } // GetAllDelegatorsInPagination is a free data retrieval call binding the contract method 0xd31d83d9. @@ -664,37 +815,6 @@ func (_L2Staking *L2StakingCallerSession) GetStakesInfo(_stakerAddresses []commo return _L2Staking.Contract.GetStakesInfo(&_L2Staking.CallOpts, _stakerAddresses) } -// GetUndelegations is a free data retrieval call binding the contract method 0xed70b343. -// -// Solidity: function getUndelegations(address delegator) view returns((address,uint256,uint256)[]) -func (_L2Staking *L2StakingCaller) GetUndelegations(opts *bind.CallOpts, delegator common.Address) ([]IL2StakingUndelegation, error) { - var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "getUndelegations", delegator) - - if err != nil { - return *new([]IL2StakingUndelegation), err - } - - out0 := *abi.ConvertType(out[0], new([]IL2StakingUndelegation)).(*[]IL2StakingUndelegation) - - return out0, err - -} - -// GetUndelegations is a free data retrieval call binding the contract method 0xed70b343. -// -// Solidity: function getUndelegations(address delegator) view returns((address,uint256,uint256)[]) -func (_L2Staking *L2StakingSession) GetUndelegations(delegator common.Address) ([]IL2StakingUndelegation, error) { - return _L2Staking.Contract.GetUndelegations(&_L2Staking.CallOpts, delegator) -} - -// GetUndelegations is a free data retrieval call binding the contract method 0xed70b343. -// -// Solidity: function getUndelegations(address delegator) view returns((address,uint256,uint256)[]) -func (_L2Staking *L2StakingCallerSession) GetUndelegations(delegator common.Address) ([]IL2StakingUndelegation, error) { - return _L2Staking.Contract.GetUndelegations(&_L2Staking.CallOpts, delegator) -} - // IsStakingTo is a free data retrieval call binding the contract method 0x84d7d1d4. // // Solidity: function isStakingTo(address staker) view returns(bool) @@ -757,6 +877,37 @@ func (_L2Staking *L2StakingCallerSession) LatestSequencerSetSize() (*big.Int, er return _L2Staking.Contract.LatestSequencerSetSize(&_L2Staking.CallOpts) } +// LockedAmount is a free data retrieval call binding the contract method 0xa61bb764. +// +// Solidity: function lockedAmount(address delegator, uint256 number) view returns(uint256) +func (_L2Staking *L2StakingCaller) LockedAmount(opts *bind.CallOpts, delegator common.Address, number *big.Int) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "lockedAmount", delegator, number) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LockedAmount is a free data retrieval call binding the contract method 0xa61bb764. +// +// Solidity: function lockedAmount(address delegator, uint256 number) view returns(uint256) +func (_L2Staking *L2StakingSession) LockedAmount(delegator common.Address, number *big.Int) (*big.Int, error) { + return _L2Staking.Contract.LockedAmount(&_L2Staking.CallOpts, delegator, number) +} + +// LockedAmount is a free data retrieval call binding the contract method 0xa61bb764. +// +// Solidity: function lockedAmount(address delegator, uint256 number) view returns(uint256) +func (_L2Staking *L2StakingCallerSession) LockedAmount(delegator common.Address, number *big.Int) (*big.Int, error) { + return _L2Staking.Contract.LockedAmount(&_L2Staking.CallOpts, delegator, number) +} + // Messenger is a free data retrieval call binding the contract method 0x3cb747bf. // // Solidity: function messenger() view returns(address) @@ -850,6 +1001,99 @@ func (_L2Staking *L2StakingCallerSession) Owner() (common.Address, error) { return _L2Staking.Contract.Owner(&_L2Staking.CallOpts) } +// PendingUndelegateRequest is a free data retrieval call binding the contract method 0x0321731c. +// +// Solidity: function pendingUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCaller) PendingUndelegateRequest(opts *bind.CallOpts, delegator common.Address) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "pendingUndelegateRequest", delegator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PendingUndelegateRequest is a free data retrieval call binding the contract method 0x0321731c. +// +// Solidity: function pendingUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingSession) PendingUndelegateRequest(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.PendingUndelegateRequest(&_L2Staking.CallOpts, delegator) +} + +// PendingUndelegateRequest is a free data retrieval call binding the contract method 0x0321731c. +// +// Solidity: function pendingUndelegateRequest(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCallerSession) PendingUndelegateRequest(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.PendingUndelegateRequest(&_L2Staking.CallOpts, delegator) +} + +// QueryDelegationAmount is a free data retrieval call binding the contract method 0x9d51c3b9. +// +// Solidity: function queryDelegationAmount(address delegatee, address delegator) view returns(uint256 amount) +func (_L2Staking *L2StakingCaller) QueryDelegationAmount(opts *bind.CallOpts, delegatee common.Address, delegator common.Address) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "queryDelegationAmount", delegatee, delegator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// QueryDelegationAmount is a free data retrieval call binding the contract method 0x9d51c3b9. +// +// Solidity: function queryDelegationAmount(address delegatee, address delegator) view returns(uint256 amount) +func (_L2Staking *L2StakingSession) QueryDelegationAmount(delegatee common.Address, delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.QueryDelegationAmount(&_L2Staking.CallOpts, delegatee, delegator) +} + +// QueryDelegationAmount is a free data retrieval call binding the contract method 0x9d51c3b9. +// +// Solidity: function queryDelegationAmount(address delegatee, address delegator) view returns(uint256 amount) +func (_L2Staking *L2StakingCallerSession) QueryDelegationAmount(delegatee common.Address, delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.QueryDelegationAmount(&_L2Staking.CallOpts, delegatee, delegator) +} + +// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. +// +// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) +func (_L2Staking *L2StakingCaller) QueryUnclaimedCommission(opts *bind.CallOpts, delegatee common.Address) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "queryUnclaimedCommission", delegatee) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. +// +// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) +func (_L2Staking *L2StakingSession) QueryUnclaimedCommission(delegatee common.Address) (*big.Int, error) { + return _L2Staking.Contract.QueryUnclaimedCommission(&_L2Staking.CallOpts, delegatee) +} + +// QueryUnclaimedCommission is a free data retrieval call binding the contract method 0xbf2dca0a. +// +// Solidity: function queryUnclaimedCommission(address delegatee) view returns(uint256 amount) +func (_L2Staking *L2StakingCallerSession) QueryUnclaimedCommission(delegatee common.Address) (*big.Int, error) { + return _L2Staking.Contract.QueryUnclaimedCommission(&_L2Staking.CallOpts, delegatee) +} + // RewardStartTime is a free data retrieval call binding the contract method 0x2cc138be. // // Solidity: function rewardStartTime() view returns(uint256) @@ -974,37 +1218,6 @@ func (_L2Staking *L2StakingCallerSession) StakerAddresses(arg0 *big.Int) (common return _L2Staking.Contract.StakerAddresses(&_L2Staking.CallOpts, arg0) } -// StakerDelegations is a free data retrieval call binding the contract method 0x91bd43a4. -// -// Solidity: function stakerDelegations(address staker) view returns(uint256 totalDelegationAmount) -func (_L2Staking *L2StakingCaller) StakerDelegations(opts *bind.CallOpts, staker common.Address) (*big.Int, error) { - var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "stakerDelegations", staker) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// StakerDelegations is a free data retrieval call binding the contract method 0x91bd43a4. -// -// Solidity: function stakerDelegations(address staker) view returns(uint256 totalDelegationAmount) -func (_L2Staking *L2StakingSession) StakerDelegations(staker common.Address) (*big.Int, error) { - return _L2Staking.Contract.StakerDelegations(&_L2Staking.CallOpts, staker) -} - -// StakerDelegations is a free data retrieval call binding the contract method 0x91bd43a4. -// -// Solidity: function stakerDelegations(address staker) view returns(uint256 totalDelegationAmount) -func (_L2Staking *L2StakingCallerSession) StakerDelegations(staker common.Address) (*big.Int, error) { - return _L2Staking.Contract.StakerDelegations(&_L2Staking.CallOpts, staker) -} - // StakerRankings is a free data retrieval call binding the contract method 0xb5d2e0dc. // // Solidity: function stakerRankings(address staker) view returns(uint256 ranking) @@ -1117,54 +1330,66 @@ func (_L2Staking *L2StakingCallerSession) UndelegateLockEpochs() (*big.Int, erro return _L2Staking.Contract.UndelegateLockEpochs(&_L2Staking.CallOpts) } -// Undelegations is a free data retrieval call binding the contract method 0x0f3b7059. +// UndelegateRequest is a free data retrieval call binding the contract method 0xb7a587bf. // -// Solidity: function undelegations(address delegator, uint256 ) view returns(address delegatee, uint256 amount, uint256 unlockEpoch) -func (_L2Staking *L2StakingCaller) Undelegations(opts *bind.CallOpts, delegator common.Address, arg1 *big.Int) (struct { - Delegatee common.Address - Amount *big.Int - UnlockEpoch *big.Int -}, error) { +// Solidity: function undelegateRequest(address delegator, uint256 _index) view returns((uint256,uint256)) +func (_L2Staking *L2StakingCaller) UndelegateRequest(opts *bind.CallOpts, delegator common.Address, _index *big.Int) (IL2StakingUndelegateRequest, error) { var out []interface{} - err := _L2Staking.contract.Call(opts, &out, "undelegations", delegator, arg1) + err := _L2Staking.contract.Call(opts, &out, "undelegateRequest", delegator, _index) - outstruct := new(struct { - Delegatee common.Address - Amount *big.Int - UnlockEpoch *big.Int - }) if err != nil { - return *outstruct, err + return *new(IL2StakingUndelegateRequest), err } - outstruct.Delegatee = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - outstruct.Amount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - outstruct.UnlockEpoch = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + out0 := *abi.ConvertType(out[0], new(IL2StakingUndelegateRequest)).(*IL2StakingUndelegateRequest) - return *outstruct, err + return out0, err } -// Undelegations is a free data retrieval call binding the contract method 0x0f3b7059. +// UndelegateRequest is a free data retrieval call binding the contract method 0xb7a587bf. // -// Solidity: function undelegations(address delegator, uint256 ) view returns(address delegatee, uint256 amount, uint256 unlockEpoch) -func (_L2Staking *L2StakingSession) Undelegations(delegator common.Address, arg1 *big.Int) (struct { - Delegatee common.Address - Amount *big.Int - UnlockEpoch *big.Int -}, error) { - return _L2Staking.Contract.Undelegations(&_L2Staking.CallOpts, delegator, arg1) +// Solidity: function undelegateRequest(address delegator, uint256 _index) view returns((uint256,uint256)) +func (_L2Staking *L2StakingSession) UndelegateRequest(delegator common.Address, _index *big.Int) (IL2StakingUndelegateRequest, error) { + return _L2Staking.Contract.UndelegateRequest(&_L2Staking.CallOpts, delegator, _index) } -// Undelegations is a free data retrieval call binding the contract method 0x0f3b7059. +// UndelegateRequest is a free data retrieval call binding the contract method 0xb7a587bf. // -// Solidity: function undelegations(address delegator, uint256 ) view returns(address delegatee, uint256 amount, uint256 unlockEpoch) -func (_L2Staking *L2StakingCallerSession) Undelegations(delegator common.Address, arg1 *big.Int) (struct { - Delegatee common.Address - Amount *big.Int - UnlockEpoch *big.Int -}, error) { - return _L2Staking.Contract.Undelegations(&_L2Staking.CallOpts, delegator, arg1) +// Solidity: function undelegateRequest(address delegator, uint256 _index) view returns((uint256,uint256)) +func (_L2Staking *L2StakingCallerSession) UndelegateRequest(delegator common.Address, _index *big.Int) (IL2StakingUndelegateRequest, error) { + return _L2Staking.Contract.UndelegateRequest(&_L2Staking.CallOpts, delegator, _index) +} + +// UndelegateSequence is a free data retrieval call binding the contract method 0x7c7e8bd2. +// +// Solidity: function undelegateSequence(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCaller) UndelegateSequence(opts *bind.CallOpts, delegator common.Address) (*big.Int, error) { + var out []interface{} + err := _L2Staking.contract.Call(opts, &out, "undelegateSequence", delegator) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// UndelegateSequence is a free data retrieval call binding the contract method 0x7c7e8bd2. +// +// Solidity: function undelegateSequence(address delegator) view returns(uint256) +func (_L2Staking *L2StakingSession) UndelegateSequence(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.UndelegateSequence(&_L2Staking.CallOpts, delegator) +} + +// UndelegateSequence is a free data retrieval call binding the contract method 0x7c7e8bd2. +// +// Solidity: function undelegateSequence(address delegator) view returns(uint256) +func (_L2Staking *L2StakingCallerSession) UndelegateSequence(delegator common.Address) (*big.Int, error) { + return _L2Staking.Contract.UndelegateSequence(&_L2Staking.CallOpts, delegator) } // AddStaker is a paid mutator transaction binding the contract method 0x7046529b. @@ -1209,67 +1434,67 @@ func (_L2Staking *L2StakingTransactorSession) ClaimCommission() (*types.Transact return _L2Staking.Contract.ClaimCommission(&_L2Staking.TransactOpts) } -// ClaimReward is a paid mutator transaction binding the contract method 0x174e31c4. +// ClaimUndelegation is a paid mutator transaction binding the contract method 0x201018fb. // -// Solidity: function claimReward(address delegatee, uint256 targetEpochIndex) returns() -func (_L2Staking *L2StakingTransactor) ClaimReward(opts *bind.TransactOpts, delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _L2Staking.contract.Transact(opts, "claimReward", delegatee, targetEpochIndex) +// Solidity: function claimUndelegation(uint256 number) returns(uint256) +func (_L2Staking *L2StakingTransactor) ClaimUndelegation(opts *bind.TransactOpts, number *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "claimUndelegation", number) } -// ClaimReward is a paid mutator transaction binding the contract method 0x174e31c4. +// ClaimUndelegation is a paid mutator transaction binding the contract method 0x201018fb. // -// Solidity: function claimReward(address delegatee, uint256 targetEpochIndex) returns() -func (_L2Staking *L2StakingSession) ClaimReward(delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.ClaimReward(&_L2Staking.TransactOpts, delegatee, targetEpochIndex) +// Solidity: function claimUndelegation(uint256 number) returns(uint256) +func (_L2Staking *L2StakingSession) ClaimUndelegation(number *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.ClaimUndelegation(&_L2Staking.TransactOpts, number) } -// ClaimReward is a paid mutator transaction binding the contract method 0x174e31c4. +// ClaimUndelegation is a paid mutator transaction binding the contract method 0x201018fb. // -// Solidity: function claimReward(address delegatee, uint256 targetEpochIndex) returns() -func (_L2Staking *L2StakingTransactorSession) ClaimReward(delegatee common.Address, targetEpochIndex *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.ClaimReward(&_L2Staking.TransactOpts, delegatee, targetEpochIndex) +// Solidity: function claimUndelegation(uint256 number) returns(uint256) +func (_L2Staking *L2StakingTransactorSession) ClaimUndelegation(number *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.ClaimUndelegation(&_L2Staking.TransactOpts, number) } -// ClaimUndelegation is a paid mutator transaction binding the contract method 0xe10911b1. +// Delegate is a paid mutator transaction binding the contract method 0x026e402b. // -// Solidity: function claimUndelegation() returns() -func (_L2Staking *L2StakingTransactor) ClaimUndelegation(opts *bind.TransactOpts) (*types.Transaction, error) { - return _L2Staking.contract.Transact(opts, "claimUndelegation") +// Solidity: function delegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "delegate", delegatee, amount) } -// ClaimUndelegation is a paid mutator transaction binding the contract method 0xe10911b1. +// Delegate is a paid mutator transaction binding the contract method 0x026e402b. // -// Solidity: function claimUndelegation() returns() -func (_L2Staking *L2StakingSession) ClaimUndelegation() (*types.Transaction, error) { - return _L2Staking.Contract.ClaimUndelegation(&_L2Staking.TransactOpts) +// Solidity: function delegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingSession) Delegate(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Delegate(&_L2Staking.TransactOpts, delegatee, amount) } -// ClaimUndelegation is a paid mutator transaction binding the contract method 0xe10911b1. +// Delegate is a paid mutator transaction binding the contract method 0x026e402b. // -// Solidity: function claimUndelegation() returns() -func (_L2Staking *L2StakingTransactorSession) ClaimUndelegation() (*types.Transaction, error) { - return _L2Staking.Contract.ClaimUndelegation(&_L2Staking.TransactOpts) +// Solidity: function delegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingTransactorSession) Delegate(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Delegate(&_L2Staking.TransactOpts, delegatee, amount) } -// DelegateStake is a paid mutator transaction binding the contract method 0x3c323a1b. +// Distribute is a paid mutator transaction binding the contract method 0x91c05b0b. // -// Solidity: function delegateStake(address delegatee, uint256 amount) returns() -func (_L2Staking *L2StakingTransactor) DelegateStake(opts *bind.TransactOpts, delegatee common.Address, amount *big.Int) (*types.Transaction, error) { - return _L2Staking.contract.Transact(opts, "delegateStake", delegatee, amount) +// Solidity: function distribute(uint256 amount) returns() +func (_L2Staking *L2StakingTransactor) Distribute(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "distribute", amount) } -// DelegateStake is a paid mutator transaction binding the contract method 0x3c323a1b. +// Distribute is a paid mutator transaction binding the contract method 0x91c05b0b. // -// Solidity: function delegateStake(address delegatee, uint256 amount) returns() -func (_L2Staking *L2StakingSession) DelegateStake(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.DelegateStake(&_L2Staking.TransactOpts, delegatee, amount) +// Solidity: function distribute(uint256 amount) returns() +func (_L2Staking *L2StakingSession) Distribute(amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Distribute(&_L2Staking.TransactOpts, amount) } -// DelegateStake is a paid mutator transaction binding the contract method 0x3c323a1b. +// Distribute is a paid mutator transaction binding the contract method 0x91c05b0b. // -// Solidity: function delegateStake(address delegatee, uint256 amount) returns() -func (_L2Staking *L2StakingTransactorSession) DelegateStake(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.DelegateStake(&_L2Staking.TransactOpts, delegatee, amount) +// Solidity: function distribute(uint256 amount) returns() +func (_L2Staking *L2StakingTransactorSession) Distribute(amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Distribute(&_L2Staking.TransactOpts, amount) } // EmergencyAddStaker is a paid mutator transaction binding the contract method 0x009c6f0c. @@ -1335,6 +1560,48 @@ func (_L2Staking *L2StakingTransactorSession) Initialize(_owner common.Address, return _L2Staking.Contract.Initialize(&_L2Staking.TransactOpts, _owner, _sequencersMaxSize, _undelegateLockEpochs, _rewardStartTime, _stakers) } +// RecordBlocks is a paid mutator transaction binding the contract method 0xff4840cd. +// +// Solidity: function recordBlocks(address sequencerAddr) returns() +func (_L2Staking *L2StakingTransactor) RecordBlocks(opts *bind.TransactOpts, sequencerAddr common.Address) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "recordBlocks", sequencerAddr) +} + +// RecordBlocks is a paid mutator transaction binding the contract method 0xff4840cd. +// +// Solidity: function recordBlocks(address sequencerAddr) returns() +func (_L2Staking *L2StakingSession) RecordBlocks(sequencerAddr common.Address) (*types.Transaction, error) { + return _L2Staking.Contract.RecordBlocks(&_L2Staking.TransactOpts, sequencerAddr) +} + +// RecordBlocks is a paid mutator transaction binding the contract method 0xff4840cd. +// +// Solidity: function recordBlocks(address sequencerAddr) returns() +func (_L2Staking *L2StakingTransactorSession) RecordBlocks(sequencerAddr common.Address) (*types.Transaction, error) { + return _L2Staking.Contract.RecordBlocks(&_L2Staking.TransactOpts, sequencerAddr) +} + +// Redelegate is a paid mutator transaction binding the contract method 0x6bd8f804. +// +// Solidity: function redelegate(address delegateeFrom, address delegateeTo, uint256 amount) returns() +func (_L2Staking *L2StakingTransactor) Redelegate(opts *bind.TransactOpts, delegateeFrom common.Address, delegateeTo common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "redelegate", delegateeFrom, delegateeTo, amount) +} + +// Redelegate is a paid mutator transaction binding the contract method 0x6bd8f804. +// +// Solidity: function redelegate(address delegateeFrom, address delegateeTo, uint256 amount) returns() +func (_L2Staking *L2StakingSession) Redelegate(delegateeFrom common.Address, delegateeTo common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Redelegate(&_L2Staking.TransactOpts, delegateeFrom, delegateeTo, amount) +} + +// Redelegate is a paid mutator transaction binding the contract method 0x6bd8f804. +// +// Solidity: function redelegate(address delegateeFrom, address delegateeTo, uint256 amount) returns() +func (_L2Staking *L2StakingTransactorSession) Redelegate(delegateeFrom common.Address, delegateeTo common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Redelegate(&_L2Staking.TransactOpts, delegateeFrom, delegateeTo, amount) +} + // RemoveStakers is a paid mutator transaction binding the contract method 0xcce6cf9f. // // Solidity: function removeStakers(uint256 _nonce, address[] remove) returns() @@ -1379,23 +1646,23 @@ func (_L2Staking *L2StakingTransactorSession) RenounceOwnership() (*types.Transa // SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. // -// Solidity: function setCommissionRate(uint256 commission) returns() -func (_L2Staking *L2StakingTransactor) SetCommissionRate(opts *bind.TransactOpts, commission *big.Int) (*types.Transaction, error) { - return _L2Staking.contract.Transact(opts, "setCommissionRate", commission) +// Solidity: function setCommissionRate(uint256 rate) returns() +func (_L2Staking *L2StakingTransactor) SetCommissionRate(opts *bind.TransactOpts, rate *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "setCommissionRate", rate) } // SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. // -// Solidity: function setCommissionRate(uint256 commission) returns() -func (_L2Staking *L2StakingSession) SetCommissionRate(commission *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.SetCommissionRate(&_L2Staking.TransactOpts, commission) +// Solidity: function setCommissionRate(uint256 rate) returns() +func (_L2Staking *L2StakingSession) SetCommissionRate(rate *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.SetCommissionRate(&_L2Staking.TransactOpts, rate) } // SetCommissionRate is a paid mutator transaction binding the contract method 0x19fac8fd. // -// Solidity: function setCommissionRate(uint256 commission) returns() -func (_L2Staking *L2StakingTransactorSession) SetCommissionRate(commission *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.SetCommissionRate(&_L2Staking.TransactOpts, commission) +// Solidity: function setCommissionRate(uint256 rate) returns() +func (_L2Staking *L2StakingTransactorSession) SetCommissionRate(rate *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.SetCommissionRate(&_L2Staking.TransactOpts, rate) } // StartReward is a paid mutator transaction binding the contract method 0x746c8ae1. @@ -1440,25 +1707,25 @@ func (_L2Staking *L2StakingTransactorSession) TransferOwnership(newOwner common. return _L2Staking.Contract.TransferOwnership(&_L2Staking.TransactOpts, newOwner) } -// UndelegateStake is a paid mutator transaction binding the contract method 0x3385ccc2. +// Undelegate is a paid mutator transaction binding the contract method 0x4d99dd16. // -// Solidity: function undelegateStake(address delegatee) returns() -func (_L2Staking *L2StakingTransactor) UndelegateStake(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { - return _L2Staking.contract.Transact(opts, "undelegateStake", delegatee) +// Solidity: function undelegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingTransactor) Undelegate(opts *bind.TransactOpts, delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.contract.Transact(opts, "undelegate", delegatee, amount) } -// UndelegateStake is a paid mutator transaction binding the contract method 0x3385ccc2. +// Undelegate is a paid mutator transaction binding the contract method 0x4d99dd16. // -// Solidity: function undelegateStake(address delegatee) returns() -func (_L2Staking *L2StakingSession) UndelegateStake(delegatee common.Address) (*types.Transaction, error) { - return _L2Staking.Contract.UndelegateStake(&_L2Staking.TransactOpts, delegatee) +// Solidity: function undelegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingSession) Undelegate(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Undelegate(&_L2Staking.TransactOpts, delegatee, amount) } -// UndelegateStake is a paid mutator transaction binding the contract method 0x3385ccc2. +// Undelegate is a paid mutator transaction binding the contract method 0x4d99dd16. // -// Solidity: function undelegateStake(address delegatee) returns() -func (_L2Staking *L2StakingTransactorSession) UndelegateStake(delegatee common.Address) (*types.Transaction, error) { - return _L2Staking.Contract.UndelegateStake(&_L2Staking.TransactOpts, delegatee) +// Solidity: function undelegate(address delegatee, uint256 amount) returns() +func (_L2Staking *L2StakingTransactorSession) Undelegate(delegatee common.Address, amount *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.Undelegate(&_L2Staking.TransactOpts, delegatee, amount) } // UpdateRewardStartTime is a paid mutator transaction binding the contract method 0x40b5c837. @@ -1496,11 +1763,156 @@ func (_L2Staking *L2StakingSession) UpdateSequencerSetMaxSize(_sequencerSetMaxSi return _L2Staking.Contract.UpdateSequencerSetMaxSize(&_L2Staking.TransactOpts, _sequencerSetMaxSize) } -// UpdateSequencerSetMaxSize is a paid mutator transaction binding the contract method 0x0eb573af. +// UpdateSequencerSetMaxSize is a paid mutator transaction binding the contract method 0x0eb573af. +// +// Solidity: function updateSequencerSetMaxSize(uint256 _sequencerSetMaxSize) returns() +func (_L2Staking *L2StakingTransactorSession) UpdateSequencerSetMaxSize(_sequencerSetMaxSize *big.Int) (*types.Transaction, error) { + return _L2Staking.Contract.UpdateSequencerSetMaxSize(&_L2Staking.TransactOpts, _sequencerSetMaxSize) +} + +// L2StakingCommissionClaimedIterator is returned from FilterCommissionClaimed and is used to iterate over the raw logs and unpacked data for CommissionClaimed events raised by the L2Staking contract. +type L2StakingCommissionClaimedIterator struct { + Event *L2StakingCommissionClaimed // 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 *L2StakingCommissionClaimedIterator) 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(L2StakingCommissionClaimed) + 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(L2StakingCommissionClaimed) + 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 *L2StakingCommissionClaimedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StakingCommissionClaimedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StakingCommissionClaimed represents a CommissionClaimed event raised by the L2Staking contract. +type L2StakingCommissionClaimed struct { + Delegatee common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCommissionClaimed is a free log retrieval operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. +// +// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) +func (_L2Staking *L2StakingFilterer) FilterCommissionClaimed(opts *bind.FilterOpts, delegatee []common.Address) (*L2StakingCommissionClaimedIterator, error) { + + var delegateeRule []interface{} + for _, delegateeItem := range delegatee { + delegateeRule = append(delegateeRule, delegateeItem) + } + + logs, sub, err := _L2Staking.contract.FilterLogs(opts, "CommissionClaimed", delegateeRule) + if err != nil { + return nil, err + } + return &L2StakingCommissionClaimedIterator{contract: _L2Staking.contract, event: "CommissionClaimed", logs: logs, sub: sub}, nil +} + +// WatchCommissionClaimed is a free log subscription operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. +// +// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) +func (_L2Staking *L2StakingFilterer) WatchCommissionClaimed(opts *bind.WatchOpts, sink chan<- *L2StakingCommissionClaimed, delegatee []common.Address) (event.Subscription, error) { + + var delegateeRule []interface{} + for _, delegateeItem := range delegatee { + delegateeRule = append(delegateeRule, delegateeItem) + } + + logs, sub, err := _L2Staking.contract.WatchLogs(opts, "CommissionClaimed", delegateeRule) + 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(L2StakingCommissionClaimed) + if err := _L2Staking.contract.UnpackLog(event, "CommissionClaimed", 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 +} + +// ParseCommissionClaimed is a log parse operation binding the contract event 0x8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e411. // -// Solidity: function updateSequencerSetMaxSize(uint256 _sequencerSetMaxSize) returns() -func (_L2Staking *L2StakingTransactorSession) UpdateSequencerSetMaxSize(_sequencerSetMaxSize *big.Int) (*types.Transaction, error) { - return _L2Staking.Contract.UpdateSequencerSetMaxSize(&_L2Staking.TransactOpts, _sequencerSetMaxSize) +// Solidity: event CommissionClaimed(address indexed delegatee, uint256 amount) +func (_L2Staking *L2StakingFilterer) ParseCommissionClaimed(log types.Log) (*L2StakingCommissionClaimed, error) { + event := new(L2StakingCommissionClaimed) + if err := _L2Staking.contract.UnpackLog(event, "CommissionClaimed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil } // L2StakingCommissionUpdatedIterator is returned from FilterCommissionUpdated and is used to iterate over the raw logs and unpacked data for CommissionUpdated events raised by the L2Staking contract. @@ -1572,15 +1984,15 @@ func (it *L2StakingCommissionUpdatedIterator) Close() error { // L2StakingCommissionUpdated represents a CommissionUpdated event raised by the L2Staking contract. type L2StakingCommissionUpdated struct { - Staker common.Address - Percentage *big.Int - EpochEffective *big.Int - Raw types.Log // Blockchain specific contextual infos + Staker common.Address + OldRate *big.Int + NewRate *big.Int + Raw types.Log // Blockchain specific contextual infos } // FilterCommissionUpdated is a free log retrieval operation binding the contract event 0x6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5. // -// Solidity: event CommissionUpdated(address indexed staker, uint256 percentage, uint256 epochEffective) +// Solidity: event CommissionUpdated(address indexed staker, uint256 oldRate, uint256 newRate) func (_L2Staking *L2StakingFilterer) FilterCommissionUpdated(opts *bind.FilterOpts, staker []common.Address) (*L2StakingCommissionUpdatedIterator, error) { var stakerRule []interface{} @@ -1597,7 +2009,7 @@ func (_L2Staking *L2StakingFilterer) FilterCommissionUpdated(opts *bind.FilterOp // WatchCommissionUpdated is a free log subscription operation binding the contract event 0x6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5. // -// Solidity: event CommissionUpdated(address indexed staker, uint256 percentage, uint256 epochEffective) +// Solidity: event CommissionUpdated(address indexed staker, uint256 oldRate, uint256 newRate) func (_L2Staking *L2StakingFilterer) WatchCommissionUpdated(opts *bind.WatchOpts, sink chan<- *L2StakingCommissionUpdated, staker []common.Address) (event.Subscription, error) { var stakerRule []interface{} @@ -1639,7 +2051,7 @@ func (_L2Staking *L2StakingFilterer) WatchCommissionUpdated(opts *bind.WatchOpts // ParseCommissionUpdated is a log parse operation binding the contract event 0x6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5. // -// Solidity: event CommissionUpdated(address indexed staker, uint256 percentage, uint256 epochEffective) +// Solidity: event CommissionUpdated(address indexed staker, uint256 oldRate, uint256 newRate) func (_L2Staking *L2StakingFilterer) ParseCommissionUpdated(log types.Log) (*L2StakingCommissionUpdated, error) { event := new(L2StakingCommissionUpdated) if err := _L2Staking.contract.UnpackLog(event, "CommissionUpdated", log); err != nil { @@ -1718,17 +2130,16 @@ func (it *L2StakingDelegatedIterator) Close() error { // L2StakingDelegated represents a Delegated event raised by the L2Staking contract. type L2StakingDelegated struct { - Delegatee common.Address - Delegator common.Address - Amount *big.Int - StakeAmount *big.Int - EffectiveEpoch *big.Int - Raw types.Log // Blockchain specific contextual infos + Delegatee common.Address + Delegator common.Address + Amount *big.Int + DelegateeAmount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterDelegated is a free log retrieval operation binding the contract event 0xc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d0. +// FilterDelegated is a free log retrieval operation binding the contract event 0x24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04. // -// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 stakeAmount, uint256 effectiveEpoch) +// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount) func (_L2Staking *L2StakingFilterer) FilterDelegated(opts *bind.FilterOpts, delegatee []common.Address, delegator []common.Address) (*L2StakingDelegatedIterator, error) { var delegateeRule []interface{} @@ -1747,9 +2158,9 @@ func (_L2Staking *L2StakingFilterer) FilterDelegated(opts *bind.FilterOpts, dele return &L2StakingDelegatedIterator{contract: _L2Staking.contract, event: "Delegated", logs: logs, sub: sub}, nil } -// WatchDelegated is a free log subscription operation binding the contract event 0xc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d0. +// WatchDelegated is a free log subscription operation binding the contract event 0x24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04. // -// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 stakeAmount, uint256 effectiveEpoch) +// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount) func (_L2Staking *L2StakingFilterer) WatchDelegated(opts *bind.WatchOpts, sink chan<- *L2StakingDelegated, delegatee []common.Address, delegator []common.Address) (event.Subscription, error) { var delegateeRule []interface{} @@ -1793,9 +2204,9 @@ func (_L2Staking *L2StakingFilterer) WatchDelegated(opts *bind.WatchOpts, sink c }), nil } -// ParseDelegated is a log parse operation binding the contract event 0xc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d0. +// ParseDelegated is a log parse operation binding the contract event 0x24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04. // -// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 stakeAmount, uint256 effectiveEpoch) +// Solidity: event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount) func (_L2Staking *L2StakingFilterer) ParseDelegated(log types.Log) (*L2StakingDelegated, error) { event := new(L2StakingDelegated) if err := _L2Staking.contract.UnpackLog(event, "Delegated", log); err != nil { @@ -1805,6 +2216,152 @@ func (_L2Staking *L2StakingFilterer) ParseDelegated(log types.Log) (*L2StakingDe return event, nil } +// L2StakingDistributedIterator is returned from FilterDistributed and is used to iterate over the raw logs and unpacked data for Distributed events raised by the L2Staking contract. +type L2StakingDistributedIterator struct { + Event *L2StakingDistributed // 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 *L2StakingDistributedIterator) 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(L2StakingDistributed) + 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(L2StakingDistributed) + 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 *L2StakingDistributedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StakingDistributedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StakingDistributed represents a Distributed event raised by the L2Staking contract. +type L2StakingDistributed struct { + Sequencer common.Address + DelegatorReward *big.Int + CommissionAmount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDistributed is a free log retrieval operation binding the contract event 0x60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d8. +// +// Solidity: event Distributed(address indexed sequencer, uint256 delegatorReward, uint256 commissionAmount) +func (_L2Staking *L2StakingFilterer) FilterDistributed(opts *bind.FilterOpts, sequencer []common.Address) (*L2StakingDistributedIterator, error) { + + var sequencerRule []interface{} + for _, sequencerItem := range sequencer { + sequencerRule = append(sequencerRule, sequencerItem) + } + + logs, sub, err := _L2Staking.contract.FilterLogs(opts, "Distributed", sequencerRule) + if err != nil { + return nil, err + } + return &L2StakingDistributedIterator{contract: _L2Staking.contract, event: "Distributed", logs: logs, sub: sub}, nil +} + +// WatchDistributed is a free log subscription operation binding the contract event 0x60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d8. +// +// Solidity: event Distributed(address indexed sequencer, uint256 delegatorReward, uint256 commissionAmount) +func (_L2Staking *L2StakingFilterer) WatchDistributed(opts *bind.WatchOpts, sink chan<- *L2StakingDistributed, sequencer []common.Address) (event.Subscription, error) { + + var sequencerRule []interface{} + for _, sequencerItem := range sequencer { + sequencerRule = append(sequencerRule, sequencerItem) + } + + logs, sub, err := _L2Staking.contract.WatchLogs(opts, "Distributed", sequencerRule) + 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(L2StakingDistributed) + if err := _L2Staking.contract.UnpackLog(event, "Distributed", 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 +} + +// ParseDistributed is a log parse operation binding the contract event 0x60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d8. +// +// Solidity: event Distributed(address indexed sequencer, uint256 delegatorReward, uint256 commissionAmount) +func (_L2Staking *L2StakingFilterer) ParseDistributed(log types.Log) (*L2StakingDistributed, error) { + event := new(L2StakingDistributed) + if err := _L2Staking.contract.UnpackLog(event, "Distributed", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // L2StakingInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2Staking contract. type L2StakingInitializedIterator struct { Event *L2StakingInitialized // Event containing the contract specifics and raw log @@ -2092,6 +2649,171 @@ func (_L2Staking *L2StakingFilterer) ParseOwnershipTransferred(log types.Log) (* return event, nil } +// L2StakingRedelegatedIterator is returned from FilterRedelegated and is used to iterate over the raw logs and unpacked data for Redelegated events raised by the L2Staking contract. +type L2StakingRedelegatedIterator struct { + Event *L2StakingRedelegated // 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 *L2StakingRedelegatedIterator) 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(L2StakingRedelegated) + 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(L2StakingRedelegated) + 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 *L2StakingRedelegatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *L2StakingRedelegatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// L2StakingRedelegated represents a Redelegated event raised by the L2Staking contract. +type L2StakingRedelegated struct { + DelegateeFrom common.Address + DelegateeTo common.Address + Delegator common.Address + Amount *big.Int + DelegateeAmountFrom *big.Int + DelegateeAmountTo *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedelegated is a free log retrieval operation binding the contract event 0xfdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b4. +// +// Solidity: event Redelegated(address indexed delegateeFrom, address indexed delegateeTo, address indexed delegator, uint256 amount, uint256 delegateeAmountFrom, uint256 delegateeAmountTo) +func (_L2Staking *L2StakingFilterer) FilterRedelegated(opts *bind.FilterOpts, delegateeFrom []common.Address, delegateeTo []common.Address, delegator []common.Address) (*L2StakingRedelegatedIterator, error) { + + var delegateeFromRule []interface{} + for _, delegateeFromItem := range delegateeFrom { + delegateeFromRule = append(delegateeFromRule, delegateeFromItem) + } + var delegateeToRule []interface{} + for _, delegateeToItem := range delegateeTo { + delegateeToRule = append(delegateeToRule, delegateeToItem) + } + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + + logs, sub, err := _L2Staking.contract.FilterLogs(opts, "Redelegated", delegateeFromRule, delegateeToRule, delegatorRule) + if err != nil { + return nil, err + } + return &L2StakingRedelegatedIterator{contract: _L2Staking.contract, event: "Redelegated", logs: logs, sub: sub}, nil +} + +// WatchRedelegated is a free log subscription operation binding the contract event 0xfdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b4. +// +// Solidity: event Redelegated(address indexed delegateeFrom, address indexed delegateeTo, address indexed delegator, uint256 amount, uint256 delegateeAmountFrom, uint256 delegateeAmountTo) +func (_L2Staking *L2StakingFilterer) WatchRedelegated(opts *bind.WatchOpts, sink chan<- *L2StakingRedelegated, delegateeFrom []common.Address, delegateeTo []common.Address, delegator []common.Address) (event.Subscription, error) { + + var delegateeFromRule []interface{} + for _, delegateeFromItem := range delegateeFrom { + delegateeFromRule = append(delegateeFromRule, delegateeFromItem) + } + var delegateeToRule []interface{} + for _, delegateeToItem := range delegateeTo { + delegateeToRule = append(delegateeToRule, delegateeToItem) + } + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + + logs, sub, err := _L2Staking.contract.WatchLogs(opts, "Redelegated", delegateeFromRule, delegateeToRule, delegatorRule) + 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(L2StakingRedelegated) + if err := _L2Staking.contract.UnpackLog(event, "Redelegated", 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 +} + +// ParseRedelegated is a log parse operation binding the contract event 0xfdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b4. +// +// Solidity: event Redelegated(address indexed delegateeFrom, address indexed delegateeTo, address indexed delegator, uint256 amount, uint256 delegateeAmountFrom, uint256 delegateeAmountTo) +func (_L2Staking *L2StakingFilterer) ParseRedelegated(log types.Log) (*L2StakingRedelegated, error) { + event := new(L2StakingRedelegated) + if err := _L2Staking.contract.UnpackLog(event, "Redelegated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // L2StakingRewardStartTimeUpdatedIterator is returned from FilterRewardStartTimeUpdated and is used to iterate over the raw logs and unpacked data for RewardStartTimeUpdated events raised by the L2Staking contract. type L2StakingRewardStartTimeUpdatedIterator struct { Event *L2StakingRewardStartTimeUpdated // Event containing the contract specifics and raw log @@ -2711,17 +3433,17 @@ func (it *L2StakingUndelegatedIterator) Close() error { // L2StakingUndelegated represents a Undelegated event raised by the L2Staking contract. type L2StakingUndelegated struct { - Delegatee common.Address - Delegator common.Address - Amount *big.Int - EffectiveEpoch *big.Int - UnlockEpoch *big.Int - Raw types.Log // Blockchain specific contextual infos + Delegatee common.Address + Delegator common.Address + Amount *big.Int + DelegateeAmount *big.Int + UnlockEpoch *big.Int + Raw types.Log // Blockchain specific contextual infos } // FilterUndelegated is a free log retrieval operation binding the contract event 0x92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c. // -// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 effectiveEpoch, uint256 unlockEpoch) +// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount, uint256 unlockEpoch) func (_L2Staking *L2StakingFilterer) FilterUndelegated(opts *bind.FilterOpts, delegatee []common.Address, delegator []common.Address) (*L2StakingUndelegatedIterator, error) { var delegateeRule []interface{} @@ -2742,7 +3464,7 @@ func (_L2Staking *L2StakingFilterer) FilterUndelegated(opts *bind.FilterOpts, de // WatchUndelegated is a free log subscription operation binding the contract event 0x92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c. // -// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 effectiveEpoch, uint256 unlockEpoch) +// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount, uint256 unlockEpoch) func (_L2Staking *L2StakingFilterer) WatchUndelegated(opts *bind.WatchOpts, sink chan<- *L2StakingUndelegated, delegatee []common.Address, delegator []common.Address) (event.Subscription, error) { var delegateeRule []interface{} @@ -2788,7 +3510,7 @@ func (_L2Staking *L2StakingFilterer) WatchUndelegated(opts *bind.WatchOpts, sink // ParseUndelegated is a log parse operation binding the contract event 0x92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c. // -// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 effectiveEpoch, uint256 unlockEpoch) +// Solidity: event Undelegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount, uint256 unlockEpoch) func (_L2Staking *L2StakingFilterer) ParseUndelegated(log types.Log) (*L2StakingUndelegated, error) { event := new(L2StakingUndelegated) if err := _L2Staking.contract.UnpackLog(event, "Undelegated", log); err != nil { @@ -2867,49 +3589,39 @@ func (it *L2StakingUndelegationClaimedIterator) Close() error { // L2StakingUndelegationClaimed represents a UndelegationClaimed event raised by the L2Staking contract. type L2StakingUndelegationClaimed struct { - Delegatee common.Address - Delegator common.Address - UnlockEpoch *big.Int - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos + Delegator common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterUndelegationClaimed is a free log retrieval operation binding the contract event 0x921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6. +// FilterUndelegationClaimed is a free log retrieval operation binding the contract event 0xcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb3. // -// Solidity: event UndelegationClaimed(address indexed delegatee, address indexed delegator, uint256 unlockEpoch, uint256 amount) -func (_L2Staking *L2StakingFilterer) FilterUndelegationClaimed(opts *bind.FilterOpts, delegatee []common.Address, delegator []common.Address) (*L2StakingUndelegationClaimedIterator, error) { +// Solidity: event UndelegationClaimed(address indexed delegator, uint256 amount) +func (_L2Staking *L2StakingFilterer) FilterUndelegationClaimed(opts *bind.FilterOpts, delegator []common.Address) (*L2StakingUndelegationClaimedIterator, error) { - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } - logs, sub, err := _L2Staking.contract.FilterLogs(opts, "UndelegationClaimed", delegateeRule, delegatorRule) + logs, sub, err := _L2Staking.contract.FilterLogs(opts, "UndelegationClaimed", delegatorRule) if err != nil { return nil, err } return &L2StakingUndelegationClaimedIterator{contract: _L2Staking.contract, event: "UndelegationClaimed", logs: logs, sub: sub}, nil } -// WatchUndelegationClaimed is a free log subscription operation binding the contract event 0x921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6. +// WatchUndelegationClaimed is a free log subscription operation binding the contract event 0xcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb3. // -// Solidity: event UndelegationClaimed(address indexed delegatee, address indexed delegator, uint256 unlockEpoch, uint256 amount) -func (_L2Staking *L2StakingFilterer) WatchUndelegationClaimed(opts *bind.WatchOpts, sink chan<- *L2StakingUndelegationClaimed, delegatee []common.Address, delegator []common.Address) (event.Subscription, error) { +// Solidity: event UndelegationClaimed(address indexed delegator, uint256 amount) +func (_L2Staking *L2StakingFilterer) WatchUndelegationClaimed(opts *bind.WatchOpts, sink chan<- *L2StakingUndelegationClaimed, delegator []common.Address) (event.Subscription, error) { - var delegateeRule []interface{} - for _, delegateeItem := range delegatee { - delegateeRule = append(delegateeRule, delegateeItem) - } var delegatorRule []interface{} for _, delegatorItem := range delegator { delegatorRule = append(delegatorRule, delegatorItem) } - logs, sub, err := _L2Staking.contract.WatchLogs(opts, "UndelegationClaimed", delegateeRule, delegatorRule) + logs, sub, err := _L2Staking.contract.WatchLogs(opts, "UndelegationClaimed", delegatorRule) if err != nil { return nil, err } @@ -2941,9 +3653,9 @@ func (_L2Staking *L2StakingFilterer) WatchUndelegationClaimed(opts *bind.WatchOp }), nil } -// ParseUndelegationClaimed is a log parse operation binding the contract event 0x921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6. +// ParseUndelegationClaimed is a log parse operation binding the contract event 0xcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb3. // -// Solidity: event UndelegationClaimed(address indexed delegatee, address indexed delegator, uint256 unlockEpoch, uint256 amount) +// Solidity: event UndelegationClaimed(address indexed delegator, uint256 amount) func (_L2Staking *L2StakingFilterer) ParseUndelegationClaimed(log types.Log) (*L2StakingUndelegationClaimed, error) { event := new(L2StakingUndelegationClaimed) if err := _L2Staking.contract.UnpackLog(event, "UndelegationClaimed", log); err != nil { diff --git a/bindings/bindings/l2staking_more.go b/bindings/bindings/l2staking_more.go index 1f7dc0a57..55313dd52 100644 --- a/bindings/bindings/l2staking_more.go +++ b/bindings/bindings/l2staking_more.go @@ -9,11 +9,11 @@ import ( "morph-l2/bindings/solc" ) -const L2StakingStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1023_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1022_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_status\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)1022_storage\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"rewardStarted\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_bool\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"rewardStartTime\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"sequencerSetMaxSize\",\"offset\":0,\"slot\":\"153\",\"type\":\"t_uint256\"},{\"astId\":1010,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"undelegateLockEpochs\",\"offset\":0,\"slot\":\"154\",\"type\":\"t_uint256\"},{\"astId\":1011,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"latestSequencerSetSize\",\"offset\":0,\"slot\":\"155\",\"type\":\"t_uint256\"},{\"astId\":1012,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"candidateNumber\",\"offset\":0,\"slot\":\"156\",\"type\":\"t_uint256\"},{\"astId\":1013,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakerAddresses\",\"offset\":0,\"slot\":\"157\",\"type\":\"t_array(t_address)dyn_storage\"},{\"astId\":1014,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakerRankings\",\"offset\":0,\"slot\":\"158\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1015,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakers\",\"offset\":0,\"slot\":\"159\",\"type\":\"t_mapping(t_address,t_struct(StakerInfo)1026_storage)\"},{\"astId\":1016,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"commissions\",\"offset\":0,\"slot\":\"160\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1017,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakerDelegations\",\"offset\":0,\"slot\":\"161\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1018,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"delegators\",\"offset\":0,\"slot\":\"162\",\"type\":\"t_mapping(t_address,t_struct(AddressSet)1024_storage)\"},{\"astId\":1019,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"delegations\",\"offset\":0,\"slot\":\"163\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":1020,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"undelegations\",\"offset\":0,\"slot\":\"164\",\"type\":\"t_mapping(t_address,t_array(t_struct(Undelegation)1027_storage)dyn_storage)\"},{\"astId\":1021,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"nonce\",\"offset\":0,\"slot\":\"165\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_address)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"address[]\",\"numberOfBytes\":\"32\"},\"t_array(t_bytes32)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"bytes32[]\",\"numberOfBytes\":\"32\"},\"t_array(t_struct(Undelegation)1027_storage)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"struct IL2Staking.Undelegation[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1022_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1023_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_bytes_storage\":{\"encoding\":\"bytes\",\"label\":\"bytes\",\"numberOfBytes\":\"32\"},\"t_mapping(t_address,t_array(t_struct(Undelegation)1027_storage)dyn_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct IL2Staking.Undelegation[])\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_array(t_struct(Undelegation)1027_storage)dyn_storage\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(AddressSet)1024_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct EnumerableSetUpgradeable.AddressSet)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(AddressSet)1024_storage\"},\"t_mapping(t_address,t_struct(StakerInfo)1026_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Types.StakerInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(StakerInfo)1026_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_mapping(t_bytes32,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_uint256\"},\"t_struct(AddressSet)1024_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.AddressSet\",\"numberOfBytes\":\"64\"},\"t_struct(Set)1025_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.Set\",\"numberOfBytes\":\"64\"},\"t_struct(StakerInfo)1026_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Types.StakerInfo\",\"numberOfBytes\":\"96\"},\"t_struct(Undelegation)1027_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IL2Staking.Undelegation\",\"numberOfBytes\":\"96\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" +const L2StakingStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1028_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1027_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_status\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_uint256\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_array(t_uint256)1027_storage\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"rewardStarted\",\"offset\":0,\"slot\":\"151\",\"type\":\"t_bool\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"rewardStartTime\",\"offset\":0,\"slot\":\"152\",\"type\":\"t_uint256\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"sequencerSetMaxSize\",\"offset\":0,\"slot\":\"153\",\"type\":\"t_uint256\"},{\"astId\":1010,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"undelegateLockEpochs\",\"offset\":0,\"slot\":\"154\",\"type\":\"t_uint256\"},{\"astId\":1011,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"latestSequencerSetSize\",\"offset\":0,\"slot\":\"155\",\"type\":\"t_uint256\"},{\"astId\":1012,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"candidateNumber\",\"offset\":0,\"slot\":\"156\",\"type\":\"t_uint256\"},{\"astId\":1013,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"nonce\",\"offset\":0,\"slot\":\"157\",\"type\":\"t_uint256\"},{\"astId\":1014,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakerAddresses\",\"offset\":0,\"slot\":\"158\",\"type\":\"t_array(t_address)dyn_storage\"},{\"astId\":1015,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakerRankings\",\"offset\":0,\"slot\":\"159\",\"type\":\"t_mapping(t_address,t_uint256)\"},{\"astId\":1016,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"stakers\",\"offset\":0,\"slot\":\"160\",\"type\":\"t_mapping(t_address,t_struct(StakerInfo)1035_storage)\"},{\"astId\":1017,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"commissions\",\"offset\":0,\"slot\":\"161\",\"type\":\"t_mapping(t_address,t_struct(Commission)1031_storage)\"},{\"astId\":1018,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"delegators\",\"offset\":0,\"slot\":\"162\",\"type\":\"t_mapping(t_address,t_struct(AddressSet)1029_storage)\"},{\"astId\":1019,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"delegateeDelegations\",\"offset\":0,\"slot\":\"163\",\"type\":\"t_mapping(t_address,t_struct(DelegateeDelegation)1033_storage)\"},{\"astId\":1020,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"delegatorDelegations\",\"offset\":0,\"slot\":\"164\",\"type\":\"t_mapping(t_address,t_mapping(t_address,t_uint256))\"},{\"astId\":1021,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_undelegateRequests\",\"offset\":0,\"slot\":\"165\",\"type\":\"t_mapping(t_bytes32,t_struct(UndelegateRequest)1036_storage)\"},{\"astId\":1022,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_undelegateRequestsQueue\",\"offset\":0,\"slot\":\"166\",\"type\":\"t_mapping(t_address,t_struct(Bytes32Deque)1030_storage)\"},{\"astId\":1023,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"_undelegateSequence\",\"offset\":0,\"slot\":\"167\",\"type\":\"t_mapping(t_address,t_struct(Counter)1032_storage)\"},{\"astId\":1024,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"epochSequencers\",\"offset\":0,\"slot\":\"168\",\"type\":\"t_struct(AddressSet)1029_storage\"},{\"astId\":1025,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"epochTotalBlocks\",\"offset\":0,\"slot\":\"170\",\"type\":\"t_uint256\"},{\"astId\":1026,\"contract\":\"contracts/l2/staking/L2Staking.sol:L2Staking\",\"label\":\"epochSequencerBlocks\",\"offset\":0,\"slot\":\"171\",\"type\":\"t_mapping(t_address,t_uint256)\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_address)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"address[]\",\"numberOfBytes\":\"32\"},\"t_array(t_bytes32)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"bytes32[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1027_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1028_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_bytes32\":{\"encoding\":\"inplace\",\"label\":\"bytes32\",\"numberOfBytes\":\"32\"},\"t_bytes_storage\":{\"encoding\":\"bytes\",\"label\":\"bytes\",\"numberOfBytes\":\"32\"},\"t_int128\":{\"encoding\":\"inplace\",\"label\":\"int128\",\"numberOfBytes\":\"16\"},\"t_mapping(t_address,t_mapping(t_address,t_uint256))\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e mapping(address =\u003e uint256))\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_mapping(t_address,t_uint256)\"},\"t_mapping(t_address,t_struct(AddressSet)1029_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct EnumerableSetUpgradeable.AddressSet)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(AddressSet)1029_storage\"},\"t_mapping(t_address,t_struct(Bytes32Deque)1030_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct DoubleEndedQueueUpgradeable.Bytes32Deque)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Bytes32Deque)1030_storage\"},\"t_mapping(t_address,t_struct(Commission)1031_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct IL2Staking.Commission)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Commission)1031_storage\"},\"t_mapping(t_address,t_struct(Counter)1032_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct CountersUpgradeable.Counter)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(Counter)1032_storage\"},\"t_mapping(t_address,t_struct(DelegateeDelegation)1033_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct IL2Staking.DelegateeDelegation)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(DelegateeDelegation)1033_storage\"},\"t_mapping(t_address,t_struct(StakerInfo)1035_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e struct Types.StakerInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_struct(StakerInfo)1035_storage\"},\"t_mapping(t_address,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(address =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_address\",\"value\":\"t_uint256\"},\"t_mapping(t_bytes32,t_struct(UndelegateRequest)1036_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e struct IL2Staking.UndelegateRequest)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_struct(UndelegateRequest)1036_storage\"},\"t_mapping(t_bytes32,t_uint256)\":{\"encoding\":\"mapping\",\"label\":\"mapping(bytes32 =\u003e uint256)\",\"numberOfBytes\":\"32\",\"key\":\"t_bytes32\",\"value\":\"t_uint256\"},\"t_mapping(t_int128,t_bytes32)\":{\"encoding\":\"mapping\",\"label\":\"mapping(int128 =\u003e bytes32)\",\"numberOfBytes\":\"32\",\"key\":\"t_int128\",\"value\":\"t_bytes32\"},\"t_struct(AddressSet)1029_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.AddressSet\",\"numberOfBytes\":\"64\"},\"t_struct(Bytes32Deque)1030_storage\":{\"encoding\":\"inplace\",\"label\":\"struct DoubleEndedQueueUpgradeable.Bytes32Deque\",\"numberOfBytes\":\"64\"},\"t_struct(Commission)1031_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IL2Staking.Commission\",\"numberOfBytes\":\"64\"},\"t_struct(Counter)1032_storage\":{\"encoding\":\"inplace\",\"label\":\"struct CountersUpgradeable.Counter\",\"numberOfBytes\":\"32\"},\"t_struct(DelegateeDelegation)1033_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IL2Staking.DelegateeDelegation\",\"numberOfBytes\":\"64\"},\"t_struct(Set)1034_storage\":{\"encoding\":\"inplace\",\"label\":\"struct EnumerableSetUpgradeable.Set\",\"numberOfBytes\":\"64\"},\"t_struct(StakerInfo)1035_storage\":{\"encoding\":\"inplace\",\"label\":\"struct Types.StakerInfo\",\"numberOfBytes\":\"96\"},\"t_struct(UndelegateRequest)1036_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IL2Staking.UndelegateRequest\",\"numberOfBytes\":\"64\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" var L2StakingStorageLayout = new(solc.StorageLayout) -var L2StakingDeployedBin = "0x608060405234801561000f575f80fd5b50600436106102ec575f3560e01c8063746c8ae111610192578063affed0e0116100e8578063e10911b111610093578063f2fde38b1161006e578063f2fde38b146106f6578063fad99f9814610709578063fc6facc614610711575f80fd5b8063e10911b1146106c5578063ed70b343146106cd578063f0261bc2146106ed575f80fd5b8063cce6cf9f116100c3578063cce6cf9f1461066a578063d31d83d91461067d578063d55771411461069e575f80fd5b8063affed0e014610618578063b5d2e0dc14610621578063c64814dd14610640575f80fd5b80638da5cb5b1161014857806391bd43a41161012357806391bd43a4146105c5578063927ede2d146105e457806396ab994d1461060b575f80fd5b80638da5cb5b1461055e5780638e21d5fb1461057c5780639168ae72146105a3575f80fd5b80637b05afb5116101785780637b05afb5146104f5578063831cfb581461051457806384d7d1d41461053b575f80fd5b8063746c8ae1146104e557806376671808146104ed575f80fd5b80633b8024211161024757806343352d61116101fd57806346cdc18a116101d857806346cdc18a146104c25780637046529b146104ca578063715018a6146104dd575f80fd5b806343352d6114610494578063439162b51461049c578063459598a2146104af575f80fd5b80633cb747bf1161022d5780633cb747bf146104135780633d9353fe1461045a57806340b5c83714610481575f80fd5b80633b802421146103f75780633c323a1b14610400575f80fd5b8063174e31c4116102a75780632e787be3116102825780632e787be3146103bb57806330158eea146103c45780633385ccc2146103e4575f80fd5b8063174e31c41461038c57806319fac8fd1461039f5780632cc138be146103b2575f80fd5b80630eb573af116102d75780630eb573af1461032b5780630f3b70591461033e57806312a3e94714610383575f80fd5b806243b758146102f05780629c6f0c14610316575b5f80fd5b6103036102fe3660046152e8565b610724565b6040519081526020015b60405180910390f35b610329610324366004615303565b610757565b005b61032961033936600461534d565b6109a8565b61035161034c366004615364565b610ad5565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260208401929092529082015260600161030d565b610303609a5481565b61032961039a366004615364565b610b2a565b6103296103ad36600461534d565b610ce3565b61030360985481565b61030360995481565b6103d76103d23660046153d6565b610e39565b60405161030d9190615476565b6103296103f23660046152e8565b6110a1565b610303609c5481565b61032961040e366004615364565b61181a565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161030d565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b61032961048f36600461534d565b61202d565b6103d7612174565b6103296104aa366004615529565b6123d1565b6104356104bd36600461534d565b6129dd565b609d54610303565b6103296104d8366004615303565b612a12565b610329612bba565b610329612bcd565b610303612f80565b6103036105033660046152e8565b60a06020525f908152604090205481565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b61054e6105493660046152e8565b61300e565b604051901515815260200161030d565b60335473ffffffffffffffffffffffffffffffffffffffff16610435565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b6105b66105b13660046152e8565b613045565b60405161030d93929190615597565b6103036105d33660046152e8565b60a16020525f908152604090205481565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b60975461054e9060ff1681565b61030360a55481565b61030361062f3660046152e8565b609e6020525f908152604090205481565b61030361064e3660046155d4565b60a360209081525f928352604080842090915290825290205481565b610329610678366004615600565b613104565b61069061068b366004615648565b6137d0565b60405161030d9291906156ca565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b6103296139ac565b6106e06106db3660046152e8565b613df4565b60405161030d91906156ea565b610303609b5481565b6103296107043660046152e8565b613ea4565b610329613f58565b61032961071f366004615600565b614020565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a260205260408120610751906144fd565b92915050565b61075f614506565b8160a55481146107d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064015b60405180910390fd5b6107db836001615785565b60a555609e5f6107ee60208501856152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20545f036108cf57609d61083d60208401846152e8565b81546001810183555f928352602080842090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9390931692909217909155609d5491609e916108a8908601866152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f20555b81609f5f6108e060208401846152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2061090f82826158b5565b5061091f905060208301836152e8565b73ffffffffffffffffffffffffffffffffffffffff167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d60208401356109686040860186615798565b60405161097793929190615a72565b60405180910390a260975460ff161580156109965750609954609d5411155b156109a3576109a3614587565b505050565b6109b0614506565b5f811180156109c157506099548114155b610a4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f696e76616c6964206e65772073657175656e63657220736574206d617820736960448201527f7a6500000000000000000000000000000000000000000000000000000000000060648201526084016107c7565b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff16610aa257609d54610aa6565b609c545b90505f6099548210610aba57609954610abc565b815b9050609b548114610acf57610acf614587565b50505050565b60a4602052815f5260405f208181548110610aee575f80fd5b5f91825260209091206003909102018054600182015460029092015473ffffffffffffffffffffffffffffffffffffffff909116935090915083565b610b3261472e565b73ffffffffffffffffffffffffffffffffffffffff8216610c0f5773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016635cf20c7b336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044015f604051808303815f87803b158015610bf4575f80fd5b505af1158015610c06573d5f803e3d5ffd5b50505050610cd5565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663996cba6883336040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff928316600482015291166024820152604481018490526064015f604051808303815f87803b158015610cbe575f80fd5b505af1158015610cd0573d5f803e3d5ffd5b505050505b610cdf6001606555565b5050565b335f908152609e6020526040902054610d58576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6f6e6c79207374616b657220616c6c6f7765640000000000000000000000000060448201526064016107c7565b6014811115610dc3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c696420636f6d6d697373696f6e000000000000000000000000000060448201526064016107c7565b335f90815260a06020526040812082905560975460ff16610de4575f610df7565b610dec612f80565b610df7906001615785565b604080518481526020810183905291925033917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a25050565b60605f8267ffffffffffffffff811115610e5557610e556157f9565b604051908082528060200260200182016040528015610ea157816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081610e735790505b5090505f5b83811015611099576040518060600160405280609f5f888886818110610ece57610ece615ac5565b9050602002016020810190610ee391906152e8565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409091015f908120549091168352910190609f90888886818110610f2d57610f2d615ac5565b9050602002016020810190610f4291906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20600101548152602001609f5f888886818110610f9957610f99615ac5565b9050602002016020810190610fae91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206002018054610ff590615826565b80601f016020809104026020016040519081016040528092919081815260200182805461102190615826565b801561106c5780601f106110435761010080835404028352916020019161106c565b820191905f5260205f20905b81548152906001019060200180831161104f57829003601f168201915b505050505081525082828151811061108657611086615ac5565b6020908102919091010152600101610ea6565b509392505050565b6110a961472e565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a36020908152604080832033845290915290205461113f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f7374616b696e6720616d6f756e74206973207a65726f0000000000000000000060448201526064016107c7565b73ffffffffffffffffffffffffffffffffffffffff81165f908152609e60205260408120546097549015919060ff16611178575f61118b565b611180612f80565b61118b906001615785565b6097549091505f9060ff1680156111a0575082155b6111aa57816111b7565b609a546111b79083615785565b6040805160608101825273ffffffffffffffffffffffffffffffffffffffff8781168083525f81815260a36020908152858220338084528183528784208054848901908152888a018b815283875260a486528a87208054600180820183559189528789208c5160039092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909b16178a558251908a015551600290980197909755908452908252829055925191815260a190925292812080549495509193611286908490615af2565b909155505073ffffffffffffffffffffffffffffffffffffffff85165f90815260a2602052604090206112b990336147a8565b5073ffffffffffffffffffffffffffffffffffffffff85165f908152609e6020526040902054841580156112ef575060975460ff165b80156112fc5750609c5481105b156115e85773ffffffffffffffffffffffffffffffffffffffff86165f908152609e602052604081205461133290600190615af2565b90505b6001609c546113449190615af2565b8110156115e65760a15f609d838154811061136157611361615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040018120549060a190609d6113a3856001615785565b815481106113b3576113b3615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205411156115de575f609d82815481106113fe576113fe615ac5565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff169050609d61142e836001615785565b8154811061143e5761143e615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff909216918490811061147657611476615ac5565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905580609d6114d1846001615785565b815481106114e1576114e1615ac5565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055611539826001615785565b609e5f609d858154811061154f5761154f615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205561158b826002615785565b609e5f609d61159b866001615785565b815481106115ab576115ab615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b600101611335565b505b84158015611618575073ffffffffffffffffffffffffffffffffffffffff86165f90815260a16020526040902054155b15611635576001609c5f82825461162f9190615af2565b90915550505b73ffffffffffffffffffffffffffffffffffffffff8681165f81815260a160205260408082205481517f7f683ee30000000000000000000000000000000000000000000000000000000081526004810194909452336024850152604484018990526064840152517f000000000000000000000000000000000000000000000000000000000000000090931692637f683ee392608480820193929182900301818387803b1580156116e3575f80fd5b505af11580156116f5573d5f803e3d5ffd5b505050506117003390565b73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c84602001518787604051611775939291909283526020830191909152604082015260600190565b60405180910390a38415801561178d575060975460ff165b801561179b5750609b548111155b80156117fb5750609b5473ffffffffffffffffffffffffffffffffffffffff87165f908152609e602052604090205411806117fb5750609c5473ffffffffffffffffffffffffffffffffffffffff87165f908152609e6020526040902054115b1561180857611808614587565b50505050506118176001606555565b50565b73ffffffffffffffffffffffffffffffffffffffff82165f908152609e602052604090205482906118a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6e6f74207374616b65720000000000000000000000000000000000000000000060448201526064016107c7565b6118af61472e565b5f8211611918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c6964207374616b6520616d6f756e7400000000000000000000000060448201526064016107c7565b61192233846147d0565b15611989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f756e64656c65676174696f6e20756e636c61696d65640000000000000000000060448201526064016107c7565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260a360209081526040808320338452909152902054611a2e576119c73384614880565b15611a2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f72657761726420756e636c61696d65640000000000000000000000000000000060448201526064016107c7565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260a1602052604081208054849290611a62908490615785565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f90815260a36020908152604080832033845290915281208054849290611aa6908490615785565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f90815260a260205260409020611ad99033614942565b5073ffffffffffffffffffffffffffffffffffffffff83165f90815260a16020526040902054829003611b1e576001609c5f828254611b189190615785565b90915550505b73ffffffffffffffffffffffffffffffffffffffff83165f908152609e602052604090205460975460ff168015611b555750600181115b15611e35575f611b66600183615af2565b90505b8015611e335760a15f609d611b7f600185615af2565b81548110611b8f57611b8f615ac5565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205460a15f609d8481548110611c0757611c07615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020541115611e21575f609d611c4c600184615af2565b81548110611c5c57611c5c615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff90921692509083908110611c9657611c96615ac5565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16609d611cc4600185615af2565b81548110611cd457611cd4615ac5565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080609d8381548110611d2d57611d2d615ac5565b5f918252602082200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff93909316929092179091558290609e90609d611d8c600185615af2565b81548110611d9c57611d9c615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055611dd8826001615785565b609e5f609d8581548110611dee57611dee615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b80611e2b81615b05565b915050611b69565b505b6097545f9060ff16611e47575f611e5a565b611e4f612f80565b611e5a906001615785565b73ffffffffffffffffffffffffffffffffffffffff86165f81815260a36020908152604080832033808552908352928190205481519081529182018990528181018590525193945090927fc4ad67bad2c1f682946a406d840f1b273f5cd5a53fcc1a03d078d92bfa2e07d09181900360600190a373ffffffffffffffffffffffffffffffffffffffff8581165f81815260a360209081526040808320338085528184528285205486865260a18552838620548287529290945282517fb809af0f000000000000000000000000000000000000000000000000000000008152600481019690965260248601526044850187905260648501839052608485015290881460a4840152517f00000000000000000000000000000000000000000000000000000000000000009093169263b809af0f9260c480820193929182900301818387803b158015611fa8575f80fd5b505af1158015611fba573d5f803e3d5ffd5b50505050611fcf611fc83390565b3086614963565b60975460ff168015611fe25750609b5482115b8015612014575060995473ffffffffffffffffffffffffffffffffffffffff86165f908152609e602052604090205411155b1561202157612021614587565b50506109a36001606555565b612035614506565b60975460ff16156120a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f72657761726420616c726561647920737461727465640000000000000000000060448201526064016107c7565b42811180156120bb57506120b96201518082615b66565b155b80156120c957506098548114155b61212f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d650000000000000060448201526064016107c7565b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609d546060905f9067ffffffffffffffff811115612194576121946157f9565b6040519080825280602002602001820160405280156121e057816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816121b25790505b5090505f5b609d548110156123cb576040518060600160405280609f5f609d858154811061221057612210615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff90811684528382019490945260409092018120549092168352609d80549390910192609f9291908690811061226957612269615ac5565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20600101548152602001609f5f609d85815481106122e9576122e9615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020600201805461232790615826565b80601f016020809104026020016040519081016040528092919081815260200182805461235390615826565b801561239e5780601f106123755761010080835404028352916020019161239e565b820191905f5260205f20905b81548152906001019060200180831161238157829003601f168201915b50505050508152508282815181106123b8576123b8615ac5565b60209081029190910101526001016121e5565b50919050565b5f54610100900460ff16158080156123ef57505f54600160ff909116105b806124085750303b15801561240857505f5460ff166001145b612494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107c7565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156124f0575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff871661256d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016107c7565b5f86116125fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f73657175656e6365727353697a65206d7573742067726561746572207468616e60448201527f203000000000000000000000000000000000000000000000000000000000000060648201526084016107c7565b5f8511612665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f696e76616c696420756e64656c65676174654c6f636b45706f6368730000000060448201526064016107c7565b428411801561267e575061267c6201518085615b66565b155b6126e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f696e76616c6964207265776172642073746172742074696d650000000000000060448201526064016107c7565b8161274b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f696e76616c696420696e697469616c207374616b65727300000000000000000060448201526064016107c7565b61275487614c6f565b61275c614ce5565b6099869055609a8590556098849055609b8290555f5b609b548110156128ff5783838281811061278e5761278e615ac5565b90506020028101906127a09190615b79565b609f5f8686858181106127b5576127b5615ac5565b90506020028101906127c79190615b79565b6127d59060208101906152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2061280482826158b5565b905050609d84848381811061281b5761281b615ac5565b905060200281019061282d9190615b79565b61283b9060208101906152e8565b8154600180820184555f93845260209093200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905561289c908290615785565b609e5f8686858181106128b1576128b1615ac5565b90506020028101906128c39190615b79565b6128d19060208101906152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2055600101612772565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a180156129d4575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609d81815481106129ec575f80fd5b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148015612b2e57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015612af2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b169190615bb5565b73ffffffffffffffffffffffffffffffffffffffff16145b61075f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f776564000000000000000000000000000000000000000060648201526084016107c7565b612bc2614506565b612bcb5f614c6f565b565b612bd5614506565b609854421015612c66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f63616e2774207374617274206265666f7265207265776172642073746172742060448201527f74696d650000000000000000000000000000000000000000000000000000000060648201526084016107c7565b5f609c5411612cd1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f6e6f6e652063616e64696461746500000000000000000000000000000000000060448201526064016107c7565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609d54811015612f10575f5b81811015612f075760a15f609d8381548110612d2a57612d2a615ac5565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205460a15f609d8581548110612da257612da2615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020541115612eff575f609d8281548110612ded57612ded615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff90921692509084908110612e2757612e27615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff9092169184908110612e5f57612e5f615ac5565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080609d8481548110612eb857612eb8615ac5565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b600101612d0c565b50600101612d00565b505f5b609d54811015612f7757612f28816001615785565b609e5f609d8481548110612f3e57612f3e615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055600101612f13565b50612bcb614587565b5f609854421015612fed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f726577617264206973206e6f742073746172746564207965740000000000000060448201526064016107c7565b6201518060985442612fff9190615af2565b6130099190615bd0565b905090565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a3602090815260408083203384529091528120541515610751565b609f6020525f908152604090208054600182015460028301805473ffffffffffffffffffffffffffffffffffffffff90931693919261308390615826565b80601f01602080910402602001604051908101604052809291908181526020018280546130af90615826565b80156130fa5780601f106130d1576101008083540402835291602001916130fa565b820191905f5260205f20905b8154815290600101906020018083116130dd57829003601f168201915b5050505050905083565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561322057507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131e4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132089190615bb5565b73ffffffffffffffffffffffffffffffffffffffff16145b6132ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f776564000000000000000000000000000000000000000060648201526084016107c7565b8260a5548114613318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016107c7565b613323846001615785565b60a5555f805b8381101561378157609b54609e5f87878581811061334957613349615ac5565b905060200201602081019061335e91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054116133a257600191505b5f609e5f8787858181106133b8576133b8615ac5565b90506020020160208101906133cd91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205411156136eb575f6001609e5f88888681811061342557613425615ac5565b905060200201602081019061343a91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461347e9190615af2565b90505b609d5461349090600190615af2565b81101561359657609d6134a4826001615785565b815481106134b4576134b4615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff90921691839081106134ec576134ec615ac5565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001609e5f609d848154811061354957613549615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400181208054909190613589908490615af2565b9091555050600101613481565b50609d8054806135a8576135a8615be3565b5f8281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055909101909155609e9086868481811061361757613617615ac5565b905060200201602081019061362c91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f90555f60a15f87878581811061367e5761367e615ac5565b905060200201602081019061369391906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205411156136eb576001609c5f8282546136e59190615af2565b90915550505b609f5f86868481811061370057613700615ac5565b905060200201602081019061371591906152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f90812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001810182905590613777600283018261527d565b5050600101613329565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f6184846040516137b3929190615c10565b60405180910390a180156137c9576137c9614587565b5050505050565b5f60605f841161383c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c696420706167652073697a6500000000000000000000000000000060448201526064016107c7565b73ffffffffffffffffffffffffffffffffffffffff85165f90815260a260205260409020613869906144fd565b91508367ffffffffffffffff811115613884576138846157f9565b6040519080825280602002602001820160405280156138ad578160200160208202803683370190505b5090505f6138bb8486615c6a565b90505f60016138ca8682615785565b6138d49088615c6a565b6138de9190615af2565b90506138eb600185615af2565b811115613900576138fd600185615af2565b90505b815f5b8282116139a0576139448261391781615c81565b73ffffffffffffffffffffffffffffffffffffffff8c165f90815260a26020526040902090945090614d83565b858261394f81615c81565b93508151811061396157613961615ac5565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050613903565b50505050935093915050565b6139b461472e565b335f90815260a46020526040812054815b81811015613d745760975460ff161580613a1557506139e2612f80565b335f90815260a460205260409020805483908110613a0257613a02615ac5565b905f5260205f2090600302016002015411155b15613d6257335f90815260a460205260409020805482908110613a3a57613a3a615ac5565b905f5260205f2090600302016001015483613a559190615785565b335f90815260a4602052604081208054929550909183908110613a7a57613a7a615ac5565b5f918252602082206003909102015473ffffffffffffffffffffffffffffffffffffffff16915060a481613aab3390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208381548110613af557613af5615ac5565b905f5260205f2090600302016002015490505f60a45f613b123390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208481548110613b5c57613b5c615ac5565b905f5260205f209060030201600101549050600185613b7b9190615af2565b841015613c7257335f90815260a460205260409020613b9b600187615af2565b81548110613bab57613bab615ac5565b905f5260205f20906003020160a45f613bc13390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208581548110613c0b57613c0b615ac5565b5f9182526020909120825460039092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091178155600180830154908201556002918201549101555b335f90815260a460205260409020805480613c8f57613c8f615be3565b5f8281526020812060037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9093019283020180547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018181018390556002909101919091559155613d049086615af2565b6040805184815260208101849052919650339173ffffffffffffffffffffffffffffffffffffffff8616917f921046659ea3b3b3f8e8fefd2bece3121b2d929ead94c696a75beedee477fdb6910160405180910390a35050506139c5565b613d6d816001615785565b90506139c5565b505f8211613dde576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6e6f204d6f72706820746f6b656e20746f20636c61696d00000000000000000060448201526064016107c7565b613de83383614d8e565b5050612bcb6001606555565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a460209081526040808320805482518185028101850190935280835260609492939192909184015b82821015613e99575f8481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff16835260018082015484860152600290910154918301919091529083529092019101613e38565b505050509050919050565b613eac614506565b73ffffffffffffffffffffffffffffffffffffffff8116613f4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107c7565b61181781614c6f565b613f6061472e565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663ac2ac640336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024015f604051808303815f87803b158015614000575f80fd5b505af1158015614012573d5f803e3d5ffd5b50505050612bcb6001606555565b614028614506565b8260a5548114614094576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c6964206e6f6e63650000000000000000000000000000000000000060448201526064016107c7565b61409f846001615785565b60a5555f805b8381101561378157609b54609e5f8787858181106140c5576140c5615ac5565b90506020020160208101906140da91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541161411e57600191505b5f609e5f87878581811061413457614134615ac5565b905060200201602081019061414991906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541115614467575f6001609e5f8888868181106141a1576141a1615ac5565b90506020020160208101906141b691906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546141fa9190615af2565b90505b609d5461420c90600190615af2565b81101561431257609d614220826001615785565b8154811061423057614230615ac5565b5f91825260209091200154609d805473ffffffffffffffffffffffffffffffffffffffff909216918390811061426857614268615ac5565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001609e5f609d84815481106142c5576142c5615ac5565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400181208054909190614305908490615af2565b90915550506001016141fd565b50609d80548061432457614324615be3565b5f8281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055909101909155609e9086868481811061439357614393615ac5565b90506020020160208101906143a891906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f90555f60a15f8787858181106143fa576143fa615ac5565b905060200201602081019061440f91906152e8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541115614467576001609c5f8282546144619190615af2565b90915550505b609f5f86868481811061447c5761447c615ac5565b905060200201602081019061449191906152e8565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f90812080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101829055906144f3600283018261527d565b50506001016140a5565b5f610751825490565b60335473ffffffffffffffffffffffffffffffffffffffff163314612bcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107c7565b60995460975460ff16156145ab57609954609c5410156145a65750609c545b6145bc565b609954609d5410156145bc5750609d545b5f8167ffffffffffffffff8111156145d6576145d66157f9565b6040519080825280602002602001820160405280156145ff578160200160208202803683370190505b5090505f5b8281101561468657609d818154811061461f5761461f615ac5565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682828151811061465957614659615ac5565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101614604565b506040517f9b8201a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b8201a4906146f9908490600401615cb8565b5f604051808303815f87803b158015614710575f80fd5b505af1158015614722573d5f803e3d5ffd5b50509151609b55505050565b60026065540361479a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107c7565b6002606555565b6001606555565b5f6147c98373ffffffffffffffffffffffffffffffffffffffff8416615092565b9392505050565b5f805b73ffffffffffffffffffffffffffffffffffffffff84165f90815260a460205260409020548110156148775773ffffffffffffffffffffffffffffffffffffffff8481165f90815260a4602052604090208054918516918390811061483a5761483a615ac5565b5f91825260209091206003909102015473ffffffffffffffffffffffffffffffffffffffff160361486f576001915050610751565b6001016147d3565b505f9392505050565b6040517fde6ac93300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282811660248301525f917f00000000000000000000000000000000000000000000000000000000000000009091169063de6ac93390604401602060405180830381865afa158015614916573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061493a9190615cca565b159392505050565b5f6147c98373ffffffffffffffffffffffffffffffffffffffff8416615175565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa1580156149f1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614a159190615ce9565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015614ab4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614ad89190615cca565b614b3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f7472616e7366657246726f6d206661696c65640000000000000000000000000060448201526064016107c7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614bcc573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614bf09190615ce9565b90505f83118015614c09575082614c078383615af2565b145b6137c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c6564000000000060448201526064016107c7565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff16614d7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107c7565b612bcb6151c1565b5f6147c98383615257565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614e1c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614e409190615ce9565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af1158015614ed7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614efb9190615cca565b614f61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f7472616e73666572206661696c6564000000000000000000000000000000000060448201526064016107c7565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015614fef573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906150139190615ce9565b90505f8311801561502c57508261502a8383615af2565b145b610acf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d6f72706820746f6b656e207472616e73666572206661696c6564000000000060448201526064016107c7565b5f818152600183016020526040812054801561516c575f6150b4600183615af2565b85549091505f906150c790600190615af2565b9050818114615126575f865f0182815481106150e5576150e5615ac5565b905f5260205f200154905080875f01848154811061510557615105615ac5565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061513757615137615be3565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610751565b5f915050610751565b5f8181526001830160205260408120546151ba57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610751565b505f610751565b5f54610100900460ff166147a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107c7565b5f825f01828154811061526c5761526c615ac5565b905f5260205f200154905092915050565b50805461528990615826565b5f825580601f10615298575050565b601f0160209004905f5260205f209081019061181791905b808211156152c3575f81556001016152b0565b5090565b73ffffffffffffffffffffffffffffffffffffffff81168114611817575f80fd5b5f602082840312156152f8575f80fd5b81356147c9816152c7565b5f8060408385031215615314575f80fd5b82359150602083013567ffffffffffffffff811115615331575f80fd5b830160608186031215615342575f80fd5b809150509250929050565b5f6020828403121561535d575f80fd5b5035919050565b5f8060408385031215615375575f80fd5b8235615380816152c7565b946020939093013593505050565b5f8083601f84011261539e575f80fd5b50813567ffffffffffffffff8111156153b5575f80fd5b6020830191508360208260051b85010111156153cf575f80fd5b9250929050565b5f80602083850312156153e7575f80fd5b823567ffffffffffffffff8111156153fd575f80fd5b6154098582860161538e565b90969095509350505050565b5f81518084525f5b818110156154395760208185018101518683018201520161541d565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b8381101561551b578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff1684528781015188850152860151606087850181905261550781860183615415565b96890196945050509086019060010161549d565b509098975050505050505050565b5f805f805f8060a0878903121561553e575f80fd5b8635615549816152c7565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115615579575f80fd5b61558589828a0161538e565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201525f6155cb6060830184615415565b95945050505050565b5f80604083850312156155e5575f80fd5b82356155f0816152c7565b91506020830135615342816152c7565b5f805f60408486031215615612575f80fd5b83359250602084013567ffffffffffffffff81111561562f575f80fd5b61563b8682870161538e565b9497909650939450505050565b5f805f6060848603121561565a575f80fd5b8335615665816152c7565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b838110156156bf57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161568d565b509495945050505050565b828152604060208201525f6156e2604083018461567a565b949350505050565b602080825282518282018190525f919060409081850190868401855b8281101561574b578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528501518585015260609093019290850190600101615706565b5091979650505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561075157610751615758565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126157cb575f80fd5b83018035915067ffffffffffffffff8211156157e5575f80fd5b6020019150368190038213156153cf575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c9082168061583a57607f821691505b6020821081036123cb577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f8211156109a357805f5260205f20601f840160051c810160208510156158965750805b601f840160051c820191505b818110156137c9575f81556001016158a2565b81356158c0816152c7565b73ffffffffffffffffffffffffffffffffffffffff81167fffffffffffffffffffffffff000000000000000000000000000000000000000083541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112615944575f80fd5b8501803567ffffffffffffffff81111561595c575f80fd5b803603848301131561596c575f80fd5b6159808161597a8554615826565b85615871565b5f601f8211600181146159d2575f831561599c57508382018601355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600385901b1c1916600184901b178555615a67565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b82811015615a1e578685018901358255938801939089019088016159ff565b5084821015615a5b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8181038181111561075157610751615758565b5f81615b1357615b13615758565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f82615b7457615b74615b39565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112615bab575f80fd5b9190910192915050565b5f60208284031215615bc5575f80fd5b81516147c9816152c7565b5f82615bde57615bde615b39565b500490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015615c5f578235615c37816152c7565b73ffffffffffffffffffffffffffffffffffffffff1682529183019190830190600101615c24565b509695505050505050565b808202811582820484141761075157610751615758565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615cb157615cb1615758565b5060010190565b602081525f6147c9602083018461567a565b5f60208284031215615cda575f80fd5b815180151581146147c9575f80fd5b5f60208284031215615cf9575f80fd5b505191905056fea164736f6c6343000818000a" +var L2StakingDeployedBin = "0x608060405234801561000f575f80fd5b506004361061034f575f3560e01c806376671808116101be578063affed0e0116100fe578063eefecafd1161009e578063fad99f9811610079578063fad99f981461081a578063fc6facc614610822578063fe34888414610835578063ff4840cd14610854575f80fd5b8063eefecafd146107f5578063f0261bc2146107fe578063f2fde38b14610807575f80fd5b8063bf2dca0a116100d9578063bf2dca0a14610762578063cce6cf9f1461079a578063d31d83d9146107ad578063d5577141146107ce575f80fd5b8063affed0e01461070c578063b5d2e0dc14610715578063b7a587bf14610734575f80fd5b80638e21d5fb11610169578063927ede2d11610144578063927ede2d146106b257806396ab994d146106d95780639d51c3b9146106e6578063a61bb764146106f9575f80fd5b80638e21d5fb146106565780639168ae721461067d57806391c05b0b1461069f575f80fd5b8063831cfb5811610199578063831cfb58146105ee57806384d7d1d4146106155780638da5cb5b14610638575f80fd5b806376671808146105ad5780637b05afb5146105b55780637c7e8bd2146105db575f80fd5b80633434735f11610294578063459598a2116102345780636bd8f8041161020f5780636bd8f804146105775780637046529b1461058a578063715018a61461059d578063746c8ae1146105a5575f80fd5b8063459598a21461054957806346cdc18a1461055c5780634d99dd1614610564575f80fd5b80633cb747bf1161026f5780633cb747bf146104f557806340b5c8371461051b57806343352d611461052e578063439162b514610536575f80fd5b80633434735f146104765780633b2713c5146104c25780633b802421146104ec575f80fd5b806313f22527116102ff578063201018fb116102da578063201018fb146104315780632cc138be146104445780632e787be31461044d57806330158eea14610456575f80fd5b806313f22527146103d057806319fac8fd146103e35780631d5611b8146103f6575f80fd5b80630321731c1161032f5780630321731c146103a15780630eb573af146103b457806312a3e947146103c7575f80fd5b806243b758146103535780629c6f0c14610379578063026e402b1461038e575b5f80fd5b6103666103613660046160d3565b610867565b6040519081526020015b60405180910390f35b61038c6103873660046160ee565b61089a565b005b61038c61039c366004616138565b610ab6565b6103666103af3660046160d3565b611183565b61038c6103c2366004616162565b6111ca565b610366609a5481565b6103666103de3660046160d3565b61129f565b61038c6103f1366004616162565b611381565b61041c6104043660046160d3565b60a36020525f90815260409020805460019091015482565b60408051928352602083019190915201610370565b61036661043f366004616162565b61147a565b61036660985481565b61036660995481565b6104696104643660046161c1565b61167e565b6040516103709190616261565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610370565b6103666104d0366004616314565b60a460209081525f928352604080842090915290825290205481565b610366609c5481565b7f000000000000000000000000000000000000000000000000000000000000000061049d565b61038c610529366004616162565b6118e6565b6104696119cd565b61038c610544366004616340565b611c2a565b61049d610557366004616162565b61212a565b609e54610366565b61038c610572366004616138565b61215f565b61038c6105853660046163ae565b6129d9565b61038c6105983660046160ee565b613721565b61038c6138c9565b61038c6138dc565b610366613bdf565b61041c6105c33660046160d3565b60a16020525f90815260409020805460019091015482565b6103666105e93660046160d3565b613c3d565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6106286106233660046160d3565b613c67565b6040519015158152602001610370565b60335473ffffffffffffffffffffffffffffffffffffffff1661049d565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61069061068b3660046160d3565b613c9e565b604051610370939291906163ec565b61038c6106ad366004616162565b613d5d565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b6097546106289060ff1681565b6103666106f4366004616314565b614058565b610366610707366004616138565b61406a565b610366609d5481565b6103666107233660046160d3565b609f6020525f908152604090205481565b610747610742366004616138565b6141d6565b60408051825181526020928301519281019290925201610370565b6103666107703660046160d3565b73ffffffffffffffffffffffffffffffffffffffff165f90815260a1602052604090206001015490565b61038c6107a8366004616429565b614244565b6107c06107bb366004616471565b6148c5565b6040516103709291906164f3565b61049d7f000000000000000000000000000000000000000000000000000000000000000081565b61036660aa5481565b610366609b5481565b61038c6108153660046160d3565b614a71565b61038c614b28565b61038c610830366004616429565b614bda565b6103666108433660046160d3565b60ab6020525f908152604090205481565b61038c6108623660046160d3565b615073565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a26020526040812061089490615142565b92915050565b6108a261514b565b81609d5481146108de576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108e9836001616540565b609d55609f5f6108fc60208501856160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20545f036109dd57609e61094b60208401846160d3565b81546001810183555f928352602080842090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9390931692909217909155609e5491609f916109b6908601866160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f20555b8160a05f6109ee60208401846160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f20610a1d8282616670565b50610a2d905060208301836160d3565b73ffffffffffffffffffffffffffffffffffffffff167f058ecb29c230cd5df283c89e996187ed521393fe4546cd1b097921c4b2de293d6020840135610a766040860186616553565b604051610a859392919061682d565b60405180910390a260975460ff16158015610aa45750609954609e5411155b15610ab157610ab16151cc565b505050565b73ffffffffffffffffffffffffffffffffffffffff82165f908152609f6020526040812054839103610b14576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1c615373565b815f03610b55576040517f608294ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b833373ffffffffffffffffffffffffffffffffffffffff85165f90815260a260205260409020906153e6565b5060975460ff16610c3c5773ffffffffffffffffffffffffffffffffffffffff83165f90815260a46020908152604080832033845290915281208054849290610bcd908490616540565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f90815260a3602052604081208054849290610c06908490616540565b909155505073ffffffffffffffffffffffffffffffffffffffff83165f90815260a3602052604090208054600190910155610d8c565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260a3602090815260408083206001810154905460a48452828520338652909352908320549092829003610ccd5773ffffffffffffffffffffffffffffffffffffffff86165f81815260a460209081526040808320338452825280832089905592825260a390522060018101869055859055610d88565b81610cd88487616880565b610ce291906168c4565b610cec9082616540565b73ffffffffffffffffffffffffffffffffffffffff87165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054879290610d3a908490616540565b90915550829050610d4b8487616880565b610d5591906168c4565b610d5f9084616540565b73ffffffffffffffffffffffffffffffffffffffff87165f90815260a360205260409020600101555b5050505b73ffffffffffffffffffffffffffffffffffffffff83165f90815260a36020526040902054829003610dd0576001609c5f828254610dca9190616540565b90915550505b73ffffffffffffffffffffffffffffffffffffffff83165f908152609f602052604090205460975460ff168015610e075750600181115b156110bc575f610e186001836168d7565b90505b80156110ba5760a35f609e610e316001856168d7565b81548110610e4157610e416168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812054609e8054919260a39290919085908110610e8e57610e8e6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205411156110a8575f609e610ed36001846168d7565b81548110610ee357610ee36168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff90921692509083908110610f1d57610f1d6168ea565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16609e610f4b6001856168d7565b81548110610f5b57610f5b6168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080609e8381548110610fb457610fb46168ea565b5f918252602082200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff93909316929092179091558290609f90609e6110136001856168d7565b81548110611023576110236168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205561105f826001616540565b609f5f609e8581548110611075576110756168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b806110b281616917565b915050610e1b565b505b73ffffffffffffffffffffffffffffffffffffffff84165f81815260a360209081526040918290205482518781529182015281513393927f24d7bda8602b916d64417f0dbfe2e2e88ec9b1157bd9f596dfdb91ba26624e04928290030190a3611126333085615407565b60975460ff1680156111395750609b5481115b801561116b575060995473ffffffffffffffffffffffffffffffffffffffff85165f908152609f602052604090205411155b15611178576111786151cc565b50610ab16001606555565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b03610894565b6111d261514b565b8015806111e0575060995481145b15611217576040517f383a648e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609980549082905560408051828152602081018490527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a16097545f9060ff1661126c57609e54611270565b609c545b90505f609954821061128457609954611286565b815b9050609b548114611299576112996151cc565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a66020526040812054609754600f82810b700100000000000000000000000000000000909304900b919091039060ff166112f55792915050565b5f5b8181101561137a5773ffffffffffffffffffffffffffffffffffffffff84165f90815260a66020526040812061132d90836156ba565b5f81815260a560209081526040918290208251808401909352805483526001015490820181905291925090611360613bdf565b1015611370575090949350505050565b50506001016112f7565b5092915050565b335f818152609f602052604081205490036113c8576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6014821115611403576040517f6e11528c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a1602081815260408084208054825180840184528981526001830180548287019081529789905295855251909155935190925581518681529081018390529192917f6e500db30ce535d38852e318f333e9be41a3fec6c65d234ebb06203c896db9a5910160405180910390a2505050565b5f611483615373565b6114e560a65f335b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054600f81810b700100000000000000000000000000000000909204900b0390565b5f0361151d576040517f5f013ef800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b811580611534575061153160a65f3361148b565b82115b61153e578161154a565b61154a60a65f3361148b565b91505f5b82156115f457335f90815260a66020526040812061156b9061574f565b5f81815260a5602090815260409182902082518084019093528054835260010154908201526097549192509060ff1680156115b0575080602001516115ae613bdf565b105b156115bc5750506115f4565b335f90815260a6602052604090206115d3906157c7565b5080516115e09084616540565b92506115eb85616917565b9450505061154e565b805f0361162d576040517f3cc5dedc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611638335b82615882565b60405181815233907fcc3089abc79631b3c0c81414a72e237c08559073a970cf474e36ae965e382fb39060200160405180910390a290506116796001606555565b919050565b60605f8267ffffffffffffffff81111561169a5761169a6165b4565b6040519080825280602002602001820160405280156116e657816020015b60408051606080820183525f8083526020830152918101919091528152602001906001900390816116b85790505b5090505f5b838110156118de57604051806060016040528060a05f888886818110611713576117136168ea565b905060200201602081019061172891906160d3565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409091015f90812054909116835291019060a090888886818110611772576117726168ea565b905060200201602081019061178791906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2060010154815260200160a05f8888868181106117de576117de6168ea565b90506020020160208101906117f391906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20600201805461183a906165e1565b80601f0160208091040260200160405190810160405280929190818152602001828054611866906165e1565b80156118b15780601f10611888576101008083540402835291602001916118b1565b820191905f5260205f20905b81548152906001019060200180831161189457829003601f168201915b50505050508152508282815181106118cb576118cb6168ea565b60209081029190910101526001016116eb565b509392505050565b6118ee61514b565b60975460ff161561192b576040517fbd51da0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b42811115806119455750611942620151808261694b565b15155b80611951575060985481145b15611988576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609880549082905560408051828152602081018490527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a15050565b609e546060905f9067ffffffffffffffff8111156119ed576119ed6165b4565b604051908082528060200260200182016040528015611a3957816020015b60408051606080820183525f808352602083015291810191909152815260200190600190039081611a0b5790505b5090505f5b609e54811015611c2457604051806060016040528060a05f609e8581548110611a6957611a696168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff90811684528382019490945260409092018120549092168352609e8054939091019260a092919086908110611ac257611ac26168ea565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2060010154815260200160a05f609e8581548110611b4257611b426168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190206002018054611b80906165e1565b80601f0160208091040260200160405190810160405280929190818152602001828054611bac906165e1565b8015611bf75780601f10611bce57610100808354040283529160200191611bf7565b820191905f5260205f20905b815481529060010190602001808311611bda57829003601f168201915b5050505050815250828281518110611c1157611c116168ea565b6020908102919091010152600101611a3e565b50919050565b5f54610100900460ff1615808015611c4857505f54600160ff909116105b80611c615750303b158015611c6157505f5460ff166001145b611cf2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611d4e575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8716611d9b576040517fee77070400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b855f03611dd4576040517f2da55d0200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845f03611e0d576040517f7d8ad8a800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4284111580611e275750611e24620151808561694b565b15155b15611e5e576040517fde16b26100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f829003611e98576040517fbb01aad100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ea187615b26565b611ea9615b9c565b6099869055609a8590556098849055609b8290555f5b609b5481101561204c57838382818110611edb57611edb6168ea565b9050602002810190611eed919061695e565b60a05f868685818110611f0257611f026168ea565b9050602002810190611f14919061695e565b611f229060208101906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f20611f518282616670565b905050609e848483818110611f6857611f686168ea565b9050602002810190611f7a919061695e565b611f889060208101906160d3565b8154600180820184555f93845260209093200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055611fe9908290616540565b609f5f868685818110611ffe57611ffe6168ea565b9050602002810190612010919061695e565b61201e9060208101906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2055600101611ebf565b50604080515f8152602081018890527f98b982a120d9be7d9c68d85a1aed8158d1d52e517175bfb3eb4280692f19b1ed910160405180910390a1604080515f8152602081018690527f91c38708087fb4ba51bd0e6a106cc1fbaf340479a2e81d18f2341e8c78f97555910160405180910390a18015612121575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b609e8181548110612139575f80fd5b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b612167615373565b5f6121728333615c3a565b9050805f036121ad576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818110156121e7576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f82156121f457826121f6565b815b73ffffffffffffffffffffffffffffffffffffffff85165f908152609f6020526040812054609754929350159160ff16612230575f61223e565b609a5461223e906001616540565b60408051808201909152848152602081018290529091505f3361226033615cda565b60405160609290921b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208301526034820152605401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301205f81815260a590935291205490915015612314576040517fdeeb052700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f81815260a560209081526040808320855181558583015160019182015533845260a68352818420805470010000000000000000000000000000000090819004600f0b8087528284019095529290942085905583546fffffffffffffffffffffffffffffffff90811693909101160217905560975460ff1661243e5773ffffffffffffffffffffffffffffffffffffffff88165f90815260a460209081526040808320338452909152812080548792906123cf9084906168d7565b909155505073ffffffffffffffffffffffffffffffffffffffff88165f90815260a36020526040812080548792906124089084906168d7565b909155505073ffffffffffffffffffffffffffffffffffffffff88165f90815260a360205260409020805460019091015561253a565b73ffffffffffffffffffffffffffffffffffffffff88165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612487848a616880565b61249191906168c4565b61249b90826168d7565b73ffffffffffffffffffffffffffffffffffffffff8c165f81815260a46020908152604080832033845282528083209490945591815260a390915290812080548a92906124e99084906168d7565b909155508290506124fa848a616880565b61250491906168c4565b61250e90846168d7565b73ffffffffffffffffffffffffffffffffffffffff8c165f90815260a360205260409020600101555050505b73ffffffffffffffffffffffffffffffffffffffff88165f908152609f60205260409020548415801561256f575060975460ff165b801561257c5750609c5481105b156128685773ffffffffffffffffffffffffffffffffffffffff89165f908152609f60205260408120546125b2906001906168d7565b90505b6001609c546125c491906168d7565b8110156128665760a35f609e83815481106125e1576125e16168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040018120549060a390609e612623856001616540565b81548110612633576126336168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902054111561285e575f609e828154811061267e5761267e6168ea565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff169050609e6126ae836001616540565b815481106126be576126be6168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff90921691849081106126f6576126f66168ea565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905580609e612751846001616540565b81548110612761576127616168ea565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556127b9826001616540565b609f5f609e85815481106127cf576127cf6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400190205561280b826002616540565b609f5f609e61281b866001616540565b8154811061282b5761282b6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b6001016125b5565b505b84158015612898575073ffffffffffffffffffffffffffffffffffffffff89165f90815260a36020526040902054155b156128b5576001609c5f8282546128af91906168d7565b90915550505b73ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602052604090205433604080518981526020810184905290810187905273ffffffffffffffffffffffffffffffffffffffff918216918c16907f92039db29d8c0a1aa1433fe109c69488c8c5e51b23c9de7d303ad80c1fef778c9060600160405180910390a385158015612948575060975460ff165b80156129565750609b548211155b80156129b65750609b5473ffffffffffffffffffffffffffffffffffffffff8b165f908152609f602052604090205411806129b65750609c5473ffffffffffffffffffffffffffffffffffffffff8b165f908152609f6020526040902054115b156129c3576129c36151cc565b50505050505050506129d56001606555565b5050565b73ffffffffffffffffffffffffffffffffffffffff83165f908152609f6020526040812054849103612a37576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff83165f908152609f6020526040812054849103612a95576040517f3efa0ab900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a9d615373565b5f612aa88633615c3a565b9050612ab48633615c3a565b5f03612aec576040517f857ad50500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612af78733615c3a565b1015612b2f576040517f08c2348a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8415612b3c5784612b3e565b815b73ffffffffffffffffffffffffffffffffffffffff88165f908152609f6020526040812054609754929350909190159060ff16612c235773ffffffffffffffffffffffffffffffffffffffff89165f90815260a46020908152604080832033845290915281208054859290612bb49084906168d7565b909155505073ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602052604081208054859290612bed9084906168d7565b909155505073ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602052604090208054600190910155612d1f565b73ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481612c6c848c616880565b612c7691906168c4565b612c8090826168d7565b73ffffffffffffffffffffffffffffffffffffffff8d165f81815260a46020908152604080832033845282528083209490945591815260a39091529081208054889290612cce9084906168d7565b90915550829050612cdf848c616880565b612ce991906168c4565b612cf390846168d7565b73ffffffffffffffffffffffffffffffffffffffff8d165f90815260a360205260409020600101555050505b73ffffffffffffffffffffffffffffffffffffffff89165f908152609f602052604090205481158015612d54575060975460ff165b8015612d615750609c5481105b1561304d5773ffffffffffffffffffffffffffffffffffffffff8a165f908152609f6020526040812054612d97906001906168d7565b90505b6001609c54612da991906168d7565b81101561304b5760a35f609e8381548110612dc657612dc66168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040018120549060a390609e612e08856001616540565b81548110612e1857612e186168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020541115613043575f609e8281548110612e6357612e636168ea565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff169050609e612e93836001616540565b81548110612ea357612ea36168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff9092169184908110612edb57612edb6168ea565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905580609e612f36846001616540565b81548110612f4657612f466168ea565b5f91825260209091200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055612f9e826001616540565b609f5f609e8581548110612fb457612fb46168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055612ff0826002616540565b609f5f609e613000866001616540565b81548110613010576130106168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b600101612d9a565b505b8115801561307d575073ffffffffffffffffffffffffffffffffffffffff8a165f90815260a36020526040902054155b1561309a576001609c5f82825461309491906168d7565b90915550505b811580156130aa575060975460ff165b80156130b85750609b548111155b80156131185750609b5473ffffffffffffffffffffffffffffffffffffffff8b165f908152609f602052604090205411806131185750609c5473ffffffffffffffffffffffffffffffffffffffff8b165f908152609f6020526040902054115b1561312257600192505b6131503373ffffffffffffffffffffffffffffffffffffffff8b165f90815260a260205260409020906153e6565b5060975460ff166132095773ffffffffffffffffffffffffffffffffffffffff89165f90815260a4602090815260408083203384529091528120805486929061319a908490616540565b909155505073ffffffffffffffffffffffffffffffffffffffff89165f90815260a36020526040812080548692906131d3908490616540565b909155505073ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602052604090208054600190910155613305565b73ffffffffffffffffffffffffffffffffffffffff89165f90815260a3602090815260408083206001810154905460a4845282852033865290935292205481613252848d616880565b61325c91906168c4565b6132669082616540565b73ffffffffffffffffffffffffffffffffffffffff8d165f81815260a46020908152604080832033845282528083209490945591815260a390915290812080548992906132b4908490616540565b909155508290506132c5848d616880565b6132cf91906168c4565b6132d99084616540565b73ffffffffffffffffffffffffffffffffffffffff8d165f90815260a360205260409020600101555050505b73ffffffffffffffffffffffffffffffffffffffff89165f90815260a36020526040902054849003613349576001609c5f8282546133439190616540565b90915550505b5073ffffffffffffffffffffffffffffffffffffffff88165f908152609f602052604090205460975460ff1680156133815750600181115b15613636575f6133926001836168d7565b90505b80156136345760a35f609e6133ab6001856168d7565b815481106133bb576133bb6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812054609e8054919260a39290919085908110613408576134086168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020541115613622575f609e61344d6001846168d7565b8154811061345d5761345d6168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff90921692509083908110613497576134976168ea565b5f9182526020909120015473ffffffffffffffffffffffffffffffffffffffff16609e6134c56001856168d7565b815481106134d5576134d56168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080609e838154811061352e5761352e6168ea565b5f918252602082200180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff93909316929092179091558290609f90609e61358d6001856168d7565b8154811061359d5761359d6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020556135d9826001616540565b609f5f609e85815481106135ef576135ef6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055505b8061362c81616917565b915050613395565b505b60975460ff1680156136495750609b5481115b801561367b575060995473ffffffffffffffffffffffffffffffffffffffff8a165f908152609f602052604090205411155b1561368557600192505b8215613693576136936151cc565b73ffffffffffffffffffffffffffffffffffffffff8a81165f81815260a36020908152604080832054948e16808452928190205481518a8152928301869052908201819052923392917ffdac6e81913996d95abcc289e90f2d8bd235487ce6fe6f821e7d21002a1915b49060600160405180910390a45050505050505061371a6001606555565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561383d57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015613801573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613825919061699a565b73ffffffffffffffffffffffffffffffffffffffff16145b6108a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611ce9565b6138d161514b565b6138da5f615b26565b565b6138e461514b565b609854421015613920576040517f080bb11a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609c545f0361395b576040517fd7d776cb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091555b609e54811015613b6f575f5b81811015613b665760a35f609e83815481106139b4576139b46168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812054609e8054919260a39290919086908110613a0157613a016168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff1683528201929092526040019020541115613b5e575f609e8281548110613a4c57613a4c6168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff90921692509084908110613a8657613a866168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff9092169184908110613abe57613abe6168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080609e8481548110613b1757613b176168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b600101613996565b5060010161398a565b505f5b609e54811015613bd657613b87816001616540565b609f5f609e8481548110613b9d57613b9d6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902055600101613b72565b506138da6151cc565b5f609854421015613c1c576040517fd021716f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6201518060985442613c2e91906168d7565b613c3891906168c4565b905090565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a76020526040812054610894565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a4602090815260408083203384529091528120541515610894565b60a06020525f908152604090208054600182015460028301805473ffffffffffffffffffffffffffffffffffffffff909316939192613cdc906165e1565b80601f0160208091040260200160405190810160405280929190818152602001828054613d08906165e1565b8015613d535780601f10613d2a57610100808354040283529160200191613d53565b820191905f5260205f20905b815481529060010190602001808311613d3657829003601f168201915b5050505050905083565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614613dcc576040517f4032cbb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60aa5415613fc6575f5b613de060a8615142565b811015613fc4575f60a181613df660a885615d0c565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f9081205460aa5490925060ab82613e3260a887615d0c565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f2054613e629086616880565b613e6c91906168c4565b90505f6064613e7b8484616880565b613e8591906168c4565b90505f613e9282846168d7565b90508160a15f613ea360a889615d0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f206001015f828254613eed9190616540565b9091555081905060a35f613f0260a889615d0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f015f828254613f4b9190616540565b90915550613f5c905060a886615d0c565b73ffffffffffffffffffffffffffffffffffffffff167f60ce3cc2d133631eac66a476f14997a9fa682bd05a60dd993cf02285822d78d88284604051613fac929190918252602082015260400190565b60405180910390a2505060019092019150613dd69050565b505b5f613fd160a8615142565b90505f5b8181101561404f5760ab5f613feb60a882615d0c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f905561404661403e5f60a8615d0c90919063ffffffff16565b60a890615d17565b50600101613fd5565b50505f60aa5550565b5f6140638383615c3a565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260a66020526040812054600f81810b700100000000000000000000000000000000909204900b035f036140b957505f610894565b811580614106575073ffffffffffffffffffffffffffffffffffffffff83165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b0382115b6141105781614153565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260a66020526040902054600f81810b700100000000000000000000000000000000909204900b035b91505f805b838110156118de5773ffffffffffffffffffffffffffffffffffffffff85165f90815260a66020526040812061418e90836156ba565b5f81815260a560209081526040918290208251808401909352805480845260019091015491830191909152919250906141c79085616540565b93505050806001019050614158565b604080518082019091525f808252602082015273ffffffffffffffffffffffffffffffffffffffff83165f90815260a66020526040812061421790846156ba565b5f90815260a560209081526040918290208251808401909352805483526001015490820152949350505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614801561436057507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b8152600401602060405180830381865afa158015614324573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614348919061699a565b73ffffffffffffffffffffffffffffffffffffffff16145b6143ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f7374616b696e673a206f6e6c79206f74686572207374616b696e6720636f6e7460448201527f7261637420616c6c6f77656400000000000000000000000000000000000000006064820152608401611ce9565b82609d548114614428576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b614433846001616540565b609d555f805b8381101561487d57609b54609f5f878785818110614459576144596168ea565b905060200201602081019061446e91906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054116144b257600191505b5f609f5f8787858181106144c8576144c86168ea565b90506020020160208101906144dd91906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205411156147e7575f6001609f5f888886818110614535576145356168ea565b905060200201602081019061454a91906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461458e91906168d7565b90505b609e546145a0906001906168d7565b8110156146a657609e6145b4826001616540565b815481106145c4576145c46168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff90921691839081106145fc576145fc6168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001609f5f609e8481548110614659576146596168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001812080549091906146999084906168d7565b9091555050600101614591565b50609e8054806146b8576146b86169b5565b5f8281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055909101909155609f90868684818110614727576147276168ea565b905060200201602081019061473c91906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f90555f60a35f87878581811061478e5761478e6168ea565b90506020020160208101906147a391906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f205411156147e7576001609c5f8282546147e191906168d7565b90915550505b60a05f8686848181106147fc576147fc6168ea565b905060200201602081019061481191906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f90812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001810182905590614873600283018261606c565b5050600101614439565b507f3511bf213f9290ba907e91e12a43e8471251e1879580ae5509292a3514c23f6184846040516148af9291906169e2565b60405180910390a1801561371a5761371a6151cc565b5f6060835f03614901576040517f89076b3900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff85165f90815260a26020526040902061492e90615142565b91508367ffffffffffffffff811115614949576149496165b4565b604051908082528060200260200182016040528015614972578160200160208202803683370190505b5090505f6149808486616880565b90505f600161498f8682616540565b6149999088616880565b6149a391906168d7565b90506149b06001856168d7565b8111156149c5576149c26001856168d7565b90505b815f5b828211614a6557614a09826149dc81616a3c565b73ffffffffffffffffffffffffffffffffffffffff8c165f90815260a26020526040902090945090615d0c565b8582614a1481616a3c565b935081518110614a2657614a266168ea565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506149c8565b50505050935093915050565b614a7961514b565b73ffffffffffffffffffffffffffffffffffffffff8116614b1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401611ce9565b614b2581615b26565b50565b614b30615373565b335f90815260a160205260408120600101549003614b7a576040517f5426dfcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b335f81815260a160205260408120600101805491905590614b9a90611632565b60405181815233907f8e14daa5332205b1634040e1054e93d1f5396ec8bf0115d133b7fbaf4a52e4119060200160405180910390a2506138da6001606555565b614be261514b565b82609d548114614c1e576040517f2f0fd70500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b614c29846001616540565b609d555f805b8381101561487d57609b54609f5f878785818110614c4f57614c4f6168ea565b9050602002016020810190614c6491906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205411614ca857600191505b5f609f5f878785818110614cbe57614cbe6168ea565b9050602002016020810190614cd391906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541115614fdd575f6001609f5f888886818110614d2b57614d2b6168ea565b9050602002016020810190614d4091906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054614d8491906168d7565b90505b609e54614d96906001906168d7565b811015614e9c57609e614daa826001616540565b81548110614dba57614dba6168ea565b5f91825260209091200154609e805473ffffffffffffffffffffffffffffffffffffffff9092169183908110614df257614df26168ea565b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001609f5f609e8481548110614e4f57614e4f6168ea565b5f91825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282019290925260400181208054909190614e8f9084906168d7565b9091555050600101614d87565b50609e805480614eae57614eae6169b5565b5f8281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055909101909155609f90868684818110614f1d57614f1d6168ea565b9050602002016020810190614f3291906160d3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f90555f60a35f878785818110614f8457614f846168ea565b9050602002016020810190614f9991906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f20541115614fdd576001609c5f828254614fd791906168d7565b90915550505b60a05f868684818110614ff257614ff26168ea565b905060200201602081019061500791906160d3565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040015f90812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001810182905590615069600283018261606c565b5050600101614c2f565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146150e2576040517f52d033bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6150ed60a8826153e6565b50600160aa5f8282546151009190616540565b909155505073ffffffffffffffffffffffffffffffffffffffff81165f90815260ab6020526040812080546001929061513a908490616540565b909155505050565b5f610894825490565b60335473ffffffffffffffffffffffffffffffffffffffff1633146138da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611ce9565b60995460975460ff16156151f057609954609c5410156151eb5750609c545b615201565b609954609e5410156152015750609e545b5f8167ffffffffffffffff81111561521b5761521b6165b4565b604051908082528060200260200182016040528015615244578160200160208202803683370190505b5090505f5b828110156152cb57609e8181548110615264576152646168ea565b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682828151811061529e5761529e6168ea565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101615249565b506040517f9b8201a400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639b8201a49061533e908490600401616a73565b5f604051808303815f87803b158015615355575f80fd5b505af1158015615367573d5f803e3d5ffd5b50509151609b55505050565b6002606554036153df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611ce9565b6002606555565b5f6140638373ffffffffffffffffffffffffffffffffffffffff8416615d38565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015615495573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906154b99190616a85565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301528581166024830152604482018590529192507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303815f875af1158015615558573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061557c9190616a9c565b6155b2576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015615640573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906156649190616a85565b905082158061567c57508261567983836168d7565b14155b1561371a576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001606555565b5f806156dc6156c884615d84565b85546156d79190600f0b616abb565b615e39565b84549091507001000000000000000000000000000000009004600f90810b9082900b12615735576040517fb4120f1400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f0b5f9081526001939093016020525050604090205490565b5f6157768254600f81810b700100000000000000000000000000000000909204900b131590565b156157ad576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f9081526001909101602052604090205490565b5f6157ee8254600f81810b700100000000000000000000000000000000909204900b131590565b15615825576040517f3db2a12a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b508054600f0b5f818152600180840160205260408220805492905583547fffffffffffffffffffffffffffffffff000000000000000000000000000000001692016fffffffffffffffffffffffffffffffff169190911790915590565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015615910573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906159349190616a85565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590529192507f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303815f875af11580156159cb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906159ef9190616a9c565b615a25576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015615ab3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190615ad79190616a85565b9050821580615aef575082615aec83836168d7565b14155b15611299576040517f9a7058e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff16615c32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611ce9565b6138da615ecd565b73ffffffffffffffffffffffffffffffffffffffff8083165f90815260a46020908152604080832093851683529290529081205415615cd25773ffffffffffffffffffffffffffffffffffffffff8084165f81815260a360208181526040808420600181015460a48452828620978a16865296835290842054949093525254615cc39190616880565b615ccd91906168c4565b614063565b505f92915050565b73ffffffffffffffffffffffffffffffffffffffff81165f90815260a760205260409020805460018101825590611c24565b5f6140638383615f63565b5f6140638373ffffffffffffffffffffffffffffffffffffffff8416615f89565b5f818152600183016020526040812054615d7d57508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610894565b505f610894565b5f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821115615e35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e206160448201527f6e20696e743235360000000000000000000000000000000000000000000000006064820152608401611ce9565b5090565b80600f81900b8114611679576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201527f32382062697473000000000000000000000000000000000000000000000000006064820152608401611ce9565b5f54610100900460ff166156b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401611ce9565b5f825f018281548110615f7857615f786168ea565b905f5260205f200154905092915050565b5f8181526001830160205260408120548015616063575f615fab6001836168d7565b85549091505f90615fbe906001906168d7565b905081811461601d575f865f018281548110615fdc57615fdc6168ea565b905f5260205f200154905080875f018481548110615ffc57615ffc6168ea565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061602e5761602e6169b5565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610894565b5f915050610894565b508054616078906165e1565b5f825580601f10616087575050565b601f0160209004905f5260205f2090810190614b2591905b80821115615e35575f815560010161609f565b73ffffffffffffffffffffffffffffffffffffffff81168114614b25575f80fd5b5f602082840312156160e3575f80fd5b8135614063816160b2565b5f80604083850312156160ff575f80fd5b82359150602083013567ffffffffffffffff81111561611c575f80fd5b83016060818603121561612d575f80fd5b809150509250929050565b5f8060408385031215616149575f80fd5b8235616154816160b2565b946020939093013593505050565b5f60208284031215616172575f80fd5b5035919050565b5f8083601f840112616189575f80fd5b50813567ffffffffffffffff8111156161a0575f80fd5b6020830191508360208260051b85010111156161ba575f80fd5b9250929050565b5f80602083850312156161d2575f80fd5b823567ffffffffffffffff8111156161e8575f80fd5b6161f485828601616179565b90969095509350505050565b5f81518084525f5b8181101561622457602081850181015186830182015201616208565b505f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b83811015616306578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00185528151805173ffffffffffffffffffffffffffffffffffffffff168452878101518885015286015160608785018190526162f281860183616200565b968901969450505090860190600101616288565b509098975050505050505050565b5f8060408385031215616325575f80fd5b8235616330816160b2565b9150602083013561612d816160b2565b5f805f805f8060a08789031215616355575f80fd5b8635616360816160b2565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115616390575f80fd5b61639c89828a01616179565b979a9699509497509295939492505050565b5f805f606084860312156163c0575f80fd5b83356163cb816160b2565b925060208401356163db816160b2565b929592945050506040919091013590565b73ffffffffffffffffffffffffffffffffffffffff84168152826020820152606060408201525f6164206060830184616200565b95945050505050565b5f805f6040848603121561643b575f80fd5b83359250602084013567ffffffffffffffff811115616458575f80fd5b61646486828701616179565b9497909650939450505050565b5f805f60608486031215616483575f80fd5b833561648e816160b2565b95602085013595506040909401359392505050565b5f815180845260208085019450602084015f5b838110156164e857815173ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016164b6565b509495945050505050565b828152604060208201525f61650b60408301846164a3565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8082018082111561089457610894616513565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112616586575f80fd5b83018035915067ffffffffffffffff8211156165a0575f80fd5b6020019150368190038213156161ba575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b600181811c908216806165f557607f821691505b602082108103611c24577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b601f821115610ab157805f5260205f20601f840160051c810160208510156166515750805b601f840160051c820191505b8181101561371a575f815560010161665d565b813561667b816160b2565b73ffffffffffffffffffffffffffffffffffffffff81167fffffffffffffffffffffffff000000000000000000000000000000000000000083541617825550600160208084013560018401556002830160408501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18636030181126166ff575f80fd5b8501803567ffffffffffffffff811115616717575f80fd5b8036038483011315616727575f80fd5b61673b8161673585546165e1565b8561662c565b5f601f82116001811461678d575f831561675757508382018601355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600385901b1c1916600184901b178555616822565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b828110156167d9578685018901358255938801939089019088016167ba565b5084821015616816577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88660031b161c198885880101351681555b505060018360011b0185555b505050505050505050565b83815260406020820152816040820152818360608301375f818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b808202811582820484141761089457610894616513565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f826168d2576168d2616897565b500490565b8181038181111561089457610894616513565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8161692557616925616513565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b5f8261695957616959616897565b500690565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112616990575f80fd5b9190910192915050565b5f602082840312156169aa575f80fd5b8151614063816160b2565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b60208082528181018390525f908460408401835b86811015616a31578235616a09816160b2565b73ffffffffffffffffffffffffffffffffffffffff16825291830191908301906001016169f6565b509695505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203616a6c57616a6c616513565b5060010190565b602081525f61406360208301846164a3565b5f60208284031215616a95575f80fd5b5051919050565b5f60208284031215616aac575f80fd5b81518015158114614063575f80fd5b8082018281125f831280158216821582161715616ada57616ada616513565b50509291505056fea164736f6c6343000818000a" func init() { if err := json.Unmarshal([]byte(L2StakingStorageLayoutJSON), L2StakingStorageLayout); err != nil { diff --git a/bindings/bindings/morphtoken.go b/bindings/bindings/morphtoken.go index 16d4e117d..da313b301 100644 --- a/bindings/bindings/morphtoken.go +++ b/bindings/bindings/morphtoken.go @@ -37,8 +37,8 @@ type IMorphTokenEpochInflationRate struct { // MorphTokenMetaData contains all meta data concerning the MorphToken contract. var MorphTokenMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"InflationMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"name\":\"UpdateEpochInflationRate\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DISTRIBUTE_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RECORD_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"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\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"epochInflationRates\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"internalType\":\"structIMorphToken.EpochInflationRate\",\"name\":\"\",\"type\":\"tuple\"}],\"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\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"}],\"name\":\"inflation\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inflationMintedEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inflationRatesCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dailyInflationRate_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"upToEpochIndex\",\"type\":\"uint256\"}],\"name\":\"mintInflations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"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\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"name\":\"updateRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x60e060405234801561000f575f80fd5b5073530000000000000000000000000000000000001560805273530000000000000000000000000000000000001460a05273530000000000000000000000000000000000001260c05260805160a05160c051611bb76100975f395f81816103d20152610a7a01525f81816102330152610d3501525f81816103250152610aff0152611bb75ff3fe608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e8578063a29bfb2c11610093578063c553f7b31161006e578063c553f7b3146103c5578063cd4281d0146103cd578063dd62ed3e146103f4578063f2fde38b14610439575f80fd5b8063a29bfb2c1461038c578063a457c2d71461039f578063a9059cbb146103b2575f80fd5b80638da5cb5b116100c35780638da5cb5b14610347578063944fa7461461036557806395d89b4114610384575f80fd5b8063715018a614610305578063748231321461030d578063807de44314610320575f80fd5b8063395093511161014857806342966c681161012357806342966c681461028f5780636d0c4a26146102a257806370a08231146102d0575f80fd5b8063395093511461021b5780633d9353fe1461022e578063405abb411461027a575f80fd5b806318160ddd1161017857806318160ddd146101f157806323b872dd146101f9578063313ce5671461020c575f80fd5b806306fdde031461019e578063095ea7b3146101bc5780630b88a984146101df575b5f80fd5b6101a661044c565b6040516101b391906115d5565b60405180910390f35b6101cf6101ca366004611667565b6104dc565b60405190151581526020016101b3565b606c545b6040519081526020016101b3565b6067546101e3565b6101cf61020736600461168f565b6104f5565b604051601281526020016101b3565b6101cf610229366004611667565b610518565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b3565b61028d6102883660046116c8565b610563565b005b61028d61029d3660046116e8565b61075e565b6102b56102b03660046116e8565b6107c2565b604080518251815260209283015192810192909252016101b3565b6101e36102de3660046116ff565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61028d610819565b61028d61031b3660046117f3565b61082c565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610255565b6101e36103733660046116e8565b5f908152606b602052604090205490565b6101a6610a68565b61028d61039a3660046116e8565b610a77565b6101cf6103ad366004611667565b610dbb565b6101cf6103c0366004611667565b610e4b565b606a546101e3565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b6101e3610402366004611873565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61028d6104473660046116ff565b610e58565b60606065805461045b906118a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610487906118a4565b80156104d25780601f106104a9576101008083540402835291602001916104d2565b820191905f5260205f20905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b5f336104e9818585610ef2565b60019150505b92915050565b5f33610502858285611026565b61050d8585856110e2565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104e9908290869061055e908790611922565b610ef2565b61056b611297565b606a805483919061057e90600190611935565b8154811061058e5761058e611948565b905f5260205f2090600202015f0154036106155760405162461bcd60e51b815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f737420726174650000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b606a805461062590600190611935565b8154811061063557610635611948565b905f5260205f2090600202016001015481116106b95760405162461bcd60e51b815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f72650000000000000000000000000000606482015260840161060c565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b610766611297565b5f81116107b55760405162461bcd60e51b815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f00000000000000000000604482015260640161060c565b6107bf33826112fe565b50565b604080518082019091525f8082526020820152606a82815481106107e8576107e8611948565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b610821611297565b61082a5f611486565b565b5f54610100900460ff161580801561084a57505f54600160ff909116105b806108635750303b15801561086357505f5460ff166001145b6108d55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060c565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610931575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b606561093d87826119c1565b50606661094a86826119c1565b5061095584846114fc565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909101556109d284611486565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610a60575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60606066805461045b906118a4565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614610afc5760405162461bcd60e51b815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f77656400000000604482015260640161060c565b807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8a9190611ad9565b11610bfd5760405162461bcd60e51b815260206004820152602b60248201527f746865207370656369666965642074696d6520686173206e6f7420796574206260448201527f65656e2072656163686564000000000000000000000000000000000000000000606482015260840161060c565b606c54811015610c4f5760405162461bcd60e51b815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e7465640000000000000000000000604482015260640161060c565b606c545b818111610da9575f606a5f81548110610c6e57610c6e611948565b5f9182526020822060029091020154606a54909250610c8f90600190611935565b90505b8015610cfc5782606a8281548110610cac57610cac611948565b905f5260205f2090600202016001015411610cea57606a8181548110610cd457610cd4611948565b905f5260205f2090600202015f01549150610cfc565b80610cf481611af0565b915050610c92565b505f662386f26fc1000082606754610d149190611b24565b610d1e9190611b3b565b5f848152606b602052604090208190559050610d5a7f0000000000000000000000000000000000000000000000000000000000000000826114fc565b827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa32782604051610d8c91815260200190565b60405180910390a250508080610da190611b73565b915050610c53565b50610db5816001611922565b606c5550565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610e3e5760405162461bcd60e51b815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f0000604482015260640161060c565b61050d8286868403610ef2565b5f336104e98185856110e2565b610e60611297565b73ffffffffffffffffffffffffffffffffffffffff8116610ee95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161060c565b6107bf81611486565b73ffffffffffffffffffffffffffffffffffffffff8316610f555760405162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f2061646472657373000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8216610fb85760405162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f20616464726573730000000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146110dc57818110156110cf5760405162461bcd60e51b815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e636500000000000000000000604482015260640161060c565b6110dc8484848403610ef2565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166111455760405162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f20616464726573730000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff82166111a85760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f206164647265737300000000604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff83165f908152606860205260409020548181101561121d5760405162461bcd60e51b815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e636500604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112899086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff16331461082a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060c565b73ffffffffffffffffffffffffffffffffffffffff82166113875760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161060c565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156114225760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161060c565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101611019565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b73ffffffffffffffffffffffffffffffffffffffff821661155f5760405162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f20616464726573730000000000000000604482015260640161060c565b8060675f8282546115709190611922565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f602080835283518060208501525f5b81811015611601578581018301518582016040015282016115e5565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611662575f80fd5b919050565b5f8060408385031215611678575f80fd5b6116818361163f565b946020939093013593505050565b5f805f606084860312156116a1575f80fd5b6116aa8461163f565b92506116b86020850161163f565b9150604084013590509250925092565b5f80604083850312156116d9575f80fd5b50508035926020909101359150565b5f602082840312156116f8575f80fd5b5035919050565b5f6020828403121561170f575f80fd5b6117188261163f565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f83011261175b575f80fd5b813567ffffffffffffffff808211156117765761177661171f565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156117bc576117bc61171f565b816040528381528660208588010111156117d4575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a08688031215611807575f80fd5b853567ffffffffffffffff8082111561181e575f80fd5b61182a89838a0161174c565b9650602088013591508082111561183f575f80fd5b5061184c8882890161174c565b94505061185b6040870161163f565b94979396509394606081013594506080013592915050565b5f8060408385031215611884575f80fd5b61188d8361163f565b915061189b6020840161163f565b90509250929050565b600181811c908216806118b857607f821691505b6020821081036118ef577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156104ef576104ef6118f5565b818103818111156104ef576104ef6118f5565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b601f8211156119bc57805f5260205f20601f840160051c8101602085101561199a5750805b601f840160051c820191505b818110156119b9575f81556001016119a6565b50505b505050565b815167ffffffffffffffff8111156119db576119db61171f565b6119ef816119e984546118a4565b84611975565b602080601f831160018114611a41575f8415611a0b5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610a60565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611a8d57888601518255948401946001909101908401611a6e565b5085821015611ac957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215611ae9575f80fd5b5051919050565b5f81611afe57611afe6118f5565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b80820281158282048414176104ef576104ef6118f5565b5f82611b6e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ba357611ba36118f5565b506001019056fea164736f6c6343000818000a", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"InflationMinted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"name\":\"UpdateEpochInflationRate\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SYSTEM_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"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\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"epochInflationRates\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"internalType\":\"structIMorphToken.EpochInflationRate\",\"name\":\"\",\"type\":\"tuple\"}],\"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\":\"uint256\",\"name\":\"epochIndex\",\"type\":\"uint256\"}],\"name\":\"inflation\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inflationMintedEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inflationRatesCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"dailyInflationRate_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintInflations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"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\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"effectiveEpochIndex\",\"type\":\"uint256\"}],\"name\":\"updateRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60c060405234801561000f575f80fd5b5073530000000000000000000000000000000000001560805273530000000000000000000000000000000000002160a05260805160a051611c8b6100845f395f818161021f015261041201525f81816103220152818161049c0152818161057901528181610748015261079c0152611c8b5ff3fe608060405234801561000f575f80fd5b506004361061018f575f3560e01c806370a08231116100dd57806395d89b4111610088578063c553f7b311610063578063c553f7b3146103af578063dd62ed3e146103b7578063f2fde38b146103fc575f80fd5b806395d89b4114610381578063a457c2d714610389578063a9059cbb1461039c575f80fd5b8063807de443116100b8578063807de4431461031d5780638da5cb5b14610344578063944fa74614610362575f80fd5b806370a08231146102cd578063715018a614610302578063748231321461030a575f80fd5b8063313ce5671161013d578063405abb4111610118578063405abb411461027957806342966c681461028c5780636d0c4a261461029f575f80fd5b8063313ce5671461020b5780633434735f1461021a5780633950935114610266575f80fd5b80630b88a9841161016d5780630b88a984146101de57806318160ddd146101f057806323b872dd146101f8575f80fd5b806303d9c2e31461019357806306fdde031461019d578063095ea7b3146101bb575b5f80fd5b61019b61040f565b005b6101a5610869565b6040516101b291906116a9565b60405180910390f35b6101ce6101c936600461173b565b6108f9565b60405190151581526020016101b2565b606c545b6040519081526020016101b2565b6067546101e2565b6101ce610206366004611763565b610912565b604051601281526020016101b2565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b6101ce61027436600461173b565b610935565b61019b61028736600461179c565b610980565b61019b61029a3660046117bc565b610b76565b6102b26102ad3660046117bc565b610bda565b604080518251815260209283015192810192909252016101b2565b6101e26102db3660046117d3565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61019b610c31565b61019b6103183660046118c7565b610c44565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610241565b6101e26103703660046117bc565b5f908152606b602052604090205490565b6101a5610e80565b6101ce61039736600461173b565b610e8f565b6101ce6103aa36600461173b565b610f1f565b606a546101e2565b6101e26103c5366004611947565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61019b61040a3660046117d3565b610f2c565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146104995760405162461bcd60e51b815260206004820152601b60248201527f6f6e6c792073797374656d206164647265737320616c6c6f776564000000000060448201526064015b60405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610503573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105279190611978565b116105745760405162461bcd60e51b815260206004820152601160248201527f6e6f20696e666c6174696f6e73207965740000000000000000000000000000006044820152606401610490565b5f60017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106049190611978565b61060e91906119bc565b9050606c548110156106625760405162461bcd60e51b815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e74656400000000000000000000006044820152606401610490565b606c545b818111610857575f606a5f81548110610681576106816119cf565b5f9182526020822060029091020154606a549092506106a2906001906119bc565b90505b801561070f5782606a82815481106106bf576106bf6119cf565b905f5260205f20906002020160010154116106fd57606a81815481106106e7576106e76119cf565b905f5260205f2090600202015f0154915061070f565b80610707816119fc565b9150506106a5565b505f662386f26fc10000826067546107279190611a30565b6107319190611a47565b5f848152606b60205260409020819055905061076d7f000000000000000000000000000000000000000000000000000000000000000082610fc6565b6040517f91c05b0b000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906391c05b0b906024015f604051808303815f87803b1580156107f2575f80fd5b505af1158015610804573d5f803e3d5ffd5b50505050827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa3278260405161083a91815260200190565b60405180910390a25050808061084f90611a7f565b915050610666565b50610863816001611ab6565b606c5550565b60606065805461087890611ac9565b80601f01602080910402602001604051908101604052809291908181526020018280546108a490611ac9565b80156108ef5780601f106108c6576101008083540402835291602001916108ef565b820191905f5260205f20905b8154815290600101906020018083116108d257829003601f168201915b5050505050905090565b5f3361090681858561109f565b60019150505b92915050565b5f3361091f8582856111d3565b61092a85858561128f565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190610906908290869061097b908790611ab6565b61109f565b610988611444565b606a805483919061099b906001906119bc565b815481106109ab576109ab6119cf565b905f5260205f2090600202015f015403610a2d5760405162461bcd60e51b815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f73742072617465000000000000000000000000000000000000000000000000006064820152608401610490565b606a8054610a3d906001906119bc565b81548110610a4d57610a4d6119cf565b905f5260205f209060020201600101548111610ad15760405162461bcd60e51b815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f726500000000000000000000000000006064820152608401610490565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b610b7e611444565b5f8111610bcd5760405162461bcd60e51b815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f000000000000000000006044820152606401610490565b610bd733826114ab565b50565b604080518082019091525f8082526020820152606a8281548110610c0057610c006119cf565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b610c39611444565b610c425f611633565b565b5f54610100900460ff1615808015610c6257505f54600160ff909116105b80610c7b5750303b158015610c7b57505f5460ff166001145b610ced5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d49575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6065610d558782611b66565b506066610d628682611b66565b50610d6d8484610fc6565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5290910155610dea84611633565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610e78575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60606066805461087890611ac9565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610f125760405162461bcd60e51b815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f00006044820152606401610490565b61092a828686840361109f565b5f3361090681858561128f565b610f34611444565b73ffffffffffffffffffffffffffffffffffffffff8116610fbd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610490565b610bd781611633565b73ffffffffffffffffffffffffffffffffffffffff82166110295760405162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610490565b8060675f82825461103a9190611ab6565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff83166111025760405162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f20616464726573730000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166111655760405162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f206164647265737300000000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611289578181101561127c5760405162461bcd60e51b815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e6365000000000000000000006044820152606401610490565b611289848484840361109f565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166112f25760405162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166113555760405162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260686020526040902054818110156113ca5760405162461bcd60e51b815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906114369086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610c425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff82166115345760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610490565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156115cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610490565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016111c6565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f602080835283518060208501525f5b818110156116d5578581018301518582016040015282016116b9565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611736575f80fd5b919050565b5f806040838503121561174c575f80fd5b61175583611713565b946020939093013593505050565b5f805f60608486031215611775575f80fd5b61177e84611713565b925061178c60208501611713565b9150604084013590509250925092565b5f80604083850312156117ad575f80fd5b50508035926020909101359150565b5f602082840312156117cc575f80fd5b5035919050565b5f602082840312156117e3575f80fd5b6117ec82611713565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f83011261182f575f80fd5b813567ffffffffffffffff8082111561184a5761184a6117f3565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611890576118906117f3565b816040528381528660208588010111156118a8575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a086880312156118db575f80fd5b853567ffffffffffffffff808211156118f2575f80fd5b6118fe89838a01611820565b96506020880135915080821115611913575f80fd5b5061192088828901611820565b94505061192f60408701611713565b94979396509394606081013594506080013592915050565b5f8060408385031215611958575f80fd5b61196183611713565b915061196f60208401611713565b90509250929050565b5f60208284031215611988575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181038181111561090c5761090c61198f565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81611a0a57611a0a61198f565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b808202811582820484141761090c5761090c61198f565b5f82611a7a577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611aaf57611aaf61198f565b5060010190565b8082018082111561090c5761090c61198f565b600181811c90821680611add57607f821691505b602082108103611b14577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b601f821115611b6157805f5260205f20601f840160051c81016020851015611b3f5750805b601f840160051c820191505b81811015611b5e575f8155600101611b4b565b50505b505050565b815167ffffffffffffffff811115611b8057611b806117f3565b611b9481611b8e8454611ac9565b84611b1a565b602080601f831160018114611be6575f8415611bb05750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610e78565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611c3257888601518255948401946001909101908401611c13565b5085821015611c6e57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000818000a", } // MorphTokenABI is the input ABI used to generate the binding from. @@ -208,37 +208,6 @@ func (_MorphToken *MorphTokenTransactorRaw) Transact(opts *bind.TransactOpts, me return _MorphToken.Contract.contract.Transact(opts, method, params...) } -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenCaller) DISTRIBUTECONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _MorphToken.contract.Call(opts, &out, "DISTRIBUTE_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _MorphToken.Contract.DISTRIBUTECONTRACT(&_MorphToken.CallOpts) -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenCallerSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _MorphToken.Contract.DISTRIBUTECONTRACT(&_MorphToken.CallOpts) -} - // L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. // // Solidity: function L2_STAKING_CONTRACT() view returns(address) @@ -270,12 +239,12 @@ func (_MorphToken *MorphTokenCallerSession) L2STAKINGCONTRACT() (common.Address, return _MorphToken.Contract.L2STAKINGCONTRACT(&_MorphToken.CallOpts) } -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. // -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenCaller) RECORDCONTRACT(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_MorphToken *MorphTokenCaller) SYSTEMADDRESS(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _MorphToken.contract.Call(opts, &out, "RECORD_CONTRACT") + err := _MorphToken.contract.Call(opts, &out, "SYSTEM_ADDRESS") if err != nil { return *new(common.Address), err @@ -287,18 +256,18 @@ func (_MorphToken *MorphTokenCaller) RECORDCONTRACT(opts *bind.CallOpts) (common } -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. // -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenSession) RECORDCONTRACT() (common.Address, error) { - return _MorphToken.Contract.RECORDCONTRACT(&_MorphToken.CallOpts) +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_MorphToken *MorphTokenSession) SYSTEMADDRESS() (common.Address, error) { + return _MorphToken.Contract.SYSTEMADDRESS(&_MorphToken.CallOpts) } -// RECORDCONTRACT is a free data retrieval call binding the contract method 0xcd4281d0. +// SYSTEMADDRESS is a free data retrieval call binding the contract method 0x3434735f. // -// Solidity: function RECORD_CONTRACT() view returns(address) -func (_MorphToken *MorphTokenCallerSession) RECORDCONTRACT() (common.Address, error) { - return _MorphToken.Contract.RECORDCONTRACT(&_MorphToken.CallOpts) +// Solidity: function SYSTEM_ADDRESS() view returns(address) +func (_MorphToken *MorphTokenCallerSession) SYSTEMADDRESS() (common.Address, error) { + return _MorphToken.Contract.SYSTEMADDRESS(&_MorphToken.CallOpts) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. @@ -747,25 +716,25 @@ func (_MorphToken *MorphTokenTransactorSession) Initialize(name_ string, symbol_ return _MorphToken.Contract.Initialize(&_MorphToken.TransactOpts, name_, symbol_, _owner, initialSupply_, dailyInflationRate_) } -// MintInflations is a paid mutator transaction binding the contract method 0xa29bfb2c. +// MintInflations is a paid mutator transaction binding the contract method 0x03d9c2e3. // -// Solidity: function mintInflations(uint256 upToEpochIndex) returns() -func (_MorphToken *MorphTokenTransactor) MintInflations(opts *bind.TransactOpts, upToEpochIndex *big.Int) (*types.Transaction, error) { - return _MorphToken.contract.Transact(opts, "mintInflations", upToEpochIndex) +// Solidity: function mintInflations() returns() +func (_MorphToken *MorphTokenTransactor) MintInflations(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MorphToken.contract.Transact(opts, "mintInflations") } -// MintInflations is a paid mutator transaction binding the contract method 0xa29bfb2c. +// MintInflations is a paid mutator transaction binding the contract method 0x03d9c2e3. // -// Solidity: function mintInflations(uint256 upToEpochIndex) returns() -func (_MorphToken *MorphTokenSession) MintInflations(upToEpochIndex *big.Int) (*types.Transaction, error) { - return _MorphToken.Contract.MintInflations(&_MorphToken.TransactOpts, upToEpochIndex) +// Solidity: function mintInflations() returns() +func (_MorphToken *MorphTokenSession) MintInflations() (*types.Transaction, error) { + return _MorphToken.Contract.MintInflations(&_MorphToken.TransactOpts) } -// MintInflations is a paid mutator transaction binding the contract method 0xa29bfb2c. +// MintInflations is a paid mutator transaction binding the contract method 0x03d9c2e3. // -// Solidity: function mintInflations(uint256 upToEpochIndex) returns() -func (_MorphToken *MorphTokenTransactorSession) MintInflations(upToEpochIndex *big.Int) (*types.Transaction, error) { - return _MorphToken.Contract.MintInflations(&_MorphToken.TransactOpts, upToEpochIndex) +// Solidity: function mintInflations() returns() +func (_MorphToken *MorphTokenTransactorSession) MintInflations() (*types.Transaction, error) { + return _MorphToken.Contract.MintInflations(&_MorphToken.TransactOpts) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. diff --git a/bindings/bindings/morphtoken_more.go b/bindings/bindings/morphtoken_more.go index 66baacc67..9582f486e 100644 --- a/bindings/bindings/morphtoken_more.go +++ b/bindings/bindings/morphtoken_more.go @@ -13,7 +13,7 @@ const MorphTokenStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\": var MorphTokenStorageLayout = new(solc.StorageLayout) -var MorphTokenDeployedBin = "0x608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e8578063a29bfb2c11610093578063c553f7b31161006e578063c553f7b3146103c5578063cd4281d0146103cd578063dd62ed3e146103f4578063f2fde38b14610439575f80fd5b8063a29bfb2c1461038c578063a457c2d71461039f578063a9059cbb146103b2575f80fd5b80638da5cb5b116100c35780638da5cb5b14610347578063944fa7461461036557806395d89b4114610384575f80fd5b8063715018a614610305578063748231321461030d578063807de44314610320575f80fd5b8063395093511161014857806342966c681161012357806342966c681461028f5780636d0c4a26146102a257806370a08231146102d0575f80fd5b8063395093511461021b5780633d9353fe1461022e578063405abb411461027a575f80fd5b806318160ddd1161017857806318160ddd146101f157806323b872dd146101f9578063313ce5671461020c575f80fd5b806306fdde031461019e578063095ea7b3146101bc5780630b88a984146101df575b5f80fd5b6101a661044c565b6040516101b391906117c3565b60405180910390f35b6101cf6101ca366004611855565b6104dc565b60405190151581526020016101b3565b606c545b6040519081526020016101b3565b6067546101e3565b6101cf61020736600461187d565b6104f5565b604051601281526020016101b3565b6101cf610229366004611855565b610518565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b3565b61028d6102883660046118b6565b610563565b005b61028d61029d3660046118d6565b610792565b6102b56102b03660046118d6565b610810565b604080518251815260209283015192810192909252016101b3565b6101e36102de3660046118ed565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61028d610867565b61028d61031b3660046119e1565b61087a565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610255565b6101e36103733660046118d6565b5f908152606b602052604090205490565b6101a6610ad0565b61028d61039a3660046118d6565b610adf565b6101cf6103ad366004611855565b610e71565b6101cf6103c0366004611855565b610f1b565b606a546101e3565b6102557f000000000000000000000000000000000000000000000000000000000000000081565b6101e3610402366004611a61565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61028d6104473660046118ed565b610f28565b60606065805461045b90611a92565b80601f016020809104026020016040519081016040528092919081815260200182805461048790611a92565b80156104d25780601f106104a9576101008083540402835291602001916104d2565b820191905f5260205f20905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b5f336104e9818585610fdc565b60019150505b92915050565b5f33610502858285611144565b61050d85858561121a565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906104e9908290869061055e908790611b10565b610fdc565b61056b61141d565b606a805483919061057e90600190611b23565b8154811061058e5761058e611b36565b905f5260205f2090600202015f01540361062f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f737420726174650000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b606a805461063f90600190611b23565b8154811061064f5761064f611b36565b905f5260205f2090600202016001015481116106ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f726500000000000000000000000000006064820152608401610626565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b61079a61141d565b5f8111610803576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f000000000000000000006044820152606401610626565b61080d338261149e565b50565b604080518082019091525f8082526020820152606a828154811061083657610836611b36565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b61086f61141d565b6108785f61165a565b565b5f54610100900460ff161580801561089857505f54600160ff909116105b806108b15750303b1580156108b157505f5460ff166001145b61093d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610626565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610999575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b60656109a58782611baf565b5060666109b28682611baf565b506109bd84846116d0565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5290910155610a3a8461165a565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610ac8575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b60606066805461045b90611a92565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1614610b7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6f6e6c79207265636f726420636f6e747261637420616c6c6f776564000000006044820152606401610626565b807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610be8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c0c9190611cc7565b11610c99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f746865207370656369666965642074696d6520686173206e6f7420796574206260448201527f65656e20726561636865640000000000000000000000000000000000000000006064820152608401610626565b606c54811015610d05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e74656400000000000000000000006044820152606401610626565b606c545b818111610e5f575f606a5f81548110610d2457610d24611b36565b5f9182526020822060029091020154606a54909250610d4590600190611b23565b90505b8015610db25782606a8281548110610d6257610d62611b36565b905f5260205f2090600202016001015411610da057606a8181548110610d8a57610d8a611b36565b905f5260205f2090600202015f01549150610db2565b80610daa81611cde565b915050610d48565b505f662386f26fc1000082606754610dca9190611d12565b610dd49190611d29565b5f848152606b602052604090208190559050610e107f0000000000000000000000000000000000000000000000000000000000000000826116d0565b827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa32782604051610e4291815260200190565b60405180910390a250508080610e5790611d61565b915050610d09565b50610e6b816001611b10565b606c5550565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610f0e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f00006044820152606401610626565b61050d8286868403610fdc565b5f336104e981858561121a565b610f3061141d565b73ffffffffffffffffffffffffffffffffffffffff8116610fd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610626565b61080d8161165a565b73ffffffffffffffffffffffffffffffffffffffff8316611059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f20616464726573730000006044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff82166110d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f617070726f766520746f20746865207a65726f206164647265737300000000006044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146112145781811015611207576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e6365000000000000000000006044820152606401610626565b6112148484848403610fdc565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316611297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f206164647265737300006044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff8216611314576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f2061646472657373000000006044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff83165f90815260686020526040902054818110156113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e6365006044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061140f9086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610878576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610626565b73ffffffffffffffffffffffffffffffffffffffff8216611541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610626565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156115f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610626565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101611137565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b73ffffffffffffffffffffffffffffffffffffffff821661174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6d696e7420746f20746865207a65726f206164647265737300000000000000006044820152606401610626565b8060675f82825461175e9190611b10565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b5f602080835283518060208501525f5b818110156117ef578581018301518582016040015282016117d3565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611850575f80fd5b919050565b5f8060408385031215611866575f80fd5b61186f8361182d565b946020939093013593505050565b5f805f6060848603121561188f575f80fd5b6118988461182d565b92506118a66020850161182d565b9150604084013590509250925092565b5f80604083850312156118c7575f80fd5b50508035926020909101359150565b5f602082840312156118e6575f80fd5b5035919050565b5f602082840312156118fd575f80fd5b6119068261182d565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611949575f80fd5b813567ffffffffffffffff808211156119645761196461190d565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156119aa576119aa61190d565b816040528381528660208588010111156119c2575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a086880312156119f5575f80fd5b853567ffffffffffffffff80821115611a0c575f80fd5b611a1889838a0161193a565b96506020880135915080821115611a2d575f80fd5b50611a3a8882890161193a565b945050611a496040870161182d565b94979396509394606081013594506080013592915050565b5f8060408385031215611a72575f80fd5b611a7b8361182d565b9150611a896020840161182d565b90509250929050565b600181811c90821680611aa657607f821691505b602082108103611add577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156104ef576104ef611ae3565b818103818111156104ef576104ef611ae3565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b601f821115611baa57805f5260205f20601f840160051c81016020851015611b885750805b601f840160051c820191505b81811015611ba7575f8155600101611b94565b50505b505050565b815167ffffffffffffffff811115611bc957611bc961190d565b611bdd81611bd78454611a92565b84611b63565b602080601f831160018114611c2f575f8415611bf95750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610ac8565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611c7b57888601518255948401946001909101908401611c5c565b5085821015611cb757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215611cd7575f80fd5b5051919050565b5f81611cec57611cec611ae3565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b80820281158282048414176104ef576104ef611ae3565b5f82611d5c577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611d9157611d91611ae3565b506001019056fea164736f6c6343000818000a" +var MorphTokenDeployedBin = "0x608060405234801561000f575f80fd5b506004361061018f575f3560e01c806370a08231116100dd57806395d89b4111610088578063c553f7b311610063578063c553f7b3146103af578063dd62ed3e146103b7578063f2fde38b146103fc575f80fd5b806395d89b4114610381578063a457c2d714610389578063a9059cbb1461039c575f80fd5b8063807de443116100b8578063807de4431461031d5780638da5cb5b14610344578063944fa74614610362575f80fd5b806370a08231146102cd578063715018a614610302578063748231321461030a575f80fd5b8063313ce5671161013d578063405abb4111610118578063405abb411461027957806342966c681461028c5780636d0c4a261461029f575f80fd5b8063313ce5671461020b5780633434735f1461021a5780633950935114610266575f80fd5b80630b88a9841161016d5780630b88a984146101de57806318160ddd146101f057806323b872dd146101f8575f80fd5b806303d9c2e31461019357806306fdde031461019d578063095ea7b3146101bb575b5f80fd5b61019b61040f565b005b6101a56108b7565b6040516101b29190611897565b60405180910390f35b6101ce6101c9366004611929565b610947565b60405190151581526020016101b2565b606c545b6040519081526020016101b2565b6067546101e2565b6101ce610206366004611951565b610960565b604051601281526020016101b2565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b2565b6101ce610274366004611929565b610983565b61019b61028736600461198a565b6109ce565b61019b61029a3660046119aa565b610bf8565b6102b26102ad3660046119aa565b610c76565b604080518251815260209283015192810192909252016101b2565b6101e26102db3660046119c1565b73ffffffffffffffffffffffffffffffffffffffff165f9081526068602052604090205490565b61019b610ccd565b61019b610318366004611ab5565b610ce0565b6102417f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff16610241565b6101e26103703660046119aa565b5f908152606b602052604090205490565b6101a5610f36565b6101ce610397366004611929565b610f45565b6101ce6103aa366004611929565b610fef565b606a546101e2565b6101e26103c5366004611b35565b73ffffffffffffffffffffffffffffffffffffffff9182165f90815260696020908152604080832093909416825291909152205490565b61019b61040a3660046119c1565b610ffc565b337f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16146104b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6f6e6c792073797374656d206164647265737320616c6c6f776564000000000060448201526064015b60405180910390fd5b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105419190611b66565b116105a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f20696e666c6174696f6e732079657400000000000000000000000000000060448201526064016104aa565b5f60017f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610614573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106389190611b66565b6106429190611baa565b9050606c548110156106b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f616c6c20696e666c6174696f6e73206d696e746564000000000000000000000060448201526064016104aa565b606c545b8181116108a5575f606a5f815481106106cf576106cf611bbd565b5f9182526020822060029091020154606a549092506106f090600190611baa565b90505b801561075d5782606a828154811061070d5761070d611bbd565b905f5260205f209060020201600101541161074b57606a818154811061073557610735611bbd565b905f5260205f2090600202015f0154915061075d565b8061075581611bea565b9150506106f3565b505f662386f26fc10000826067546107759190611c1e565b61077f9190611c35565b5f848152606b6020526040902081905590506107bb7f0000000000000000000000000000000000000000000000000000000000000000826110b0565b6040517f91c05b0b000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906391c05b0b906024015f604051808303815f87803b158015610840575f80fd5b505af1158015610852573d5f803e3d5ffd5b50505050827f0d82c0920038b8dc7f633e18585f37092ba957b84876fcf833d6841f69eaa3278260405161088891815260200190565b60405180910390a25050808061089d90611c6d565b9150506106b4565b506108b1816001611ca4565b606c5550565b6060606580546108c690611cb7565b80601f01602080910402602001604051908101604052809291908181526020018280546108f290611cb7565b801561093d5780601f106109145761010080835404028352916020019161093d565b820191905f5260205f20905b81548152906001019060200180831161092057829003601f168201915b5050505050905090565b5f336109548185856111a3565b60019150505b92915050565b5f3361096d85828561130b565b6109788585856113e1565b506001949350505050565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061095490829086906109c9908790611ca4565b6111a3565b6109d66115e4565b606a80548391906109e990600190611baa565b815481106109f9576109f9611bbd565b905f5260205f2090600202015f015403610a95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f6e65772072617465206973207468652073616d6520617320746865206c61746560448201527f737420726174650000000000000000000000000000000000000000000000000060648201526084016104aa565b606a8054610aa590600190611baa565b81548110610ab557610ab5611bbd565b905f5260205f209060020201600101548111610b53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f6566666563746976652065706f636873206166746572206d757374206265206760448201527f726561746572207468616e206265666f7265000000000000000000000000000060648201526084016104aa565b60408051808201825283815260208101838152606a80546001810182555f91825292517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029094029384015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a52909201919091559051829184917fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f49190a35050565b610c006115e4565b5f8111610c69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f616d6f756e7420746f206275726e206973207a65726f0000000000000000000060448201526064016104aa565b610c733382611665565b50565b604080518082019091525f8082526020820152606a8281548110610c9c57610c9c611bbd565b905f5260205f2090600202016040518060400160405290815f82015481526020016001820154815250509050919050565b610cd56115e4565b610cde5f611821565b565b5f54610100900460ff1615808015610cfe57505f54600160ff909116105b80610d175750303b158015610d1757505f5460ff166001145b610da3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016104aa565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610dff575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6065610e0b8782611d54565b506066610e188682611d54565b50610e2384846110b0565b604080518082019091528281525f60208201818152606a8054600181018255925291517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5160029092029182015590517f116fea137db6e131133e7f2bab296045d8f41cc5607279db17b218cab0929a5290910155610ea084611821565b6040515f9083907fbe80a5653ecb34691beafb0fb70004d50f9032b798f68a2f73a137c4f98ab3f4908390a38015610f2e575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060606680546108c690611cb7565b335f81815260696020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015610fe2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f000060448201526064016104aa565b61097882868684036111a3565b5f336109548185856113e1565b6110046115e4565b73ffffffffffffffffffffffffffffffffffffffff81166110a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104aa565b610c7381611821565b73ffffffffffffffffffffffffffffffffffffffff821661112d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f6d696e7420746f20746865207a65726f2061646472657373000000000000000060448201526064016104aa565b8060675f82825461113e9190611ca4565b909155505073ffffffffffffffffffffffffffffffffffffffff82165f818152606860209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8316611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f206164647265737300000060448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff821661129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f617070726f766520746f20746865207a65726f2061646472657373000000000060448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff8381165f8181526069602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381165f908152606960209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146113db57818110156113ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f696e73756666696369656e7420616c6c6f77616e63650000000000000000000060448201526064016104aa565b6113db84848484036111a3565b50505050565b73ffffffffffffffffffffffffffffffffffffffff831661145e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f2061646472657373000060448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff82166114db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f20616464726573730000000060448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff83165f908152606860205260409020548181101561156a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f7472616e7366657220616d6f756e7420657863656564732062616c616e63650060448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff8085165f8181526068602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906115d69086815260200190565b60405180910390a350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610cde576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104aa565b73ffffffffffffffffffffffffffffffffffffffff8216611708576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016104aa565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260686020526040902054818110156117bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016104aa565b73ffffffffffffffffffffffffffffffffffffffff83165f8181526068602090815260408083208686039055606780548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016112fe565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f602080835283518060208501525f5b818110156118c3578581018301518582016040015282016118a7565b505f6040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611924575f80fd5b919050565b5f806040838503121561193a575f80fd5b61194383611901565b946020939093013593505050565b5f805f60608486031215611963575f80fd5b61196c84611901565b925061197a60208501611901565b9150604084013590509250925092565b5f806040838503121561199b575f80fd5b50508035926020909101359150565b5f602082840312156119ba575f80fd5b5035919050565b5f602082840312156119d1575f80fd5b6119da82611901565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611a1d575f80fd5b813567ffffffffffffffff80821115611a3857611a386119e1565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611a7e57611a7e6119e1565b81604052838152866020858801011115611a96575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f805f60a08688031215611ac9575f80fd5b853567ffffffffffffffff80821115611ae0575f80fd5b611aec89838a01611a0e565b96506020880135915080821115611b01575f80fd5b50611b0e88828901611a0e565b945050611b1d60408701611901565b94979396509394606081013594506080013592915050565b5f8060408385031215611b46575f80fd5b611b4f83611901565b9150611b5d60208401611901565b90509250929050565b5f60208284031215611b76575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181038181111561095a5761095a611b7d565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81611bf857611bf8611b7d565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b808202811582820484141761095a5761095a611b7d565b5f82611c68577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c9d57611c9d611b7d565b5060010190565b8082018082111561095a5761095a611b7d565b600181811c90821680611ccb57607f821691505b602082108103611d02577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b601f821115611d4f57805f5260205f20601f840160051c81016020851015611d2d5750805b601f840160051c820191505b81811015611d4c575f8155600101611d39565b50505b505050565b815167ffffffffffffffff811115611d6e57611d6e6119e1565b611d8281611d7c8454611cb7565b84611d08565b602080601f831160018114611dd4575f8415611d9e5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610f2e565b5f858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611e2057888601518255948401946001909101908401611e01565b5085821015611e5c57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea164736f6c6343000818000a" func init() { if err := json.Unmarshal([]byte(MorphTokenStorageLayoutJSON), MorphTokenStorageLayout); err != nil { diff --git a/bindings/bindings/record.go b/bindings/bindings/record.go deleted file mode 100644 index 606145dfd..000000000 --- a/bindings/bindings/record.go +++ /dev/null @@ -1,1726 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/morph-l2/go-ethereum" - "github.com/morph-l2/go-ethereum/accounts/abi" - "github.com/morph-l2/go-ethereum/accounts/abi/bind" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/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 -) - -// IRecordBatchSubmission is an auto generated low-level Go binding around an user-defined struct. -type IRecordBatchSubmission struct { - Index *big.Int - Submitter common.Address - StartBlock *big.Int - EndBlock *big.Int - RollupTime *big.Int - RollupBlock *big.Int -} - -// IRecordRewardEpochInfo is an auto generated low-level Go binding around an user-defined struct. -type IRecordRewardEpochInfo struct { - Index *big.Int - BlockCount *big.Int - Sequencers []common.Address - SequencerBlocks []*big.Int - SequencerRatios []*big.Int - SequencerCommissions []*big.Int -} - -// IRecordRollupEpochInfo is an auto generated low-level Go binding around an user-defined struct. -type IRecordRollupEpochInfo struct { - Index *big.Int - Submitter common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int -} - -// RecordMetaData contains all meta data concerning the Record contract. -var RecordMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dataLength\",\"type\":\"uint256\"}],\"name\":\"BatchSubmissionsUploaded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dataLength\",\"type\":\"uint256\"}],\"name\":\"RewardEpochsUploaded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"startIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"dataLength\",\"type\":\"uint256\"}],\"name\":\"RollupEpochsUploaded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DISTRIBUTE_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOV_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_STAKING_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MORPH_TOKEN_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEQUENCER_CONTRACT\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchSubmissions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"getBatchSubmissions\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIRecord.BatchSubmission[]\",\"name\":\"res\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"getRewardEpochs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockCount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"sequencers\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerBlocks\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerRatios\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerCommissions\",\"type\":\"uint256[]\"}],\"internalType\":\"structIRecord.RewardEpochInfo[]\",\"name\":\"res\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"start\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"end\",\"type\":\"uint256\"}],\"name\":\"getRollupEpochs\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIRecord.RollupEpochInfo[]\",\"name\":\"res\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_oracle\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_nextBatchSubmissionIndex\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRewardEpochBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextBatchSubmissionIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextRewardEpochIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextRollupEpochIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rollupBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIRecord.BatchSubmission[]\",\"name\":\"_batchSubmissions\",\"type\":\"tuple[]\"}],\"name\":\"recordFinalizedBatchSubmissions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockCount\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"sequencers\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerBlocks\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerRatios\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"sequencerCommissions\",\"type\":\"uint256[]\"}],\"internalType\":\"structIRecord.RewardEpochInfo[]\",\"name\":\"_rewardEpochs\",\"type\":\"tuple[]\"}],\"name\":\"recordRewardEpochs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIRecord.RollupEpochInfo[]\",\"name\":\"_rollupEpochs\",\"type\":\"tuple[]\"}],\"name\":\"recordRollupEpochs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rewardEpochIndex\",\"type\":\"uint256\"}],\"name\":\"rewardEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"rollupEpochIndex\",\"type\":\"uint256\"}],\"name\":\"rollupEpochs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endBlock\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_latestBlock\",\"type\":\"uint256\"}],\"name\":\"setLatestRewardEpochBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"setOracleAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x61012060405234801562000011575f80fd5b5073530000000000000000000000000000000000001360805273530000000000000000000000000000000000001560a05273530000000000000000000000000000000000001760c05273530000000000000000000000000000000000001460e05273530000000000000000000000000000000000000461010052620000956200009b565b62000159565b5f54610100900460ff1615620001075760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161462000157575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160a05160c05160e05161010051612c94620001b35f395f6102cf01525f81816101f90152611c5e01525f6103f601525f81816103b101526111b301525f8181610508015281816112cd01526118050152612c945ff3fe608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e85780638e21d5fb11610093578063cb6293e81161006e578063cb6293e8146104e3578063d557714114610503578063f2fde38b1461052a578063fe49dbc91461053d575f80fd5b80638e21d5fb146103f1578063a24231e814610418578063a795f409146104a8575f80fd5b80637dc0d1d0116100c35780637dc0d1d01461038c578063807de443146103ac5780638da5cb5b146103d3575f80fd5b8063715018a6146102c25780637828a905146102ca57806378f908e1146102f1575f80fd5b806341ed047f116101485780634e3ca406116101235780634e3ca4061461026f57806364b4abe31461028f5780636ea0396e146102af575f80fd5b806341ed047f14610240578063484f8d0f146102535780634c69c00f1461025c575f80fd5b80631794bb3c116101785780631794bb3c146101d85780632fbf6487146101eb5780633d9353fe146101f4575f80fd5b80630776c0f71461019e57806310c9873f146101ba5780631511e1b1146101cf575b5f80fd5b6101a7606c5481565b6040519081526020015b60405180910390f35b6101cd6101c83660046125b9565b610550565b005b6101a760695481565b6101cd6101e63660046125f8565b610676565b6101a7606b5481565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b1565b6101cd61024e366004612631565b61096c565b6101a7606a5481565b6101cd61026a3660046126a0565b610cab565b61028261027d3660046126c0565b610d5d565b6040516101b191906126e0565b6102a261029d3660046126c0565b610ef5565b6040516101b19190612763565b6101cd6102bd3660046127e3565b611096565b6101cd611d98565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61034a6102ff3660046125b9565b60666020525f9081526040902080546001820154600283015460038401546004850154600590950154939473ffffffffffffffffffffffffffffffffffffffff909316939192909186565b6040805196875273ffffffffffffffffffffffffffffffffffffffff9095166020870152938501929092526060840152608083015260a082015260c0016101b1565b60655461021b9073ffffffffffffffffffffffffffffffffffffffff1681565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff1661021b565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61046b6104263660046125b9565b60676020525f908152604090208054600182015460028301546003840154600490940154929373ffffffffffffffffffffffffffffffffffffffff9092169290919085565b6040805195865273ffffffffffffffffffffffffffffffffffffffff9094166020860152928401919091526060830152608082015260a0016101b1565b6104ce6104b63660046125b9565b60686020525f90815260409020805460019091015482565b604080519283526020830191909152016101b1565b6104f66104f13660046126c0565b611dab565b6040516101b1919061287a565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b6101cd6105383660046126a0565b61205f565b6101cd61054b3660046129a8565b6120fc565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105d25760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064015b60405180910390fd5b606c54156106225760405162461bcd60e51b815260206004820152600b60248201527f616c72656164792073657400000000000000000000000000000000000000000060448201526064016105c9565b5f81116106715760405162461bcd60e51b815260206004820152601460248201527f696e76616c6964206c617465737420626c6f636b00000000000000000000000060448201526064016105c9565b606c55565b5f54610100900460ff161580801561069457505f54600160ff909116105b806106ad5750303b1580156106ad57505f5460ff166001145b61071f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105c9565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561077b575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff84166107de5760405162461bcd60e51b815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016105c9565b815f036108535760405162461bcd60e51b815260206004820152602360248201527f696e76616c6964206e657874206261746368207375626d697373696f6e20696e60448201527f646578000000000000000000000000000000000000000000000000000000000060648201526084016105c9565b73ffffffffffffffffffffffffffffffffffffffff83166108b65760405162461bcd60e51b815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105c9565b6108bf84612407565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851617905560698290558015610966575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109e95760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b80610a365760405162461bcd60e51b815260206004820152601760248201527f656d707479206261746368207375626d697373696f6e7300000000000000000060448201526064016105c9565b5f5b81811015610c575780606954610a4e9190612a32565b838383818110610a6057610a60612a4b565b905060c002015f013514610ab65760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b6040518060c00160405280848484818110610ad357610ad3612a4b565b905060c002015f01358152602001848484818110610af357610af3612a4b565b905060c002016020016020810190610b0b91906126a0565b73ffffffffffffffffffffffffffffffffffffffff168152602001848484818110610b3857610b38612a4b565b905060c00201604001358152602001848484818110610b5957610b59612a4b565b905060c00201606001358152602001848484818110610b7a57610b7a612a4b565b905060c00201608001358152602001848484818110610b9b57610b9b612a4b565b905060c0020160a0013581525060665f858585818110610bbd57610bbd612a4b565b60c002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155908301516002830155606083015160038301556080830151600483015560a09092015160059091015501610a38565b506069546040518281527f1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e9060200160405180910390a28181905060695f828254610ca29190612a32565b90915550505050565b610cb361247d565b73ffffffffffffffffffffffffffffffffffffffff8116610d165760405162461bcd60e51b815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105c9565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606082821015610daf5760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b610db98383612a78565b610dc4906001612a32565b67ffffffffffffffff811115610ddc57610ddc612a8b565b604051908082528060200260200182016040528015610e5057816020015b610e3d6040518060a001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81525090565b815260200190600190039081610dfa5790505b509050825b828111610eee575f81815260676020908152604091829020825160a08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff16928101929092526002810154928201929092526003820154606082015260049091015460808201528251839083908110610ed057610ed0612a4b565b60200260200101819052508080610ee690612ab8565b915050610e55565b5092915050565b606082821015610f475760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b610f518383612a78565b610f5c906001612a32565b67ffffffffffffffff811115610f7457610f74612a8b565b604051908082528060200260200182016040528015610fee57816020015b610fdb6040518060c001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f81525090565b815260200190600190039081610f925790505b509050825b828111610eee575f81815260666020908152604091829020825160c08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff1692810192909252600281015492820192909252600382015460608201526004820154608082015260059091015460a0820152825183908390811061107857611078612a4b565b6020026020010181905250808061108e90612ab8565b915050610ff3565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111135760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b806111605760405162461bcd60e51b815260206004820152601360248201527f656d707479207265776172642065706f6368730000000000000000000000000060448201526064016105c9565b5f606c54116111b15760405162461bcd60e51b815260206004820152601960248201527f737461727420626c6f636b2073686f756c64206265207365740000000000000060448201526064016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561121a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061123e9190612aef565b606b5460019061124f908490612a32565b6112599190612a78565b106112cb5760405162461bcd60e51b8152602060048201526024808201527f756e66696e69736865642065706f6368732063616e6e6f742062652075706c6f60448201527f616465640000000000000000000000000000000000000000000000000000000060648201526084016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a29bfb2c600184849050606b5461131a9190612a32565b6113249190612a78565b6040518263ffffffff1660e01b815260040161134291815260200190565b5f604051808303815f87803b158015611359575f80fd5b505af115801561136b573d5f803e3d5ffd5b505f9250829150505b82811015611d2d575f84848381811061138f5761138f612a4b565b90506020028101906113a19190612b06565b6113af906040810190612b42565b905090505f8585848181106113c6576113c6612a4b565b90506020028101906113d89190612b06565b606b54903591506113ea908490612a32565b81146114385760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642065706f636820696e6465780000000000000000000000000060448201526064016105c9565b8186868581811061144b5761144b612a4b565b905060200281019061145d9190612b06565b61146b906060810190612b42565b90501480156114ac57508186868581811061148857611488612a4b565b905060200281019061149a9190612b06565b6114a8906080810190612b42565b9050145b80156114ea5750818686858181106114c6576114c6612a4b565b90506020028101906114d89190612b06565b6114e69060a0810190612b42565b9050145b6115365760405162461bcd60e51b815260206004820152601360248201527f696e76616c69642064617461206c656e6774680000000000000000000000000060448201526064016105c9565b85858481811061154857611548612a4b565b905060200281019061155a9190612b06565b611568906020013585612a32565b93506040518060c0016040528082815260200187878681811061158d5761158d612a4b565b905060200281019061159f9190612b06565b6020013581526020018787868181106115ba576115ba612a4b565b90506020028101906115cc9190612b06565b6115da906040810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061162257611622612a4b565b90506020028101906116349190612b06565b611642906060810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061168a5761168a612a4b565b905060200281019061169c9190612b06565b6116aa906080810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152505050908252506020018787868181106116f2576116f2612a4b565b90506020028101906117049190612b06565b6117129060a0810190612b42565b808060200260200160405190810160405280939291908181526020018383602002808284375f920182905250939094525050838152606860209081526040918290208451815584820151600182015591840151805192935061177d92600285019291909101906124e4565b506060820151805161179991600384019160209091019061256c565b50608082015180516117b591600484019160209091019061256c565b5060a082015180516117d191600584019160209091019061256c565b50506040517f944fa746000000000000000000000000000000000000000000000000000000008152600481018390525f91507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063944fa74690602401602060405180830381865afa15801561185f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118839190612aef565b90505f805f8567ffffffffffffffff8111156118a1576118a1612a8b565b6040519080825280602002602001820160405280156118ca578160200160208202803683370190505b5090505f8667ffffffffffffffff8111156118e7576118e7612a8b565b604051908082528060200260200182016040528015611910578160200160208202803683370190505b5090505f5b87811015611b915760148c8c8b81811061193157611931612a4b565b90506020028101906119439190612b06565b6119519060a0810190612b42565b8381811061196157611961612a4b565b9050602002013511156119b65760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642073657175656e6365727320636f6d6d697373696f6e00000060448201526064016105c9565b8b8b8a8181106119c8576119c8612a4b565b90506020028101906119da9190612b06565b6119e8906080810190612b42565b828181106119f8576119f8612a4b565b9050602002013584611a0a9190612a32565b93508b8b8a818110611a1e57611a1e612a4b565b9050602002810190611a309190612b06565b611a3e906060810190612b42565b82818110611a4e57611a4e612a4b565b9050602002013585611a609190612a32565b94505f6305f5e1008d8d8c818110611a7a57611a7a612a4b565b9050602002810190611a8c9190612b06565b611a9a906080810190612b42565b84818110611aaa57611aaa612a4b565b9050602002013588611abc9190612bad565b611ac69190612bc4565b905060648d8d8c818110611adc57611adc612a4b565b9050602002810190611aee9190612b06565b611afc9060a0810190612b42565b84818110611b0c57611b0c612a4b565b9050602002013582611b1e9190612bad565b611b289190612bc4565b838381518110611b3a57611b3a612a4b565b602002602001018181525050828281518110611b5857611b58612a4b565b602002602001015181611b6b9190612a78565b848381518110611b7d57611b7d612a4b565b602090810291909101015250600101611915565b508a8a89818110611ba457611ba4612a4b565b9050602002810190611bb69190612b06565b602001358414611c085760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642073657175656e6365727320626c6f636b730000000000000060448201526064016105c9565b6305f5e100831115611c5c5760405162461bcd60e51b815260206004820152601960248201527f696e76616c69642073657175656e6365727320726174696f730000000000000060448201526064016105c9565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cdd0c50e878d8d8c818110611cab57611cab612a4b565b9050602002810190611cbd9190612b06565b611ccb906040810190612b42565b86866040518663ffffffff1660e01b8152600401611ced959493929190612bfc565b5f604051808303815f87803b158015611d04575f80fd5b505af1158015611d16573d5f803e3d5ffd5b505060019099019850611374975050505050505050565b50606b546040518381527f4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea9060200160405180910390a280606c5f828254611d759190612a32565b9091555050606b80548391905f90611d8e908490612a32565b9091555050505050565b611da061247d565b611da95f612407565b565b606082821015611dfd5760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b611e078383612a78565b611e12906001612a32565b67ffffffffffffffff811115611e2a57611e2a612a8b565b604051908082528060200260200182016040528015611e9257816020015b611e7f6040518060c001604052805f81526020015f8152602001606081526020016060815260200160608152602001606081525090565b815260200190600190039081611e485790505b509050825b828111610eee575f81815260686020908152604091829020825160c0810184528154815260018201548184015260028201805485518186028101860187528181529295939493860193830182828015611f2457602002820191905f5260205f20905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611ef9575b5050505050815260200160038201805480602002602001604051908101604052809291908181526020018280548015611f7a57602002820191905f5260205f20905b815481526020019060010190808311611f66575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020018280548015611fd057602002820191905f5260205f20905b815481526020019060010190808311611fbc575b505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561202657602002820191905f5260205f20905b815481526020019060010190808311612012575b50505050508152505082828151811061204157612041612a4b565b6020026020010181905250808061205790612ab8565b915050611e97565b61206761247d565b73ffffffffffffffffffffffffffffffffffffffff81166120f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105c9565b6120f981612407565b50565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121795760405162461bcd60e51b815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105c9565b806121c65760405162461bcd60e51b815260206004820152601360248201527f656d70747920726f6c6c75702065706f6368730000000000000000000000000060448201526064016105c9565b5f5b818110156123bc5780606a546121de9190612a32565b8383838181106121f0576121f0612a4b565b905060a002015f0135146122465760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105c9565b6040518060a0016040528084848481811061226357612263612a4b565b905060a002015f0135815260200184848481811061228357612283612a4b565b905060a00201602001602081019061229b91906126a0565b73ffffffffffffffffffffffffffffffffffffffff1681526020018484848181106122c8576122c8612a4b565b905060a002016040013581526020018484848181106122e9576122e9612a4b565b905060a0020160600135815260200184848481811061230a5761230a612a4b565b905060a002016080013581525060675f85858581811061232c5761232c612a4b565b60a002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9093169290921790915590830151600283015560608301516003830155608090920151600490910155016121c8565b50606a546040518281527f0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed29929299060200160405180910390a281819050606a5f828254610ca29190612a32565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611da95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105c9565b828054828255905f5260205f2090810192821561255c579160200282015b8281111561255c57825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612502565b506125689291506125a5565b5090565b828054828255905f5260205f2090810192821561255c579160200282015b8281111561255c57825182559160200191906001019061258a565b5b80821115612568575f81556001016125a6565b5f602082840312156125c9575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146125f3575f80fd5b919050565b5f805f6060848603121561260a575f80fd5b612613846125d0565b9250612621602085016125d0565b9150604084013590509250925092565b5f8060208385031215612642575f80fd5b823567ffffffffffffffff80821115612659575f80fd5b818501915085601f83011261266c575f80fd5b81358181111561267a575f80fd5b86602060c08302850101111561268e575f80fd5b60209290920196919550909350505050565b5f602082840312156126b0575f80fd5b6126b9826125d0565b9392505050565b5f80604083850312156126d1575f80fd5b50508035926020909101359150565b602080825282518282018190525f919060409081850190868401855b82811015612756578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016126fc565b5091979650505050505050565b602080825282518282018190525f919060409081850190868401855b82811015612756578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080808201519086015260a0908101519085015260c0909301929085019060010161277f565b5f80602083850312156127f4575f80fd5b823567ffffffffffffffff8082111561280b575f80fd5b818501915085601f83011261281e575f80fd5b81358181111561282c575f80fd5b8660208260051b850101111561268e575f80fd5b5f815180845260208085019450602084015f5b8381101561286f57815187529582019590820190600101612853565b509495945050505050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b8381101561299a578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc001855281518051845287810151888501528681015160c0888601819052815190860181905260e08601918a01905f905b8082101561293357825173ffffffffffffffffffffffffffffffffffffffff168452928b0192918b0191600191909101906128fd565b5050506060808301518683038288015261294d8382612840565b92505050608080830151868303828801526129688382612840565b9250505060a080830151925085820381870152506129868183612840565b9689019694505050908601906001016128a1565b509098975050505050505050565b5f80602083850312156129b9575f80fd5b823567ffffffffffffffff808211156129d0575f80fd5b818501915085601f8301126129e3575f80fd5b8135818111156129f1575f80fd5b86602060a08302850101111561268e575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115612a4557612a45612a05565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115612a4557612a45612a05565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612ae857612ae8612a05565b5060010190565b5f60208284031215612aff575f80fd5b5051919050565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612b38575f80fd5b9190910192915050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612b75575f80fd5b83018035915067ffffffffffffffff821115612b8f575f80fd5b6020019150600581901b3603821315612ba6575f80fd5b9250929050565b8082028115828204841417612a4557612a45612a05565b5f82612bf7577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b858152608060208083018290529082018590525f90869060a08401835b88811015612c525773ffffffffffffffffffffffffffffffffffffffff612c3f856125d0565b1682529282019290820190600101612c19565b508481036040860152612c658188612840565b925050508281036060840152612c7b8185612840565b9897505050505050505056fea164736f6c6343000818000a", -} - -// RecordABI is the input ABI used to generate the binding from. -// Deprecated: Use RecordMetaData.ABI instead. -var RecordABI = RecordMetaData.ABI - -// RecordBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use RecordMetaData.Bin instead. -var RecordBin = RecordMetaData.Bin - -// DeployRecord deploys a new Ethereum contract, binding an instance of Record to it. -func DeployRecord(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Record, error) { - parsed, err := RecordMetaData.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(RecordBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Record{RecordCaller: RecordCaller{contract: contract}, RecordTransactor: RecordTransactor{contract: contract}, RecordFilterer: RecordFilterer{contract: contract}}, nil -} - -// Record is an auto generated Go binding around an Ethereum contract. -type Record struct { - RecordCaller // Read-only binding to the contract - RecordTransactor // Write-only binding to the contract - RecordFilterer // Log filterer for contract events -} - -// RecordCaller is an auto generated read-only Go binding around an Ethereum contract. -type RecordCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// RecordTransactor is an auto generated write-only Go binding around an Ethereum contract. -type RecordTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// RecordFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type RecordFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// RecordSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type RecordSession struct { - Contract *Record // 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 -} - -// RecordCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type RecordCallerSession struct { - Contract *RecordCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// RecordTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type RecordTransactorSession struct { - Contract *RecordTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// RecordRaw is an auto generated low-level Go binding around an Ethereum contract. -type RecordRaw struct { - Contract *Record // Generic contract binding to access the raw methods on -} - -// RecordCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type RecordCallerRaw struct { - Contract *RecordCaller // Generic read-only contract binding to access the raw methods on -} - -// RecordTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type RecordTransactorRaw struct { - Contract *RecordTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewRecord creates a new instance of Record, bound to a specific deployed contract. -func NewRecord(address common.Address, backend bind.ContractBackend) (*Record, error) { - contract, err := bindRecord(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Record{RecordCaller: RecordCaller{contract: contract}, RecordTransactor: RecordTransactor{contract: contract}, RecordFilterer: RecordFilterer{contract: contract}}, nil -} - -// NewRecordCaller creates a new read-only instance of Record, bound to a specific deployed contract. -func NewRecordCaller(address common.Address, caller bind.ContractCaller) (*RecordCaller, error) { - contract, err := bindRecord(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &RecordCaller{contract: contract}, nil -} - -// NewRecordTransactor creates a new write-only instance of Record, bound to a specific deployed contract. -func NewRecordTransactor(address common.Address, transactor bind.ContractTransactor) (*RecordTransactor, error) { - contract, err := bindRecord(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &RecordTransactor{contract: contract}, nil -} - -// NewRecordFilterer creates a new log filterer instance of Record, bound to a specific deployed contract. -func NewRecordFilterer(address common.Address, filterer bind.ContractFilterer) (*RecordFilterer, error) { - contract, err := bindRecord(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &RecordFilterer{contract: contract}, nil -} - -// bindRecord binds a generic wrapper to an already deployed contract. -func bindRecord(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := RecordMetaData.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 (_Record *RecordRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Record.Contract.RecordCaller.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 (_Record *RecordRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Record.Contract.RecordTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Record *RecordRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Record.Contract.RecordTransactor.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 (_Record *RecordCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Record.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 (_Record *RecordTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Record.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Record *RecordTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Record.Contract.contract.Transact(opts, method, params...) -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_Record *RecordCaller) DISTRIBUTECONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "DISTRIBUTE_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_Record *RecordSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _Record.Contract.DISTRIBUTECONTRACT(&_Record.CallOpts) -} - -// DISTRIBUTECONTRACT is a free data retrieval call binding the contract method 0x3d9353fe. -// -// Solidity: function DISTRIBUTE_CONTRACT() view returns(address) -func (_Record *RecordCallerSession) DISTRIBUTECONTRACT() (common.Address, error) { - return _Record.Contract.DISTRIBUTECONTRACT(&_Record.CallOpts) -} - -// GOVCONTRACT is a free data retrieval call binding the contract method 0x7828a905. -// -// Solidity: function GOV_CONTRACT() view returns(address) -func (_Record *RecordCaller) GOVCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "GOV_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GOVCONTRACT is a free data retrieval call binding the contract method 0x7828a905. -// -// Solidity: function GOV_CONTRACT() view returns(address) -func (_Record *RecordSession) GOVCONTRACT() (common.Address, error) { - return _Record.Contract.GOVCONTRACT(&_Record.CallOpts) -} - -// GOVCONTRACT is a free data retrieval call binding the contract method 0x7828a905. -// -// Solidity: function GOV_CONTRACT() view returns(address) -func (_Record *RecordCallerSession) GOVCONTRACT() (common.Address, error) { - return _Record.Contract.GOVCONTRACT(&_Record.CallOpts) -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Record *RecordCaller) L2STAKINGCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "L2_STAKING_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Record *RecordSession) L2STAKINGCONTRACT() (common.Address, error) { - return _Record.Contract.L2STAKINGCONTRACT(&_Record.CallOpts) -} - -// L2STAKINGCONTRACT is a free data retrieval call binding the contract method 0x807de443. -// -// Solidity: function L2_STAKING_CONTRACT() view returns(address) -func (_Record *RecordCallerSession) L2STAKINGCONTRACT() (common.Address, error) { - return _Record.Contract.L2STAKINGCONTRACT(&_Record.CallOpts) -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Record *RecordCaller) MORPHTOKENCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "MORPH_TOKEN_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Record *RecordSession) MORPHTOKENCONTRACT() (common.Address, error) { - return _Record.Contract.MORPHTOKENCONTRACT(&_Record.CallOpts) -} - -// MORPHTOKENCONTRACT is a free data retrieval call binding the contract method 0xd5577141. -// -// Solidity: function MORPH_TOKEN_CONTRACT() view returns(address) -func (_Record *RecordCallerSession) MORPHTOKENCONTRACT() (common.Address, error) { - return _Record.Contract.MORPHTOKENCONTRACT(&_Record.CallOpts) -} - -// SEQUENCERCONTRACT is a free data retrieval call binding the contract method 0x8e21d5fb. -// -// Solidity: function SEQUENCER_CONTRACT() view returns(address) -func (_Record *RecordCaller) SEQUENCERCONTRACT(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "SEQUENCER_CONTRACT") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// SEQUENCERCONTRACT is a free data retrieval call binding the contract method 0x8e21d5fb. -// -// Solidity: function SEQUENCER_CONTRACT() view returns(address) -func (_Record *RecordSession) SEQUENCERCONTRACT() (common.Address, error) { - return _Record.Contract.SEQUENCERCONTRACT(&_Record.CallOpts) -} - -// SEQUENCERCONTRACT is a free data retrieval call binding the contract method 0x8e21d5fb. -// -// Solidity: function SEQUENCER_CONTRACT() view returns(address) -func (_Record *RecordCallerSession) SEQUENCERCONTRACT() (common.Address, error) { - return _Record.Contract.SEQUENCERCONTRACT(&_Record.CallOpts) -} - -// BatchSubmissions is a free data retrieval call binding the contract method 0x78f908e1. -// -// Solidity: function batchSubmissions(uint256 batchIndex) view returns(uint256 index, address submitter, uint256 startBlock, uint256 endBlock, uint256 rollupTime, uint256 rollupBlock) -func (_Record *RecordCaller) BatchSubmissions(opts *bind.CallOpts, batchIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartBlock *big.Int - EndBlock *big.Int - RollupTime *big.Int - RollupBlock *big.Int -}, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "batchSubmissions", batchIndex) - - outstruct := new(struct { - Index *big.Int - Submitter common.Address - StartBlock *big.Int - EndBlock *big.Int - RollupTime *big.Int - RollupBlock *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.Index = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.Submitter = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.StartBlock = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.EndBlock = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.RollupTime = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - outstruct.RollupBlock = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// BatchSubmissions is a free data retrieval call binding the contract method 0x78f908e1. -// -// Solidity: function batchSubmissions(uint256 batchIndex) view returns(uint256 index, address submitter, uint256 startBlock, uint256 endBlock, uint256 rollupTime, uint256 rollupBlock) -func (_Record *RecordSession) BatchSubmissions(batchIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartBlock *big.Int - EndBlock *big.Int - RollupTime *big.Int - RollupBlock *big.Int -}, error) { - return _Record.Contract.BatchSubmissions(&_Record.CallOpts, batchIndex) -} - -// BatchSubmissions is a free data retrieval call binding the contract method 0x78f908e1. -// -// Solidity: function batchSubmissions(uint256 batchIndex) view returns(uint256 index, address submitter, uint256 startBlock, uint256 endBlock, uint256 rollupTime, uint256 rollupBlock) -func (_Record *RecordCallerSession) BatchSubmissions(batchIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartBlock *big.Int - EndBlock *big.Int - RollupTime *big.Int - RollupBlock *big.Int -}, error) { - return _Record.Contract.BatchSubmissions(&_Record.CallOpts, batchIndex) -} - -// GetBatchSubmissions is a free data retrieval call binding the contract method 0x64b4abe3. -// -// Solidity: function getBatchSubmissions(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256,uint256)[] res) -func (_Record *RecordCaller) GetBatchSubmissions(opts *bind.CallOpts, start *big.Int, end *big.Int) ([]IRecordBatchSubmission, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "getBatchSubmissions", start, end) - - if err != nil { - return *new([]IRecordBatchSubmission), err - } - - out0 := *abi.ConvertType(out[0], new([]IRecordBatchSubmission)).(*[]IRecordBatchSubmission) - - return out0, err - -} - -// GetBatchSubmissions is a free data retrieval call binding the contract method 0x64b4abe3. -// -// Solidity: function getBatchSubmissions(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256,uint256)[] res) -func (_Record *RecordSession) GetBatchSubmissions(start *big.Int, end *big.Int) ([]IRecordBatchSubmission, error) { - return _Record.Contract.GetBatchSubmissions(&_Record.CallOpts, start, end) -} - -// GetBatchSubmissions is a free data retrieval call binding the contract method 0x64b4abe3. -// -// Solidity: function getBatchSubmissions(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256,uint256)[] res) -func (_Record *RecordCallerSession) GetBatchSubmissions(start *big.Int, end *big.Int) ([]IRecordBatchSubmission, error) { - return _Record.Contract.GetBatchSubmissions(&_Record.CallOpts, start, end) -} - -// GetRewardEpochs is a free data retrieval call binding the contract method 0xcb6293e8. -// -// Solidity: function getRewardEpochs(uint256 start, uint256 end) view returns((uint256,uint256,address[],uint256[],uint256[],uint256[])[] res) -func (_Record *RecordCaller) GetRewardEpochs(opts *bind.CallOpts, start *big.Int, end *big.Int) ([]IRecordRewardEpochInfo, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "getRewardEpochs", start, end) - - if err != nil { - return *new([]IRecordRewardEpochInfo), err - } - - out0 := *abi.ConvertType(out[0], new([]IRecordRewardEpochInfo)).(*[]IRecordRewardEpochInfo) - - return out0, err - -} - -// GetRewardEpochs is a free data retrieval call binding the contract method 0xcb6293e8. -// -// Solidity: function getRewardEpochs(uint256 start, uint256 end) view returns((uint256,uint256,address[],uint256[],uint256[],uint256[])[] res) -func (_Record *RecordSession) GetRewardEpochs(start *big.Int, end *big.Int) ([]IRecordRewardEpochInfo, error) { - return _Record.Contract.GetRewardEpochs(&_Record.CallOpts, start, end) -} - -// GetRewardEpochs is a free data retrieval call binding the contract method 0xcb6293e8. -// -// Solidity: function getRewardEpochs(uint256 start, uint256 end) view returns((uint256,uint256,address[],uint256[],uint256[],uint256[])[] res) -func (_Record *RecordCallerSession) GetRewardEpochs(start *big.Int, end *big.Int) ([]IRecordRewardEpochInfo, error) { - return _Record.Contract.GetRewardEpochs(&_Record.CallOpts, start, end) -} - -// GetRollupEpochs is a free data retrieval call binding the contract method 0x4e3ca406. -// -// Solidity: function getRollupEpochs(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256)[] res) -func (_Record *RecordCaller) GetRollupEpochs(opts *bind.CallOpts, start *big.Int, end *big.Int) ([]IRecordRollupEpochInfo, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "getRollupEpochs", start, end) - - if err != nil { - return *new([]IRecordRollupEpochInfo), err - } - - out0 := *abi.ConvertType(out[0], new([]IRecordRollupEpochInfo)).(*[]IRecordRollupEpochInfo) - - return out0, err - -} - -// GetRollupEpochs is a free data retrieval call binding the contract method 0x4e3ca406. -// -// Solidity: function getRollupEpochs(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256)[] res) -func (_Record *RecordSession) GetRollupEpochs(start *big.Int, end *big.Int) ([]IRecordRollupEpochInfo, error) { - return _Record.Contract.GetRollupEpochs(&_Record.CallOpts, start, end) -} - -// GetRollupEpochs is a free data retrieval call binding the contract method 0x4e3ca406. -// -// Solidity: function getRollupEpochs(uint256 start, uint256 end) view returns((uint256,address,uint256,uint256,uint256)[] res) -func (_Record *RecordCallerSession) GetRollupEpochs(start *big.Int, end *big.Int) ([]IRecordRollupEpochInfo, error) { - return _Record.Contract.GetRollupEpochs(&_Record.CallOpts, start, end) -} - -// LatestRewardEpochBlock is a free data retrieval call binding the contract method 0x0776c0f7. -// -// Solidity: function latestRewardEpochBlock() view returns(uint256) -func (_Record *RecordCaller) LatestRewardEpochBlock(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "latestRewardEpochBlock") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// LatestRewardEpochBlock is a free data retrieval call binding the contract method 0x0776c0f7. -// -// Solidity: function latestRewardEpochBlock() view returns(uint256) -func (_Record *RecordSession) LatestRewardEpochBlock() (*big.Int, error) { - return _Record.Contract.LatestRewardEpochBlock(&_Record.CallOpts) -} - -// LatestRewardEpochBlock is a free data retrieval call binding the contract method 0x0776c0f7. -// -// Solidity: function latestRewardEpochBlock() view returns(uint256) -func (_Record *RecordCallerSession) LatestRewardEpochBlock() (*big.Int, error) { - return _Record.Contract.LatestRewardEpochBlock(&_Record.CallOpts) -} - -// NextBatchSubmissionIndex is a free data retrieval call binding the contract method 0x1511e1b1. -// -// Solidity: function nextBatchSubmissionIndex() view returns(uint256) -func (_Record *RecordCaller) NextBatchSubmissionIndex(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "nextBatchSubmissionIndex") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// NextBatchSubmissionIndex is a free data retrieval call binding the contract method 0x1511e1b1. -// -// Solidity: function nextBatchSubmissionIndex() view returns(uint256) -func (_Record *RecordSession) NextBatchSubmissionIndex() (*big.Int, error) { - return _Record.Contract.NextBatchSubmissionIndex(&_Record.CallOpts) -} - -// NextBatchSubmissionIndex is a free data retrieval call binding the contract method 0x1511e1b1. -// -// Solidity: function nextBatchSubmissionIndex() view returns(uint256) -func (_Record *RecordCallerSession) NextBatchSubmissionIndex() (*big.Int, error) { - return _Record.Contract.NextBatchSubmissionIndex(&_Record.CallOpts) -} - -// NextRewardEpochIndex is a free data retrieval call binding the contract method 0x2fbf6487. -// -// Solidity: function nextRewardEpochIndex() view returns(uint256) -func (_Record *RecordCaller) NextRewardEpochIndex(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "nextRewardEpochIndex") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// NextRewardEpochIndex is a free data retrieval call binding the contract method 0x2fbf6487. -// -// Solidity: function nextRewardEpochIndex() view returns(uint256) -func (_Record *RecordSession) NextRewardEpochIndex() (*big.Int, error) { - return _Record.Contract.NextRewardEpochIndex(&_Record.CallOpts) -} - -// NextRewardEpochIndex is a free data retrieval call binding the contract method 0x2fbf6487. -// -// Solidity: function nextRewardEpochIndex() view returns(uint256) -func (_Record *RecordCallerSession) NextRewardEpochIndex() (*big.Int, error) { - return _Record.Contract.NextRewardEpochIndex(&_Record.CallOpts) -} - -// NextRollupEpochIndex is a free data retrieval call binding the contract method 0x484f8d0f. -// -// Solidity: function nextRollupEpochIndex() view returns(uint256) -func (_Record *RecordCaller) NextRollupEpochIndex(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "nextRollupEpochIndex") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// NextRollupEpochIndex is a free data retrieval call binding the contract method 0x484f8d0f. -// -// Solidity: function nextRollupEpochIndex() view returns(uint256) -func (_Record *RecordSession) NextRollupEpochIndex() (*big.Int, error) { - return _Record.Contract.NextRollupEpochIndex(&_Record.CallOpts) -} - -// NextRollupEpochIndex is a free data retrieval call binding the contract method 0x484f8d0f. -// -// Solidity: function nextRollupEpochIndex() view returns(uint256) -func (_Record *RecordCallerSession) NextRollupEpochIndex() (*big.Int, error) { - return _Record.Contract.NextRollupEpochIndex(&_Record.CallOpts) -} - -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. -// -// Solidity: function oracle() view returns(address) -func (_Record *RecordCaller) Oracle(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "oracle") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. -// -// Solidity: function oracle() view returns(address) -func (_Record *RecordSession) Oracle() (common.Address, error) { - return _Record.Contract.Oracle(&_Record.CallOpts) -} - -// Oracle is a free data retrieval call binding the contract method 0x7dc0d1d0. -// -// Solidity: function oracle() view returns(address) -func (_Record *RecordCallerSession) Oracle() (common.Address, error) { - return _Record.Contract.Oracle(&_Record.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Record *RecordCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Record *RecordSession) Owner() (common.Address, error) { - return _Record.Contract.Owner(&_Record.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Record *RecordCallerSession) Owner() (common.Address, error) { - return _Record.Contract.Owner(&_Record.CallOpts) -} - -// RewardEpochs is a free data retrieval call binding the contract method 0xa795f409. -// -// Solidity: function rewardEpochs(uint256 rewardEpochIndex) view returns(uint256 index, uint256 blockCount) -func (_Record *RecordCaller) RewardEpochs(opts *bind.CallOpts, rewardEpochIndex *big.Int) (struct { - Index *big.Int - BlockCount *big.Int -}, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "rewardEpochs", rewardEpochIndex) - - outstruct := new(struct { - Index *big.Int - BlockCount *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.Index = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.BlockCount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// RewardEpochs is a free data retrieval call binding the contract method 0xa795f409. -// -// Solidity: function rewardEpochs(uint256 rewardEpochIndex) view returns(uint256 index, uint256 blockCount) -func (_Record *RecordSession) RewardEpochs(rewardEpochIndex *big.Int) (struct { - Index *big.Int - BlockCount *big.Int -}, error) { - return _Record.Contract.RewardEpochs(&_Record.CallOpts, rewardEpochIndex) -} - -// RewardEpochs is a free data retrieval call binding the contract method 0xa795f409. -// -// Solidity: function rewardEpochs(uint256 rewardEpochIndex) view returns(uint256 index, uint256 blockCount) -func (_Record *RecordCallerSession) RewardEpochs(rewardEpochIndex *big.Int) (struct { - Index *big.Int - BlockCount *big.Int -}, error) { - return _Record.Contract.RewardEpochs(&_Record.CallOpts, rewardEpochIndex) -} - -// RollupEpochs is a free data retrieval call binding the contract method 0xa24231e8. -// -// Solidity: function rollupEpochs(uint256 rollupEpochIndex) view returns(uint256 index, address submitter, uint256 startTime, uint256 endTime, uint256 endBlock) -func (_Record *RecordCaller) RollupEpochs(opts *bind.CallOpts, rollupEpochIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int -}, error) { - var out []interface{} - err := _Record.contract.Call(opts, &out, "rollupEpochs", rollupEpochIndex) - - outstruct := new(struct { - Index *big.Int - Submitter common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int - }) - if err != nil { - return *outstruct, err - } - - outstruct.Index = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.Submitter = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - outstruct.StartTime = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.EndTime = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.EndBlock = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - - return *outstruct, err - -} - -// RollupEpochs is a free data retrieval call binding the contract method 0xa24231e8. -// -// Solidity: function rollupEpochs(uint256 rollupEpochIndex) view returns(uint256 index, address submitter, uint256 startTime, uint256 endTime, uint256 endBlock) -func (_Record *RecordSession) RollupEpochs(rollupEpochIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int -}, error) { - return _Record.Contract.RollupEpochs(&_Record.CallOpts, rollupEpochIndex) -} - -// RollupEpochs is a free data retrieval call binding the contract method 0xa24231e8. -// -// Solidity: function rollupEpochs(uint256 rollupEpochIndex) view returns(uint256 index, address submitter, uint256 startTime, uint256 endTime, uint256 endBlock) -func (_Record *RecordCallerSession) RollupEpochs(rollupEpochIndex *big.Int) (struct { - Index *big.Int - Submitter common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int -}, error) { - return _Record.Contract.RollupEpochs(&_Record.CallOpts, rollupEpochIndex) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address _owner, address _oracle, uint256 _nextBatchSubmissionIndex) returns() -func (_Record *RecordTransactor) Initialize(opts *bind.TransactOpts, _owner common.Address, _oracle common.Address, _nextBatchSubmissionIndex *big.Int) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "initialize", _owner, _oracle, _nextBatchSubmissionIndex) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address _owner, address _oracle, uint256 _nextBatchSubmissionIndex) returns() -func (_Record *RecordSession) Initialize(_owner common.Address, _oracle common.Address, _nextBatchSubmissionIndex *big.Int) (*types.Transaction, error) { - return _Record.Contract.Initialize(&_Record.TransactOpts, _owner, _oracle, _nextBatchSubmissionIndex) -} - -// Initialize is a paid mutator transaction binding the contract method 0x1794bb3c. -// -// Solidity: function initialize(address _owner, address _oracle, uint256 _nextBatchSubmissionIndex) returns() -func (_Record *RecordTransactorSession) Initialize(_owner common.Address, _oracle common.Address, _nextBatchSubmissionIndex *big.Int) (*types.Transaction, error) { - return _Record.Contract.Initialize(&_Record.TransactOpts, _owner, _oracle, _nextBatchSubmissionIndex) -} - -// RecordFinalizedBatchSubmissions is a paid mutator transaction binding the contract method 0x41ed047f. -// -// Solidity: function recordFinalizedBatchSubmissions((uint256,address,uint256,uint256,uint256,uint256)[] _batchSubmissions) returns() -func (_Record *RecordTransactor) RecordFinalizedBatchSubmissions(opts *bind.TransactOpts, _batchSubmissions []IRecordBatchSubmission) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "recordFinalizedBatchSubmissions", _batchSubmissions) -} - -// RecordFinalizedBatchSubmissions is a paid mutator transaction binding the contract method 0x41ed047f. -// -// Solidity: function recordFinalizedBatchSubmissions((uint256,address,uint256,uint256,uint256,uint256)[] _batchSubmissions) returns() -func (_Record *RecordSession) RecordFinalizedBatchSubmissions(_batchSubmissions []IRecordBatchSubmission) (*types.Transaction, error) { - return _Record.Contract.RecordFinalizedBatchSubmissions(&_Record.TransactOpts, _batchSubmissions) -} - -// RecordFinalizedBatchSubmissions is a paid mutator transaction binding the contract method 0x41ed047f. -// -// Solidity: function recordFinalizedBatchSubmissions((uint256,address,uint256,uint256,uint256,uint256)[] _batchSubmissions) returns() -func (_Record *RecordTransactorSession) RecordFinalizedBatchSubmissions(_batchSubmissions []IRecordBatchSubmission) (*types.Transaction, error) { - return _Record.Contract.RecordFinalizedBatchSubmissions(&_Record.TransactOpts, _batchSubmissions) -} - -// RecordRewardEpochs is a paid mutator transaction binding the contract method 0x6ea0396e. -// -// Solidity: function recordRewardEpochs((uint256,uint256,address[],uint256[],uint256[],uint256[])[] _rewardEpochs) returns() -func (_Record *RecordTransactor) RecordRewardEpochs(opts *bind.TransactOpts, _rewardEpochs []IRecordRewardEpochInfo) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "recordRewardEpochs", _rewardEpochs) -} - -// RecordRewardEpochs is a paid mutator transaction binding the contract method 0x6ea0396e. -// -// Solidity: function recordRewardEpochs((uint256,uint256,address[],uint256[],uint256[],uint256[])[] _rewardEpochs) returns() -func (_Record *RecordSession) RecordRewardEpochs(_rewardEpochs []IRecordRewardEpochInfo) (*types.Transaction, error) { - return _Record.Contract.RecordRewardEpochs(&_Record.TransactOpts, _rewardEpochs) -} - -// RecordRewardEpochs is a paid mutator transaction binding the contract method 0x6ea0396e. -// -// Solidity: function recordRewardEpochs((uint256,uint256,address[],uint256[],uint256[],uint256[])[] _rewardEpochs) returns() -func (_Record *RecordTransactorSession) RecordRewardEpochs(_rewardEpochs []IRecordRewardEpochInfo) (*types.Transaction, error) { - return _Record.Contract.RecordRewardEpochs(&_Record.TransactOpts, _rewardEpochs) -} - -// RecordRollupEpochs is a paid mutator transaction binding the contract method 0xfe49dbc9. -// -// Solidity: function recordRollupEpochs((uint256,address,uint256,uint256,uint256)[] _rollupEpochs) returns() -func (_Record *RecordTransactor) RecordRollupEpochs(opts *bind.TransactOpts, _rollupEpochs []IRecordRollupEpochInfo) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "recordRollupEpochs", _rollupEpochs) -} - -// RecordRollupEpochs is a paid mutator transaction binding the contract method 0xfe49dbc9. -// -// Solidity: function recordRollupEpochs((uint256,address,uint256,uint256,uint256)[] _rollupEpochs) returns() -func (_Record *RecordSession) RecordRollupEpochs(_rollupEpochs []IRecordRollupEpochInfo) (*types.Transaction, error) { - return _Record.Contract.RecordRollupEpochs(&_Record.TransactOpts, _rollupEpochs) -} - -// RecordRollupEpochs is a paid mutator transaction binding the contract method 0xfe49dbc9. -// -// Solidity: function recordRollupEpochs((uint256,address,uint256,uint256,uint256)[] _rollupEpochs) returns() -func (_Record *RecordTransactorSession) RecordRollupEpochs(_rollupEpochs []IRecordRollupEpochInfo) (*types.Transaction, error) { - return _Record.Contract.RecordRollupEpochs(&_Record.TransactOpts, _rollupEpochs) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Record *RecordTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Record *RecordSession) RenounceOwnership() (*types.Transaction, error) { - return _Record.Contract.RenounceOwnership(&_Record.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_Record *RecordTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _Record.Contract.RenounceOwnership(&_Record.TransactOpts) -} - -// SetLatestRewardEpochBlock is a paid mutator transaction binding the contract method 0x10c9873f. -// -// Solidity: function setLatestRewardEpochBlock(uint256 _latestBlock) returns() -func (_Record *RecordTransactor) SetLatestRewardEpochBlock(opts *bind.TransactOpts, _latestBlock *big.Int) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "setLatestRewardEpochBlock", _latestBlock) -} - -// SetLatestRewardEpochBlock is a paid mutator transaction binding the contract method 0x10c9873f. -// -// Solidity: function setLatestRewardEpochBlock(uint256 _latestBlock) returns() -func (_Record *RecordSession) SetLatestRewardEpochBlock(_latestBlock *big.Int) (*types.Transaction, error) { - return _Record.Contract.SetLatestRewardEpochBlock(&_Record.TransactOpts, _latestBlock) -} - -// SetLatestRewardEpochBlock is a paid mutator transaction binding the contract method 0x10c9873f. -// -// Solidity: function setLatestRewardEpochBlock(uint256 _latestBlock) returns() -func (_Record *RecordTransactorSession) SetLatestRewardEpochBlock(_latestBlock *big.Int) (*types.Transaction, error) { - return _Record.Contract.SetLatestRewardEpochBlock(&_Record.TransactOpts, _latestBlock) -} - -// SetOracleAddress is a paid mutator transaction binding the contract method 0x4c69c00f. -// -// Solidity: function setOracleAddress(address _oracle) returns() -func (_Record *RecordTransactor) SetOracleAddress(opts *bind.TransactOpts, _oracle common.Address) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "setOracleAddress", _oracle) -} - -// SetOracleAddress is a paid mutator transaction binding the contract method 0x4c69c00f. -// -// Solidity: function setOracleAddress(address _oracle) returns() -func (_Record *RecordSession) SetOracleAddress(_oracle common.Address) (*types.Transaction, error) { - return _Record.Contract.SetOracleAddress(&_Record.TransactOpts, _oracle) -} - -// SetOracleAddress is a paid mutator transaction binding the contract method 0x4c69c00f. -// -// Solidity: function setOracleAddress(address _oracle) returns() -func (_Record *RecordTransactorSession) SetOracleAddress(_oracle common.Address) (*types.Transaction, error) { - return _Record.Contract.SetOracleAddress(&_Record.TransactOpts, _oracle) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Record *RecordTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Record.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Record *RecordSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Record.Contract.TransferOwnership(&_Record.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Record *RecordTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Record.Contract.TransferOwnership(&_Record.TransactOpts, newOwner) -} - -// RecordBatchSubmissionsUploadedIterator is returned from FilterBatchSubmissionsUploaded and is used to iterate over the raw logs and unpacked data for BatchSubmissionsUploaded events raised by the Record contract. -type RecordBatchSubmissionsUploadedIterator struct { - Event *RecordBatchSubmissionsUploaded // 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 *RecordBatchSubmissionsUploadedIterator) 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(RecordBatchSubmissionsUploaded) - 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(RecordBatchSubmissionsUploaded) - 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 *RecordBatchSubmissionsUploadedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *RecordBatchSubmissionsUploadedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// RecordBatchSubmissionsUploaded represents a BatchSubmissionsUploaded event raised by the Record contract. -type RecordBatchSubmissionsUploaded struct { - StartIndex *big.Int - DataLength *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBatchSubmissionsUploaded is a free log retrieval operation binding the contract event 0x1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e. -// -// Solidity: event BatchSubmissionsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) FilterBatchSubmissionsUploaded(opts *bind.FilterOpts, startIndex []*big.Int) (*RecordBatchSubmissionsUploadedIterator, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.FilterLogs(opts, "BatchSubmissionsUploaded", startIndexRule) - if err != nil { - return nil, err - } - return &RecordBatchSubmissionsUploadedIterator{contract: _Record.contract, event: "BatchSubmissionsUploaded", logs: logs, sub: sub}, nil -} - -// WatchBatchSubmissionsUploaded is a free log subscription operation binding the contract event 0x1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e. -// -// Solidity: event BatchSubmissionsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) WatchBatchSubmissionsUploaded(opts *bind.WatchOpts, sink chan<- *RecordBatchSubmissionsUploaded, startIndex []*big.Int) (event.Subscription, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.WatchLogs(opts, "BatchSubmissionsUploaded", startIndexRule) - 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(RecordBatchSubmissionsUploaded) - if err := _Record.contract.UnpackLog(event, "BatchSubmissionsUploaded", 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 -} - -// ParseBatchSubmissionsUploaded is a log parse operation binding the contract event 0x1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e. -// -// Solidity: event BatchSubmissionsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) ParseBatchSubmissionsUploaded(log types.Log) (*RecordBatchSubmissionsUploaded, error) { - event := new(RecordBatchSubmissionsUploaded) - if err := _Record.contract.UnpackLog(event, "BatchSubmissionsUploaded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// RecordInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Record contract. -type RecordInitializedIterator struct { - Event *RecordInitialized // 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 *RecordInitializedIterator) 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(RecordInitialized) - 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(RecordInitialized) - 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 *RecordInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *RecordInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// RecordInitialized represents a Initialized event raised by the Record contract. -type RecordInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Record *RecordFilterer) FilterInitialized(opts *bind.FilterOpts) (*RecordInitializedIterator, error) { - - logs, sub, err := _Record.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &RecordInitializedIterator{contract: _Record.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Record *RecordFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *RecordInitialized) (event.Subscription, error) { - - logs, sub, err := _Record.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(RecordInitialized) - if err := _Record.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_Record *RecordFilterer) ParseInitialized(log types.Log) (*RecordInitialized, error) { - event := new(RecordInitialized) - if err := _Record.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// RecordOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Record contract. -type RecordOwnershipTransferredIterator struct { - Event *RecordOwnershipTransferred // 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 *RecordOwnershipTransferredIterator) 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(RecordOwnershipTransferred) - 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(RecordOwnershipTransferred) - 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 *RecordOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *RecordOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// RecordOwnershipTransferred represents a OwnershipTransferred event raised by the Record contract. -type RecordOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Record *RecordFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*RecordOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Record.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &RecordOwnershipTransferredIterator{contract: _Record.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Record *RecordFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RecordOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Record.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(RecordOwnershipTransferred) - if err := _Record.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Record *RecordFilterer) ParseOwnershipTransferred(log types.Log) (*RecordOwnershipTransferred, error) { - event := new(RecordOwnershipTransferred) - if err := _Record.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// RecordRewardEpochsUploadedIterator is returned from FilterRewardEpochsUploaded and is used to iterate over the raw logs and unpacked data for RewardEpochsUploaded events raised by the Record contract. -type RecordRewardEpochsUploadedIterator struct { - Event *RecordRewardEpochsUploaded // 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 *RecordRewardEpochsUploadedIterator) 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(RecordRewardEpochsUploaded) - 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(RecordRewardEpochsUploaded) - 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 *RecordRewardEpochsUploadedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *RecordRewardEpochsUploadedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// RecordRewardEpochsUploaded represents a RewardEpochsUploaded event raised by the Record contract. -type RecordRewardEpochsUploaded struct { - StartIndex *big.Int - DataLength *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRewardEpochsUploaded is a free log retrieval operation binding the contract event 0x4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea. -// -// Solidity: event RewardEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) FilterRewardEpochsUploaded(opts *bind.FilterOpts, startIndex []*big.Int) (*RecordRewardEpochsUploadedIterator, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.FilterLogs(opts, "RewardEpochsUploaded", startIndexRule) - if err != nil { - return nil, err - } - return &RecordRewardEpochsUploadedIterator{contract: _Record.contract, event: "RewardEpochsUploaded", logs: logs, sub: sub}, nil -} - -// WatchRewardEpochsUploaded is a free log subscription operation binding the contract event 0x4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea. -// -// Solidity: event RewardEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) WatchRewardEpochsUploaded(opts *bind.WatchOpts, sink chan<- *RecordRewardEpochsUploaded, startIndex []*big.Int) (event.Subscription, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.WatchLogs(opts, "RewardEpochsUploaded", startIndexRule) - 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(RecordRewardEpochsUploaded) - if err := _Record.contract.UnpackLog(event, "RewardEpochsUploaded", 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 -} - -// ParseRewardEpochsUploaded is a log parse operation binding the contract event 0x4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea. -// -// Solidity: event RewardEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) ParseRewardEpochsUploaded(log types.Log) (*RecordRewardEpochsUploaded, error) { - event := new(RecordRewardEpochsUploaded) - if err := _Record.contract.UnpackLog(event, "RewardEpochsUploaded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// RecordRollupEpochsUploadedIterator is returned from FilterRollupEpochsUploaded and is used to iterate over the raw logs and unpacked data for RollupEpochsUploaded events raised by the Record contract. -type RecordRollupEpochsUploadedIterator struct { - Event *RecordRollupEpochsUploaded // 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 *RecordRollupEpochsUploadedIterator) 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(RecordRollupEpochsUploaded) - 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(RecordRollupEpochsUploaded) - 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 *RecordRollupEpochsUploadedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *RecordRollupEpochsUploadedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// RecordRollupEpochsUploaded represents a RollupEpochsUploaded event raised by the Record contract. -type RecordRollupEpochsUploaded struct { - StartIndex *big.Int - DataLength *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRollupEpochsUploaded is a free log retrieval operation binding the contract event 0x0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed2992929. -// -// Solidity: event RollupEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) FilterRollupEpochsUploaded(opts *bind.FilterOpts, startIndex []*big.Int) (*RecordRollupEpochsUploadedIterator, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.FilterLogs(opts, "RollupEpochsUploaded", startIndexRule) - if err != nil { - return nil, err - } - return &RecordRollupEpochsUploadedIterator{contract: _Record.contract, event: "RollupEpochsUploaded", logs: logs, sub: sub}, nil -} - -// WatchRollupEpochsUploaded is a free log subscription operation binding the contract event 0x0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed2992929. -// -// Solidity: event RollupEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) WatchRollupEpochsUploaded(opts *bind.WatchOpts, sink chan<- *RecordRollupEpochsUploaded, startIndex []*big.Int) (event.Subscription, error) { - - var startIndexRule []interface{} - for _, startIndexItem := range startIndex { - startIndexRule = append(startIndexRule, startIndexItem) - } - - logs, sub, err := _Record.contract.WatchLogs(opts, "RollupEpochsUploaded", startIndexRule) - 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(RecordRollupEpochsUploaded) - if err := _Record.contract.UnpackLog(event, "RollupEpochsUploaded", 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 -} - -// ParseRollupEpochsUploaded is a log parse operation binding the contract event 0x0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed2992929. -// -// Solidity: event RollupEpochsUploaded(uint256 indexed startIndex, uint256 dataLength) -func (_Record *RecordFilterer) ParseRollupEpochsUploaded(log types.Log) (*RecordRollupEpochsUploaded, error) { - event := new(RecordRollupEpochsUploaded) - if err := _Record.contract.UnpackLog(event, "RollupEpochsUploaded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/bindings/bindings/record_more.go b/bindings/bindings/record_more.go deleted file mode 100644 index 785e2a0cb..000000000 --- a/bindings/bindings/record_more.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "encoding/json" - - "morph-l2/bindings/solc" -) - -const RecordStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"_initialized\",\"offset\":0,\"slot\":\"0\",\"type\":\"t_uint8\"},{\"astId\":1001,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"_initializing\",\"offset\":1,\"slot\":\"0\",\"type\":\"t_bool\"},{\"astId\":1002,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"1\",\"type\":\"t_array(t_uint256)1014_storage\"},{\"astId\":1003,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"_owner\",\"offset\":0,\"slot\":\"51\",\"type\":\"t_address\"},{\"astId\":1004,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"__gap\",\"offset\":0,\"slot\":\"52\",\"type\":\"t_array(t_uint256)1013_storage\"},{\"astId\":1005,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"oracle\",\"offset\":0,\"slot\":\"101\",\"type\":\"t_address\"},{\"astId\":1006,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"batchSubmissions\",\"offset\":0,\"slot\":\"102\",\"type\":\"t_mapping(t_uint256,t_struct(BatchSubmission)1015_storage)\"},{\"astId\":1007,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"rollupEpochs\",\"offset\":0,\"slot\":\"103\",\"type\":\"t_mapping(t_uint256,t_struct(RollupEpochInfo)1017_storage)\"},{\"astId\":1008,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"rewardEpochs\",\"offset\":0,\"slot\":\"104\",\"type\":\"t_mapping(t_uint256,t_struct(RewardEpochInfo)1016_storage)\"},{\"astId\":1009,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"nextBatchSubmissionIndex\",\"offset\":0,\"slot\":\"105\",\"type\":\"t_uint256\"},{\"astId\":1010,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"nextRollupEpochIndex\",\"offset\":0,\"slot\":\"106\",\"type\":\"t_uint256\"},{\"astId\":1011,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"nextRewardEpochIndex\",\"offset\":0,\"slot\":\"107\",\"type\":\"t_uint256\"},{\"astId\":1012,\"contract\":\"contracts/l2/staking/Record.sol:Record\",\"label\":\"latestRewardEpochBlock\",\"offset\":0,\"slot\":\"108\",\"type\":\"t_uint256\"}],\"types\":{\"t_address\":{\"encoding\":\"inplace\",\"label\":\"address\",\"numberOfBytes\":\"20\"},\"t_array(t_address)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"address[]\",\"numberOfBytes\":\"32\"},\"t_array(t_uint256)1013_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[49]\",\"numberOfBytes\":\"1568\"},\"t_array(t_uint256)1014_storage\":{\"encoding\":\"inplace\",\"label\":\"uint256[50]\",\"numberOfBytes\":\"1600\"},\"t_array(t_uint256)dyn_storage\":{\"encoding\":\"dynamic_array\",\"label\":\"uint256[]\",\"numberOfBytes\":\"32\"},\"t_bool\":{\"encoding\":\"inplace\",\"label\":\"bool\",\"numberOfBytes\":\"1\"},\"t_mapping(t_uint256,t_struct(BatchSubmission)1015_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IRecord.BatchSubmission)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(BatchSubmission)1015_storage\"},\"t_mapping(t_uint256,t_struct(RewardEpochInfo)1016_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IRecord.RewardEpochInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(RewardEpochInfo)1016_storage\"},\"t_mapping(t_uint256,t_struct(RollupEpochInfo)1017_storage)\":{\"encoding\":\"mapping\",\"label\":\"mapping(uint256 =\u003e struct IRecord.RollupEpochInfo)\",\"numberOfBytes\":\"32\",\"key\":\"t_uint256\",\"value\":\"t_struct(RollupEpochInfo)1017_storage\"},\"t_struct(BatchSubmission)1015_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IRecord.BatchSubmission\",\"numberOfBytes\":\"192\"},\"t_struct(RewardEpochInfo)1016_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IRecord.RewardEpochInfo\",\"numberOfBytes\":\"192\"},\"t_struct(RollupEpochInfo)1017_storage\":{\"encoding\":\"inplace\",\"label\":\"struct IRecord.RollupEpochInfo\",\"numberOfBytes\":\"160\"},\"t_uint256\":{\"encoding\":\"inplace\",\"label\":\"uint256\",\"numberOfBytes\":\"32\"},\"t_uint8\":{\"encoding\":\"inplace\",\"label\":\"uint8\",\"numberOfBytes\":\"1\"}}}" - -var RecordStorageLayout = new(solc.StorageLayout) - -var RecordDeployedBin = "0x608060405234801561000f575f80fd5b506004361061019a575f3560e01c8063715018a6116100e85780638e21d5fb11610093578063cb6293e81161006e578063cb6293e8146104e3578063d557714114610503578063f2fde38b1461052a578063fe49dbc91461053d575f80fd5b80638e21d5fb146103f1578063a24231e814610418578063a795f409146104a8575f80fd5b80637dc0d1d0116100c35780637dc0d1d01461038c578063807de443146103ac5780638da5cb5b146103d3575f80fd5b8063715018a6146102c25780637828a905146102ca57806378f908e1146102f1575f80fd5b806341ed047f116101485780634e3ca406116101235780634e3ca4061461026f57806364b4abe31461028f5780636ea0396e146102af575f80fd5b806341ed047f14610240578063484f8d0f146102535780634c69c00f1461025c575f80fd5b80631794bb3c116101785780631794bb3c146101d85780632fbf6487146101eb5780633d9353fe146101f4575f80fd5b80630776c0f71461019e57806310c9873f146101ba5780631511e1b1146101cf575b5f80fd5b6101a7606c5481565b6040519081526020015b60405180910390f35b6101cd6101c8366004612891565b610550565b005b6101a760695481565b6101cd6101e63660046128d0565b6106c4565b6101a7606b5481565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101b1565b6101cd61024e366004612909565b610a22565b6101a7606a5481565b6101cd61026a366004612978565b610daf565b61028261027d366004612998565b610e7b565b6040516101b191906129b8565b6102a261029d366004612998565b61102d565b6040516101b19190612a3b565b6101cd6102bd366004612abb565b6111e8565b6101cd611fd4565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61034a6102ff366004612891565b60666020525f9081526040902080546001820154600283015460038401546004850154600590950154939473ffffffffffffffffffffffffffffffffffffffff909316939192909186565b6040805196875273ffffffffffffffffffffffffffffffffffffffff9095166020870152938501929092526060840152608083015260a082015260c0016101b1565b60655461021b9073ffffffffffffffffffffffffffffffffffffffff1681565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b60335473ffffffffffffffffffffffffffffffffffffffff1661021b565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b61046b610426366004612891565b60676020525f908152604090208054600182015460028301546003840154600490940154929373ffffffffffffffffffffffffffffffffffffffff9092169290919085565b6040805195865273ffffffffffffffffffffffffffffffffffffffff9094166020860152928401919091526060830152608082015260a0016101b1565b6104ce6104b6366004612891565b60686020525f90815260409020805460019091015482565b604080519283526020830191909152016101b1565b6104f66104f1366004612998565b611fe7565b6040516101b19190612b52565b61021b7f000000000000000000000000000000000000000000000000000000000000000081565b6101cd610538366004612978565b6122b5565b6101cd61054b366004612c80565b61236c565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064015b60405180910390fd5b606c5415610656576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f616c72656164792073657400000000000000000000000000000000000000000060448201526064016105e3565b5f81116106bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f696e76616c6964206c617465737420626c6f636b00000000000000000000000060448201526064016105e3565b606c55565b5f54610100900460ff16158080156106e257505f54600160ff909116105b806106fb5750303b1580156106fb57505f5460ff166001145b610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105e3565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156107e3575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8416610860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c6964206f776e65722061646472657373000000000000000000000060448201526064016105e3565b815f036108ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f696e76616c6964206e657874206261746368207375626d697373696f6e20696e60448201527f646578000000000000000000000000000000000000000000000000000000000060648201526084016105e3565b73ffffffffffffffffffffffffffffffffffffffff831661096c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105e3565b610975846126c5565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff851617905560698290558015610a1c575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ab9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105e3565b80610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f656d707479206261746368207375626d697373696f6e7300000000000000000060448201526064016105e3565b5f5b81811015610d5b5780606954610b389190612d0a565b838383818110610b4a57610b4a612d23565b905060c002015f013514610bba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105e3565b6040518060c00160405280848484818110610bd757610bd7612d23565b905060c002015f01358152602001848484818110610bf757610bf7612d23565b905060c002016020016020810190610c0f9190612978565b73ffffffffffffffffffffffffffffffffffffffff168152602001848484818110610c3c57610c3c612d23565b905060c00201604001358152602001848484818110610c5d57610c5d612d23565b905060c00201606001358152602001848484818110610c7e57610c7e612d23565b905060c00201608001358152602001848484818110610c9f57610c9f612d23565b905060c0020160a0013581525060665f858585818110610cc157610cc1612d23565b60c002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155908301516002830155606083015160038301556080830151600483015560a09092015160059091015501610b22565b506069546040518281527f1c517c9850aa84483b0b2434e58bab4c7967f0b1a34d8b18a6ad22436add010e9060200160405180910390a28181905060695f828254610da69190612d0a565b90915550505050565b610db761273b565b73ffffffffffffffffffffffffffffffffffffffff8116610e34576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f696e76616c6964206f7261636c6520616464726573730000000000000000000060448201526064016105e3565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606082821015610ee7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105e3565b610ef18383612d50565b610efc906001612d0a565b67ffffffffffffffff811115610f1457610f14612d63565b604051908082528060200260200182016040528015610f8857816020015b610f756040518060a001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81525090565b815260200190600190039081610f325790505b509050825b828111611026575f81815260676020908152604091829020825160a08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff1692810192909252600281015492820192909252600382015460608201526004909101546080820152825183908390811061100857611008612d23565b6020026020010181905250808061101e90612d90565b915050610f8d565b5092915050565b606082821015611099576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105e3565b6110a38383612d50565b6110ae906001612d0a565b67ffffffffffffffff8111156110c6576110c6612d63565b60405190808252806020026020018201604052801561114057816020015b61112d6040518060c001604052805f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f81525090565b8152602001906001900390816110e45790505b509050825b828111611026575f81815260666020908152604091829020825160c08101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff1692810192909252600281015492820192909252600382015460608201526004820154608082015260059091015460a082015282518390839081106111ca576111ca612d23565b602002602001018190525080806111e090612d90565b915050611145565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461127f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105e3565b806112e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f656d707479207265776172642065706f6368730000000000000000000000000060448201526064016105e3565b5f606c5411611351576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f737461727420626c6f636b2073686f756c64206265207365740000000000000060448201526064016105e3565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663766718086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113de9190612dc7565b606b546001906113ef908490612d0a565b6113f99190612d50565b10611485576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f756e66696e69736865642065706f6368732063616e6e6f742062652075706c6f60448201527f616465640000000000000000000000000000000000000000000000000000000060648201526084016105e3565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a29bfb2c600184849050606b546114d49190612d0a565b6114de9190612d50565b6040518263ffffffff1660e01b81526004016114fc91815260200190565b5f604051808303815f87803b158015611513575f80fd5b505af1158015611525573d5f803e3d5ffd5b505f9250829150505b82811015611f69575f84848381811061154957611549612d23565b905060200281019061155b9190612dde565b611569906040810190612e1a565b905090505f85858481811061158057611580612d23565b90506020028101906115929190612dde565b606b54903591506115a4908490612d0a565b811461160c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642065706f636820696e6465780000000000000000000000000060448201526064016105e3565b8186868581811061161f5761161f612d23565b90506020028101906116319190612dde565b61163f906060810190612e1a565b905014801561168057508186868581811061165c5761165c612d23565b905060200281019061166e9190612dde565b61167c906080810190612e1a565b9050145b80156116be57508186868581811061169a5761169a612d23565b90506020028101906116ac9190612dde565b6116ba9060a0810190612e1a565b9050145b611724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642064617461206c656e6774680000000000000000000000000060448201526064016105e3565b85858481811061173657611736612d23565b90506020028101906117489190612dde565b611756906020013585612d0a565b93506040518060c0016040528082815260200187878681811061177b5761177b612d23565b905060200281019061178d9190612dde565b6020013581526020018787868181106117a8576117a8612d23565b90506020028101906117ba9190612dde565b6117c8906040810190612e1a565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061181057611810612d23565b90506020028101906118229190612dde565b611830906060810190612e1a565b808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050509082525060200187878681811061187857611878612d23565b905060200281019061188a9190612dde565b611898906080810190612e1a565b808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152505050908252506020018787868181106118e0576118e0612d23565b90506020028101906118f29190612dde565b6119009060a0810190612e1a565b808060200260200160405190810160405280939291908181526020018383602002808284375f920182905250939094525050838152606860209081526040918290208451815584820151600182015591840151805192935061196b92600285019291909101906127bc565b5060608201518051611987916003840191602090910190612844565b50608082015180516119a3916004840191602090910190612844565b5060a082015180516119bf916005840191602090910190612844565b50506040517f944fa746000000000000000000000000000000000000000000000000000000008152600481018390525f91507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063944fa74690602401602060405180830381865afa158015611a4d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a719190612dc7565b90505f805f8567ffffffffffffffff811115611a8f57611a8f612d63565b604051908082528060200260200182016040528015611ab8578160200160208202803683370190505b5090505f8667ffffffffffffffff811115611ad557611ad5612d63565b604051908082528060200260200182016040528015611afe578160200160208202803683370190505b5090505f5b87811015611d995760148c8c8b818110611b1f57611b1f612d23565b9050602002810190611b319190612dde565b611b3f9060a0810190612e1a565b83818110611b4f57611b4f612d23565b905060200201351115611bbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f696e76616c69642073657175656e6365727320636f6d6d697373696f6e00000060448201526064016105e3565b8b8b8a818110611bd057611bd0612d23565b9050602002810190611be29190612dde565b611bf0906080810190612e1a565b82818110611c0057611c00612d23565b9050602002013584611c129190612d0a565b93508b8b8a818110611c2657611c26612d23565b9050602002810190611c389190612dde565b611c46906060810190612e1a565b82818110611c5657611c56612d23565b9050602002013585611c689190612d0a565b94505f6305f5e1008d8d8c818110611c8257611c82612d23565b9050602002810190611c949190612dde565b611ca2906080810190612e1a565b84818110611cb257611cb2612d23565b9050602002013588611cc49190612e85565b611cce9190612e9c565b905060648d8d8c818110611ce457611ce4612d23565b9050602002810190611cf69190612dde565b611d049060a0810190612e1a565b84818110611d1457611d14612d23565b9050602002013582611d269190612e85565b611d309190612e9c565b838381518110611d4257611d42612d23565b602002602001018181525050828281518110611d6057611d60612d23565b602002602001015181611d739190612d50565b848381518110611d8557611d85612d23565b602090810291909101015250600101611b03565b508a8a89818110611dac57611dac612d23565b9050602002810190611dbe9190612dde565b602001358414611e2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f696e76616c69642073657175656e6365727320626c6f636b730000000000000060448201526064016105e3565b6305f5e100831115611e98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f696e76616c69642073657175656e6365727320726174696f730000000000000060448201526064016105e3565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cdd0c50e878d8d8c818110611ee757611ee7612d23565b9050602002810190611ef99190612dde565b611f07906040810190612e1a565b86866040518663ffffffff1660e01b8152600401611f29959493929190612ed4565b5f604051808303815f87803b158015611f40575f80fd5b505af1158015611f52573d5f803e3d5ffd5b50506001909901985061152e975050505050505050565b50606b546040518381527f4aa68efd05426e59a9d43654a55a2a74c3e8840894d6e291f8f83085e3a6d1ea9060200160405180910390a280606c5f828254611fb19190612d0a565b9091555050606b80548391905f90611fca908490612d0a565b9091555050505050565b611fdc61273b565b611fe55f6126c5565b565b606082821015612053576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105e3565b61205d8383612d50565b612068906001612d0a565b67ffffffffffffffff81111561208057612080612d63565b6040519080825280602002602001820160405280156120e857816020015b6120d56040518060c001604052805f81526020015f8152602001606081526020016060815260200160608152602001606081525090565b81526020019060019003908161209e5790505b509050825b828111611026575f81815260686020908152604091829020825160c081018452815481526001820154818401526002820180548551818602810186018752818152929593949386019383018282801561217a57602002820191905f5260205f20905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161214f575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156121d057602002820191905f5260205f20905b8154815260200190600101908083116121bc575b505050505081526020016004820180548060200260200160405190810160405280929190818152602001828054801561222657602002820191905f5260205f20905b815481526020019060010190808311612212575b505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561227c57602002820191905f5260205f20905b815481526020019060010190808311612268575b50505050508152505082828151811061229757612297612d23565b602002602001018190525080806122ad90612d90565b9150506120ed565b6122bd61273b565b73ffffffffffffffffffffffffffffffffffffffff8116612360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105e3565b612369816126c5565b50565b60655473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612403576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6f6e6c79206f7261636c6520616c6c6f7765640000000000000000000000000060448201526064016105e3565b8061246a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f656d70747920726f6c6c75702065706f6368730000000000000000000000000060448201526064016105e3565b5f5b8181101561267a5780606a546124829190612d0a565b83838381811061249457612494612d23565b905060a002015f013514612504576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f696e76616c696420696e6465780000000000000000000000000000000000000060448201526064016105e3565b6040518060a0016040528084848481811061252157612521612d23565b905060a002015f0135815260200184848481811061254157612541612d23565b905060a0020160200160208101906125599190612978565b73ffffffffffffffffffffffffffffffffffffffff16815260200184848481811061258657612586612d23565b905060a002016040013581526020018484848181106125a7576125a7612d23565b905060a002016060013581526020018484848181106125c8576125c8612d23565b905060a002016080013581525060675f8585858181106125ea576125ea612d23565b60a002919091013582525060208082019290925260409081015f208351815591830151600180840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90931692909217909155908301516002830155606083015160038301556080909201516004909101550161246c565b50606a546040518281527f0c53377f3eed25c9883c67adabc3f817b4fdcde29f550a6a26c0676ed29929299060200160405180910390a281819050606a5f828254610da69190612d0a565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611fe5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e3565b828054828255905f5260205f20908101928215612834579160200282015b8281111561283457825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9091161782556020909201916001909101906127da565b5061284092915061287d565b5090565b828054828255905f5260205f20908101928215612834579160200282015b82811115612834578251825591602001919060010190612862565b5b80821115612840575f815560010161287e565b5f602082840312156128a1575f80fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146128cb575f80fd5b919050565b5f805f606084860312156128e2575f80fd5b6128eb846128a8565b92506128f9602085016128a8565b9150604084013590509250925092565b5f806020838503121561291a575f80fd5b823567ffffffffffffffff80821115612931575f80fd5b818501915085601f830112612944575f80fd5b813581811115612952575f80fd5b86602060c083028501011115612966575f80fd5b60209290920196919550909350505050565b5f60208284031215612988575f80fd5b612991826128a8565b9392505050565b5f80604083850312156129a9575f80fd5b50508035926020909101359150565b602080825282518282018190525f919060409081850190868401855b82811015612a2e578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016129d4565b5091979650505050505050565b602080825282518282018190525f919060409081850190868401855b82811015612a2e578151805185528681015173ffffffffffffffffffffffffffffffffffffffff16878601528581015186860152606080820151908601526080808201519086015260a0908101519085015260c09093019290850190600101612a57565b5f8060208385031215612acc575f80fd5b823567ffffffffffffffff80821115612ae3575f80fd5b818501915085601f830112612af6575f80fd5b813581811115612b04575f80fd5b8660208260051b8501011115612966575f80fd5b5f815180845260208085019450602084015f5b83811015612b4757815187529582019590820190600101612b2b565b509495945050505050565b5f60208083018184528085518083526040925060408601915060408160051b8701018488015f5b83811015612c72578883037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc001855281518051845287810151888501528681015160c0888601819052815190860181905260e08601918a01905f905b80821015612c0b57825173ffffffffffffffffffffffffffffffffffffffff168452928b0192918b019160019190910190612bd5565b50505060608083015186830382880152612c258382612b18565b9250505060808083015186830382880152612c408382612b18565b9250505060a08083015192508582038187015250612c5e8183612b18565b968901969450505090860190600101612b79565b509098975050505050505050565b5f8060208385031215612c91575f80fd5b823567ffffffffffffffff80821115612ca8575f80fd5b818501915085601f830112612cbb575f80fd5b813581811115612cc9575f80fd5b86602060a083028501011115612966575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b80820180821115612d1d57612d1d612cdd565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b81810381811115612d1d57612d1d612cdd565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612dc057612dc0612cdd565b5060010190565b5f60208284031215612dd7575f80fd5b5051919050565b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612e10575f80fd5b9190910192915050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612e4d575f80fd5b83018035915067ffffffffffffffff821115612e67575f80fd5b6020019150600581901b3603821315612e7e575f80fd5b9250929050565b8082028115828204841417612d1d57612d1d612cdd565b5f82612ecf577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b858152608060208083018290529082018590525f90869060a08401835b88811015612f2a5773ffffffffffffffffffffffffffffffffffffffff612f17856128a8565b1682529282019290820190600101612ef1565b508481036040860152612f3d8188612b18565b925050508281036060840152612f538185612b18565b9897505050505050505056fea164736f6c6343000818000a" - -func init() { - if err := json.Unmarshal([]byte(RecordStorageLayoutJSON), RecordStorageLayout); err != nil { - panic(err) - } - - layouts["Record"] = RecordStorageLayout - deployedBytecodes["Record"] = RecordDeployedBin -} diff --git a/bindings/go.mod b/bindings/go.mod index c6e19ebc2..93a17dc2c 100644 --- a/bindings/go.mod +++ b/bindings/go.mod @@ -4,7 +4,7 @@ go 1.22 replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 -require github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de +require github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 require ( github.com/VictoriaMetrics/fastcache v1.12.2 // indirect diff --git a/bindings/go.sum b/bindings/go.sum index 8341ef8c7..c06ce4071 100644 --- a/bindings/go.sum +++ b/bindings/go.sum @@ -109,8 +109,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= diff --git a/bindings/predeploys/addresses.go b/bindings/predeploys/addresses.go index dc8a1b39b..469e51c76 100644 --- a/bindings/predeploys/addresses.go +++ b/bindings/predeploys/addresses.go @@ -20,15 +20,16 @@ const ( GasPriceOracle = "0x530000000000000000000000000000000000000F" L2WETHGateway = "0x5300000000000000000000000000000000000010" L2WETH = "0x5300000000000000000000000000000000000011" - Record = "0x5300000000000000000000000000000000000012" + _ = "0x5300000000000000000000000000000000000012" MorphToken = "0x5300000000000000000000000000000000000013" - Distribute = "0x5300000000000000000000000000000000000014" + _ = "0x5300000000000000000000000000000000000014" L2Staking = "0x5300000000000000000000000000000000000015" L2CustomERC20Gateway = "0x5300000000000000000000000000000000000016" Sequencer = "0x5300000000000000000000000000000000000017" L2ReverseCustomGateway = "0x5300000000000000000000000000000000000018" L2WithdrawLockERC20Gateway = "0x5300000000000000000000000000000000000019" L2USDCGateway = "0x5300000000000000000000000000000000000020" + System = "0x5300000000000000000000000000000000000021" ) var ( @@ -48,14 +49,13 @@ var ( MorphStandardERC20FactoryAddr = common.HexToAddress(MorphStandardERC20Factory) L2WETHGatewayAddr = common.HexToAddress(L2WETHGateway) L2WETHAddr = common.HexToAddress(L2WETH) - RecordAddr = common.HexToAddress(Record) MorphTokenAddr = common.HexToAddress(MorphToken) - DistributeAddr = common.HexToAddress(Distribute) L2StakingAddr = common.HexToAddress(L2Staking) L2CustomERC20GatewayAddr = common.HexToAddress(L2CustomERC20Gateway) L2ReverseCustomGatewayAddr = common.HexToAddress(L2ReverseCustomGateway) L2WithdrawLockERC20GatewayAddr = common.HexToAddress(L2WithdrawLockERC20Gateway) L2USDCGatewayAddr = common.HexToAddress(L2USDCGateway) + SystemAddr = common.HexToAddress(System) Predeploys = make(map[string]*common.Address) ) @@ -67,7 +67,6 @@ func init() { Predeploys["ProxyAdmin"] = &ProxyAdminAddr Predeploys["Sequencer"] = &SequencerAddr Predeploys["Gov"] = &GovAddr - Predeploys["Record"] = &RecordAddr Predeploys["L2GatewayRouter"] = &L2GatewayRouterAddr Predeploys["L2ETHGateway"] = &L2ETHGatewayAddr Predeploys["L2StandardERC20Gateway"] = &L2StandardERC20GatewayAddr @@ -76,7 +75,6 @@ func init() { Predeploys["MorphStandardERC20"] = &MorphStandardERC20Addr Predeploys["MorphStandardERC20Factory"] = &MorphStandardERC20FactoryAddr Predeploys["MorphToken"] = &MorphTokenAddr - Predeploys["Distribute"] = &DistributeAddr Predeploys["L2Staking"] = &L2StakingAddr Predeploys["L2TxFeeVault"] = &L2TxFeeVaultAddr Predeploys["L2WETHGateway"] = &L2WETHGatewayAddr @@ -85,4 +83,5 @@ func init() { Predeploys["L2ReverseCustomGateway"] = &L2ReverseCustomGatewayAddr Predeploys["L2WithdrawLockERC20Gateway"] = &L2WithdrawLockERC20GatewayAddr Predeploys["L2USDCGateway"] = &L2USDCGatewayAddr + Predeploys["SYSTEM"] = &SystemAddr } diff --git a/contracts/contracts/Staking.md b/contracts/contracts/Staking.md deleted file mode 100644 index b657c8114..000000000 --- a/contracts/contracts/Staking.md +++ /dev/null @@ -1,134 +0,0 @@ -# Staking - ---- - -## Core Process - -**Staking & Sequencer Selection** - -Morph token staking will be divided into three stages: - -- MorphToken has not yet issued yet -- MorphToken has been issued, but inflation and staking rewards have not started yet. -- Inflation starts and distribute staking rewards - -1. `L1` Update whitelist -2. `L1` Register and stake eth to become staker -3. `L1->L2` Send {add staker} message -4. `L2` Update stakers -5. `L2` Delegate stake MorphToken to staker -6. `L2` Update sequencer set by amount of MorphToken delegation - -**Rollp Verify** - -- The submitted batch requires the BLS signature of more than 2/3 of the sequencers -- Before BLS implementation, only staker (not withdrawing, not slashing) can rollup - -1. `L1` Submit batch and sequencer sets -2. `L1` Verify sequencer set -3. `L1` Verify batch signature - -**Slash Sequencers After Challenger Win** - -- Sequencer will be confiscated all stake amount and removed from sequencer set if defense challenge fails -- Even if challenged repeatedly, each sequencer will only be slashed once -- The reward for a successful challenge is a fixed proportion of the staking amount, and is greater than the challenge deposit -- If the slash causes the number of sequences to be 0, then the layer2 will stop running. We can restart by upgrading, reset stakers and sequencer set. This does not affect the security of the evm state - -1. `L1` Slash staking value of signed sequencers and remove from stakers -2. `L1` Distribute challenger rewards -3. `L1->L2` Send {remove stakers} message -4. `L2` Update sequencer set by amount of MorphToken delegation - -**Delegation Rewards** - -- MorphToken is inflated at a fixed ratio every day, and the additional tokens are used as rewards for sequencers and delegators -- The sequencer and his delegators get MorphToken inflation reward according to the block production ratio -- Sequencer charges commission as its own income -- Users get remaining reward according to their delegation amount - -1. `L2` Staker set delegation commission rate -2. `L2` Upload sequencers work records in epoch (an epoch is a day) -3. `L2` Mint MorphToken inflation as delegation reward -4. `L2` Claim delegation reward or claim commission - -**Quit Staker** - -The exit lock period should be long enough to ensure that stakers and sequencers in L2 have been updated - -1. `L1` Apply to withdraw, remove from staker list, enter lock period -2. `L1->L2` Send {remove staker} message -3. `L2` Remove from stakers and sequencers if needed -4. `L1` Claim allowed until reach unlock height,remove staker info after claiming - ---- - -## Contracts - -### L1 Contract - -#### L1Staking Contract - -**Main functions** - -- Update whitelist -- Register as staker -- Staker quit -- Slash signed sequencers if challenger win, call by rollup contract - -#### Rollup Contract - -**Main functions** - -- Commit batch & verify -- Challenge batch - -### L2 Contract - -#### MorphToken Contract - -**Main functions** - -- Mint inflation - -#### Record Contract - -**Main functions** - -- Record finalized batch submissions, call by oracle -- Record rollup epochs, call by oracle -- Record reward epochs, call by oracle - -#### L2Staking Contract - -**Main functions** - -- Add staker, sync from L1 staking contract -- Remove stakers, sync from L1 staking contract -- Staker set commission rate -- User delegate stake morph token -- User undelegate stake morph token -- User claim delegation reward -- Sequencer claim commission - -#### Sequencer Contract - -**Main functions** - -- Update sequencer set, call form l2 staking contract - -#### Distribute Contract - -**Main functions** - -- Record delegation info by l2 staking contract -- Record undelegation info by l2 staking contract -- Compute delegator's delegation reward, call form l2 staking contract -- Compute sequencer's commission, call form l2 staking contract - -#### Gov Contract - -**Main functions** - -- Submit proposal -- Vote proposal diff --git a/contracts/contracts/l2/staking/Distribute.sol b/contracts/contracts/l2/staking/Distribute.sol deleted file mode 100644 index c7b132cad..000000000 --- a/contracts/contracts/l2/staking/Distribute.sol +++ /dev/null @@ -1,399 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity =0.8.24; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; - -import {Predeploys} from "../../libraries/constants/Predeploys.sol"; -import {IDistribute} from "./IDistribute.sol"; -import {IMorphToken} from "../system/IMorphToken.sol"; - -contract Distribute is IDistribute, OwnableUpgradeable { - using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; - - /************* - * Constants * - *************/ - - /// @notice MorphToken contract address - address public immutable MORPH_TOKEN_CONTRACT; - - /// @notice l2 staking contract address - address public immutable L2_STAKING_CONTRACT; - - /// @notice record contract address - address public immutable RECORD_CONTRACT; - - /************* - * Variables * - *************/ - - /// @notice total minted epoch - uint256 private mintedEpochCount; - - /// @notice distribution info, delete after all claimed - mapping(address delegatee => mapping(uint256 epochIndex => Distribution)) private distributions; - - /// oldest distribution - mapping(address delegatee => uint256 epochIndex) private oldestDistribution; - - /// @notice delegatee's unclaimed commission - mapping(address delegatee => uint256 amount) private commissions; - - /// @notice delegator's unclaimed reward - mapping(address delegator => Unclaimed) private unclaimed; - - /********************** - * Function Modifiers * - **********************/ - - /// @notice Ensures that the caller message from l2 staking contract. - modifier onlyL2StakingContract() { - require(_msgSender() == L2_STAKING_CONTRACT, "only l2 staking contract allowed"); - _; - } - - /// @notice Ensures that the caller message from record contract. - modifier onlyRecordContract() { - require(_msgSender() == RECORD_CONTRACT, "only record contract allowed"); - _; - } - - /*************** - * Constructor * - ***************/ - - /// @notice constructor - constructor() { - MORPH_TOKEN_CONTRACT = Predeploys.MORPH_TOKEN; - L2_STAKING_CONTRACT = Predeploys.L2_STAKING; - RECORD_CONTRACT = Predeploys.RECORD; - _disableInitializers(); - } - - /*************** - * Initializer * - ***************/ - - /// @notice initializer - /// @param _owner owner - function initialize(address _owner) public initializer { - require(_owner != address(0), "invalid owner address"); - _transferOwnership(_owner); - } - - /************************ - * Restricted Functions * - ************************/ - - /// @dev notify delegation - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param effectiveEpoch delegation effective epoch - /// @param amount delegator total amount, not increment - /// @param totalAmount delegatee total amount - /// @param newDelegation first delegate or additional delegate - function notifyDelegation( - address delegatee, - address delegator, - uint256 effectiveEpoch, - uint256 amount, - uint256 totalAmount, - bool newDelegation - ) public onlyL2StakingContract { - // update distribution info - distributions[delegatee][effectiveEpoch].delegationAmount = totalAmount; - distributions[delegatee][effectiveEpoch].delegators.add(delegator); - distributions[delegatee][effectiveEpoch].amounts[delegator] = amount; - - // update unclaimed info - if (newDelegation) { - unclaimed[delegator].delegatees.add(delegatee); - unclaimed[delegator].unclaimedStart[delegatee] = effectiveEpoch; - } - } - - /// @dev notify unDelegation - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param effectiveEpoch delegation effective epoch - /// @param totalAmount delegatee total amount - function notifyUndelegation( - address delegatee, - address delegator, - uint256 effectiveEpoch, - uint256 totalAmount - ) public onlyL2StakingContract { - // update distribution info - distributions[delegatee][effectiveEpoch].delegationAmount = totalAmount; - - // not start reward yet, or delegate and undelegation within the same epoch, remove unclaim info - if (effectiveEpoch == 0 || unclaimed[delegator].unclaimedStart[delegatee] == effectiveEpoch) { - // update distribution info - distributions[delegatee][effectiveEpoch].delegators.remove(delegator); - delete distributions[delegatee][effectiveEpoch].amounts[delegator]; - - // update unclaimed info - unclaimed[delegator].delegatees.remove(delegatee); - delete unclaimed[delegator].undelegated[delegatee]; - delete unclaimed[delegator].unclaimedStart[delegatee]; - delete unclaimed[delegator].unclaimedEnd[delegatee]; - return; - } - - // update unclaimed info - unclaimed[delegator].undelegated[delegatee] = true; - unclaimed[delegator].unclaimedEnd[delegatee] = effectiveEpoch - 1; - } - - /// @dev update epoch reward - /// @param epochIndex epoch index - /// @param sequencers sequencers - /// @param delegatorRewards sequencer's delegator reward amount - /// @param commissionsAmount sequencers commission amount - function updateEpochReward( - uint256 epochIndex, - address[] calldata sequencers, - uint256[] calldata delegatorRewards, - uint256[] calldata commissionsAmount - ) external onlyRecordContract { - mintedEpochCount++; - require(mintedEpochCount - 1 == epochIndex, "invalid epoch index"); - require( - delegatorRewards.length == sequencers.length && commissionsAmount.length == sequencers.length, - "invalid data length" - ); - - for (uint256 i = 0; i < sequencers.length; i++) { - distributions[sequencers[i]][epochIndex].delegatorRewardAmount = delegatorRewards[i]; - if (distributions[sequencers[i]][epochIndex].delegationAmount == 0 && epochIndex > 0) { - distributions[sequencers[i]][epochIndex].delegationAmount = distributions[sequencers[i]][epochIndex - 1] - .delegationAmount; - } - commissions[sequencers[i]] += commissionsAmount[i]; - } - } - - /// @dev clean distributions - /// @param delegatee delegatee address - /// @param targetEpochIndex the epoch index to delete up to - /// - /// check off-chain that all rewards have been claimed - function cleanDistributions(address delegatee, uint256 targetEpochIndex) external onlyOwner { - uint256 i = oldestDistribution[delegatee]; - for (; i <= targetEpochIndex; i++) { - delete distributions[delegatee][i]; - } - oldestDistribution[delegatee] = i; - } - - /// @dev claim delegation reward of a delegatee. - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param targetEpochIndex the epoch index that the user wants to claim up to - /// - /// If targetEpochIndex is zero, claim up to latest mint epoch, - /// otherwise it must be greater than the last claimed epoch index. - function claim(address delegatee, address delegator, uint256 targetEpochIndex) external onlyL2StakingContract { - require(mintedEpochCount != 0, "not minted yet"); - uint256 endEpochIndex = (targetEpochIndex == 0 || targetEpochIndex > mintedEpochCount - 1) - ? mintedEpochCount - 1 - : targetEpochIndex; - (uint256 reward, ) = _claim(delegatee, delegator, endEpochIndex); - if (reward > 0) { - _transfer(delegator, reward); - } - } - - /// @dev claim delegation reward of all sequencers. - /// @param delegator delegator address - /// @param targetEpochIndex the epoch index that the user wants to claim up to - /// - /// If targetEpochIndex is zero, claim up to latest mint epoch, - /// otherwise it must be greater than the last claimed epoch index. - function claimAll(address delegator, uint256 targetEpochIndex) external onlyL2StakingContract { - require(mintedEpochCount != 0, "not minted yet"); - uint256 endEpochIndex = (targetEpochIndex == 0 || targetEpochIndex > mintedEpochCount - 1) - ? mintedEpochCount - 1 - : targetEpochIndex; - uint256 reward; - for (uint256 i = 0; i < unclaimed[delegator].delegatees.length(); ) { - bool removed = false; - address delegatee = unclaimed[delegator].delegatees.at(i); - if ( - unclaimed[delegator].delegatees.contains(delegatee) && - unclaimed[delegator].unclaimedStart[delegatee] <= endEpochIndex - ) { - (uint256 rewardTmp, bool removedTmp) = _claim(delegatee, delegator, endEpochIndex); - reward += rewardTmp; - removed = removedTmp; - } - if (!removed) { - i++; - } - } - if (reward > 0) { - _transfer(delegator, reward); - } - } - - /// @dev claim commission reward - /// @param delegatee delegatee address - function claimCommission(address delegatee) external onlyL2StakingContract { - require(commissions[delegatee] > 0, "no commission to claim"); - - uint256 amount = commissions[delegatee]; - delete commissions[delegatee]; - _transfer(delegatee, amount); - - emit CommissionClaimed(delegatee, amount); - } - - /************************* - * Public View Functions * - *************************/ - - /// @notice query oldest distribution - /// @param delegatee delegatee address - function queryOldestDistribution(address delegatee) external view returns (uint256 epochIndex) { - return oldestDistribution[delegatee]; - } - - /// @notice query whether all rewards have been claimed for a delegatee - /// @param delegator delegatee address - /// @param delegatee delegatee address - function isRewardClaimed(address delegator, address delegatee) external view returns (bool claimed) { - return !unclaimed[delegator].delegatees.contains(delegatee); - } - - /// @notice query all unclaimed commission of a delegatee - /// @param delegatee delegatee address - function queryUnclaimedCommission(address delegatee) external view returns (uint256 amount) { - return commissions[delegatee]; - } - - /// @notice query unclaimed morph reward on a delegatee - /// @param delegatee delegatee address - /// @param delegator delegatee address - function queryUnclaimed(address delegatee, address delegator) external view returns (uint256 reward) { - require(unclaimed[delegator].delegatees.length() != 0, "invalid delegator or no remaining reward"); - require(unclaimed[delegator].delegatees.contains(delegatee), "no remaining reward of the delegatee"); - - uint256 delegateeAmount; - uint256 delegatorAmount; - for (uint256 i = unclaimed[delegator].unclaimedStart[delegatee]; i < mintedEpochCount; i++) { - if (distributions[delegatee][i].amounts[delegator] > 0) { - delegatorAmount = distributions[delegatee][i].amounts[delegator]; - } - if (distributions[delegatee][i].delegationAmount > 0) { - delegateeAmount = distributions[delegatee][i].delegationAmount; - } - reward += (distributions[delegatee][i].delegatorRewardAmount * delegatorAmount) / delegateeAmount; - - if (unclaimed[delegator].undelegated[delegatee] && unclaimed[delegator].unclaimedEnd[delegatee] == i) { - break; - } - } - } - - /// @notice query all unclaimed morph reward - /// @param delegator delegatee address - function queryAllUnclaimed( - address delegator - ) external view returns (address[] memory delegatees, uint256[] memory rewards) { - uint256 length = unclaimed[delegator].delegatees.length(); - require(length != 0, "invalid delegator or no remaining reward"); - delegatees = new address[](length); - rewards = new uint256[](length); - for (uint256 j = 0; j < unclaimed[delegator].delegatees.length(); j++) { - address delegatee = unclaimed[delegator].delegatees.at(j); - uint256 reward; - uint256 delegateeAmount; - uint256 delegatorAmount; - uint256 start = unclaimed[delegator].unclaimedStart[delegatee]; - for (uint256 i = start; i < mintedEpochCount; i++) { - if (distributions[delegatee][i].amounts[delegator] > 0) { - delegatorAmount = distributions[delegatee][i].amounts[delegator]; - } - if (distributions[delegatee][i].delegationAmount > 0) { - delegateeAmount = distributions[delegatee][i].delegationAmount; - } - reward += (distributions[delegatee][i].delegatorRewardAmount * delegatorAmount) / delegateeAmount; - if (unclaimed[delegator].undelegated[delegatee] && unclaimed[delegator].unclaimedEnd[delegatee] == i) { - break; - } - } - delegatees[j] = delegatee; - rewards[j] = reward; - } - } - - /// @notice query all unclaimed morph reward epochs info - /// @param delegator delegatee address - function queryAllUnclaimedEpochs( - address delegator - ) external view returns (address[] memory, bool[] memory, uint256[] memory, uint256[] memory) { - uint256 length = unclaimed[delegator].delegatees.length(); - address[] memory delegatees = new address[](length); - bool[] memory undelegated = new bool[](length); - uint256[] memory unclaimedStart = new uint256[](length); - uint256[] memory unclaimedEnd = new uint256[](length); - for (uint256 i = 0; i < length; i++) { - delegatees[i] = unclaimed[delegator].delegatees.at(i); - undelegated[i] = unclaimed[delegator].undelegated[delegatees[i]]; - unclaimedStart[i] = unclaimed[delegator].unclaimedStart[delegatees[i]]; - unclaimedEnd[i] = unclaimed[delegator].unclaimedEnd[delegatees[i]]; - } - return (delegatees, undelegated, unclaimedStart, unclaimedEnd); - } - - /********************** - * Internal Functions * - **********************/ - - /// @notice transfer morph token - function _transfer(address _to, uint256 _amount) internal { - uint256 balanceBefore = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(address(this)); - IMorphToken(MORPH_TOKEN_CONTRACT).transfer(_to, _amount); - uint256 balanceAfter = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(address(this)); - require(_amount > 0 && balanceBefore - balanceAfter == _amount, "morph token transfer failed"); - } - - /// @notice claim delegator morph reward - function _claim( - address delegatee, - address delegator, - uint256 endEpochIndex - ) internal returns (uint256 reward, bool removed) { - require(unclaimed[delegator].delegatees.contains(delegatee), "no remaining reward"); - require(unclaimed[delegator].unclaimedStart[delegatee] <= endEpochIndex, "all reward claimed"); - - uint256 delegateeAmount; - uint256 delegatorAmount; - for (uint256 i = unclaimed[delegator].unclaimedStart[delegatee]; i <= endEpochIndex; i++) { - if (distributions[delegatee][i].amounts[delegator] > 0) { - delegatorAmount = distributions[delegatee][i].amounts[delegator]; - } - if (distributions[delegatee][i].delegationAmount > 0) { - delegateeAmount = distributions[delegatee][i].delegationAmount; - } - reward += (distributions[delegatee][i].delegatorRewardAmount * delegatorAmount) / delegateeAmount; - - // if undelegated, remove delegator unclaimed info after claimed all - if (unclaimed[delegator].undelegated[delegatee] && unclaimed[delegator].unclaimedEnd[delegatee] == i) { - removed = true; - unclaimed[delegator].delegatees.remove(delegatee); - delete unclaimed[delegator].undelegated[delegatee]; - delete unclaimed[delegator].unclaimedStart[delegatee]; - delete unclaimed[delegator].unclaimedEnd[delegatee]; - break; - } - } - unclaimed[delegator].unclaimedStart[delegatee] = endEpochIndex + 1; - if (distributions[delegatee][endEpochIndex + 1].amounts[delegator] == 0) { - distributions[delegatee][endEpochIndex + 1].amounts[delegator] = delegatorAmount; - } - - emit RewardClaimed(delegator, delegatee, endEpochIndex, reward); - } -} diff --git a/contracts/contracts/l2/staking/Gov.sol b/contracts/contracts/l2/staking/Gov.sol index 7edf13a07..3b5cc4973 100644 --- a/contracts/contracts/l2/staking/Gov.sol +++ b/contracts/contracts/l2/staking/Gov.sol @@ -28,21 +28,9 @@ contract Gov is IGov, OwnableUpgradeable { /// @notice batch block interval uint256 public override batchBlockInterval; - /// @notice deprecated, to delete - uint256 private batchMaxBytes; - /// @notice batch timeout uint256 public override batchTimeout; - /// @notice deprecated, to delete - uint256 private maxChunks; - - /// @notice rollup epoch - uint256 public override rollupEpoch; - - /// @notice rollup epoch last modified timestamp - uint256 public rollupEpochUpdateTime; - /// @notice proposal voting duration uint256 public votingDuration; @@ -95,17 +83,14 @@ contract Gov is IGov, OwnableUpgradeable { /// @param _votingDuration proposal interval /// @param _batchBlockInterval batch block interval /// @param _batchTimeout batch timeout - /// @param _rollupEpoch rollup epoch function initialize( address _owner, uint256 _votingDuration, uint256 _batchBlockInterval, - uint256 _batchTimeout, - uint256 _rollupEpoch + uint256 _batchTimeout ) public initializer { require(_owner != address(0), "invalid owner address"); require(_votingDuration > 0, "invalid proposal voting duration"); - require(_rollupEpoch > 0, "invalid rollup epoch"); require(_batchBlockInterval != 0 || _batchTimeout != 0, "invalid batch params"); _transferOwnership(_owner); @@ -113,13 +98,10 @@ contract Gov is IGov, OwnableUpgradeable { votingDuration = _votingDuration; batchBlockInterval = _batchBlockInterval; batchTimeout = _batchTimeout; - rollupEpoch = _rollupEpoch; - rollupEpochUpdateTime = block.timestamp; emit VotingDurationUpdated(0, _votingDuration); emit BatchBlockIntervalUpdated(0, _batchBlockInterval); emit BatchTimeoutUpdated(0, _batchTimeout); - emit RollupEpochUpdated(0, _rollupEpoch); } /************************ @@ -128,20 +110,13 @@ contract Gov is IGov, OwnableUpgradeable { /// @notice create a proposal function createProposal(ProposalData calldata proposal) external onlySequencer returns (uint256) { - require(proposal.rollupEpoch != 0, "invalid rollup epoch"); require(proposal.batchBlockInterval != 0 || proposal.batchTimeout != 0, "invalid batch params"); currentProposalID++; proposalData[currentProposalID] = proposal; proposalInfos[currentProposalID] = ProposalInfo(block.timestamp + votingDuration, false); - emit ProposalCreated( - currentProposalID, - _msgSender(), - proposal.batchBlockInterval, - proposal.batchTimeout, - proposal.rollupEpoch - ); + emit ProposalCreated(currentProposalID, _msgSender(), proposal.batchBlockInterval, proposal.batchTimeout); return (currentProposalID); } @@ -246,15 +221,9 @@ contract Gov is IGov, OwnableUpgradeable { batchTimeout = proposalData[proposalID].batchTimeout; emit BatchTimeoutUpdated(_oldValue, proposalData[proposalID].batchTimeout); } - if (rollupEpoch != proposalData[proposalID].rollupEpoch) { - uint256 _oldValue = rollupEpoch; - rollupEpoch = proposalData[proposalID].rollupEpoch; - rollupEpochUpdateTime = block.timestamp; - emit RollupEpochUpdated(_oldValue, proposalData[proposalID].rollupEpoch); - } proposalInfos[proposalID].executed = true; - emit ProposalExecuted(proposalID, batchBlockInterval, batchTimeout, rollupEpoch); + emit ProposalExecuted(proposalID, batchBlockInterval, batchTimeout); } /// @notice check whether the proposal has been passed diff --git a/contracts/contracts/l2/staking/IDistribute.sol b/contracts/contracts/l2/staking/IDistribute.sol deleted file mode 100644 index 5bb84d0f0..000000000 --- a/contracts/contracts/l2/staking/IDistribute.sol +++ /dev/null @@ -1,155 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity =0.8.24; - -import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; - -/** - * @dev Interface of the Distribute. - */ -interface IDistribute { - /*********** - * Structs * - ***********/ - - /// @notice Distribution representing a distribution - /// - /// @custom:field delegatorRewardAmount total reward amount minus commission - /// @custom:field delegationAmount total delegation amount - /// @custom:field delegators delegator set - /// @custom:field amounts delegators delegation amount - struct Distribution { - uint256 delegatorRewardAmount; - uint256 delegationAmount; - EnumerableSetUpgradeable.AddressSet delegators; - mapping(address delegator => uint256 amount) amounts; - } - - /// @notice Unclaimed representing a unclaimd info of a delegator - /// - /// @custom:field delegatees all delegatees if this delegator, remove delegatee after all reward claimed - /// @custom:field undelegated whether is undelegated - /// @custom:field unclaimedStart unclaimed start epoch index - /// @custom:field unclaimedEnd unclaimed end epoch index, set 0 if undelegated is false or all claimed - struct Unclaimed { - EnumerableSetUpgradeable.AddressSet delegatees; - mapping(address delegator => bool undelegated) undelegated; - mapping(address delegator => uint256 startEpoch) unclaimedStart; - mapping(address delegator => uint256 endEpoch) unclaimedEnd; - } - - /********** - * Events * - **********/ - - /// @notice reward claimed - /// @param delegator delegator - /// @param delegatee delegatee - /// @param upToEpoch up to epoch index - /// @param amount amount - event RewardClaimed(address indexed delegator, address indexed delegatee, uint256 upToEpoch, uint256 amount); - - /// @notice commission claimed - /// @param delegatee delegatee - /// @param amount amount - event CommissionClaimed(address indexed delegatee, uint256 amount); - - /************************* - * Public View Functions * - *************************/ - - /// @notice query whether all rewards have been claimed for a delegatee - /// @param delegator delegatee address - /// @param delegatee delegatee address - function isRewardClaimed(address delegator, address delegatee) external view returns (bool claimed); - - /// @notice query unclaimed morph reward on a delegatee - /// @param delegatee delegatee address - /// @param delegator delegatee address - function queryUnclaimed(address delegatee, address delegator) external view returns (uint256); - - /// @notice query all unclaimed morph reward - /// @param delegator delegatee address - function queryAllUnclaimed( - address delegator - ) external view returns (address[] memory delegatee, uint256[] memory reward); - - /// @notice query all unclaimed morph reward epochs info - /// @param delegator delegatee address - function queryAllUnclaimedEpochs( - address delegator - ) external view returns (address[] memory, bool[] memory, uint256[] memory, uint256[] memory); - - /// @notice query oldest distribution - /// @param delegatee delegatee address - function queryOldestDistribution(address delegatee) external view returns (uint256 epochIndex); - - /// @notice query all unclaimed commission of a staker - /// @param delegatee delegatee address - function queryUnclaimedCommission(address delegatee) external view returns (uint256 amount); - - /***************************** - * Public Mutating Functions * - *****************************/ - - /// @dev notify delegation - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param effectiveEpoch delegation effective epoch - /// @param amount delegator amount - /// @param totalAmount delegatee total amount - /// @param newDelegation first delegate or additional delegate - function notifyDelegation( - address delegatee, - address delegator, - uint256 effectiveEpoch, - uint256 amount, - uint256 totalAmount, - bool newDelegation - ) external; - - /// @dev notify unDelegation - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param effectiveEpoch delegation effective epoch - /// @param totalAmount delegatee total amount - function notifyUndelegation( - address delegatee, - address delegator, - uint256 effectiveEpoch, - uint256 totalAmount - ) external; - - /// @dev update epoch reward - /// @param epochIndex epoch index - /// @param sequencers sequencers - /// @param delegatorRewards sequencer's delegator reward amount - /// @param commissionsAmount sequencers commission amount - function updateEpochReward( - uint256 epochIndex, - address[] calldata sequencers, - uint256[] calldata delegatorRewards, - uint256[] calldata commissionsAmount - ) external; - - /// @dev claim delegation reward of all sequencers. - /// @param delegator delegator address - /// @param targetEpochIndex the epoch index that the user wants to claim up to - /// - /// If targetEpochIndex is zero, claim up to latest mint epoch, - /// otherwise it must be greater than the last claimed epoch index. - function claimAll(address delegator, uint256 targetEpochIndex) external; - - /// @dev claim delegation reward of a delegatee. - /// @param delegatee delegatee address - /// @param delegator delegator address - /// @param targetEpochIndex the epoch index that the user wants to claim up to - /// - /// If targetEpochIndex is zero, claim up to latest mint epoch, - /// otherwise it must be greater than the last claimed epoch index. - function claim(address delegatee, address delegator, uint256 targetEpochIndex) external; - - /// @dev claim commission reward - /// @param delegatee delegatee address - function claimCommission(address delegatee) external; -} diff --git a/contracts/contracts/l2/staking/IGov.sol b/contracts/contracts/l2/staking/IGov.sol index ec61d6576..521cd49e5 100644 --- a/contracts/contracts/l2/staking/IGov.sol +++ b/contracts/contracts/l2/staking/IGov.sol @@ -15,11 +15,9 @@ interface IGov { /// @custom:field batchBlockInterval /// @custom:field batchTimeout - /// @custom:field rollupEpoch struct ProposalData { uint256 batchBlockInterval; uint256 batchTimeout; - uint256 rollupEpoch; } /********** @@ -31,17 +29,11 @@ interface IGov { uint256 indexed proposalID, address indexed creator, uint256 batchBlockInterval, - uint256 batchTimeout, - uint256 rollupEpoch + uint256 batchTimeout ); /// @notice event of proposal executed - event ProposalExecuted( - uint256 indexed proposalID, - uint256 batchBlockInterval, - uint256 batchTimeout, - uint256 rollupEpoch - ); + event ProposalExecuted(uint256 indexed proposalID, uint256 batchBlockInterval, uint256 batchTimeout); /// @notice proposal voting duration updated /// @param oldProposalVotingDuration old proposal voting duration @@ -58,11 +50,6 @@ interface IGov { /// @param newBatchTimeout new batch timeout event BatchTimeoutUpdated(uint256 oldBatchTimeout, uint256 newBatchTimeout); - /// @notice rollup epoch updated - /// @param odlRollupEpoch old rollup epoch - /// @param newRollupEpoch new rollup epoch - event RollupEpochUpdated(uint256 odlRollupEpoch, uint256 newRollupEpoch); - /************************* * Public View Functions * *************************/ @@ -73,9 +60,6 @@ interface IGov { /// @notice batch timeout function batchTimeout() external view returns (uint256); - /// @notice rollup epoch - function rollupEpoch() external view returns (uint256); - /// @notice current proposal ID number function currentProposalID() external view returns (uint256); diff --git a/contracts/contracts/l2/staking/IL2Staking.sol b/contracts/contracts/l2/staking/IL2Staking.sol index 793da06bc..55780b462 100644 --- a/contracts/contracts/l2/staking/IL2Staking.sol +++ b/contracts/contracts/l2/staking/IL2Staking.sol @@ -8,17 +8,87 @@ interface IL2Staking { * Structs * ***********/ - /// @notice Undelegation representing a undelegation info. + /// @notice Commission representing a delegatee's commission info. + /// + /// @custom:field rate commission percentage + /// @custom:field amount unclaimed commission amount + struct Commission { + uint256 rate; + uint256 amount; + } + + /// @notice DelegateeDelegation representing a delegatee's delegation info. + /// + /// @custom:field checkpoint The epoch when the share was last changed + /// @custom:field amount Total delegations of a delegatee + /// @custom:field share Total share of a delegatee at the end of an epoch + struct DelegateeDelegation { + uint256 amount; + uint256 share; + } + + /// @notice UndelegateRequest representing a undelegate request info. /// - /// @custom:field delegatee delegatee /// @custom:field amount staking amount /// @custom:field unlock unlock epoch index - struct Undelegation { - address delegatee; + struct UndelegateRequest { uint256 amount; uint256 unlockEpoch; } + /*********** + * Errors * + ***********/ + + /// @notice error invalid owner + error ErrInvalidOwner(); + /// @notice error zero sequencer size + error ErrZeroSequencerSize(); + /// @notice error invalid sequencer size + error ErrInvalidSequencerSize(); + /// @notice error zero lock epochs + error ErrZeroLockEpochs(); + /// @notice error reward started + error ErrRewardStarted(); + /// @notice error reward not started + error ErrRewardNotStarted(); + /// @notice error start time not reached + error ErrStartTimeNotReached(); + /// @notice error invalid start time + error ErrInvalidStartTime(); + /// @notice error no candidate + error ErrNoCandidate(); + /// @notice error no stakers + error ErrNoStakers(); + /// @notice error invalid commission rate + error ErrInvalidCommissionRate(); + /// @notice error no commission to claim + error ErrNoCommission(); + /// @notice error not staker + error ErrNotStaker(); + /// @notice error invalid nonce + error ErrInvalidNonce(); + /// @notice error zero delegate amount + error ErrZeroShares(); + // @notice error zero amount + error ErrZeroAmount(); + /// @notice error insufficient balance + error ErrInsufficientBalance(); + /// @notice error only system address allowed + error ErrOnlySystem(); + /// @notice error only morph token contract allowed + error ErrOnlyMorphTokenContract(); + /// @notice error request existed + error ErrRequestExisted(); + /// @notice error no undelegate request + error ErrNoUndelegateRequest(); + /// @notice error no claimable undelegate request + error ErrNoClaimableUndelegateRequest(); + // @notice error transfer failed + error ErrTransferFailed(); + // @notice error invalid page size + error ErrInvalidPageSize(); + /********** * Events * **********/ @@ -26,47 +96,44 @@ interface IL2Staking { /// @notice Emitted delegated stake /// @param delegatee delegatee /// @param delegator delegator - /// @param amount new delegation amount, not increment - /// @param stakeAmount stake amount - /// @param effectiveEpoch effective epoch - event Delegated( - address indexed delegatee, - address indexed delegator, - uint256 amount, - uint256 stakeAmount, - uint256 effectiveEpoch - ); + /// @param amount amount + /// @param delegateeAmount new delegatee total amount + event Delegated(address indexed delegatee, address indexed delegator, uint256 amount, uint256 delegateeAmount); /// @notice Emitted undelegated stake /// @param delegatee delegatee /// @param delegator delegator - /// @param amount undelegation amount - /// @param effectiveEpoch effective epoch + /// @param amount amount + /// @param delegateeAmount new delegatee total amount /// @param unlockEpoch unlock epoch index event Undelegated( address indexed delegatee, address indexed delegator, uint256 amount, - uint256 effectiveEpoch, + uint256 delegateeAmount, uint256 unlockEpoch ); - /// @notice Emitted claim info - /// @param delegator delegator - /// @param unlockEpoch unlock epoch index - /// @param amount staking amount - event UndelegationClaimed( - address indexed delegatee, + /// @notice Emitted undelegated stake + /// @param delegateeFrom delegatee from + /// @param delegateeTo delegatee to + /// @param delegator delegator + /// @param amount stake amount + /// @param delegateeAmountFrom new delegatee from total amount + /// @param delegateeAmountTo new delegatee to total amount + event Redelegated( + address indexed delegateeFrom, + address indexed delegateeTo, address indexed delegator, - uint256 unlockEpoch, - uint256 amount + uint256 amount, + uint256 delegateeAmountFrom, + uint256 delegateeAmountTo ); - /// @notice Emitted commission updated - /// @param staker staker address - /// @param percentage commission percentage - /// @param epochEffective epoch effective - event CommissionUpdated(address indexed staker, uint256 percentage, uint256 epochEffective); + /// @notice Emitted claim info + /// @param delegator delegator + /// @param amount staking amount + event UndelegationClaimed(address indexed delegator, uint256 amount); /// @notice Emitted staker added /// @param addr staker address @@ -88,6 +155,23 @@ interface IL2Staking { /// @param newSize The new sequencer set max size event SequencerSetMaxSizeUpdated(uint256 oldSize, uint256 newSize); + /// @notice Emitted reward epochs uploaded + /// @param sequencer The sequencer address + /// @param delegatorReward The delegator reward amount + /// @param commissionAmount The commission amount + event Distributed(address indexed sequencer, uint256 delegatorReward, uint256 commissionAmount); + + /// @notice Emitted commission updated + /// @param staker staker address + /// @param oldRate old commission percentage + /// @param newRate new commission percentage + event CommissionUpdated(address indexed staker, uint256 oldRate, uint256 newRate); + + /// @notice commission claimed + /// @param delegatee delegatee + /// @param amount amount + event CommissionClaimed(address indexed delegatee, uint256 amount); + /************************* * Public View Functions * *************************/ @@ -135,6 +219,10 @@ interface IL2Staking { /// @notice get staker addresses length function getStakerAddressesLength() external view returns (uint256); + /// @notice query all unclaimed commission of a staker + /// @param delegatee delegatee address + function queryUnclaimedCommission(address delegatee) external view returns (uint256 amount); + /***************************** * Public Mutating Functions * *****************************/ @@ -150,26 +238,34 @@ interface IL2Staking { function removeStakers(uint256 nonce, address[] calldata remove) external; /// @notice setCommissionRate set delegate commission percentage - /// @param commission commission percentage, denominator is 100 - function setCommissionRate(uint256 commission) external; + /// @param rate commission percentage, denominator is 100 + function setCommissionRate(uint256 rate) external; /// @notice delegator stake morph to delegatee /// @param delegatee stake to whom /// @param amount stake amount - function delegateStake(address delegatee, uint256 amount) external; + function delegate(address delegatee, uint256 amount) external; - /// @notice delegator unstake morph - /// @param delegatee delegatee address - function undelegateStake(address delegatee) external; + /// @notice delegator redelegate stake morph token to new delegatee + /// @param delegateeFrom old delegatee + /// @param delegateeTo new delegatee + /// @param amount amount + function redelegate(address delegateeFrom, address delegateeTo, uint256 amount) external; - /// @notice delegator cliam delegate staking value - function claimUndelegation() external; + /// @notice delegator undelegate stake morph token + /// @param delegatee delegatee address + /// @param amount undelegate stake amount, undelegate all if set 0 + function undelegate(address delegatee, uint256 amount) external; - /// @notice delegator claim reward - /// @param delegatee delegatee address, claim all if address(0) - /// @param targetEpochIndex up to the epoch index that the delegator wants to claim - function claimReward(address delegatee, uint256 targetEpochIndex) external; + /// @notice delegator cliam delegate staking value + /// @param number the number of undelegate requests to be claimed. 0 means claim all + /// @return amount the total amount of MPH claimed + function claimUndelegation(uint256 number) external returns (uint256); /// @notice claimCommission claim unclaimed commission reward of a staker function claimCommission() external; + + /// @dev distribute inflation by MorphTokenContract on epoch end + /// @param amount amount + function distribute(uint256 amount) external; } diff --git a/contracts/contracts/l2/staking/IRecord.sol b/contracts/contracts/l2/staking/IRecord.sol deleted file mode 100644 index 63d7d0d72..000000000 --- a/contracts/contracts/l2/staking/IRecord.sol +++ /dev/null @@ -1,130 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity =0.8.24; - -interface IRecord { - /*********** - * Structs * - ***********/ - - /// @notice BatchSubmission representing a batch submission - /// - /// @custom:field index batch index - /// @custom:field submitter batch submitter - /// @custom:field startBlock batch start block - /// @custom:field endBlock batch end block - /// @custom:field rollupTime batch rollup time - /// @custom:field rollupBlock batch rollup block number - struct BatchSubmission { - uint256 index; - address submitter; - uint256 startBlock; - uint256 endBlock; - uint256 rollupTime; - uint256 rollupBlock; - } - - /// @notice RollupEpochInfo representing a rollup epoch - /// - /// @custom:field index epoch index - /// @custom:field submitter submitter - /// @custom:field startTime epoch start time - /// @custom:field endTime epoch end time - /// @custom:field endBlock epoch end block number - struct RollupEpochInfo { - uint256 index; - address submitter; - uint256 startTime; - uint256 endTime; - uint256 endBlock; - } - - /// @notice RewardEpochInfo representing a reward epoch. - /// - /// @custom:field index epoch index - /// @custom:field blockCount the number of blocks included in epoch - /// @custom:field sequencers sequencers have produced blocks - /// @custom:field sequencerBlocks number of blocks produced by sequencer - /// @custom:field sequencerRatios sequencers reward ratio, precision is 1e8 - /// @custom:field sequencerCommissions sequencers commission percentage - /// - /// If no blocks were produced in this epoch, no sequencer will receive the reward - struct RewardEpochInfo { - uint256 index; - uint256 blockCount; - address[] sequencers; - uint256[] sequencerBlocks; - uint256[] sequencerRatios; - uint256[] sequencerCommissions; - } - - /********** - * Events * - **********/ - - /// @notice Emitted batch submissions uploaded - /// @param startIndex The data start index - /// @param dataLength The data length - event BatchSubmissionsUploaded(uint256 indexed startIndex, uint256 dataLength); - - /// @notice Emitted rollup epochs uploaded - /// @param startIndex The data start index - /// @param dataLength The data length - event RollupEpochsUploaded(uint256 indexed startIndex, uint256 dataLength); - - /// @notice Emitted reward epochs uploaded - /// @param startIndex The data start index - /// @param dataLength The data length - event RewardEpochsUploaded(uint256 indexed startIndex, uint256 dataLength); - - /************************* - * Public View Functions * - *************************/ - - /// @notice return next rollup epoch index - function nextBatchSubmissionIndex() external view returns (uint256); - - /// @notice return next rollup epoch index - function nextRollupEpochIndex() external view returns (uint256); - - /// @notice return next reward epoch index - function nextRewardEpochIndex() external view returns (uint256); - - /// @notice return latest reward epoch block - function latestRewardEpochBlock() external view returns (uint256); - - /// @notice getBatchSubmissions - /// @param start start index - /// @param end end index - function getBatchSubmissions(uint256 start, uint256 end) external view returns (BatchSubmission[] memory); - - /// @notice get rollup epochs - /// @param start start index - /// @param end end index - function getRollupEpochs(uint256 start, uint256 end) external view returns (RollupEpochInfo[] memory); - - /// @notice get reward epochs - /// @param start start index - /// @param end end index - function getRewardEpochs(uint256 start, uint256 end) external view returns (RewardEpochInfo[] memory); - - /***************************** - * Public Mutating Functions * - *****************************/ - - /// @notice set oracle address - /// @param _oracle oracle address - function setOracleAddress(address _oracle) external; - - /// @notice set latest block - /// @param _latestBlock latest block - function setLatestRewardEpochBlock(uint256 _latestBlock) external; - - /// @notice record batch submissions - function recordFinalizedBatchSubmissions(BatchSubmission[] calldata _batchSubmissions) external; - - /// @notice record epochs - function recordRollupEpochs(RollupEpochInfo[] calldata _rollupEpochs) external; - - /// @notice record epochs - function recordRewardEpochs(RewardEpochInfo[] calldata _rewardEpochs) external; -} diff --git a/contracts/contracts/l2/staking/L2Staking.sol b/contracts/contracts/l2/staking/L2Staking.sol index 38b1671b1..b0f118fd0 100644 --- a/contracts/contracts/l2/staking/L2Staking.sol +++ b/contracts/contracts/l2/staking/L2Staking.sol @@ -4,17 +4,20 @@ pragma solidity =0.8.24; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {EnumerableSetUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import {CountersUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; +import {DoubleEndedQueueUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/structs/DoubleEndedQueueUpgradeable.sol"; import {Types} from "../../libraries/common/Types.sol"; import {Predeploys} from "../../libraries/constants/Predeploys.sol"; import {Staking} from "../../libraries/staking/Staking.sol"; import {IL2Staking} from "./IL2Staking.sol"; import {ISequencer} from "./ISequencer.sol"; -import {IDistribute} from "./IDistribute.sol"; import {IMorphToken} from "../system/IMorphToken.sol"; contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUpgradeable { using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; + using CountersUpgradeable for CountersUpgradeable.Counter; + using DoubleEndedQueueUpgradeable for DoubleEndedQueueUpgradeable.Bytes32Deque; /************* * Constants * @@ -23,14 +26,17 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice reward epoch, seconds of one day (3600 * 24) uint256 private constant REWARD_EPOCH = 86400; + /// @notice commission rate base + uint256 private constant COMMISSION_RATE_BASE = 100; // 100% + /// @notice MorphToken contract address address public immutable MORPH_TOKEN_CONTRACT; /// @notice sequencer contract address address public immutable SEQUENCER_CONTRACT; - /// @notice distribute contract address - address public immutable DISTRIBUTE_CONTRACT; + /// @notice system address + address public immutable SYSTEM_ADDRESS; /************* * Variables * @@ -54,6 +60,9 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice sequencer candidate number uint256 public candidateNumber; + /// @notice nonce of staking L1 => L2 msg + uint256 public nonce; + /// @notice sync from l1 staking address[] public stakerAddresses; @@ -63,43 +72,61 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice stakers info mapping(address staker => Types.StakerInfo) public stakers; - /// @notice staker commissions, default commission is zero if not set - mapping(address staker => uint256 amount) public commissions; - - /// @notice staker's total delegation amount - mapping(address staker => uint256 totalDelegationAmount) public stakerDelegations; + /// @notice staker commissions info, default commission percentage is zero if not set + mapping(address staker => Commission) public commissions; - /// @notice delegators of staker + /// @notice delegators of a delegatee mapping(address staker => EnumerableSetUpgradeable.AddressSet) internal delegators; - /// @notice delegations of a staker - mapping(address staker => mapping(address delegator => uint256 amount)) public delegations; + /// @notice delegation of a delegatee + mapping(address staker => DelegateeDelegation) public delegateeDelegations; - /// @notice delegator's undelegations - mapping(address delegator => Undelegation[]) public undelegations; + /// @notice the delegation of a delegator + mapping(address staker => mapping(address delegator => uint256 share)) public delegatorDelegations; - /// @notice nonce of staking L1 => L2 msg - uint256 public nonce; + // hash of the undelegate request => undelegate request + mapping(bytes32 => UndelegateRequest) private _undelegateRequests; + + // delegator address => undelegate request queue(hash of the request) + mapping(address => DoubleEndedQueueUpgradeable.Bytes32Deque) private _undelegateRequestsQueue; + + // delegator address => personal undelegate sequence + mapping(address => CountersUpgradeable.Counter) private _undelegateSequence; + + // total blocks of an epoch + EnumerableSetUpgradeable.AddressSet private epochSequencers; + + // sequencers that has produced blocks + uint256 public epochTotalBlocks; + + // blocks produced by sequencers + mapping(address seequencer => uint256) public epochSequencerBlocks; /********************** * Function Modifiers * **********************/ /// @notice must be staker - modifier isStaker(address addr) { - require(stakerRankings[addr] > 0, "not staker"); + modifier onlyStaker(address addr) { + if (stakerRankings[addr] == 0) revert ErrNotStaker(); _; } - /// @notice only staker allowed - modifier onlyStaker() { - require(stakerRankings[_msgSender()] > 0, "only staker allowed"); + /// @notice check nonce + modifier checkNonce(uint256 _nonce) { + if (_nonce != nonce) revert ErrInvalidNonce(); _; } - /// @notice check nonce - modifier checkNonce(uint256 _nonce) { - require(_nonce == nonce, "invalid nonce"); + /// @notice Ensures that the caller message from system + modifier onlSystem() { + if (_msgSender() != SYSTEM_ADDRESS) revert ErrOnlySystem(); + _; + } + + /// @notice Ensures that the caller message from system + modifier onlyMorphTokenContract() { + if (_msgSender() != MORPH_TOKEN_CONTRACT) revert ErrOnlyMorphTokenContract(); _; } @@ -112,7 +139,7 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp constructor(address payable _otherStaking) Staking(payable(Predeploys.L2_CROSS_DOMAIN_MESSENGER), _otherStaking) { MORPH_TOKEN_CONTRACT = Predeploys.MORPH_TOKEN; SEQUENCER_CONTRACT = Predeploys.SEQUENCER; - DISTRIBUTE_CONTRACT = Predeploys.DISTRIBUTE; + SYSTEM_ADDRESS = Predeploys.SYSTEM; } /*************** @@ -132,14 +159,11 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp uint256 _rewardStartTime, Types.StakerInfo[] calldata _stakers ) public initializer { - require(_owner != address(0), "invalid owner address"); - require(_sequencersMaxSize > 0, "sequencersSize must greater than 0"); - require(_undelegateLockEpochs > 0, "invalid undelegateLockEpochs"); - require( - _rewardStartTime > block.timestamp && _rewardStartTime % REWARD_EPOCH == 0, - "invalid reward start time" - ); - require(_stakers.length > 0, "invalid initial stakers"); + if (_owner == address(0)) revert ErrInvalidOwner(); + if (_sequencersMaxSize == 0) revert ErrZeroSequencerSize(); + if (_undelegateLockEpochs == 0) revert ErrZeroLockEpochs(); + if (_rewardStartTime <= block.timestamp || _rewardStartTime % REWARD_EPOCH != 0) revert ErrInvalidStartTime(); + if (_stakers.length == 0) revert ErrNoStakers(); _transferOwnership(_owner); __ReentrancyGuard_init(); @@ -200,7 +224,7 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp delete stakerRankings[remove[i]]; // update candidateNumber - if (stakerDelegations[remove[i]] > 0) { + if (delegateeDelegations[remove[i]].amount > 0) { candidateNumber -= 1; } } @@ -252,7 +276,7 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp delete stakerRankings[remove[i]]; // update candidateNumber - if (stakerDelegations[remove[i]] > 0) { + if (delegateeDelegations[remove[i]].amount > 0) { candidateNumber -= 1; } } @@ -266,27 +290,28 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp } } - /// @notice setCommissionRate set delegate commission percentage - /// @param commission commission percentage - function setCommissionRate(uint256 commission) external onlyStaker { - require(commission <= 20, "invalid commission"); - commissions[_msgSender()] = commission; - uint256 epochEffective = rewardStarted ? currentEpoch() + 1 : 0; - emit CommissionUpdated(_msgSender(), commission, epochEffective); + /// @notice setCommissionPercentage set delegate commission percentage + /// @param rate commission percentage + function setCommissionRate(uint256 rate) external onlyStaker(_msgSender()) { + if (rate > 20) revert ErrInvalidCommissionRate(); + uint256 oldRate = commissions[_msgSender()].rate; + commissions[_msgSender()] = Commission({rate: rate, amount: commissions[_msgSender()].amount}); + emit CommissionUpdated(_msgSender(), rate, oldRate); } /// @notice claimCommission claim unclaimed commission reward of a staker function claimCommission() external nonReentrant { - IDistribute(DISTRIBUTE_CONTRACT).claimCommission(_msgSender()); + if (commissions[_msgSender()].amount == 0) revert ErrNoCommission(); + uint256 amount = commissions[_msgSender()].amount; + commissions[_msgSender()].amount = 0; + _transfer(_msgSender(), amount); + emit CommissionClaimed(_msgSender(), amount); } /// @notice update params /// @param _sequencerSetMaxSize max size of sequencer set function updateSequencerSetMaxSize(uint256 _sequencerSetMaxSize) external onlyOwner { - require( - _sequencerSetMaxSize > 0 && _sequencerSetMaxSize != sequencerSetMaxSize, - "invalid new sequencer set max size" - ); + if (_sequencerSetMaxSize == 0 || _sequencerSetMaxSize == sequencerSetMaxSize) revert ErrInvalidSequencerSize(); uint256 _oldSequencerSetMaxSize = sequencerSetMaxSize; sequencerSetMaxSize = _sequencerSetMaxSize; emit SequencerSetMaxSizeUpdated(_oldSequencerSetMaxSize, _sequencerSetMaxSize); @@ -304,13 +329,13 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice advance layer2 stage /// @param _rewardStartTime reward start time function updateRewardStartTime(uint256 _rewardStartTime) external onlyOwner { - require(!rewardStarted, "reward already started"); - require( - _rewardStartTime > block.timestamp && - _rewardStartTime % REWARD_EPOCH == 0 && - _rewardStartTime != rewardStartTime, - "invalid reward start time" - ); + if (rewardStarted) revert ErrRewardStarted(); + if ( + _rewardStartTime <= block.timestamp || + _rewardStartTime % REWARD_EPOCH != 0 || + _rewardStartTime == rewardStartTime + ) revert ErrInvalidStartTime(); + uint256 _oldTime = rewardStartTime; rewardStartTime = _rewardStartTime; emit RewardStartTimeUpdated(_oldTime, _rewardStartTime); @@ -318,15 +343,15 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice start reward function startReward() external onlyOwner { - require(block.timestamp >= rewardStartTime, "can't start before reward start time"); - require(candidateNumber > 0, "none candidate"); + if (block.timestamp < rewardStartTime) revert ErrStartTimeNotReached(); + if (candidateNumber == 0) revert ErrNoCandidate(); rewardStarted = true; // sort stakers by insertion sort for (uint256 i = 1; i < stakerAddresses.length; i++) { for (uint256 j = 0; j < i; j++) { - if (stakerDelegations[stakerAddresses[i]] > stakerDelegations[stakerAddresses[j]]) { + if (delegateeDelegations[stakerAddresses[i]].amount > delegateeDelegations[stakerAddresses[j]].amount) { address tmp = stakerAddresses[j]; stakerAddresses[j] = stakerAddresses[i]; stakerAddresses[i] = tmp; @@ -349,19 +374,36 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp /// @notice delegator stake morph to delegatee /// @param delegatee stake to whom /// @param amount stake amount - function delegateStake(address delegatee, uint256 amount) external isStaker(delegatee) nonReentrant { - require(amount > 0, "invalid stake amount"); - // Re-staking to the same delegatee is not allowed before claiming undelegation & reward - require(!_unclaimedUndelegation(_msgSender(), delegatee), "undelegation unclaimed"); - if (!_isStakingTo(delegatee)) { - require(!_unclaimedReward(_msgSender(), delegatee), "reward unclaimed"); - } + function delegate(address delegatee, uint256 amount) external onlyStaker(delegatee) nonReentrant { + if (amount == 0) revert ErrZeroAmount(); - stakerDelegations[delegatee] += amount; - delegations[delegatee][_msgSender()] += amount; delegators[delegatee].add(_msgSender()); // will not be added repeatedly - if (stakerDelegations[delegatee] == amount) { + // *********************************************************************************************** + + if (!rewardStarted) { + delegatorDelegations[delegatee][_msgSender()] += amount; + delegateeDelegations[delegatee].amount += amount; + delegateeDelegations[delegatee].share = delegateeDelegations[delegatee].amount; // {share == amount} before reward start + } else { + uint256 _tshare = delegateeDelegations[delegatee].share; + uint256 _tAmount = delegateeDelegations[delegatee].amount; + uint256 _uShare = delegatorDelegations[delegatee][_msgSender()]; + + if (_tAmount == 0) { + delegatorDelegations[delegatee][_msgSender()] = amount; + delegateeDelegations[delegatee].share = amount; + delegateeDelegations[delegatee].amount = amount; + } else { + delegatorDelegations[delegatee][_msgSender()] = _uShare + (amount * _tshare) / _tAmount; + delegateeDelegations[delegatee].amount += amount; + delegateeDelegations[delegatee].share = _tshare + (amount * _tshare) / _tAmount; + } + } + + // *********************************************************************************************** + + if (delegateeDelegations[delegatee].amount == amount) { candidateNumber += 1; } @@ -369,7 +411,10 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp if (rewardStarted && beforeRanking > 1) { // update stakers and rankings for (uint256 i = beforeRanking - 1; i > 0; i--) { - if (stakerDelegations[stakerAddresses[i]] > stakerDelegations[stakerAddresses[i - 1]]) { + if ( + delegateeDelegations[stakerAddresses[i]].amount > + delegateeDelegations[stakerAddresses[i - 1]].amount + ) { address tmp = stakerAddresses[i - 1]; stakerAddresses[i - 1] = stakerAddresses[i]; stakerAddresses[i] = tmp; @@ -379,25 +424,8 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp } } } - uint256 effectiveEpoch = rewardStarted ? currentEpoch() + 1 : 0; - - emit Delegated( - delegatee, - _msgSender(), - delegations[delegatee][_msgSender()], // new amount, not incremental - amount, - effectiveEpoch - ); - - // notify delegation to distribute contract - IDistribute(DISTRIBUTE_CONTRACT).notifyDelegation( - delegatee, - _msgSender(), - effectiveEpoch, - delegations[delegatee][_msgSender()], - stakerDelegations[delegatee], - delegations[delegatee][_msgSender()] == amount - ); + + emit Delegated(delegatee, _msgSender(), amount, delegateeDelegations[delegatee].amount); // transfer morph token from delegator to this _transferFrom(_msgSender(), address(this), amount); @@ -409,35 +437,54 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp } } - /// @notice delegator unstake morph - /// @param delegatee delegatee address - function undelegateStake(address delegatee) external nonReentrant { - require(_isStakingTo(delegatee), "staking amount is zero"); + /// @notice delegator undelegate stake morph token + /// @param delegatee delegatee address + /// @param amount undelegate stake amount, undelegate all if set 0 + function undelegate(address delegatee, uint256 amount) external nonReentrant { + uint256 delegationAmount = _getDelegationAmount(delegatee, _msgSender()); + if (delegationAmount == 0) revert ErrZeroShares(); + if (delegationAmount < amount) revert ErrInsufficientBalance(); + uint256 _amount = (amount == 0) ? delegationAmount : amount; - // staker has been removed, unlock next epoch + // weather staker has been removed bool removed = stakerRankings[delegatee] == 0; - uint256 effectiveEpoch = rewardStarted ? currentEpoch() + 1 : 0; - uint256 unlockEpoch = (rewardStarted && !removed) - ? effectiveEpoch + undelegateLockEpochs // reward started and staker is active - : effectiveEpoch; // equal to 0 if reward not started. equal to effectiveEpoch is staker is removed - - Undelegation memory undelegation = Undelegation(delegatee, delegations[delegatee][_msgSender()], unlockEpoch); + uint256 unlockEpoch = rewardStarted ? (currentEpoch() + undelegateLockEpochs + 1) : 0; + + UndelegateRequest memory request = UndelegateRequest({amount: _amount, unlockEpoch: unlockEpoch}); + bytes32 hash = keccak256(abi.encodePacked(_msgSender(), _useSequence(_msgSender()))); + // the hash should not exist in the queue + // this will not happen in normal cases + if (_undelegateRequests[hash].amount != 0) revert ErrRequestExisted(); + _undelegateRequests[hash] = request; + _undelegateRequestsQueue[_msgSender()].pushBack(hash); + + // update delegatorDelegations & delegateeDelegations + if (!rewardStarted) { + delegatorDelegations[delegatee][_msgSender()] -= _amount; // {share = _amount} before reward start + delegateeDelegations[delegatee].amount -= _amount; + delegateeDelegations[delegatee].share = delegateeDelegations[delegatee].amount; // {share = _amount} before reward start + } else { + uint256 _tshare = delegateeDelegations[delegatee].share; + uint256 _tAmount = delegateeDelegations[delegatee].amount; + uint256 _uShare = delegatorDelegations[delegatee][_msgSender()]; - undelegations[_msgSender()].push(undelegation); - delete delegations[delegatee][_msgSender()]; - stakerDelegations[delegatee] -= undelegation.amount; - delegators[delegatee].remove(_msgSender()); + delegatorDelegations[delegatee][_msgSender()] = _uShare - (_amount * _tshare) / _tAmount; + delegateeDelegations[delegatee].amount -= _amount; + delegateeDelegations[delegatee].share = _tshare - (_amount * _tshare) / _tAmount; + } uint256 beforeRanking = stakerRankings[delegatee]; if (!removed && rewardStarted && beforeRanking < candidateNumber) { // update stakers and rankings for (uint256 i = stakerRankings[delegatee] - 1; i < candidateNumber - 1; i++) { - if (stakerDelegations[stakerAddresses[i + 1]] > stakerDelegations[stakerAddresses[i]]) { + if ( + delegateeDelegations[stakerAddresses[i + 1]].amount > + delegateeDelegations[stakerAddresses[i]].amount + ) { address tmp = stakerAddresses[i]; stakerAddresses[i] = stakerAddresses[i + 1]; stakerAddresses[i + 1] = tmp; - stakerRankings[stakerAddresses[i]] = i + 1; stakerRankings[stakerAddresses[i + 1]] = i + 2; } @@ -445,19 +492,12 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp } // update candidateNumber - if (!removed && stakerDelegations[delegatee] == 0) { + if (!removed && delegateeDelegations[delegatee].amount == 0) { candidateNumber -= 1; } - // notify undelegation to distribute contract - IDistribute(DISTRIBUTE_CONTRACT).notifyUndelegation( - delegatee, - _msgSender(), - effectiveEpoch, - stakerDelegations[delegatee] - ); - - emit Undelegated(delegatee, _msgSender(), undelegation.amount, effectiveEpoch, unlockEpoch); + uint256 delegateeAmount = delegateeDelegations[delegatee].amount; + emit Undelegated(delegatee, _msgSender(), _amount, delegateeAmount, unlockEpoch); if ( !removed && @@ -469,55 +509,269 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp } } - /// @notice delegator cliam delegate staking value - function claimUndelegation() external nonReentrant { - uint256 totalAmount; - uint256 length = undelegations[_msgSender()].length; + /// @notice delegator redelegate stake morph token to new delegatee + /// @param delegateeFrom old delegatee + /// @param delegateeTo new delegatee + /// @param amount redelegate stake amount, redelegate all if set 0 + function redelegate( + address delegateeFrom, + address delegateeTo, + uint256 amount + ) external onlyStaker(delegateeFrom) onlyStaker(delegateeTo) nonReentrant { + uint256 delegationAmount = _getDelegationAmount(delegateeFrom, _msgSender()); + if (_getDelegationAmount(delegateeFrom, _msgSender()) == 0) revert ErrZeroShares(); + if (_getDelegationAmount(delegateeFrom, _msgSender()) < amount) revert ErrInsufficientBalance(); + uint256 _amount = (amount == 0) ? delegationAmount : amount; + + bool updateSequencerSet; + + // ***************************** undelegate from old delegatee ***************************** // + // weather staker has been removed + bool removed = stakerRankings[delegateeFrom] == 0; + + // update delegatorDelegations & delegateeDelegations + if (!rewardStarted) { + delegatorDelegations[delegateeFrom][_msgSender()] -= _amount; // {share = _amount} before reward start + delegateeDelegations[delegateeFrom].amount -= _amount; + delegateeDelegations[delegateeFrom].share = delegateeDelegations[delegateeFrom].amount; // {share = _amount} before reward start + } else { + uint256 _tshare = delegateeDelegations[delegateeFrom].share; + uint256 _tAmount = delegateeDelegations[delegateeFrom].amount; + uint256 _uShare = delegatorDelegations[delegateeFrom][_msgSender()]; + + delegatorDelegations[delegateeFrom][_msgSender()] = _uShare - (amount * _tshare) / _tAmount; + delegateeDelegations[delegateeFrom].amount -= _amount; + delegateeDelegations[delegateeFrom].share = _tshare - (amount * _tshare) / _tAmount; + } + + uint256 beforeRanking = stakerRankings[delegateeFrom]; + if (!removed && rewardStarted && beforeRanking < candidateNumber) { + // update stakers and rankings + for (uint256 i = stakerRankings[delegateeFrom] - 1; i < candidateNumber - 1; i++) { + if ( + delegateeDelegations[stakerAddresses[i + 1]].amount > + delegateeDelegations[stakerAddresses[i]].amount + ) { + address tmp = stakerAddresses[i]; + stakerAddresses[i] = stakerAddresses[i + 1]; + stakerAddresses[i + 1] = tmp; + stakerRankings[stakerAddresses[i]] = i + 1; + stakerRankings[stakerAddresses[i + 1]] = i + 2; + } + } + } - for (uint256 i = 0; i < length; ) { - // if the reward is not started yet, claiming directly is allowed - if (!rewardStarted || undelegations[_msgSender()][i].unlockEpoch <= currentEpoch()) { - totalAmount += undelegations[_msgSender()][i].amount; + // update candidateNumber + if (!removed && delegateeDelegations[delegateeFrom].amount == 0) { + candidateNumber -= 1; + } - // event params - address delegatee = undelegations[_msgSender()][i].delegatee; - uint256 unlockEpoch = undelegations[_msgSender()][i].unlockEpoch; - uint256 amount = undelegations[_msgSender()][i].amount; + if ( + !removed && + rewardStarted && + beforeRanking <= latestSequencerSetSize && + (stakerRankings[delegateeFrom] > latestSequencerSetSize || stakerRankings[delegateeFrom] > candidateNumber) + ) { + updateSequencerSet = true; + } - if (i < length - 1) { - undelegations[_msgSender()][i] = undelegations[_msgSender()][length - 1]; + // ***************************** bond to new delegatee ***************************** // + + delegators[delegateeTo].add(_msgSender()); // will not be added repeatedly + + // update delegatorDelegations & delegateeDelegations + if (!rewardStarted) { + delegatorDelegations[delegateeTo][_msgSender()] += _amount; // {share = _amount} before reward start + delegateeDelegations[delegateeTo].amount += _amount; + delegateeDelegations[delegateeTo].share = delegateeDelegations[delegateeTo].amount; // {share = _amount} before reward start + } else { + uint256 _tshare = delegateeDelegations[delegateeTo].share; + uint256 _tAmount = delegateeDelegations[delegateeTo].amount; + uint256 _uShare = delegatorDelegations[delegateeTo][_msgSender()]; + + delegatorDelegations[delegateeTo][_msgSender()] = _uShare + (amount * _tshare) / _tAmount; + delegateeDelegations[delegateeTo].amount += _amount; + delegateeDelegations[delegateeTo].share = _tshare + (amount * _tshare) / _tAmount; + } + + if (delegateeDelegations[delegateeTo].amount == _amount) { + candidateNumber += 1; + } + + beforeRanking = stakerRankings[delegateeTo]; + if (rewardStarted && beforeRanking > 1) { + // update stakers and rankings + for (uint256 i = beforeRanking - 1; i > 0; i--) { + if ( + delegateeDelegations[stakerAddresses[i]].amount > + delegateeDelegations[stakerAddresses[i - 1]].amount + ) { + address tmp = stakerAddresses[i - 1]; + stakerAddresses[i - 1] = stakerAddresses[i]; + stakerAddresses[i] = tmp; + + stakerRankings[stakerAddresses[i - 1]] = i; + stakerRankings[stakerAddresses[i]] = i + 1; } - undelegations[_msgSender()].pop(); - length = length - 1; + } + } - emit UndelegationClaimed(delegatee, _msgSender(), unlockEpoch, amount); - } else { - i = i + 1; + if ( + rewardStarted && + beforeRanking > latestSequencerSetSize && + stakerRankings[delegateeTo] <= sequencerSetMaxSize + ) { + updateSequencerSet = true; + } + + // ********************************************************************************* // + + if (updateSequencerSet) { + _updateSequencerSet(); + } + + uint256 delegateeFromAmount = delegateeDelegations[delegateeFrom].amount; + uint256 delegateeToAmount = delegateeDelegations[delegateeTo].amount; + emit Redelegated(delegateeFrom, delegateeTo, _msgSender(), _amount, delegateeFromAmount, delegateeToAmount); + } + + /// @notice delegator cliam delegate staking value + /// @param number the number of undelegate requests to be claimed. 0 means claim all + /// @return amount the total amount of MPH claimed + function claimUndelegation(uint256 number) external nonReentrant returns (uint256) { + // number == 0 means claim all + // number should not exceed the length of the queue + if (_undelegateRequestsQueue[_msgSender()].length() == 0) revert ErrNoUndelegateRequest(); + + number = (number == 0 || number > _undelegateRequestsQueue[_msgSender()].length()) + ? _undelegateRequestsQueue[_msgSender()].length() + : number; + + uint256 totalAmount; + while (number != 0) { + bytes32 hash = _undelegateRequestsQueue[_msgSender()].front(); + UndelegateRequest memory request = _undelegateRequests[hash]; + if (rewardStarted && currentEpoch() < request.unlockEpoch) { + break; } + + // remove from the queue + _undelegateRequestsQueue[_msgSender()].popFront(); + + totalAmount += request.amount; + --number; } + if (totalAmount == 0) revert ErrNoClaimableUndelegateRequest(); - require(totalAmount > 0, "no Morph token to claim"); _transfer(_msgSender(), totalAmount); + + emit UndelegationClaimed(_msgSender(), totalAmount); + + return totalAmount; } - /// @notice delegator claim reward - /// @param delegatee delegatee address, claim all if empty - /// @param targetEpochIndex up to the epoch index that the delegator wants to claim - function claimReward(address delegatee, uint256 targetEpochIndex) external nonReentrant { - if (delegatee == address(0)) { - IDistribute(DISTRIBUTE_CONTRACT).claimAll(_msgSender(), targetEpochIndex); - } else { - IDistribute(DISTRIBUTE_CONTRACT).claim(delegatee, _msgSender(), targetEpochIndex); + /// @dev distribute inflation by MorphTokenContract on epoch end + /// @param amount total reward amount + function distribute(uint256 amount) external onlyMorphTokenContract { + if (epochTotalBlocks != 0) { + for (uint256 i = 0; i < epochSequencers.length(); i++) { + uint256 commissionRate = commissions[epochSequencers.at(i)].rate; + uint256 rewardAmount = (amount * epochSequencerBlocks[epochSequencers.at(i)]) / epochTotalBlocks; + uint256 commissionAmount = (rewardAmount * commissionRate) / COMMISSION_RATE_BASE; + uint256 delegatorRewardAmount = rewardAmount - commissionAmount; + + commissions[epochSequencers.at(i)].amount += commissionAmount; + delegateeDelegations[epochSequencers.at(i)].amount += delegatorRewardAmount; + + emit Distributed(epochSequencers.at(i), delegatorRewardAmount, commissionAmount); + } + } + + // clean block record + uint256 sequencerSetSize = epochSequencers.length(); + for (uint256 i = 0; i < sequencerSetSize; i++) { + delete epochSequencerBlocks[epochSequencers.at(0)]; + // remove the first element, then the last one will be moved to the first + epochSequencers.remove(epochSequencers.at(0)); } + epochTotalBlocks = 0; + } + + /// @dev record block producer + /// @param sequencerAddr producer address + function recordBlocks(address sequencerAddr) external onlSystem { + epochSequencers.add(sequencerAddr); + epochTotalBlocks += 1; + epochSequencerBlocks[sequencerAddr] += 1; } /************************* * Public View Functions * *************************/ + /// @notice return the total length of delegator's pending undelegate queue. + /// @param delegator delegator + function pendingUndelegateRequest(address delegator) public view returns (uint256) { + return _undelegateRequestsQueue[delegator].length(); + } + + /// @notice return the total number of delegator's claimable undelegate requests. + /// @param delegator delegator + function claimableUndelegateRequest(address delegator) public view returns (uint256) { + uint256 length = _undelegateRequestsQueue[delegator].length(); + + if (!rewardStarted) { + return length; + } + for (uint256 i = 0; i < length; ++i) { + bytes32 hash = _undelegateRequestsQueue[delegator].at(i); + UndelegateRequest memory request = _undelegateRequests[hash]; + if (currentEpoch() < request.unlockEpoch) { + return i; + } + } + return length; + } + + /// @notice return the sum of first `number` requests' MPH locked in delegator's undelegate queue. + /// @param delegator delegator + /// @param number number + function lockedAmount(address delegator, uint256 number) public view returns (uint256) { + // number == 0 means all + // number should not exceed the length of the queue + if (_undelegateRequestsQueue[delegator].length() == 0) { + return 0; + } + number = (number == 0 || number > _undelegateRequestsQueue[delegator].length()) + ? _undelegateRequestsQueue[delegator].length() + : number; + + uint256 _totalAmount; + for (uint256 i; i < number; ++i) { + bytes32 hash = _undelegateRequestsQueue[delegator].at(i); + UndelegateRequest memory request = _undelegateRequests[hash]; + _totalAmount += request.amount; + } + return _totalAmount; + } + + /// @notice return the undelegate request at _index. + /// @param delegator delegator + /// @param _index index + function undelegateRequest(address delegator, uint256 _index) public view returns (UndelegateRequest memory) { + bytes32 hash = _undelegateRequestsQueue[delegator].at(_index); + return _undelegateRequests[hash]; + } + + /// @notice return the personal undelegate sequence of the delegator. + /// @param delegator delegator + function undelegateSequence(address delegator) public view returns (uint256) { + return _undelegateSequence[delegator].current(); + } + /// @notice return current reward epoch index function currentEpoch() public view returns (uint256) { - require(block.timestamp >= rewardStartTime, "reward is not started yet"); + if (block.timestamp < rewardStartTime) revert ErrRewardNotStarted(); return (block.timestamp - rewardStartTime) / REWARD_EPOCH; } @@ -542,7 +796,7 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp uint256 pageSize, uint256 pageIndex ) external view returns (uint256 delegatorsTotalNumber, address[] memory delegatorsInPage) { - require(pageSize > 0, "invalid page size"); + if (pageSize == 0) revert ErrInvalidPageSize(); delegatorsTotalNumber = delegators[staker].length(); delegatorsInPage = new address[](pageSize); @@ -591,36 +845,50 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp return stakerAddresses.length; } - /// @notice get undelegations of a delegator - /// @param delegator delegator - function getUndelegations(address delegator) external view returns (Undelegation[] memory) { - return undelegations[delegator]; + /// @notice query all unclaimed commission of a delegatee + /// @param delegatee delegatee address + function queryUnclaimedCommission(address delegatee) external view returns (uint256 amount) { + return commissions[delegatee].amount; + } + + /// @notice query delegation amount of a delegator + /// @param delegatee delegatee address + /// @param delegator delegator address + function queryDelegationAmount(address delegatee, address delegator) external view returns (uint256 amount) { + return _getDelegationAmount(delegatee, delegator); } /********************** * Internal Functions * **********************/ + /// @notice use sequence + function _useSequence(address delegator) internal returns (uint256 current) { + CountersUpgradeable.Counter storage sequence = _undelegateSequence[delegator]; + current = sequence.current(); + sequence.increment(); + } + /// @notice transfer morph token function _transfer(address _to, uint256 _amount) internal { uint256 balanceBefore = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(_to); - require(IMorphToken(MORPH_TOKEN_CONTRACT).transfer(_to, _amount), "transfer failed"); + if (!IMorphToken(MORPH_TOKEN_CONTRACT).transfer(_to, _amount)) revert ErrTransferFailed(); uint256 balanceAfter = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(_to); - require(_amount > 0 && balanceAfter - balanceBefore == _amount, "morph token transfer failed"); + if (_amount == 0 || balanceAfter - balanceBefore != _amount) revert ErrTransferFailed(); } /// @notice transfer morph token from function _transferFrom(address _from, address _to, uint256 _amount) internal { uint256 balanceBefore = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(_to); - require(IMorphToken(MORPH_TOKEN_CONTRACT).transferFrom(_from, _to, _amount), "transferFrom failed"); + if (!IMorphToken(MORPH_TOKEN_CONTRACT).transferFrom(_from, _to, _amount)) revert ErrTransferFailed(); uint256 balanceAfter = IMorphToken(MORPH_TOKEN_CONTRACT).balanceOf(_to); - require(_amount > 0 && balanceAfter - balanceBefore == _amount, "morph token transfer failed"); + if (_amount == 0 || balanceAfter - balanceBefore != _amount) revert ErrTransferFailed(); } - /// @notice check if the user has staked to staker - /// @param staker sequencers size - function _isStakingTo(address staker) internal view returns (bool) { - return delegations[staker][_msgSender()] > 0; + /// @notice check if the user has staked to delegatee + /// @param delegatee delegatee + function _isStakingTo(address delegatee) internal view returns (bool) { + return delegatorDelegations[delegatee][_msgSender()] > 0; } /// @notice select the size of staker with the largest staking amount, the max size is ${sequencerSetMaxSize} @@ -641,18 +909,14 @@ contract L2Staking is IL2Staking, Staking, OwnableUpgradeable, ReentrancyGuardUp latestSequencerSetSize = sequencerSet.length; } - /// @notice whether there is a undedeletion unclaimed - function _unclaimedUndelegation(address delegator, address delegatee) internal view returns (bool) { - for (uint256 i = 0; i < undelegations[delegator].length; i++) { - if (undelegations[delegator][i].delegatee == delegatee) { - return true; - } - } - return false; - } - - /// @notice whether there is a undedeletion unclaimed - function _unclaimedReward(address delegator, address delegatee) internal view returns (bool) { - return !IDistribute(DISTRIBUTE_CONTRACT).isRewardClaimed(delegator, delegatee); + /// @notice query delegation amount of a delegator + /// @param delegatee delegatee address + /// @param delegator delegator address + function _getDelegationAmount(address delegatee, address delegator) internal view returns (uint256 amount) { + return + delegatorDelegations[delegatee][delegator] == 0 + ? 0 + : (delegateeDelegations[delegatee].amount * delegatorDelegations[delegatee][delegator]) / + delegateeDelegations[delegatee].share; } } diff --git a/contracts/contracts/l2/staking/Record.sol b/contracts/contracts/l2/staking/Record.sol deleted file mode 100644 index 1d218f69b..000000000 --- a/contracts/contracts/l2/staking/Record.sol +++ /dev/null @@ -1,262 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity =0.8.24; - -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -import {Predeploys} from "../../libraries/constants/Predeploys.sol"; -import {IMorphToken} from "../system/IMorphToken.sol"; -import {IL2Staking} from "./IL2Staking.sol"; -import {IDistribute} from "./IDistribute.sol"; -import {IRecord} from "./IRecord.sol"; - -contract Record is IRecord, OwnableUpgradeable { - /************* - * Constants * - *************/ - - /// @notice inflation rate precision - uint256 private constant PRECISION = 1e8; - - /// @notice MorphToken contract address - address public immutable MORPH_TOKEN_CONTRACT; - - /// @notice l2 staking contract address - address public immutable L2_STAKING_CONTRACT; - - /// @notice sequencer contract address - address public immutable SEQUENCER_CONTRACT; - - /// @notice distribute contract address - address public immutable DISTRIBUTE_CONTRACT; - - /// @notice gov contract address - address public immutable GOV_CONTRACT; - - /************* - * Variables * - *************/ - - /// @notice oracle address - address public oracle; - - /// @notice If the sequencer set or rollup epoch changed, reset the submitter round - mapping(uint256 batchIndex => BatchSubmission) public batchSubmissions; - - /// @notice rollup epoch info - mapping(uint256 rollupEpochIndex => RollupEpochInfo) public rollupEpochs; - - /// @notice reward epoch info - mapping(uint256 rewardEpochIndex => RewardEpochInfo) public rewardEpochs; - - /// @notice next batch submission index - uint256 public override nextBatchSubmissionIndex; - - /// @notice next rollup epoch index - uint256 public override nextRollupEpochIndex; - - /// @notice next reward epoch index - uint256 public override nextRewardEpochIndex; - - /// @notice latest reward epoch block - uint256 public override latestRewardEpochBlock; - - /********************** - * Function Modifiers * - **********************/ - - /// @notice Only prover allowed. - modifier onlyOracle() { - require(_msgSender() == oracle, "only oracle allowed"); - _; - } - - /*************** - * Constructor * - ***************/ - - /// @notice constructor - constructor() { - MORPH_TOKEN_CONTRACT = Predeploys.MORPH_TOKEN; - L2_STAKING_CONTRACT = Predeploys.L2_STAKING; - SEQUENCER_CONTRACT = Predeploys.SEQUENCER; - DISTRIBUTE_CONTRACT = Predeploys.DISTRIBUTE; - GOV_CONTRACT = Predeploys.GOV; - _disableInitializers(); - } - - /*************** - * Initializer * - ***************/ - - /// @notice Initializer. - /// @param _owner owner - /// @param _oracle oracle address - /// @param _nextBatchSubmissionIndex next batch submission index - function initialize(address _owner, address _oracle, uint256 _nextBatchSubmissionIndex) public initializer { - require(_owner != address(0), "invalid owner address"); - require(_nextBatchSubmissionIndex != 0, "invalid next batch submission index"); - require(_oracle != address(0), "invalid oracle address"); - - _transferOwnership(_owner); - - oracle = _oracle; - nextBatchSubmissionIndex = _nextBatchSubmissionIndex; - } - - /************************ - * Restricted Functions * - ************************/ - - /// @notice set oracle address - /// @param _oracle oracle address - function setOracleAddress(address _oracle) external onlyOwner { - require(_oracle != address(0), "invalid oracle address"); - oracle = _oracle; - } - - /// @notice set latest block - /// @param _latestBlock latest block - function setLatestRewardEpochBlock(uint256 _latestBlock) external onlyOracle { - require(latestRewardEpochBlock == 0, "already set"); - require(_latestBlock > 0, "invalid latest block"); - latestRewardEpochBlock = _latestBlock; - } - - /// @notice record batch submissions - function recordFinalizedBatchSubmissions(BatchSubmission[] calldata _batchSubmissions) external onlyOracle { - require(_batchSubmissions.length > 0, "empty batch submissions"); - for (uint256 i = 0; i < _batchSubmissions.length; i++) { - require(_batchSubmissions[i].index == nextBatchSubmissionIndex + i, "invalid index"); - // TODO: check more - batchSubmissions[_batchSubmissions[i].index] = BatchSubmission( - _batchSubmissions[i].index, - _batchSubmissions[i].submitter, - _batchSubmissions[i].startBlock, - _batchSubmissions[i].endBlock, - _batchSubmissions[i].rollupTime, - _batchSubmissions[i].rollupBlock - ); - } - emit BatchSubmissionsUploaded(nextBatchSubmissionIndex, _batchSubmissions.length); - nextBatchSubmissionIndex += _batchSubmissions.length; - } - - /// @notice record epochs - function recordRollupEpochs(RollupEpochInfo[] calldata _rollupEpochs) external onlyOracle { - require(_rollupEpochs.length > 0, "empty rollup epochs"); - for (uint256 i = 0; i < _rollupEpochs.length; i++) { - require(_rollupEpochs[i].index == nextRollupEpochIndex + i, "invalid index"); - // TODO: check more - rollupEpochs[_rollupEpochs[i].index] = RollupEpochInfo( - _rollupEpochs[i].index, - _rollupEpochs[i].submitter, - _rollupEpochs[i].startTime, - _rollupEpochs[i].endTime, - _rollupEpochs[i].endBlock - ); - } - emit RollupEpochsUploaded(nextRollupEpochIndex, _rollupEpochs.length); - nextRollupEpochIndex += _rollupEpochs.length; - } - - /// @notice record epochs - function recordRewardEpochs(RewardEpochInfo[] calldata _rewardEpochs) external onlyOracle { - require(_rewardEpochs.length > 0, "empty reward epochs"); - require(latestRewardEpochBlock > 0, "start block should be set"); - require( - nextRewardEpochIndex + _rewardEpochs.length - 1 < IL2Staking(L2_STAKING_CONTRACT).currentEpoch(), - "unfinished epochs cannot be uploaded" - ); - IMorphToken(MORPH_TOKEN_CONTRACT).mintInflations(nextRewardEpochIndex + _rewardEpochs.length - 1); - - uint256 totalBlocks; - for (uint256 i = 0; i < _rewardEpochs.length; i++) { - uint256 dataLen = _rewardEpochs[i].sequencers.length; - uint256 index = _rewardEpochs[i].index; - require(index == nextRewardEpochIndex + i, "invalid epoch index"); - require( - _rewardEpochs[i].sequencerBlocks.length == dataLen && - _rewardEpochs[i].sequencerRatios.length == dataLen && - _rewardEpochs[i].sequencerCommissions.length == dataLen, - "invalid data length" - ); - - totalBlocks += _rewardEpochs[i].blockCount; - rewardEpochs[index] = RewardEpochInfo( - index, - _rewardEpochs[i].blockCount, - _rewardEpochs[i].sequencers, - _rewardEpochs[i].sequencerBlocks, - _rewardEpochs[i].sequencerRatios, - _rewardEpochs[i].sequencerCommissions - ); - - uint256 inflationAmount = IMorphToken(MORPH_TOKEN_CONTRACT).inflation(index); - uint256 blockCount; - uint256 ratioSum; - uint256[] memory delegatorRewards = new uint256[](dataLen); - uint256[] memory commissions = new uint256[](dataLen); - for (uint256 j = 0; j < dataLen; j++) { - require(_rewardEpochs[i].sequencerCommissions[j] <= 20, "invalid sequencers commission"); - ratioSum += _rewardEpochs[i].sequencerRatios[j]; - blockCount += _rewardEpochs[i].sequencerBlocks[j]; - - // compute rewards per sequencer - uint256 reward = (inflationAmount * _rewardEpochs[i].sequencerRatios[j]) / PRECISION; - commissions[j] = (reward * _rewardEpochs[i].sequencerCommissions[j]) / 100; - delegatorRewards[j] = reward - commissions[j]; - } - require(blockCount == _rewardEpochs[i].blockCount, "invalid sequencers blocks"); - require(ratioSum <= PRECISION, "invalid sequencers ratios"); - - // update sequencers reward data - IDistribute(DISTRIBUTE_CONTRACT).updateEpochReward( - index, - _rewardEpochs[i].sequencers, - delegatorRewards, - commissions - ); - } - - emit RewardEpochsUploaded(nextRewardEpochIndex, _rewardEpochs.length); - latestRewardEpochBlock += totalBlocks; - nextRewardEpochIndex += _rewardEpochs.length; - } - - /************************* - * Public View Functions * - *************************/ - - /// @notice getBatchSubmissions - /// @param start start index - /// @param end end index - function getBatchSubmissions(uint256 start, uint256 end) external view returns (BatchSubmission[] memory res) { - require(end >= start, "invalid index"); - res = new BatchSubmission[](end - start + 1); - for (uint256 i = start; i <= end; i++) { - res[i] = batchSubmissions[i]; - } - } - - /// @notice get rollup epochs - /// @param start start index - /// @param end end index - function getRollupEpochs(uint256 start, uint256 end) external view returns (RollupEpochInfo[] memory res) { - require(end >= start, "invalid index"); - res = new RollupEpochInfo[](end - start + 1); - for (uint256 i = start; i <= end; i++) { - res[i] = rollupEpochs[i]; - } - } - - /// @notice get reward epochs - /// @param start start index - /// @param end end index - function getRewardEpochs(uint256 start, uint256 end) external view returns (RewardEpochInfo[] memory res) { - require(end >= start, "invalid index"); - res = new RewardEpochInfo[](end - start + 1); - for (uint256 i = start; i <= end; i++) { - res[i] = rewardEpochs[i]; - } - } -} diff --git a/contracts/contracts/l2/system/IMorphToken.sol b/contracts/contracts/l2/system/IMorphToken.sol index e4ae59a4e..3e5ac5d84 100644 --- a/contracts/contracts/l2/system/IMorphToken.sol +++ b/contracts/contracts/l2/system/IMorphToken.sol @@ -95,6 +95,5 @@ interface IMorphToken is IERC20MetadataUpgradeable { function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); /// @dev mint inflations - /// @param upToEpochIndex mint up to which epoch - function mintInflations(uint256 upToEpochIndex) external; + function mintInflations() external; } diff --git a/contracts/contracts/l2/system/MorphToken.sol b/contracts/contracts/l2/system/MorphToken.sol index 2665d7d9b..25218874a 100644 --- a/contracts/contracts/l2/system/MorphToken.sol +++ b/contracts/contracts/l2/system/MorphToken.sol @@ -19,11 +19,8 @@ contract MorphToken is IMorphToken, OwnableUpgradeable { /// @notice l2 staking contract address address public immutable L2_STAKING_CONTRACT; - /// @notice distribute contract address - address public immutable DISTRIBUTE_CONTRACT; - - /// @notice record contract address - address public immutable RECORD_CONTRACT; + /// @notice system address + address public immutable SYSTEM_ADDRESS; /************* * Variables * @@ -57,9 +54,9 @@ contract MorphToken is IMorphToken, OwnableUpgradeable { * Function Modifiers * **********************/ - /// @notice Ensures that the caller message from record contract. - modifier onlyRecordContract() { - require(_msgSender() == RECORD_CONTRACT, "only record contract allowed"); + /// @notice Ensures that the caller message from system + modifier onlSystem() { + require(_msgSender() == SYSTEM_ADDRESS, "only system address allowed"); _; } @@ -70,8 +67,7 @@ contract MorphToken is IMorphToken, OwnableUpgradeable { /// @notice constructor constructor() { L2_STAKING_CONTRACT = Predeploys.L2_STAKING; - DISTRIBUTE_CONTRACT = Predeploys.DISTRIBUTE; - RECORD_CONTRACT = Predeploys.RECORD; + SYSTEM_ADDRESS = Predeploys.SYSTEM; } /************** @@ -116,13 +112,10 @@ contract MorphToken is IMorphToken, OwnableUpgradeable { } /// @dev mint inflations - /// @param upToEpochIndex mint up to which epoch - function mintInflations(uint256 upToEpochIndex) external onlyRecordContract { + function mintInflations() external onlSystem { // inflations can only be minted for epochs that have ended. - require( - IL2Staking(L2_STAKING_CONTRACT).currentEpoch() > upToEpochIndex, - "the specified time has not yet been reached" - ); + require(IL2Staking(L2_STAKING_CONTRACT).currentEpoch() > 0, "no inflations yet"); + uint256 upToEpochIndex = IL2Staking(L2_STAKING_CONTRACT).currentEpoch() - 1; require(upToEpochIndex >= _inflationMintedEpochs, "all inflations minted"); // the index of next epoch to mint is equal to the count of minted epochs @@ -137,7 +130,8 @@ contract MorphToken is IMorphToken, OwnableUpgradeable { } uint256 increment = (_totalSupply * rate) / PRECISION; _inflations[i] = increment; - _mint(DISTRIBUTE_CONTRACT, increment); + _mint(L2_STAKING_CONTRACT, increment); + IL2Staking(L2_STAKING_CONTRACT).distribute(increment); emit InflationMinted(i, increment); } diff --git a/contracts/contracts/libraries/constants/Predeploys.sol b/contracts/contracts/libraries/constants/Predeploys.sol index f467f56f7..e6506bb8d 100644 --- a/contracts/contracts/libraries/constants/Predeploys.sol +++ b/contracts/contracts/libraries/constants/Predeploys.sol @@ -82,21 +82,11 @@ library Predeploys { */ address internal constant L2_WETH = 0x5300000000000000000000000000000000000011; - /** - * @notice Address of the RECORD predeploy. - */ - address internal constant RECORD = 0x5300000000000000000000000000000000000012; - /** * @notice Address of the MORPH_TOKEN predeploy. */ address internal constant MORPH_TOKEN = 0x5300000000000000000000000000000000000013; - /** - * @notice Address of the DISTRIBUTE predeploy. - */ - address internal constant DISTRIBUTE = 0x5300000000000000000000000000000000000014; - /** * @notice Address of the L2_STAKING predeploy. */ @@ -116,4 +106,9 @@ library Predeploys { * @notice Address of the L2_REVERSE_ERC20_GATEWAY predeploy. */ address internal constant L2_REVERSE_ERC20_GATEWAY = 0x5300000000000000000000000000000000000018; + + /** + * @notice Address of the System. + */ + address internal constant SYSTEM = 0x5300000000000000000000000000000000000021; } diff --git a/contracts/contracts/test/Distribute.t.sol b/contracts/contracts/test/Distribute.t.sol deleted file mode 100644 index ac4119cc7..000000000 --- a/contracts/contracts/test/Distribute.t.sol +++ /dev/null @@ -1,300 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity =0.8.24; - -import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol"; -import {IDistribute} from "../l2/staking/IDistribute.sol"; - -contract DistributeTest is L2StakingBaseTest { - address public firstStaker; - address public secondStaker; - uint256 public mockReward; - uint256 public mockCommission; - - function setUp() public virtual override { - super.setUp(); - - firstStaker = address(uint160(beginSeq)); - secondStaker = address(uint160(beginSeq + 1)); - mockReward = 10 ether; - mockCommission = 1 ether; - } - - /** - * @notice update epoch reward - */ - function _update_epoch_reward(uint256 epochIndex) internal { - uint256 updateEpochNum = sequencer.getSequencerSet2Size(); - address[] memory sequencers = new address[](updateEpochNum); - uint256[] memory delegatorRewards = new uint256[](updateEpochNum); - uint256[] memory commissions = new uint256[](updateEpochNum); - - for (uint256 i = 0; i < updateEpochNum; i++) { - sequencers[i] = address(uint160(beginSeq + i)); - delegatorRewards[i] = mockReward; - commissions[i] = mockCommission; - } - - hevm.prank(address(record)); - distribute.updateEpochReward(epochIndex, sequencers, delegatorRewards, commissions); - } - - /** - * @notice initialize: re-initialize - */ - function test_initialize_onlyOnce_reverts() public { - hevm.expectRevert("Initializable: contract is already initialized"); - hevm.prank(multisig); - distribute.initialize(multisig); - } - - /** - * @notice notifyDelegation: only l2 staking allowed - */ - function test_notifyDelegation_onlyCaller_reverts() public { - hevm.expectRevert("only l2 staking contract allowed"); - hevm.prank(alice); - distribute.notifyDelegation(address(0), address(0), 0, 0, 0, false); - } - - /** - * @notice notifyUndelegation: only l2 staking allowed - */ - function test_notifyUndelegation_onlyCaller_reverts() public { - hevm.expectRevert("only l2 staking contract allowed"); - hevm.prank(alice); - distribute.notifyUndelegation(address(0), address(0), 0, 0); - } - - /** - * @notice claim: check params - * 1. only l2 staking allowed - * 2. not minted yet - * 3. no remaining reward - */ - function test_claim_paramsCheck_reverts() public { - hevm.expectRevert("only l2 staking contract allowed"); - hevm.prank(alice); - distribute.claim(address(0), address(0), 0); - - hevm.expectRevert("not minted yet"); - hevm.prank(address(l2Staking)); - distribute.claim(address(0), address(0), 0); - - _update_epoch_reward(0); - hevm.expectRevert("no remaining reward"); - hevm.prank(address(l2Staking)); - distribute.claim(firstStaker, alice, 0); - } - - /** - * @notice claim - * 1. normal claim - * 2. all reward claimed - */ - function test_claim_succeeds() public { - hevm.prank(address(l2Staking)); - distribute.notifyDelegation(firstStaker, alice, 0, 10 ether, 10 ether, true); - - _update_epoch_reward(0); - - // mock inflation - hevm.prank(multisig); - morphToken.transfer(address(distribute), 100 ether); - - uint256 reward = distribute.queryUnclaimed(firstStaker, alice); - assertEq(reward, mockReward); - - // Verify the RewardClaimed event is emitted successfully. - hevm.expectEmit(true, true, true, true); - emit IDistribute.RewardClaimed(alice, firstStaker, 0, mockReward); - - // delegator claim - uint256 balanceBefore = morphToken.balanceOf(alice); - hevm.prank(address(l2Staking)); - distribute.claim(firstStaker, alice, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter - balanceBefore, mockReward); - - // delegatee claimCommission - balanceBefore = morphToken.balanceOf(firstStaker); - hevm.prank(address(l2Staking)); - distribute.claimCommission(firstStaker); - balanceAfter = morphToken.balanceOf(firstStaker); - assertEq(balanceAfter - balanceBefore, mockCommission); - - hevm.expectRevert("all reward claimed"); - hevm.prank(address(l2Staking)); - distribute.claim(firstStaker, alice, 0); - } - - /** - * @notice claim - * 1. normal claim - * 2. all reward claimed - * 3. target epoch index > minted_count - 1 - */ - function test_claim_works() public { - hevm.prank(address(l2Staking)); - distribute.notifyDelegation(firstStaker, alice, 0, 10 ether, 10 ether, true); - - _update_epoch_reward(0); - - // mock inflation - hevm.prank(multisig); - morphToken.transfer(address(distribute), 100 ether); - - uint256 reward = distribute.queryUnclaimed(firstStaker, alice); - assertEq(reward, mockReward); - - uint256 target_epoch_index = 4; - - // delegator claim - uint256 balanceBefore = morphToken.balanceOf(alice); - hevm.prank(address(l2Staking)); - distribute.claim(firstStaker, alice, target_epoch_index); - uint256 balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter - balanceBefore, mockReward); - - // delegatee claimCommission - balanceBefore = morphToken.balanceOf(firstStaker); - hevm.prank(address(l2Staking)); - distribute.claimCommission(firstStaker); - balanceAfter = morphToken.balanceOf(firstStaker); - assertEq(balanceAfter - balanceBefore, mockCommission); - - hevm.expectRevert("all reward claimed"); - hevm.prank(address(l2Staking)); - distribute.claim(firstStaker, alice, target_epoch_index); - } - - /** - * @notice claimAll: only l2 staking allowed - */ - function test_claimAll_paramsCheck_reverts() public { - hevm.expectRevert("only l2 staking contract allowed"); - hevm.prank(alice); - distribute.claimAll(address(0), 0); - - hevm.expectRevert("not minted yet"); - hevm.prank(address(l2Staking)); - distribute.claim(address(0), address(0), 0); - } - - /** - * @notice claimAll: Test claiming rewards from multiple delegatees. - */ - function test_claimAll_multipleDelegatees_succeeds() public { - // Notify delegation from two stakers: 10 ether and 5 ether to Alice - hevm.startPrank(address(l2Staking)); - distribute.notifyDelegation(firstStaker, alice, 0, 10 ether, 10 ether, true); - distribute.notifyDelegation(secondStaker, alice, 0, 5 ether, 5 ether, true); - hevm.stopPrank(); - - // Update the epoch reward for epoch 0. - _update_epoch_reward(0); - - // Transfer 100 ether to the distribute contract from multisig - hevm.prank(multisig); - morphToken.transfer(address(distribute), 100 ether); - - uint256 rewardBefore = morphToken.balanceOf(alice); - - // Claim all rewards for Alice for epoch 0 - hevm.prank(address(l2Staking)); - distribute.claimAll(alice, 0); - uint256 rewardAfter = morphToken.balanceOf(alice); - - // Verify Alice claimed the expected amount of rewards (mockReward * 2). - assertEq(rewardAfter, rewardBefore + mockReward * 2); - } - - /** - * @notice updateEpochReward: only record contract allowed - */ - function test_updateEpochReward_paramsCheck_reverts() public { - uint256 updateEpochNum = 1; - address[] memory sequencers = new address[](updateEpochNum); - uint256[] memory delegatorRewards = new uint256[](updateEpochNum); - uint256[] memory commissions = new uint256[](updateEpochNum); - - hevm.expectRevert("only record contract allowed"); - hevm.prank(alice); - distribute.updateEpochReward(0, sequencers, delegatorRewards, commissions); - - hevm.expectRevert("invalid epoch index"); - hevm.prank(address(record)); - distribute.updateEpochReward(1, sequencers, delegatorRewards, commissions); - - delegatorRewards = new uint256[](2); - hevm.expectRevert("invalid data length"); - hevm.prank(address(record)); - distribute.updateEpochReward(0, sequencers, delegatorRewards, commissions); - } - - /** - * @notice claimCommission: only l2 staking allowed - */ - function test_claimCommission_onlyCaller_reverts() public { - hevm.expectRevert("only l2 staking contract allowed"); - hevm.prank(alice); - distribute.claimCommission(address(0)); - } - - /** - * @notice claimCommission: expect revert if tokens are not minted yet - */ - function test_claimCommission_notMinted_reverts() public { - hevm.expectRevert("no commission to claim"); - hevm.prank(address(l2Staking)); - distribute.claimCommission(address(0)); - } - - /** - * @notice claimCommission: claim commission - */ - function test_claimCommission_succeeds() public { - // Simulate l2Staking address to notify delegation. - hevm.prank(address(l2Staking)); - distribute.notifyDelegation(firstStaker, alice, 0, 10 ether, 10 ether, true); - - // Update the epoch reward for epoch 0. - _update_epoch_reward(0); - - // Transfer 10 ether to the distribute contract from multisig. - hevm.prank(multisig); - morphToken.transfer(address(distribute), 10 ether); - - // Expect the CommissionClaimed event to be emitted successfully. - hevm.expectEmit(true, true, true, true); - emit IDistribute.CommissionClaimed(firstStaker, 1 ether); - - uint256 beforeReward = morphToken.balanceOf(firstStaker); - - // Simulate l2Staking address to claim the commission for the first staker for epoch 0 - hevm.prank(address(l2Staking)); - distribute.claimCommission(firstStaker); - uint256 afterReward = morphToken.balanceOf(firstStaker); - - // Verify the reward after claiming is the reward before plus the mock commission. - assertEq(afterReward, beforeReward + mockCommission); - } - - /** - * @notice claimCommission: expect revert "all commission claimed" - */ - function test_claimCommission_allCommissionClaimed_reverts() public { - hevm.prank(address(l2Staking)); - distribute.notifyDelegation(firstStaker, alice, 0, 10 ether, 10 ether, true); - _update_epoch_reward(0); - - hevm.prank(multisig); - morphToken.transfer(address(distribute), 10 ether); - - hevm.prank(address(l2Staking)); - distribute.claimCommission(firstStaker); - - hevm.expectRevert("no commission to claim"); - hevm.prank(address(l2Staking)); - distribute.claimCommission(firstStaker); - } -} diff --git a/contracts/contracts/test/Gov.t.sol b/contracts/contracts/test/Gov.t.sol index e0b5482de..45f8a7e98 100644 --- a/contracts/contracts/test/Gov.t.sol +++ b/contracts/contracts/test/Gov.t.sol @@ -19,23 +19,19 @@ contract GovTest is L2StakingBaseTest { function test_initialize_paramsCheck_reverts() public { hevm.expectRevert("Initializable: contract is already initialized"); hevm.prank(multisig); - gov.initialize(multisig, 0, 0, 0, 0); + gov.initialize(multisig, 0, 0, 0); // reset initialize hevm.store(address(gov), bytes32(uint256(0)), bytes32(uint256(0))); hevm.expectRevert("invalid proposal voting duration"); hevm.prank(multisig); - gov.initialize(multisig, 0, 0, 0, 0); - - hevm.expectRevert("invalid rollup epoch"); - hevm.prank(multisig); - gov.initialize(multisig, 1, 0, 0, 0); + gov.initialize(multisig, 0, 0, 0); // _batchBlockInterval hevm.expectRevert("invalid batch params"); hevm.prank(multisig); - gov.initialize(multisig, 1, 0, 0, 1); + gov.initialize(multisig, 1, 0, 0); } /** @@ -44,24 +40,22 @@ contract GovTest is L2StakingBaseTest { function test_createProposal_succeeds() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); address user = address(uint160(beginSeq)); uint256 nextProposalID = gov.currentProposalID() + 1; hevm.expectEmit(true, true, true, true); - emit IGov.ProposalCreated(nextProposalID, user, 0, finalizationPeriodSeconds, ROLLUP_EPOCH); + emit IGov.ProposalCreated(nextProposalID, user, 0, finalizationPeriodSeconds); hevm.startPrank(address(user)); uint256 proposalID = gov.createProposal(proposal); uint256 currentProposalID = gov.currentProposalID(); assertEq(proposalID, nextProposalID); assertEq(proposalID, currentProposalID); - (uint256 batchBlockInterval_, uint256 batchTimeout_, uint256 rollupEpoch_) = gov.proposalData(proposalID); + (uint256 batchBlockInterval_, uint256 batchTimeout_) = gov.proposalData(proposalID); hevm.stopPrank(); assertEq(batchBlockInterval_, proposal.batchBlockInterval); assertEq(batchTimeout_, proposal.batchTimeout); - assertEq(rollupEpoch_, proposal.rollupEpoch); uint256 expirationTime; bool finished; @@ -83,8 +77,7 @@ contract GovTest is L2StakingBaseTest { function test_vote_succeeds() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -101,7 +94,7 @@ contract GovTest is L2StakingBaseTest { voteCnt++; if (voteCnt > ((SEQUENCER_SIZE * 2) / 3)) { hevm.expectEmit(true, true, true, true); - emit IGov.ProposalExecuted(proposalID, 0, finalizationPeriodSeconds, ROLLUP_EPOCH); + emit IGov.ProposalExecuted(proposalID, 0, finalizationPeriodSeconds); } gov.vote(proposalID); hevm.stopPrank(); @@ -129,8 +122,7 @@ contract GovTest is L2StakingBaseTest { function test_proposalExecute_succeeds() external { IGov.ProposalData memory proposal = IGov.ProposalData( 1, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -186,7 +178,6 @@ contract GovTest is L2StakingBaseTest { assertEq(gov.batchBlockInterval(), 1); assertEq(gov.batchTimeout(), finalizationPeriodSeconds); - assertEq(gov.rollupEpoch(), ROLLUP_EPOCH); } /** @@ -197,8 +188,7 @@ contract GovTest is L2StakingBaseTest { function test_executeWithNewSequencers_succeeds() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -284,8 +274,7 @@ contract GovTest is L2StakingBaseTest { function test_vote_expired_reverts() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -308,8 +297,7 @@ contract GovTest is L2StakingBaseTest { function test_vote_repeatVoting_reverts() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -339,8 +327,7 @@ contract GovTest is L2StakingBaseTest { function test_createProposal_onlySequencer_reverts() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -350,32 +337,13 @@ contract GovTest is L2StakingBaseTest { hevm.stopPrank(); } - /** - * @notice createProposal: Reverts if rollup epoch is zero. - */ - function test_createProposal_zeroRollupEpoch_reverts() external { - IGov.ProposalData memory proposal = IGov.ProposalData( - 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - 0 // rollupEpoch - ); - - // Expect revert due to zero rollup epoch. - hevm.expectRevert("invalid rollup epoch"); - address user = address(uint160(beginSeq)); - hevm.startPrank(address(user)); - gov.createProposal(proposal); - hevm.stopPrank(); - } - /** * @notice createProposal: Reverts if batch parameters are zero. */ function test_createProposal_zeroBatchParams_reverts() external { IGov.ProposalData memory proposal = IGov.ProposalData( 0, // batchBlockInterval - 0, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + 0 // batchTimeout ); // Expect revert due to zero batch params. @@ -444,8 +412,7 @@ contract GovTest is L2StakingBaseTest { function test_deleteOldData_reverts() external { IGov.ProposalData memory proposal0 = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -478,7 +445,6 @@ contract GovTest is L2StakingBaseTest { assertEq(gov.batchBlockInterval(), 0); assertEq(gov.batchTimeout(), finalizationPeriodSeconds); - assertEq(gov.rollupEpoch(), ROLLUP_EPOCH); assertEq(gov.undeletedProposalStart(), 0); hevm.prank(address(user)); @@ -494,8 +460,7 @@ contract GovTest is L2StakingBaseTest { function test_deleteOldData_succeeds() external { IGov.ProposalData memory proposal0 = IGov.ProposalData( 0, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -528,7 +493,6 @@ contract GovTest is L2StakingBaseTest { assertEq(gov.batchBlockInterval(), 0); assertEq(gov.batchTimeout(), finalizationPeriodSeconds); - assertEq(gov.rollupEpoch(), ROLLUP_EPOCH); assertEq(gov.undeletedProposalStart(), 0); hevm.prank(address(user)); @@ -539,8 +503,7 @@ contract GovTest is L2StakingBaseTest { IGov.ProposalData memory proposal1 = IGov.ProposalData( 100, // batchBlockInterval - finalizationPeriodSeconds, // batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // batchTimeout ); // create proposal @@ -578,13 +541,11 @@ contract GovTest is L2StakingBaseTest { (expirationTime, executed) = gov.proposalInfos(preProposalID); assertEq(expirationTime, 0); assertFalse(executed); - (uint256 batchBlockInterval, uint256 batchTimeout, uint256 rollupEpoch) = gov.proposalData(preProposalID); + (uint256 batchBlockInterval, uint256 batchTimeout) = gov.proposalData(preProposalID); assertEq(batchBlockInterval, 0); assertEq(batchTimeout, 0); - assertEq(rollupEpoch, 0); assertEq(gov.batchBlockInterval(), 100); assertEq(gov.batchTimeout(), finalizationPeriodSeconds); - assertEq(gov.rollupEpoch(), ROLLUP_EPOCH); } } diff --git a/contracts/contracts/test/L2Staking.t.sol b/contracts/contracts/test/L2Staking.t.sol index bd9288372..41a708c95 100644 --- a/contracts/contracts/test/L2Staking.t.sol +++ b/contracts/contracts/test/L2Staking.t.sol @@ -3,18 +3,15 @@ pragma solidity =0.8.24; import {ITransparentUpgradeableProxy, TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -import {IRecord} from "../l2/staking/IRecord.sol"; import {Types} from "../libraries/common/Types.sol"; import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol"; import {L2Staking} from "../l2/staking/L2Staking.sol"; import {IL2Staking} from "../l2/staking/IL2Staking.sol"; +import {IMorphToken} from "../l2/system/IMorphToken.sol"; import {Predeploys} from "../libraries/constants/Predeploys.sol"; import {ICrossDomainMessenger} from "../libraries/ICrossDomainMessenger.sol"; -import {IDistribute} from "../l2/staking/IDistribute.sol"; import {console} from "forge-std/Test.sol"; -import "forge-std/console.sol"; - contract L2StakingTest is L2StakingBaseTest { uint256 public morphBalance = 20 ether; address[] public stakers; @@ -54,28 +51,33 @@ contract L2StakingTest is L2StakingBaseTest { function test_initialize_paramsCheck_reverts() public { Types.StakerInfo[] memory _stakerInfos = new Types.StakerInfo[](0); + hevm.startPrank(multisig); hevm.expectRevert("Initializable: contract is already initialized"); - hevm.prank(multisig); l2Staking.initialize(multisig, 0, 0, 0, _stakerInfos); + hevm.stopPrank(); // reset initialize hevm.store(address(l2Staking), bytes32(uint256(0)), bytes32(uint256(0))); - hevm.expectRevert("sequencersSize must greater than 0"); - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.expectRevert(IL2Staking.ErrZeroSequencerSize.selector); l2Staking.initialize(multisig, 0, 0, 0, _stakerInfos); + hevm.stopPrank(); - hevm.expectRevert("invalid undelegateLockEpochs"); - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.expectRevert(IL2Staking.ErrZeroLockEpochs.selector); l2Staking.initialize(multisig, 1, 0, 0, _stakerInfos); + hevm.stopPrank(); - hevm.expectRevert("invalid reward start time"); - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.expectRevert(IL2Staking.ErrInvalidStartTime.selector); l2Staking.initialize(multisig, 1, 1, 100, _stakerInfos); + hevm.stopPrank(); - hevm.expectRevert("invalid initial stakers"); - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.expectRevert(IL2Staking.ErrNoStakers.selector); l2Staking.initialize(multisig, 1, 1, rewardStartTime * 2, _stakerInfos); + hevm.stopPrank(); } /** @@ -112,13 +114,12 @@ contract L2StakingTest is L2StakingBaseTest { emit IL2Staking.RewardStartTimeUpdated(0, rewardStartTime); hevm.startPrank(multisig); - // Initialize the proxy with the new implementation. ITransparentUpgradeableProxy(address(l2StakingProxyTemp)).upgradeToAndCall( address(l2StakingImplTemp), abi.encodeCall( L2Staking.initialize, - (multisig, SEQUENCER_SIZE * 2, ROLLUP_EPOCH, rewardStartTime, stakerInfos) + (multisig, SEQUENCER_SIZE * 2, UNDELEGATE_LOCKED_EPOCHS, rewardStartTime, stakerInfos) ) ); hevm.stopPrank(); @@ -128,7 +129,7 @@ contract L2StakingTest is L2StakingBaseTest { // Verify the state varialbes are initialized succeefully. assertEq(l2StakingTemp.sequencerSetMaxSize(), SEQUENCER_SIZE * 2); - assertEq(l2StakingTemp.undelegateLockEpochs(), ROLLUP_EPOCH); + assertEq(l2StakingTemp.undelegateLockEpochs(), UNDELEGATE_LOCKED_EPOCHS); assertEq(l2StakingTemp.rewardStartTime(), rewardStartTime); assertEq(l2StakingTemp.latestSequencerSetSize(), stakerInfos.length); } @@ -169,14 +170,14 @@ contract L2StakingTest is L2StakingBaseTest { abi.encode(address(l2Staking.OTHER_STAKING())) ); assertEq(SEQUENCER_SIZE, l2Staking.getStakerAddressesLength()); - hevm.startPrank(address(l2CrossDomainMessenger)); + hevm.startPrank(address(l2CrossDomainMessenger)); address staker = address(uint160(beginSeq)); Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(staker); - uint256 nonce = l2Staking.nonce(); - hevm.expectRevert("invalid nonce"); + hevm.expectRevert(IL2Staking.ErrInvalidNonce.selector); l2Staking.addStaker(nonce + 1, stakerInfo); + hevm.stopPrank(); } /** @@ -189,8 +190,9 @@ contract L2StakingTest is L2StakingBaseTest { abi.encode(address(l2Staking.OTHER_STAKING())) ); assertEq(SEQUENCER_SIZE, l2Staking.getStakerAddressesLength()); - hevm.startPrank(address(l2CrossDomainMessenger)); + uint256 nonce = 0; + hevm.startPrank(address(l2CrossDomainMessenger)); for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2 + 1; i++) { address staker = address(uint160(beginSeq + i)); Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(staker); @@ -203,6 +205,7 @@ contract L2StakingTest is L2StakingBaseTest { } assertEq(7, l2Staking.getStakerAddressesLength()); hevm.stopPrank(); + for (uint256 i = 0; i < SEQUENCER_SIZE * 2 + 1; i++) { address user = address(uint160(beginSeq + i)); (address staker, , ) = l2Staking.stakers(user); @@ -210,7 +213,6 @@ contract L2StakingTest is L2StakingBaseTest { uint256 ranking = l2Staking.stakerRankings(user); assertEq(ranking, i + 1); } - assertEq(sequencer.getSequencerSet2Size(), l2Staking.sequencerSetMaxSize()); } @@ -220,22 +222,23 @@ contract L2StakingTest is L2StakingBaseTest { function test_addStakerWhenRewardStarting_succeeds() public { hevm.startPrank(alice); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + l2Staking.delegate(thirdStaker, 5 ether); hevm.stopPrank(); uint256 time = REWARD_EPOCH; hevm.warp(time); - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); - hevm.mockCall( address(l2Staking.MESSENGER()), abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); + hevm.stopPrank(); + hevm.startPrank(address(l2CrossDomainMessenger)); uint256 nonce = 0; for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2; i++) { @@ -245,6 +248,7 @@ contract L2StakingTest is L2StakingBaseTest { nonce++; } hevm.stopPrank(); + for (uint256 i = 0; i < SEQUENCER_SIZE * 2; i++) { address user = address(uint160(beginSeq + i)); (address staker, , ) = l2Staking.stakers(user); @@ -309,8 +313,8 @@ contract L2StakingTest is L2StakingBaseTest { abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); - hevm.startPrank(address(l2CrossDomainMessenger)); + hevm.startPrank(address(l2CrossDomainMessenger)); uint256 nonce = 0; for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2; i++) { address staker = address(uint160(beginSeq + i)); @@ -318,16 +322,14 @@ contract L2StakingTest is L2StakingBaseTest { l2Staking.addStaker(nonce, stakerInfo); nonce++; } - address[] memory removed = new address[](2); removed[0] = address(uint160(beginSeq + 1)); removed[1] = address(uint160(beginSeq + 4)); - - hevm.expectRevert("invalid nonce"); + hevm.expectRevert(IL2Staking.ErrInvalidNonce.selector); l2Staking.removeStakers(nonce + 1, removed); - - hevm.expectRevert("invalid nonce"); + hevm.expectRevert(IL2Staking.ErrInvalidNonce.selector); l2Staking.removeStakers(nonce - 1, removed); + hevm.stopPrank(); } /** @@ -339,8 +341,8 @@ contract L2StakingTest is L2StakingBaseTest { abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); - hevm.startPrank(address(l2CrossDomainMessenger)); + hevm.startPrank(address(l2CrossDomainMessenger)); uint256 nonce = 0; for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2; i++) { address staker = address(uint160(beginSeq + i)); @@ -381,8 +383,8 @@ contract L2StakingTest is L2StakingBaseTest { abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); - hevm.startPrank(address(l2CrossDomainMessenger)); + hevm.startPrank(address(l2CrossDomainMessenger)); // Add a set of new stakers to the L2Staking contract. uint256 nonce = 0; for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2; i++) { @@ -403,7 +405,6 @@ contract L2StakingTest is L2StakingBaseTest { // Assert that the initial length and the final length are equal. assertEq(initialLength, finalLength); - hevm.stopPrank(); } @@ -417,8 +418,8 @@ contract L2StakingTest is L2StakingBaseTest { abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); - hevm.startPrank(address(l2CrossDomainMessenger)); + hevm.startPrank(address(l2CrossDomainMessenger)); // Add a set of new stakers to the L2Staking contract. uint256 nonce = 0; for (uint256 i = SEQUENCER_SIZE; i < SEQUENCER_SIZE * 2; i++) { @@ -449,9 +450,10 @@ contract L2StakingTest is L2StakingBaseTest { */ function test_setCommissionRate_notStaker_reverts() public { // Expect revert due to only staker allowed. - hevm.expectRevert("only staker allowed"); hevm.startPrank(address(1)); + hevm.expectRevert(IL2Staking.ErrNotStaker.selector); l2Staking.setCommissionRate(21); + hevm.stopPrank(); } /** @@ -459,10 +461,9 @@ contract L2StakingTest is L2StakingBaseTest { */ function test_setCommissionRate_invalidCommission_reverts() public { hevm.startPrank(firstStaker); - - // set commission rate - hevm.expectRevert("invalid commission"); + hevm.expectRevert(IL2Staking.ErrInvalidCommissionRate.selector); l2Staking.setCommissionRate(21); + hevm.stopPrank(); } /** @@ -470,11 +471,11 @@ contract L2StakingTest is L2StakingBaseTest { */ function test_setCommissionRate_rewardNotStarted_succeeds() public { // Expect the CommissionUpdated event to be emitted successfully. + hevm.startPrank(firstStaker); hevm.expectEmit(true, true, true, true); emit IL2Staking.CommissionUpdated(firstStaker, 18, 0); - - hevm.prank(firstStaker); l2Staking.setCommissionRate(18); + hevm.stopPrank(); } /** @@ -483,95 +484,85 @@ contract L2StakingTest is L2StakingBaseTest { function test_setCommissionRate_rewardStarted_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); hevm.stopPrank(); - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); + hevm.stopPrank(); + hevm.startPrank(firstStaker); // Expect the CommissionUpdated event to be emitted successfully. hevm.expectEmit(true, true, true, true); - emit IL2Staking.CommissionUpdated(firstStaker, 18, l2Staking.currentEpoch() + 1); - - hevm.prank(firstStaker); + emit IL2Staking.CommissionUpdated(firstStaker, 18, 0); l2Staking.setCommissionRate(18); + hevm.stopPrank(); } /** * @notice failed delegate, staker not exists */ - function test_delegateStake_notStaker_reverts() public { + function test_delegate_notStaker_reverts() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - - hevm.expectRevert("not staker"); - l2Staking.delegateStake(alice, morphBalance); - + hevm.expectRevert(IL2Staking.ErrNotStaker.selector); + l2Staking.delegate(alice, morphBalance); hevm.stopPrank(); } /** - * @notice delegateStake: Expect revert with invalid stake amount. + * @notice delegate: Expect revert with invalid stake amount. */ - function test_delegateStake_invalidStakeAmount_reverts() public { - hevm.expectRevert("invalid stake amount"); - l2Staking.delegateStake(firstStaker, 0); + function test_delegate_invalidStakeAmount_reverts() public { + hevm.expectRevert(IL2Staking.ErrZeroAmount.selector); + l2Staking.delegate(firstStaker, 0); } /** * @notice staking by delegator * stag0 */ - function test_delegateStake_stakeWhenRewardNotStarting_succeeds() public { + function test_delegate_stakeWhenRewardNotStarting_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - // Expect the Delegated event is emitted successfully. hevm.expectEmit(true, true, true, true); - emit IL2Staking.Delegated(firstStaker, bob, morphBalance, morphBalance, 0); - - l2Staking.delegateStake(firstStaker, morphBalance); - - uint256 amount = l2Staking.delegations(firstStaker, bob); + emit IL2Staking.Delegated(firstStaker, bob, morphBalance, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); + uint256 amount = l2Staking.queryDelegationAmount(firstStaker, bob); assertEq(morphBalance, amount); + assertEq(l2Staking.candidateNumber(), 1); hevm.stopPrank(); } /** - * @notice delegateStake: Test that delegating the same stake again succeeds. + * @notice delegate: Test that delegating the same stake again succeeds. */ - function test_delegateStake_delegateTheSameStakeAgain_succeeds() public { + function test_delegate_delegateTheSameStakeAgain_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - // Delegate half of Bob's stake to firstStaker. - l2Staking.delegateStake(firstStaker, morphBalance / 2); - + l2Staking.delegate(firstStaker, morphBalance / 2); // Verify that the delegation amount is correct. - uint256 amount = l2Staking.delegations(firstStaker, bob); + uint256 amount = l2Staking.queryDelegationAmount(firstStaker, bob); assertEq(morphBalance / 2, amount); - // Delegate the remaining half of Bob's stake to firstStaker. - l2Staking.delegateStake(firstStaker, morphBalance / 2); - + l2Staking.delegate(firstStaker, morphBalance / 2); // Verify that the total delegation amount is correct. - amount = l2Staking.delegations(firstStaker, bob); + amount = l2Staking.queryDelegationAmount(firstStaker, bob); assertEq(morphBalance, amount); hevm.stopPrank(); } /** - * @notice delegateStake: Test that the candidate number increases when a stake is delegated. + * @notice delegate: Test that the candidate number increases when a stake is delegated. */ - function test_delegateStake_candidateNumberIncreases_succeeds() public { + function test_delegate_candidateNumberIncreases_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - uint256 initialCandidateNumber = l2Staking.candidateNumber(); - // Delegate Bob's stake to firstStaker. - l2Staking.delegateStake(firstStaker, morphBalance); - + l2Staking.delegate(firstStaker, morphBalance); // Verify that the candidate number has increased by 1. uint256 newCandidateNumber = l2Staking.candidateNumber(); assertEq(newCandidateNumber, initialCandidateNumber + 1); @@ -579,89 +570,110 @@ contract L2StakingTest is L2StakingBaseTest { } /** - * @notice delegateStake: Test that delegating a stake succeeds after rewards have started. + * @notice delegate: Test that delegating a stake succeeds after rewards have started. */ - function test_delegateStake_rewardStarted_succeeds() public { + function test_delegate_rewardStarted_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance / 2); + l2Staking.delegate(secondStaker, morphBalance / 2); uint256 oldRanking = l2Staking.stakerRankings(secondStaker); hevm.stopPrank(); - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); + hevm.stopPrank(); hevm.startPrank(bob); - // Verify the Delegated event is emitted successfully. - uint256 beforeAmount = l2Staking.delegations(secondStaker, bob); + uint256 beforeAmount = l2Staking.queryDelegationAmount(secondStaker, bob); hevm.expectEmit(true, true, true, true); - emit IL2Staking.Delegated( - secondStaker, - bob, - beforeAmount + morphBalance / 2, - beforeAmount, - l2Staking.currentEpoch() + 1 - ); - - l2Staking.delegateStake(secondStaker, morphBalance / 2); - + emit IL2Staking.Delegated(secondStaker, bob, morphBalance / 2, beforeAmount + morphBalance / 2); + l2Staking.delegate(secondStaker, morphBalance / 2); // Verify rankings is updated. uint256 newRanking = l2Staking.stakerRankings(secondStaker); assertEq(newRanking, oldRanking - 1); - hevm.stopPrank(); } /** - * @notice delegateStake: Test that notifyDelegation is called successfully when delegating a stake. + * @notice normal undelegate */ - function test_delegateStake_notifyDelegationCalled_succeeds() public { + function test_undelegate_rewardNotStarted_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); + l2Staking.delegate(firstStaker, morphBalance); + (uint256 stakerAmount0, ) = l2Staking.delegateeDelegations(firstStaker); + uint256 amount0 = l2Staking.queryDelegationAmount(firstStaker, bob); + assertEq(amount0, morphBalance); + assertEq(stakerAmount0, morphBalance); - // Expect call method notifyDelegation. - hevm.expectCall( - address(l2Staking.DISTRIBUTE_CONTRACT()), - abi.encodeWithSelector( - IDistribute.notifyDelegation.selector, - firstStaker, - bob, - 0, - morphBalance, - morphBalance, - true - ) - ); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Undelegated(firstStaker, bob, morphBalance, 0, 0); + l2Staking.undelegate(firstStaker, amount0); + uint256 amount1 = l2Staking.queryDelegationAmount(firstStaker, bob); + assertEq(amount1, 0); - l2Staking.delegateStake(firstStaker, morphBalance); + // Verify the total stake amount of firstStaker is correct + (uint256 stakerAmount1, ) = l2Staking.delegateeDelegations(firstStaker); + assertEq(stakerAmount1, stakerAmount0 - amount0); hevm.stopPrank(); } /** * @notice normal undelegate */ - function test_undelegateStake_succeeds() public { + function test_undelegate_rewardStarted_succeeds() public { hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); + (uint256 stakerAmount0, ) = l2Staking.delegateeDelegations(firstStaker); + uint256 amount0 = l2Staking.queryDelegationAmount(firstStaker, bob); + assertEq(stakerAmount0, amount0); + hevm.stopPrank(); - uint256 stakerAmount0 = l2Staking.stakerDelegations(firstStaker); - uint256 amount0 = l2Staking.delegations(firstStaker, bob); + hevm.startPrank(multisig); + l2Staking.startReward(); + hevm.stopPrank(); + hevm.startPrank(bob); // Verify the Undelegated event is emitted successfully. hevm.expectEmit(true, true, true, true); - emit IL2Staking.Undelegated(firstStaker, bob, morphBalance, 0, 0); - - l2Staking.undelegateStake(firstStaker); - uint256 amount1 = l2Staking.delegations(firstStaker, bob); + emit IL2Staking.Undelegated(firstStaker, bob, morphBalance, 0, UNDELEGATE_LOCKED_EPOCHS + 1); + l2Staking.undelegate(firstStaker, amount0); + uint256 amount1 = l2Staking.queryDelegationAmount(firstStaker, bob); assertEq(amount1, 0); - // Verify the total stake amount of firstStaker is correct - uint256 stakerAmount1 = l2Staking.stakerDelegations(firstStaker); - assertEq(stakerAmount1, stakerAmount0 - amount0); + (uint256 stakerAmount1, ) = l2Staking.delegateeDelegations(firstStaker); + assertEq(stakerAmount1, 0); + hevm.stopPrank(); + } + + /** + * @notice undelegate all when undelegate amount is zero + */ + function test_undelegate_zeroAmount_succeeds() public { + hevm.startPrank(bob); + morphToken.approve(address(l2Staking), type(uint256).max); + l2Staking.delegate(firstStaker, morphBalance); + (uint256 stakerAmount0, ) = l2Staking.delegateeDelegations(firstStaker); + uint256 amount0 = l2Staking.queryDelegationAmount(firstStaker, bob); + assertEq(stakerAmount0, amount0); + hevm.stopPrank(); + hevm.startPrank(multisig); + l2Staking.startReward(); + hevm.stopPrank(); + + hevm.startPrank(bob); + // Verify the Undelegated event is emitted successfully. + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Undelegated(firstStaker, bob, morphBalance, 0, UNDELEGATE_LOCKED_EPOCHS + 1); + l2Staking.undelegate(firstStaker, 0); + uint256 amount1 = l2Staking.queryDelegationAmount(firstStaker, bob); + assertEq(amount1, 0); + // Verify the total stake amount of firstStaker is correct + (uint256 stakerAmount1, ) = l2Staking.delegateeDelegations(firstStaker); + assertEq(stakerAmount1, 0); hevm.stopPrank(); } @@ -671,20 +683,19 @@ contract L2StakingTest is L2StakingBaseTest { function test_undelegateWhenStakerRemoved_succeeds() public { hevm.startPrank(alice); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + l2Staking.delegate(thirdStaker, 5 ether); hevm.stopPrank(); - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.warp(rewardStartTime); l2Staking.startReward(); + hevm.stopPrank(); hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); hevm.stopPrank(); // remove staker @@ -693,6 +704,7 @@ contract L2StakingTest is L2StakingBaseTest { abi.encodeCall(ICrossDomainMessenger.xDomainMessageSender, ()), abi.encode(address(l2Staking.OTHER_STAKING())) ); + hevm.startPrank(address(l2CrossDomainMessenger)); address[] memory removed = new address[](1); removed[0] = firstStaker; @@ -702,86 +714,91 @@ contract L2StakingTest is L2StakingBaseTest { // sequenser size decrease assertEq(sequencer.getSequencerSet2Size(), SEQUENCER_SIZE - 1); assertEq(l2Staking.candidateNumber(), SEQUENCER_SIZE - 1); - // staker ranking is 0, removed assertTrue(l2Staking.stakerRankings(firstStaker) == 0); hevm.startPrank(bob); - l2Staking.undelegateStake(firstStaker); + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); assertEq(l2Staking.candidateNumber(), SEQUENCER_SIZE - 1); hevm.stopPrank(); hevm.startPrank(alice); - l2Staking.undelegateStake(secondStaker); - hevm.stopPrank(); - + l2Staking.undelegate(secondStaker, l2Staking.queryDelegationAmount(secondStaker, alice)); assertEq(l2Staking.candidateNumber(), SEQUENCER_SIZE - 2); + hevm.stopPrank(); } /** - * @notice failed unstaking, when staking amount is zero + * @notice failed unstaking, when share is zero */ - function test_undelegateStake_stakingAmountIsZero_reverts() public { + function test_undelegate_zeroShare_reverts() public { hevm.startPrank(bob); - - hevm.expectRevert("staking amount is zero"); - l2Staking.undelegateStake(firstStaker); - + hevm.expectRevert(IL2Staking.ErrZeroShares.selector); + l2Staking.undelegate(firstStaker, 1 ether); hevm.stopPrank(); } /** - * @notice undelegateStake: Updates rankings and candidate number when staker is not removed. + * @notice failed unstaking, when share is insufficient */ - function test_undelegateStake_updatesRankingsAndCandidateNumber() public { + function test_undelegate_insufficientShare_reverts() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 1 ether); - l2Staking.delegateStake(secondStaker, 1 ether); - l2Staking.delegateStake(thirdStaker, 1 ether); + l2Staking.delegate(firstStaker, 5); + hevm.expectRevert(IL2Staking.ErrInsufficientBalance.selector); + l2Staking.undelegate(firstStaker, 10 ether); hevm.stopPrank(); + } - uint256 time = REWARD_EPOCH; - hevm.warp(time); + /** + * @notice undelegate: Updates rankings and candidate number when staker is not removed. + */ + function test_undelegate_updatesRankingsAndCandidateNumber() public { + hevm.startPrank(bob); + morphToken.approve(address(l2Staking), type(uint256).max); + l2Staking.delegate(firstStaker, 1 ether); + l2Staking.delegate(secondStaker, 1 ether); + l2Staking.delegate(thirdStaker, 1 ether); + hevm.stopPrank(); - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.warp(rewardStartTime); l2Staking.startReward(); + hevm.stopPrank(); hevm.startPrank(bob); - l2Staking.delegateStake(firstStaker, morphBalance / 2); + l2Staking.delegate(firstStaker, morphBalance / 2); hevm.stopPrank(); + hevm.startPrank(bob); // Check rankings and candidate number before undelegating. uint256 beforeRanking = l2Staking.stakerRankings(firstStaker); uint256 beforeCandidateNumber = l2Staking.candidateNumber(); - - hevm.startPrank(bob); - l2Staking.undelegateStake(firstStaker); - hevm.stopPrank(); - + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); // Check rankings and candidate number after undelegating. uint256 afterRanking = l2Staking.stakerRankings(firstStaker); uint256 afterCandidateNumber = l2Staking.candidateNumber(); - assertTrue(afterRanking > beforeRanking); assertEq(afterCandidateNumber, beforeCandidateNumber - 1); + hevm.stopPrank(); } /** - * @notice undelegateStake: Test that notifyUndelegation is called successfully when undelegating a stake. + * @notice failed claim, no pending undelegate requests */ - function test_undelegateStake_notifyUndelegationCalled_succeeds() public { + function test_delegatorClaim_noPendingundelegateRequests_reverts() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); + hevm.stopPrank(); - // Expect call method notifyUndelegation. - hevm.expectCall( - address(l2Staking.DISTRIBUTE_CONTRACT()), - abi.encodeWithSelector(IDistribute.notifyUndelegation.selector, firstStaker, bob, 0, 0) - ); + hevm.startPrank(multisig); + l2Staking.startReward(); + hevm.stopPrank(); - l2Staking.undelegateStake(firstStaker); + hevm.startPrank(bob); + hevm.expectRevert(IL2Staking.ErrNoUndelegateRequest.selector); + l2Staking.claimUndelegation(0); hevm.stopPrank(); } @@ -791,115 +808,167 @@ contract L2StakingTest is L2StakingBaseTest { function test_delegatorClaim_inLockPeriod_reverts() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance); hevm.stopPrank(); - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); + hevm.stopPrank(); hevm.startPrank(bob); - l2Staking.undelegateStake(firstStaker); - hevm.expectRevert("no Morph token to claim"); - l2Staking.claimUndelegation(); + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); + hevm.expectRevert(IL2Staking.ErrNoClaimableUndelegateRequest.selector); + l2Staking.claimUndelegation(0); hevm.stopPrank(); } /** - * @notice normal claim undelegation + * @notice normal claim undelegation when reward not started */ - function test_claimUndelegation_delegatorClaimUndelegation_succeeds() public { - hevm.startPrank(bob); - uint256 currentBalance = morphToken.balanceOf(bob); + function test_claimUndelegation_delegatorClaimUndelegationRewardNotStarted_succeeds() public { + hevm.warp(rewardStartTime); + hevm.startPrank(bob); + uint256 balanceBefore = morphToken.balanceOf(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); - l2Staking.undelegateStake(firstStaker); - - uint256 time = rewardStartTime + REWARD_EPOCH * 1; - hevm.warp(time); + l2Staking.delegate(firstStaker, morphBalance); + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); // Expect the UndelegationClaimed event is emitted successfully. - (address delegatee, uint256 amount, uint256 unlockEpoch) = l2Staking.undelegations(bob, 0); hevm.expectEmit(true, true, true, true); - emit IL2Staking.UndelegationClaimed(delegatee, bob, unlockEpoch, amount); + emit IL2Staking.UndelegationClaimed(bob, l2Staking.lockedAmount(bob, 0)); + l2Staking.claimUndelegation(0); + uint256 balanceAfter = morphToken.balanceOf(bob); + // Verify the balance of bob is correct. + assertEq(balanceBefore, balanceAfter); + hevm.stopPrank(); + } - l2Staking.claimUndelegation(); - uint256 newBalance = morphToken.balanceOf(bob); + /** + * @notice normal claim undelegations when reward not started + */ + function test_claimUndelegation_delegatorClaimUndelegationsRewardNotStarted_succeeds() public { + hevm.warp(rewardStartTime); - // Verify the balance of bob is correct. - assertEq(currentBalance, newBalance); + hevm.startPrank(bob); + uint256 balanceBefore = morphToken.balanceOf(bob); + morphToken.approve(address(l2Staking), type(uint256).max); + l2Staking.delegate(firstStaker, morphBalance / 2); + l2Staking.delegate(secondStaker, morphBalance / 2); + + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); + l2Staking.undelegate(secondStaker, l2Staking.queryDelegationAmount(secondStaker, bob)); + // Expect the UndelegationClaimed event is emitted successfully. + hevm.expectEmit(true, true, true, true); + emit IL2Staking.UndelegationClaimed(bob, l2Staking.lockedAmount(bob, 0)); + l2Staking.claimUndelegation(0); + uint256 balanceAfter = morphToken.balanceOf(bob); + // Verify the balance of bob is correct. + assertEq(balanceBefore, balanceAfter); hevm.stopPrank(); } /** - * @notice normal claim undelegation + * @notice normal claim undelegation when reward started */ - function test_claimUndelegation_delegatorClaimUndelegations_succeeds() public { - hevm.startPrank(bob); - uint256 currentBalance = morphToken.balanceOf(bob); + function test_claimUndelegation_delegatorClaimUndelegationRewardStarted_succeeds() public { + hevm.warp(rewardStartTime); + hevm.startPrank(bob); + uint256 balanceBefore = morphToken.balanceOf(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance / 2); - l2Staking.delegateStake(secondStaker, morphBalance / 2); + l2Staking.delegate(firstStaker, morphBalance); + hevm.stopPrank(); - hevm.warp(rewardStartTime + REWARD_EPOCH * 2); + hevm.startPrank(multisig); + l2Staking.startReward(); + hevm.stopPrank(); - l2Staking.undelegateStake(firstStaker); - l2Staking.undelegateStake(secondStaker); + hevm.startPrank(bob); + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); - hevm.warp(rewardStartTime + REWARD_EPOCH * 4); + // Unlock time not reached + hevm.expectRevert(IL2Staking.ErrNoClaimableUndelegateRequest.selector); + l2Staking.claimUndelegation(0); + // Unlock time reached + hevm.warp(rewardStartTime + REWARD_EPOCH * (UNDELEGATE_LOCKED_EPOCHS + 2)); // Expect the UndelegationClaimed event is emitted successfully. - uint256 amount; - uint256 unlockEpoch; hevm.expectEmit(true, true, true, true); - (, amount, unlockEpoch) = l2Staking.undelegations(bob, 0); - emit IL2Staking.UndelegationClaimed(firstStaker, bob, unlockEpoch, amount); - hevm.expectEmit(true, true, true, true); - (, amount, unlockEpoch) = l2Staking.undelegations(bob, 1); - emit IL2Staking.UndelegationClaimed(secondStaker, bob, unlockEpoch, amount); - - l2Staking.claimUndelegation(); - uint256 newBalance = morphToken.balanceOf(bob); - + emit IL2Staking.UndelegationClaimed(bob, l2Staking.lockedAmount(bob, 0)); + l2Staking.claimUndelegation(0); + uint256 balanceAfter = morphToken.balanceOf(bob); // Verify the balance of bob is correct. - assertEq(currentBalance, newBalance); - + assertEq(balanceBefore, balanceAfter); hevm.stopPrank(); } /** - * @notice failed restaking, pre claim in lock period + * @notice normal claim undelegations when reward started */ - function test_delegateStake_delegatorRestake_inLockPeriod_reverts() public { - hevm.startPrank(bob); + function test_claimUndelegation_delegatorClaimUndelegationsRewardStarted_succeeds() public { + hevm.warp(rewardStartTime); + hevm.startPrank(bob); + uint256 balanceBefore = morphToken.balanceOf(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); - l2Staking.undelegateStake(firstStaker); - hevm.expectRevert("undelegation unclaimed"); - l2Staking.delegateStake(firstStaker, morphBalance); + l2Staking.delegate(firstStaker, morphBalance / 2); + l2Staking.delegate(secondStaker, morphBalance / 2); + hevm.stopPrank(); + + hevm.startPrank(multisig); + l2Staking.startReward(); + hevm.stopPrank(); + + hevm.startPrank(bob); + l2Staking.undelegate(firstStaker, l2Staking.queryDelegationAmount(firstStaker, bob)); + l2Staking.undelegate(secondStaker, l2Staking.queryDelegationAmount(secondStaker, bob)); + + // Unlock time not reached + hevm.expectRevert(IL2Staking.ErrNoClaimableUndelegateRequest.selector); + l2Staking.claimUndelegation(0); + + // Unlock time reached + hevm.warp(rewardStartTime + REWARD_EPOCH * (UNDELEGATE_LOCKED_EPOCHS + 2)); + // Expect the UndelegationClaimed event is emitted successfully. + hevm.expectEmit(true, true, true, true); + emit IL2Staking.UndelegationClaimed(bob, l2Staking.lockedAmount(bob, 0)); + l2Staking.claimUndelegation(0); + uint256 balanceAfter = morphToken.balanceOf(bob); + // Verify the balance of bob is correct. + assertEq(balanceBefore, balanceAfter); hevm.stopPrank(); } /** - * @notice normal restaking + * @notice delegate again after undelegate */ - function test_claimUndelegation_delegatorRestakeAfterLockPeriod_succeeds() public { + function test_delegate_delegateAfterUndelegate_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance); - l2Staking.undelegateStake(firstStaker); + assertEq(morphToken.balanceOf(bob), morphBalance); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(firstStaker, bob, morphBalance / 2, morphBalance / 2); + l2Staking.delegate(firstStaker, morphBalance / 2); + assertEq(morphToken.balanceOf(bob), morphBalance / 2); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), morphBalance / 2); - hevm.roll(ROLLUP_EPOCH); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Undelegated(firstStaker, bob, morphBalance / 2, 0, 0); + l2Staking.undelegate(firstStaker, morphBalance / 2); + assertEq(morphToken.balanceOf(bob), morphBalance / 2); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), 0); - uint256 time = rewardStartTime + REWARD_EPOCH * (ROLLUP_EPOCH + 1); - hevm.warp(time); - l2Staking.claimUndelegation(); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(firstStaker, bob, morphBalance / 2, morphBalance / 2); + l2Staking.delegate(firstStaker, morphBalance / 2); + assertEq(morphToken.balanceOf(bob), 0); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), morphBalance / 2); + assertEq(l2Staking.lockedAmount(bob, 0), morphBalance / 2); + assertEq(l2Staking.undelegateSequence(bob), 1); - l2Staking.delegateStake(firstStaker, morphBalance); hevm.stopPrank(); } @@ -908,16 +977,13 @@ contract L2StakingTest is L2StakingBaseTest { */ function test_rankWhenRewardNotStarting_succeeds() public { hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance); - hevm.stopPrank(); - + l2Staking.delegate(secondStaker, morphBalance); uint256 secondRanking = l2Staking.stakerRankings(secondStaker); assertEq(secondRanking, 1 + 1); - uint256 firstRanking = l2Staking.stakerRankings(firstStaker); assertEq(firstRanking, 0 + 1); + hevm.stopPrank(); } /** @@ -926,196 +992,194 @@ contract L2StakingTest is L2StakingBaseTest { function test_rankWhenRewardStarting_succeeds() public { hevm.startPrank(bob); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, 10 ether); - l2Staking.delegateStake(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 10 ether); + l2Staking.delegate(firstStaker, 5 ether); hevm.stopPrank(); - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); assertEq(secondRanking, 0 + 1); - uint256 firstRanking = l2Staking.stakerRankings(firstStaker); assertEq(firstRanking, 1 + 1); - address[] memory sequencerSet = sequencer.getSequencerSet2(); assertEq(secondStaker, sequencerSet[0]); assertEq(firstStaker, sequencerSet[1]); + hevm.stopPrank(); } /** * @notice updateSequencerSetMaxSize: Reverts if called by a non-owner. */ function test_updateSequencerSetMaxSize_notOwner_reverts() public { - hevm.prank(address(1)); - + hevm.startPrank(address(1)); // Expect revert due to caller is not the owner. hevm.expectRevert("Ownable: caller is not the owner"); l2Staking.updateSequencerSetMaxSize(2); + hevm.stopPrank(); } /** * @notice updateSequencerSetMaxSize: Reverts if set to zero. */ function test_updateSequencerSetMaxSize_eqZero_reverts() public { - hevm.prank(multisig); - + hevm.startPrank(multisig); // Expect revert due to _sequencerSetMaxSize equals zero. - hevm.expectRevert("invalid new sequencer set max size"); + hevm.expectRevert(IL2Staking.ErrInvalidSequencerSize.selector); l2Staking.updateSequencerSetMaxSize(0); + hevm.stopPrank(); } /** * @notice updateSequencerSetMaxSize: Reverts if set to current max size. */ function test_updateSequencerSetMaxSize_eqCurrentMaxSize_reverts() public { + hevm.startPrank(multisig); uint256 oldSize = l2Staking.sequencerSetMaxSize(); - // Expect revert due to _sequencerSetMaxSize equals currect sequencerSetMaxSize. - hevm.expectRevert("invalid new sequencer set max size"); - hevm.prank(multisig); + hevm.expectRevert(IL2Staking.ErrInvalidSequencerSize.selector); l2Staking.updateSequencerSetMaxSize(oldSize); + hevm.stopPrank(); } /** * @notice update sequencerSetMaxSize */ function test_updateSequencerSetMaxSize_succeeds() public { + hevm.startPrank(multisig); // Expect the SequencerSetMaxSizeUpdated event is emitted successfully. hevm.expectEmit(true, true, true, true); emit IL2Staking.SequencerSetMaxSizeUpdated(l2Staking.sequencerSetMaxSize(), 2); - - hevm.prank(multisig); l2Staking.updateSequencerSetMaxSize(2); - assertEq(sequencer.getSequencerSet2Size(), 2); + hevm.stopPrank(); } /** * @notice updateSequencerSetMaxSize: No _updateSequencerSet call when increasing size. */ function test_updateSequencerSetMaxSize_largerValue_noUpdateSequencerSet_succeeds() public { + hevm.startPrank(multisig); uint256 oldSequencerSet2Size = sequencer.getSequencerSet2Size(); uint256 oldSize = l2Staking.sequencerSetMaxSize(); uint256 newSize = oldSize + 1; - - hevm.prank(multisig); l2Staking.updateSequencerSetMaxSize(newSize); - // Verify that _updateSequencerSet was not called. assertEq(sequencer.getSequencerSet2Size(), oldSequencerSet2Size); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Reverts if called by non-owner. */ function test_updateRewardStartTime_onlyOwner_reverts() public { - hevm.prank(address(1)); - + hevm.startPrank(address(1)); // Expect revert due to caller is not the owner. hevm.expectRevert("Ownable: caller is not the owner"); l2Staking.updateRewardStartTime(block.timestamp + REWARD_EPOCH); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Reverts if reward start time is before current block time. */ function test_updateRewardStartTime_NoChange_reverts() public { + hevm.warp(rewardStartTime); uint256 oldTime = l2Staking.rewardStartTime(); uint256 newTime = block.timestamp + REWARD_EPOCH * 2; - hevm.warp(REWARD_EPOCH / 2); + hevm.startPrank(multisig); hevm.expectEmit(true, true, true, true); emit IL2Staking.RewardStartTimeUpdated(oldTime, newTime); - - hevm.prank(multisig); l2Staking.updateRewardStartTime(newTime); - hevm.expectRevert("invalid reward start time"); - hevm.prank(multisig); + + hevm.expectRevert(IL2Staking.ErrInvalidStartTime.selector); l2Staking.updateRewardStartTime(newTime); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Reverts if reward start time is before current block time. */ function test_updateRewardStartTime_PastTime_reverts() public { + hevm.warp(rewardStartTime); + + hevm.startPrank(multisig); // Expect revert due to rewardStartTime being before block.timestamp. - hevm.warp(REWARD_EPOCH); - hevm.expectRevert("invalid reward start time"); - hevm.prank(multisig); + hevm.expectRevert(IL2Staking.ErrInvalidStartTime.selector); l2Staking.updateRewardStartTime(block.timestamp); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Reverts if reward start time is before current block time. */ function test_updateRewardStartTime_ZeroTime_reverts() public { + hevm.warp(rewardStartTime); + + hevm.startPrank(multisig); // Expect revert due to rewardStartTime being before block.timestamp. - hevm.warp(REWARD_EPOCH); - hevm.expectRevert("invalid reward start time"); - hevm.prank(multisig); + hevm.expectRevert(IL2Staking.ErrInvalidStartTime.selector); l2Staking.updateRewardStartTime(0); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Reverts if not a multiple of REWARD_EPOCH. */ function test_updateRewardStartTime_notMultipleRewardEpoch_reverts() public { - hevm.warp(REWARD_EPOCH / 2); - hevm.prank(multisig); + hevm.warp(rewardStartTime / 2); + hevm.startPrank(multisig); // Expect revert due to updateRewardStartTime not REWARD_EPOCH multiple. - hevm.expectRevert("invalid reward start time"); + hevm.expectRevert(IL2Staking.ErrInvalidStartTime.selector); l2Staking.updateRewardStartTime(block.timestamp + REWARD_EPOCH / 2); + hevm.stopPrank(); } /** * @notice updateRewardStartTime: Updates the reward start time successfully. */ function test_updateRewardStartTime_succeeds() public { + hevm.warp(rewardStartTime); uint256 oldTime = l2Staking.rewardStartTime(); uint256 newTime = block.timestamp + REWARD_EPOCH * 2; - hevm.warp(REWARD_EPOCH / 2); + hevm.startPrank(multisig); // Verify the SequencerSetMaxSizeUpdated event is emitted successfully. hevm.expectEmit(true, true, true, true); emit IL2Staking.RewardStartTimeUpdated(oldTime, newTime); - - hevm.prank(multisig); l2Staking.updateRewardStartTime(newTime); - assertEq(l2Staking.rewardStartTime(), newTime); + hevm.stopPrank(); } /** * @notice startReward: Reverts if called by a non-owner. */ function test_startReward_notOwner_reverts() public { - hevm.prank(address(1)); - + hevm.startPrank(address(1)); // Expect revert due to caller is not the owner. hevm.expectRevert("Ownable: caller is not the owner"); l2Staking.startReward(); + hevm.stopPrank(); } /** * @notice startReward: Reverts if called before reward start time. */ function test_startReward_beforeRewardStartTime_reverts() public { - hevm.warp(REWARD_EPOCH / 2); - hevm.startPrank(multisig); + hevm.warp(rewardStartTime / 2); + hevm.startPrank(multisig); uint256 newRewardStartTime = REWARD_EPOCH + 4800; newRewardStartTime = ((newRewardStartTime / REWARD_EPOCH) + 1) * REWARD_EPOCH; - // Update the reward start time. l2Staking.updateRewardStartTime(newRewardStartTime); // Expect revert due to "can't start before reward start time". - hevm.expectRevert("can't start before reward start time"); + hevm.expectRevert(IL2Staking.ErrStartTimeNotReached.selector); l2Staking.startReward(); - hevm.stopPrank(); } @@ -1123,1020 +1187,215 @@ contract L2StakingTest is L2StakingBaseTest { * @notice startReward: Reverts if no candidates. */ function test_startReward_notCandidateNumber_reverts() public { - hevm.prank(multisig); - + hevm.startPrank(multisig); // Expect revert due to none candidate. - hevm.expectRevert("none candidate"); + hevm.expectRevert(IL2Staking.ErrNoCandidate.selector); l2Staking.startReward(); + hevm.stopPrank(); } - function _updateDistribute(uint256 epochIndex) internal returns (uint256) { - uint256 sequencerSize = SEQUENCER_SIZE; - uint256 blockCount = REWARD_EPOCH / 3; // 1 block per 3s - address[] memory sequencers = sequencerAddresses; - uint256[] memory sequencerBlocks = new uint256[](sequencerSize); - uint256[] memory sequencerRatios = new uint256[](sequencerSize); - uint256[] memory sequencerCommissions = new uint256[](sequencerSize); + /** + * @notice update to next epoch with distribute + */ + function _updateToNextEpochWithDistribute(uint256 sequencerSize) internal returns (uint256) { + uint256 totalSupplyBefore = morphToken.totalSupply(); + uint256 inflation = (totalSupplyBefore * 1596535874529) / INFLATION_RATIO_PRECISION; + + hevm.startPrank(system); for (uint256 i = 0; i < sequencerSize; i++) { - // same blocks - sequencerBlocks[i] = blockCount / sequencerSize; - sequencerRatios[i] = SEQUENCER_RATIO_PRECISION / sequencerSize; - sequencerCommissions[i] = l2Staking.commissions(sequencers[i]); + // per sequencer gnerate 2 blocks + l2Staking.recordBlocks(address(uint160(beginSeq + i))); + l2Staking.recordBlocks(address(uint160(beginSeq + i))); } - - IRecord.RewardEpochInfo[] memory rewardEpochInfos = new IRecord.RewardEpochInfo[](1); - - rewardEpochInfos[0] = IRecord.RewardEpochInfo( - epochIndex, - blockCount, - sequencers, - sequencerBlocks, - sequencerRatios, - sequencerCommissions - ); - - uint256 totalSupply = morphToken.totalSupply(); - hevm.startPrank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); + // console.log("........................................"); + // console.log("current epoch: %s", l2Staking.currentEpoch()); + // console.log("total blocks: %s", l2Staking.epochTotalBlocks()); + // console.log("first staker blocks: %s", l2Staking.epochSequencerBlocks(firstStaker)); + // console.log("second staker blocks: %s", l2Staking.epochSequencerBlocks(secondStaker)); + assertEq(l2Staking.epochTotalBlocks(), 4, "total-blocks"); + assertEq(l2Staking.epochSequencerBlocks(firstStaker), 2, "blocks-firstStaker"); + assertEq(l2Staking.epochSequencerBlocks(secondStaker), 2, "blocks-secondStaker"); + // console.log("........................................"); + + hevm.warp(block.timestamp + REWARD_EPOCH); + hevm.expectEmit(true, true, true, true); + emit IMorphToken.InflationMinted(l2Staking.currentEpoch() - 1, inflation); + morphToken.mintInflations(); hevm.stopPrank(); - uint256 totalInflations = (totalSupply * 1596535874529) / INFLATION_RATIO_PRECISION; - uint256 inflationAmount = morphToken.inflation(epochIndex); - assertEq(totalInflations, inflationAmount); + uint256 totalSupplyAfter = morphToken.totalSupply(); + assertEq(totalSupplyAfter, totalSupplyBefore + inflation); + // console.log("........................................"); + // console.log(totalSupplyBefore); + // console.log(inflation); + // console.log(totalSupplyAfter); + // console.log("........................................"); - return totalInflations; + return inflation; } /** - * @notice staking -> distribute -> claim + * @notice delegate: test delegate when reward started in multi epochs */ - function test_delegatorClaimRewardWhenRewardStarting_succeeds() public { - uint256 sequencerSize = sequencer.getSequencerSet2Size(); + function test_delegateWhenRewardStarted_mulitEpochs_succeeds() public { + hevm.warp(rewardStartTime); + assertEq(l2Staking.currentEpoch(), 0); hevm.startPrank(alice); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(firstStaker, alice, 5 ether, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(secondStaker, alice, 5 ether, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + assertEq(l2Staking.queryDelegationAmount(firstStaker, alice), 5 ether); + assertEq(l2Staking.queryDelegationAmount(secondStaker, alice), 5 ether); + assertEq(morphToken.balanceOf(alice), 10 ether); hevm.stopPrank(); - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); + hevm.startPrank(multisig); l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); hevm.stopPrank(); - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *************** epoch = 2 ******************** // - time = REWARD_EPOCH * 3; - hevm.roll(blocksCountOfEpoch * 3); - hevm.warp(time); - _updateDistribute(1); - - // *************** epoch = 3 ******************** // - time = REWARD_EPOCH * 4; - hevm.roll(blocksCountOfEpoch * 4); - hevm.warp(time); - uint256 totalInflations = _updateDistribute(2); + uint256 inflation0 = _updateToNextEpochWithDistribute(2); + assertEq(inflation0, 159653587452900000000000, "inflation-0"); + assertEq(l2Staking.currentEpoch(), 1, "current-e1"); + assertEq(l2Staking.epochTotalBlocks(), 0, "total-blocks-e1"); + assertEq(l2Staking.epochSequencerBlocks(firstStaker), 0, "blocks-firstStaker-e1"); + assertEq(l2Staking.epochSequencerBlocks(secondStaker), 0, "blocks-secondStaker-e1"); + assertEq(l2Staking.queryDelegationAmount(firstStaker, alice), 79831793726450000000000, "alice-first-e1"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, alice), 79831793726450000000000, "alice-second-e1"); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), 0 ether, "bob-first-e1"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, bob), 0 ether, "bob-second-e1"); - /** - * 1. reward = 0 no remaining reward - * 2. reward > 0 - */ hevm.startPrank(bob); - uint256 balanceBefore = morphToken.balanceOf(bob); - l2Staking.claimReward(secondStaker, 2); - uint256 balanceAfter = morphToken.balanceOf(bob); - - // sequencer size = 3 - // proposal same blocks in epoch 2 - // commission = 1 - // alice delegate 5 ether morph token - // bob delefate 15 ether morph token - // total delegate amount = (5 + 15) ether - // check the reward - - uint256 commissionRate = l2Staking.commissions(secondStaker); - uint256 sequencerEpochReward = ((totalInflations * (SEQUENCER_RATIO_PRECISION / sequencerSize)) / - SEQUENCER_RATIO_PRECISION); - uint256 commission = (sequencerEpochReward * commissionRate) / 100; - uint256 delegatorReward = sequencerEpochReward - commission; - - uint256 bobReward = (delegatorReward * 15 ether) / (20 ether); + morphToken.approve(address(l2Staking), type(uint256).max); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(firstStaker, bob, 5 ether, 79836793726450000000000); + l2Staking.delegate(firstStaker, 5 ether); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(secondStaker, bob, 5 ether, 79836793726450000000000); + l2Staking.delegate(secondStaker, 5 ether); + // TODO: Should the loss of precision be handled? + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), 4999999999999988121); + assertEq(l2Staking.queryDelegationAmount(secondStaker, bob), 4999999999999988121); + assertEq(morphToken.balanceOf(bob), 10 ether); + hevm.stopPrank(); + + uint256 inflation1 = _updateToNextEpochWithDistribute(2); + assertEq(inflation1, 159679076720886580788309, "inflation-1"); + assertEq(l2Staking.currentEpoch(), 2, "current-e2"); + assertEq(l2Staking.epochTotalBlocks(), 0, "total-blocks-e2"); + assertEq(l2Staking.epochSequencerBlocks(firstStaker), 0, "blocks-firstStaker-e2"); + assertEq(l2Staking.epochSequencerBlocks(secondStaker), 0, "blocks-secondStaker-e2"); + assertEq(l2Staking.queryDelegationAmount(firstStaker, alice), 159666331915002996157441, "alice-first-e2"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, alice), 159666331915002996157441, "alice-second-e2"); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), 10000171890294236712, "bob-first-e2"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, bob), 10000171890294236712, "bob-second-e2"); - assertEq(balanceAfter, balanceBefore + bobReward); + hevm.startPrank(alice); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(firstStaker, alice, 5 ether, 159681332086893290394154); + l2Staking.delegate(firstStaker, 5 ether); + hevm.expectEmit(true, true, true, true); + emit IL2Staking.Delegated(secondStaker, alice, 5 ether, 159681332086893290394154); + l2Staking.delegate(secondStaker, 5 ether); + assertEq(l2Staking.queryDelegationAmount(firstStaker, alice), 159671331915002996157439); + assertEq(l2Staking.queryDelegationAmount(secondStaker, alice), 159671331915002996157439); + assertEq(morphToken.balanceOf(alice), 0 ether); hevm.stopPrank(); + + uint256 inflation2 = _updateToNextEpochWithDistribute(2); + assertEq(inflation2, 159704570058326237182599, "inflation-2"); + assertEq(l2Staking.currentEpoch(), 3, "current-e3"); + assertEq(l2Staking.epochTotalBlocks(), 0, "total-blocks-e3"); + assertEq(morphToken.balanceOf(alice), 0 ether); + assertEq(l2Staking.queryDelegationAmount(firstStaker, alice), 239518616130572639318717, "alice-first-e3"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, alice), 239518616130572639318717, "alice-second-e3"); + assertEq(morphToken.balanceOf(bob), 10 ether); + assertEq(l2Staking.queryDelegationAmount(firstStaker, bob), 15000985483769666735, "bob-first-e3"); + assertEq(l2Staking.queryDelegationAmount(secondStaker, bob), 15000985483769666735, "bob-second-e3"); } /** - * @notice staking -> distribute -> claim + * @notice redelegate: test redelegate when reward started in multi epochs */ - function test_delegatorClaimAllRewardWhenRewardStarting_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *************** epoch = 2 ******************** // - time = REWARD_EPOCH * 3; - hevm.roll(blocksCountOfEpoch * 3); - hevm.warp(time); - _updateDistribute(1); - - // *************** epoch = 3 ******************** // - time = REWARD_EPOCH * 4; - hevm.roll(blocksCountOfEpoch * 4); - hevm.warp(time); - _updateDistribute(2); - - (address[] memory delegetees, uint256[] memory aliceRewards) = distribute.queryAllUnclaimed(alice); - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - uint256 aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - // *************** epoch = 4 ******************** // - time = REWARD_EPOCH * 5; - hevm.roll(blocksCountOfEpoch * 5); - hevm.warp(time); - _updateDistribute(3); - - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(address(0), 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); + function test_redelegateWhenRewardStarted_mulitEpochs_succeeds() public { + // TODO multi delegator & multi delegatee } /** - * @notice staking -> distribute -> claim + * @notice undelegate: test undelegate all when reward started in multi epochs */ - function test_delegatorClaimAllRewardMulti_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *************** epoch = 2 ******************** // - time = REWARD_EPOCH * 3; - hevm.roll(blocksCountOfEpoch * 3); - hevm.warp(time); - _updateDistribute(1); - - // *************** epoch = 3 ******************** // - time = REWARD_EPOCH * 4; - hevm.roll(blocksCountOfEpoch * 4); - hevm.warp(time); - _updateDistribute(2); - - (address[] memory delegetees, uint256[] memory aliceRewards) = distribute.queryAllUnclaimed(alice); - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - uint256 aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertTrue(aliceReward1 > 0); - assertTrue(aliceReward2 > 0); - assertTrue(aliceReward3 > 0); - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(address(0), 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); - - (delegetees, aliceRewards) = distribute.queryAllUnclaimed(alice); - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertTrue(aliceReward1 == 0); - assertTrue(aliceReward2 == 0); - assertTrue(aliceReward3 == 0); - - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - // *************** epoch = 4 ******************** // - time = REWARD_EPOCH * 5; - hevm.roll(blocksCountOfEpoch * 5); - hevm.warp(time); - _updateDistribute(3); - - (delegetees, aliceRewards) = distribute.queryAllUnclaimed(alice); - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertTrue(aliceReward1 > 0); - assertTrue(aliceReward2 > 0); - assertTrue(aliceReward3 > 0); - - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - // *************** epoch = 5 ******************** // - time = REWARD_EPOCH * 6; - hevm.roll(blocksCountOfEpoch * 6); - hevm.warp(time); - _updateDistribute(4); - - (delegetees, aliceRewards) = distribute.queryAllUnclaimed(alice); - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertTrue(aliceReward1 > 0); - assertTrue(aliceReward2 > 0); - assertTrue(aliceReward3 > 0); - - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - hevm.startPrank(alice); - balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(address(0), 0); - balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); - - // *************** epoch = 4 ******************** // - time = REWARD_EPOCH * 7; - hevm.roll(blocksCountOfEpoch * 7); - hevm.warp(time); - _updateDistribute(5); - - // *************** epoch = 5 ******************** // - time = REWARD_EPOCH * 8; - hevm.roll(blocksCountOfEpoch * 8); - hevm.warp(time); - _updateDistribute(6); - - (delegetees, aliceRewards) = distribute.queryAllUnclaimed(alice); - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - assertTrue(aliceReward1 > 0); - assertTrue(aliceReward2 > 0); - assertTrue(aliceReward3 > 0); - - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(delegetees[2], thirdStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - assertEq(aliceRewards[2], aliceReward3); - - hevm.startPrank(alice); - balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(address(0), 0); - balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); + function test_undelegateWhenRewardStarted_undelegateAll_succeeds() public { + // TODO multi delegator & multi delegatee } /** - * @notice staking -> distribute -> claim -> undelegate -> distribute -> claim + * @notice undelegate: test undelegate part when reward started in multi epochs */ - function test_delegatorClaimAllAfterUndelegate_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *********************************** // - time = REWARD_EPOCH * (3); - hevm.roll(blocksCountOfEpoch * (3)); - hevm.warp(time); - _updateDistribute(1); - // *********************************** // - - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - uint256 aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - - l2Staking.claimReward(address(0), 0); - hevm.expectRevert("all reward claimed"); - l2Staking.claimReward(firstStaker, 0); - hevm.expectRevert("all reward claimed"); - l2Staking.claimReward(secondStaker, 0); - hevm.expectRevert("all reward claimed"); - l2Staking.claimReward(thirdStaker, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); - - // *********************************** // - time = REWARD_EPOCH * (4); - hevm.roll(blocksCountOfEpoch * (4)); - hevm.warp(time); - _updateDistribute(2); - // *********************************** // - - hevm.startPrank(alice); - l2Staking.undelegateStake(firstStaker); - l2Staking.undelegateStake(secondStaker); - l2Staking.undelegateStake(thirdStaker); - hevm.stopPrank(); - - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - - // *********************************** // - time = REWARD_EPOCH * (5); - hevm.roll(blocksCountOfEpoch * (5)); - hevm.warp(time); - _updateDistribute(3); - // *********************************** // - - // *********************************** // - time = REWARD_EPOCH * (6); - hevm.roll(blocksCountOfEpoch * (6)); - hevm.warp(time); - _updateDistribute(4); - // *********************************** // - - // *********************************** // - time = REWARD_EPOCH * (7); - hevm.roll(blocksCountOfEpoch * (7)); - hevm.warp(time); - _updateDistribute(5); - // *********************************** // - - // *********************************** // - time = REWARD_EPOCH * (8); - hevm.roll(blocksCountOfEpoch * (8)); - hevm.warp(time); - _updateDistribute(6); - // *********************************** // - - uint256 aliceRewardNew1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceRewardNew2 = distribute.queryUnclaimed(secondStaker, alice); - uint256 aliceRewardNew3 = distribute.queryUnclaimed(thirdStaker, alice); - - hevm.startPrank(alice); - balanceBefore = morphToken.balanceOf(alice); - uint256 balanceBeforeTmp = balanceBefore; - balanceBeforeTmp = morphToken.balanceOf(alice); - - l2Staking.claimReward(firstStaker, 0); - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(firstStaker, 0); - balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBeforeTmp + aliceRewardNew1); - - balanceBeforeTmp = morphToken.balanceOf(alice); - l2Staking.claimReward(secondStaker, 0); - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(secondStaker, 0); - balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBeforeTmp + aliceRewardNew2); - - balanceBeforeTmp = morphToken.balanceOf(alice); - l2Staking.claimReward(thirdStaker, 0); - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(thirdStaker, 0); - balanceAfter = morphToken.balanceOf(alice); - - assertEq(balanceAfter, balanceBeforeTmp + aliceRewardNew3); - assertEq(balanceAfter, balanceBefore + aliceRewardNew1 + aliceRewardNew2 + aliceRewardNew3); - - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(firstStaker, alice); - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(secondStaker, alice); - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(thirdStaker, alice); - hevm.stopPrank(); + function test_undelegateWhenRewardStarted_undelegatePart_succeeds() public { + // TODO multi delegator & multi delegatee } /** - * @notice staking -> distribute -> claim -> undelegate -> distribute -> claim + * @notice sequencer update: add one sequencer */ - function test_delegatorClaimAllAfterUndelegateLater1Epoch_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *********************************** // - time = REWARD_EPOCH * (3); - hevm.roll(blocksCountOfEpoch * (3)); - hevm.warp(time); - _updateDistribute(1); - // *********************************** // - - // *********************************** // - time = REWARD_EPOCH * (4); - hevm.roll(blocksCountOfEpoch * (4)); - hevm.warp(time); - _updateDistribute(2); - // *********************************** // - - hevm.startPrank(alice); - l2Staking.undelegateStake(firstStaker); - l2Staking.undelegateStake(secondStaker); - l2Staking.undelegateStake(thirdStaker); - hevm.stopPrank(); - - // *********************************** // - time = REWARD_EPOCH * (5); - hevm.roll(blocksCountOfEpoch * (5)); - hevm.warp(time); - _updateDistribute(3); - // *********************************** // - - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - uint256 aliceReward3 = distribute.queryUnclaimed(thirdStaker, alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - - hevm.startPrank(alice); - l2Staking.claimReward(address(0), 0); - - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(firstStaker, alice); - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(secondStaker, alice); - hevm.expectRevert("invalid delegator or no remaining reward"); - distribute.queryUnclaimed(thirdStaker, alice); - - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(firstStaker, 0); - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(secondStaker, 0); - hevm.expectRevert("no remaining reward"); - l2Staking.claimReward(thirdStaker, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2 + aliceReward3); - hevm.stopPrank(); + function test_sequencerSetUpdate_addOneSequencer_succeeds() public { + // TODO } /** - * @notice staking -> distribute -> claim + * @notice sequencer update: remove one sequencer */ - function test_delegatorClaimLargeEpochs_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - hevm.startPrank(alice1); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(secondStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // ranking changed by delegate amount - uint256 secondRanking = l2Staking.stakerRankings(secondStaker); - assertEq(secondRanking, 0 + 1); - - // *********************************** // - for (uint256 i = 1; i < 22; i++) { - time = REWARD_EPOCH * (i + 2); - hevm.roll(blocksCountOfEpoch * (i + 2)); - hevm.warp(time); - _updateDistribute(i); - } - // *********************************** // - - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(firstStaker, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBefore + aliceReward1); - hevm.stopPrank(); - - hevm.startPrank(alice2); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, morphBalance - 5 ether); - hevm.stopPrank(); - - // *********************************** // - for (uint256 i = 22; i < 1000; i++) { - time = REWARD_EPOCH * (i + 2); - hevm.roll(blocksCountOfEpoch * (i + 2)); - hevm.warp(time); - _updateDistribute(i); - } - // *********************************** // - - uint256 aliceReward2 = distribute.queryUnclaimed(firstStaker, alice); - hevm.startPrank(alice); - balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(firstStaker, 0); - balanceAfter = morphToken.balanceOf(alice); - assertEq(balanceAfter, balanceBefore + aliceReward2); - hevm.stopPrank(); - - uint256 alice1Reward = distribute.queryUnclaimed(firstStaker, alice1); - hevm.startPrank(alice1); - uint256 alice1BalanceBefore = morphToken.balanceOf(alice1); - l2Staking.claimReward(firstStaker, 0); - uint256 alice1BalanceAfter = morphToken.balanceOf(alice1); - assertEq(alice1BalanceAfter, alice1BalanceBefore + alice1Reward); - hevm.stopPrank(); - - uint256 alice2Reward = distribute.queryUnclaimed(firstStaker, alice2); - hevm.startPrank(alice2); - uint256 alice2BalanceBefore = morphToken.balanceOf(alice2); - - l2Staking.claimReward(firstStaker, 0); - uint256 alice2BalanceAfter = morphToken.balanceOf(alice2); - - assertEq(alice2BalanceAfter, alice2BalanceBefore + alice2Reward); - hevm.stopPrank(); - - // Throw an error to check gas consumption - // assertTrue(false); + function test_sequencerSetUpdate_removeOneSequencer_succeeds() public { + // TODO } /** - * @notice staking -> distribute -> claim + * @notice sequencer update: replace one sequencer */ - function test_delegatorClaimAllRewardAfterUndelegate_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - hevm.stopPrank(); - - hevm.startPrank(bob); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - _updateDistribute(0); - - // *************** epoch = 2 ******************** // - time = REWARD_EPOCH * 3; - hevm.roll(blocksCountOfEpoch * 3); - hevm.warp(time); - _updateDistribute(1); - - // *************** epoch = 3 ******************** // - time = REWARD_EPOCH * 4; - hevm.roll(blocksCountOfEpoch * 4); - hevm.warp(time); - _updateDistribute(2); - - (address[] memory delegetees, uint256[] memory aliceRewards) = distribute.queryAllUnclaimed(alice); - uint256 aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - uint256 aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - assertEq(delegetees[0], firstStaker); - assertEq(delegetees[1], secondStaker); - assertEq(aliceRewards[0], aliceReward1); - assertEq(aliceRewards[1], aliceReward2); - - // *************** epoch = 4 ******************** // - time = REWARD_EPOCH * 5; - hevm.roll(blocksCountOfEpoch * 5); - hevm.warp(time); - _updateDistribute(3); - - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - - hevm.startPrank(alice); - l2Staking.undelegateStake(firstStaker); - l2Staking.undelegateStake(secondStaker); - IL2Staking.Undelegation[] memory undelegations = l2Staking.getUndelegations(alice); - assertEq(undelegations.length, 2); - - // *************** epoch = 5 ******************** // - time = REWARD_EPOCH * 6; - hevm.roll(blocksCountOfEpoch * 6); - hevm.warp(time); - _updateDistribute(4); - - aliceReward1 = distribute.queryUnclaimed(firstStaker, alice); - aliceReward2 = distribute.queryUnclaimed(secondStaker, alice); - - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - l2Staking.claimReward(firstStaker, 0); - l2Staking.claimReward(secondStaker, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - - assertEq(balanceAfter, balanceBefore + aliceReward1 + aliceReward2); - hevm.stopPrank(); + function test_sequencerSetUpdate_replaceOneSequencer_succeeds() public { + // TODO } /** - * @notice staking -> distribute -> claim + * @notice commission: test commission in multi epochs */ - function test_delegatorUndelegateWhenRewardStarting_succeeds() public { - hevm.startPrank(alice); - morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); - hevm.stopPrank(); - - uint256 time = REWARD_EPOCH; - hevm.warp(time); - - // reward starting - // rewardStartTime = 86400 - // block.timeStamp >= rewardStartTime - // candidateNumber > 0 - hevm.prank(multisig); - l2Staking.startReward(); - - // staker set commission - hevm.prank(firstStaker); - l2Staking.setCommissionRate(1); - hevm.prank(secondStaker); - l2Staking.setCommissionRate(1); - hevm.prank(thirdStaker); - l2Staking.setCommissionRate(1); - - // *************** epoch = 1 ******************** // - time = REWARD_EPOCH * 2; - hevm.warp(time); - - uint256 blocksCountOfEpoch = REWARD_EPOCH / 3; - hevm.roll(blocksCountOfEpoch * 2); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(blocksCountOfEpoch); - uint256 totalInflations0 = _updateDistribute(0); - - // effectiveEpoch = 2 - hevm.startPrank(alice); - l2Staking.undelegateStake(firstStaker); - hevm.stopPrank(); - - // candidateNumber decrease - assertEq(l2Staking.candidateNumber(), SEQUENCER_SIZE - 1); - // ranking changed by undelegate action - assertEq(l2Staking.stakerRankings(secondStaker), 0 + 1); - assertEq(l2Staking.stakerRankings(thirdStaker), 0 + 2); - assertEq(l2Staking.stakerRankings(firstStaker), 0 + 3); - - hevm.startPrank(alice); - hevm.expectRevert("no Morph token to claim"); - l2Staking.claimUndelegation(); - hevm.stopPrank(); - - // *************** epoch = 2 ******************** // - time = REWARD_EPOCH * 3 + 1; - hevm.roll(blocksCountOfEpoch * 3); - hevm.warp(time); - uint256 totalInflations1 = _updateDistribute(1); - - // *************** epoch = 3 ******************** // - time = REWARD_EPOCH * 4; - hevm.roll(blocksCountOfEpoch * 4); - hevm.warp(time); - _updateDistribute(2); - - // *************** at unlock epoch ******************** // - time = rewardStartTime + REWARD_EPOCH * (ROLLUP_EPOCH + 2); - hevm.warp(time); - hevm.prank(alice); - l2Staking.claimUndelegation(); + function test_commission_claimCommissionMultiEpochs_succeeds() public { + // TODO multi delegator & multi delegatee + } - /** - * 1. reward = 0 no remaining reward - * 2. reward > 0 - */ - hevm.startPrank(alice); - uint256 balanceBefore = morphToken.balanceOf(alice); - // total 20 ether - // stake 5 ether to second staker - // stake 5 ether to third staker - // undelegate 5 ether - assertEq(balanceBefore, 10 ether); - l2Staking.claimReward(firstStaker, 0); - uint256 balanceAfter = morphToken.balanceOf(alice); - - // sequencer size = 3 - // proposal same blocks in every epoch - // commission = 1 - // alice delegate 5 ether morph token in epoch 0 - 1, undeletegate at epoch 1. valid reward epoch is 0, 1 - // check the reward - uint256 validEpoch = 2; - uint256[] memory rewardInflations = new uint256[](validEpoch); - rewardInflations[0] = totalInflations0; - rewardInflations[1] = totalInflations1; - - uint256 totalReward = 0; - for (uint256 i = 0; i < validEpoch; i++) { - uint256 commissionRate = l2Staking.commissions(secondStaker); - uint256 sequencerEpochReward = ((rewardInflations[i] * (SEQUENCER_RATIO_PRECISION / SEQUENCER_SIZE)) / - SEQUENCER_RATIO_PRECISION); - uint256 commission = (sequencerEpochReward * commissionRate) / 100; - uint256 delegatorReward = sequencerEpochReward - commission; - - totalReward += (delegatorReward * 5 ether) / (5 ether); - } + /** + * @notice commission: test commission in multi epochs with changed commission rate + */ + function test_commission_claimCommissionMultiEpochsWithChanged_succeeds() public { + // TODO multi delegator & multi delegatee + } - assertEq(balanceAfter, balanceBefore + totalReward); - hevm.stopPrank(); + /** + * @notice distribute: multi epoch no blocks + */ + function test_distribute_multiEpochNoBlocks_succeeds() public { + // TODO } /** * @notice currentEpoch */ - function test_currentEpoch_succeeds() public { + hevm.warp(rewardStartTime); uint256 currentEpoch = l2Staking.currentEpoch(); assertEq(currentEpoch, 0); - hevm.warp(rewardStartTime); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); currentEpoch = l2Staking.currentEpoch(); - assertEq(currentEpoch, 0); + assertEq(currentEpoch, 1); - hevm.warp(rewardStartTime * 2); + hevm.warp(rewardStartTime + REWARD_EPOCH * 2); currentEpoch = l2Staking.currentEpoch(); - assertEq(currentEpoch, 1); + assertEq(currentEpoch, 2); } /** @@ -2145,7 +1404,6 @@ contract L2StakingTest is L2StakingBaseTest { function test_getStakesInfo_succeeds() public { address[] memory _sequencerAddresses = new address[](SEQUENCER_SIZE); Types.StakerInfo[] memory stakerInfos0 = new Types.StakerInfo[](SEQUENCER_SIZE); - for (uint256 i = 0; i < SEQUENCER_SIZE; i++) { address user = address(uint160(beginSeq + i)); Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(user); @@ -2154,7 +1412,6 @@ contract L2StakingTest is L2StakingBaseTest { } Types.StakerInfo[] memory stakerInfos1 = l2Staking.getStakesInfo(_sequencerAddresses); - // check params assertEq(stakerInfos1.length, stakerInfos0.length); for (uint256 i = 0; i < stakerInfos1.length; i++) { @@ -2168,7 +1425,6 @@ contract L2StakingTest is L2StakingBaseTest { */ function test_getStakers_succeeds() public { Types.StakerInfo[] memory stakerInfos0 = new Types.StakerInfo[](SEQUENCER_SIZE); - for (uint256 i = 0; i < SEQUENCER_SIZE; i++) { address user = address(uint160(beginSeq + i)); Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(user); @@ -2176,7 +1432,6 @@ contract L2StakingTest is L2StakingBaseTest { } Types.StakerInfo[] memory stakerInfos1 = l2Staking.getStakers(); - // check params assertEq(stakerInfos1.length, stakerInfos0.length); for (uint256 i = 0; i < stakerInfos1.length; i++) { @@ -2191,31 +1446,31 @@ contract L2StakingTest is L2StakingBaseTest { function test_getDelegators_succeeds() public { hevm.startPrank(alice); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + l2Staking.delegate(thirdStaker, 5 ether); hevm.stopPrank(); hevm.startPrank(alice1); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); hevm.stopPrank(); hevm.startPrank(alice2); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); hevm.stopPrank(); hevm.startPrank(alice3); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); hevm.stopPrank(); hevm.startPrank(alice4); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); hevm.stopPrank(); // check firstStaker @@ -2230,21 +1485,18 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[4], alice4); assertEq(delegators[5], address(0)); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(firstStaker, 1, 0); assertEq(total, 5); assertEq(delegators.length, 1); assertEq(delegators[0], alice); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(firstStaker, 1, 1); assertEq(total, 5); assertEq(delegators.length, 1); assertEq(delegators[0], alice1); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(firstStaker, 2, 2); assertEq(total, 5); @@ -2252,7 +1504,6 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[0], alice4); assertEq(delegators[1], address(0)); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(firstStaker, 10, 3); assertEq(total, 5); @@ -2260,7 +1511,6 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[0], address(0)); assertEq(delegators[1], address(0)); } - // check secondStaker { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(secondStaker, 10, 0); @@ -2271,7 +1521,6 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[2], alice2); assertEq(delegators[3], address(0)); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(secondStaker, 2, 1); assertEq(total, 3); @@ -2279,7 +1528,6 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[0], alice2); assertEq(delegators[1], address(0)); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(secondStaker, 2, 2); assertEq(total, 3); @@ -2287,7 +1535,6 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[0], address(0)); assertEq(delegators[1], address(0)); } - // check thirdStaker { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(thirdStaker, 10, 0); @@ -2296,14 +1543,12 @@ contract L2StakingTest is L2StakingBaseTest { assertEq(delegators[0], alice); assertEq(delegators[1], address(0)); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(thirdStaker, 1, 0); assertEq(total, 1); assertEq(delegators.length, 1); assertEq(delegators[0], alice); } - { (uint256 total, address[] memory delegators) = l2Staking.getAllDelegatorsInPagination(thirdStaker, 1, 1); assertEq(total, 1); @@ -2318,9 +1563,9 @@ contract L2StakingTest is L2StakingBaseTest { function test_isStakingTo_succeeds() public { hevm.startPrank(alice); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + l2Staking.delegate(thirdStaker, 5 ether); hevm.stopPrank(); hevm.startPrank(alice); diff --git a/contracts/contracts/test/MorphToken.t.sol b/contracts/contracts/test/MorphToken.t.sol index e1bd35e01..a68d3deb6 100644 --- a/contracts/contracts/test/MorphToken.t.sol +++ b/contracts/contracts/test/MorphToken.t.sol @@ -5,8 +5,11 @@ import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20 import {Predeploys} from "../libraries/constants/Predeploys.sol"; import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol"; +import {IL2Staking} from "../l2/staking/IL2Staking.sol"; +import {L2Staking} from "../l2/staking/L2Staking.sol"; import {IMorphToken} from "../l2/system/IMorphToken.sol"; import {MorphToken} from "../l2/system/MorphToken.sol"; +import {console} from "forge-std/Test.sol"; contract MorphTokenTest is L2StakingBaseTest { function setUp() public virtual override { @@ -58,14 +61,6 @@ contract MorphTokenTest is L2StakingBaseTest { assertEq(morphToken.L2_STAKING_CONTRACT(), Predeploys.L2_STAKING); } - function test_distribute_contract_succeeds() public { - assertEq(morphToken.DISTRIBUTE_CONTRACT(), Predeploys.DISTRIBUTE); - } - - function test_record_contract_succeeds() public { - assertEq(morphToken.RECORD_CONTRACT(), Predeploys.RECORD); - } - function test_name_succeeds() public { assertEq(morphToken.name(), "Morph"); } @@ -117,8 +112,9 @@ contract MorphTokenTest is L2StakingBaseTest { uint256 newEpochIndex = info.effectiveEpochIndex + 1; hevm.expectEmit(true, true, true, true); emit IMorphToken.UpdateEpochInflationRate(newRate, newEpochIndex); - hevm.prank(multisig); + hevm.startPrank(multisig); morphToken.updateRate(newRate, newEpochIndex); + hevm.stopPrank(); uint256 newCount = morphToken.inflationRatesCount(); assertEq(morphToken.epochInflationRates(newCount - 1).rate, newRate); @@ -134,8 +130,9 @@ contract MorphTokenTest is L2StakingBaseTest { uint256 newEpochIndex = info.effectiveEpochIndex + 1; hevm.expectEmit(true, true, true, true); emit IMorphToken.UpdateEpochInflationRate(0, newEpochIndex); - hevm.prank(multisig); + hevm.startPrank(multisig); morphToken.updateRate(0, newEpochIndex); + hevm.stopPrank(); uint256 newCount = morphToken.inflationRatesCount(); assertEq(morphToken.epochInflationRates(newCount - 1).rate, 0); @@ -152,92 +149,99 @@ contract MorphTokenTest is L2StakingBaseTest { uint256 newEpochIndex = info.effectiveEpochIndex + 100; hevm.expectEmit(true, true, true, true); emit IMorphToken.UpdateEpochInflationRate(newRate, newEpochIndex); - hevm.prank(multisig); + hevm.startPrank(multisig); morphToken.updateRate(newRate, newEpochIndex); + hevm.stopPrank(); uint256 newCount = morphToken.inflationRatesCount(); assertEq(morphToken.epochInflationRates(newCount - 1).rate, newRate); assertEq(morphToken.epochInflationRates(newCount - 1).effectiveEpochIndex, newEpochIndex); } - function test_mintInflations_notRecord_reverts() public { - hevm.startPrank(Predeploys.DISTRIBUTE); - hevm.expectRevert("only record contract allowed"); - morphToken.mintInflations(0); + function test_mintInflations_notSystem_reverts() public { + hevm.startPrank(Predeploys.MORPH_TOKEN); + hevm.expectRevert("only system address allowed"); + morphToken.mintInflations(); hevm.stopPrank(); } function test_mintInflations_notStart_reverts() public { - hevm.startPrank(Predeploys.RECORD); - hevm.warp(block.timestamp + rewardStartTime - 2); - hevm.expectRevert("reward is not started yet"); - morphToken.mintInflations(0); - hevm.stopPrank(); - } - - function test_mintInflations_invalidEpoch_reverts() public { - hevm.startPrank(Predeploys.RECORD); - hevm.warp(block.timestamp + rewardStartTime); - hevm.expectRevert("the specified time has not yet been reached"); - morphToken.mintInflations(0); - hevm.stopPrank(); - } - - function test_mintInflations_exceedCurrentEpoch_reverts() public { - hevm.startPrank(Predeploys.RECORD); - hevm.warp(block.timestamp + rewardStartTime * 2); - uint256 exceedingEpoch = l2Staking.currentEpoch() + 1; - hevm.expectRevert("the specified time has not yet been reached"); - morphToken.mintInflations(exceedingEpoch); + hevm.startPrank(Predeploys.SYSTEM); + hevm.warp(rewardStartTime - 1); + hevm.expectRevert(IL2Staking.ErrRewardNotStarted.selector); + morphToken.mintInflations(); hevm.stopPrank(); } function test_mintInflations_check_reverts() public { - hevm.startPrank(Predeploys.RECORD); + hevm.startPrank(Predeploys.SYSTEM); uint256 beforeTotal = morphToken.totalSupply(); - hevm.warp(block.timestamp + rewardStartTime * 2); - morphToken.mintInflations(0); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); + morphToken.mintInflations(); uint256 afterTotal = morphToken.totalSupply(); assertEq(afterTotal - beforeTotal, morphToken.inflation(0)); assertEq(morphToken.inflationMintedEpochs(), 1); hevm.expectRevert("all inflations minted"); - morphToken.mintInflations(0); + morphToken.mintInflations(); hevm.stopPrank(); } function test_mintInflations_succeeds() public { - hevm.startPrank(Predeploys.RECORD); + hevm.startPrank(Predeploys.SYSTEM); uint256 beforeTotal = morphToken.totalSupply(); - uint256 dbb = morphToken.balanceOf(Predeploys.DISTRIBUTE); - hevm.warp(block.timestamp + rewardStartTime * 2); - morphToken.mintInflations(0); + uint256 dbb = morphToken.balanceOf(Predeploys.L2_STAKING); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); + morphToken.mintInflations(); uint256 afterTotal = morphToken.totalSupply(); - uint256 dab = morphToken.balanceOf(Predeploys.DISTRIBUTE); + uint256 dab = morphToken.balanceOf(Predeploys.L2_STAKING); assertEq(afterTotal - beforeTotal, morphToken.inflation(0)); assertEq(dab - dbb, morphToken.inflation(0)); hevm.stopPrank(); } + function test_mintInflations_multi_epochs_succeeds() public { + hevm.startPrank(Predeploys.SYSTEM); + uint256 beforeTotal = morphToken.totalSupply(); + uint256 dbb = morphToken.balanceOf(Predeploys.L2_STAKING); + hevm.warp(rewardStartTime + REWARD_EPOCH * 3); + morphToken.mintInflations(); + uint256 afterTotal = morphToken.totalSupply(); + uint256 dab = morphToken.balanceOf(Predeploys.L2_STAKING); + assertEq(afterTotal - beforeTotal, morphToken.inflation(0) + morphToken.inflation(1) + morphToken.inflation(2)); + assertEq(dab - dbb, morphToken.inflation(0) + morphToken.inflation(1) + morphToken.inflation(2)); + hevm.stopPrank(); + } + function test_mintInflations_differentRate_succeeds() public { hevm.startPrank(multisig); morphToken.updateRate(1596535874529 + 100, 1); hevm.stopPrank(); - hevm.startPrank(Predeploys.RECORD); - hevm.warp(block.timestamp + REWARD_EPOCH * 3); - morphToken.mintInflations(0); + hevm.startPrank(Predeploys.SYSTEM); uint256 oldTotal = morphToken.totalSupply(); - uint256 incrementAmount = (oldTotal * (morphToken.epochInflationRates(1).rate)) / INFLATION_RATIO_PRECISION; + uint256 incrementAmount = (oldTotal * (morphToken.epochInflationRates(0).rate)) / INFLATION_RATIO_PRECISION; + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); + hevm.expectEmit(true, true, true, true); + emit IMorphToken.InflationMinted(0, incrementAmount); + morphToken.mintInflations(); + uint256 newTotal = morphToken.totalSupply(); + hevm.stopPrank(); + + assertEq(incrementAmount, newTotal - oldTotal); + assertEq(incrementAmount, morphToken.inflation(0)); + hevm.startPrank(Predeploys.SYSTEM); + oldTotal = morphToken.totalSupply(); + incrementAmount = (oldTotal * (morphToken.epochInflationRates(1).rate)) / INFLATION_RATIO_PRECISION; + hevm.warp(rewardStartTime + REWARD_EPOCH * 2); hevm.expectEmit(true, true, true, true); emit IMorphToken.InflationMinted(1, incrementAmount); - - morphToken.mintInflations(1); - uint256 newTotal = morphToken.totalSupply(); + morphToken.mintInflations(); + newTotal = morphToken.totalSupply(); + hevm.stopPrank(); assertEq(incrementAmount, newTotal - oldTotal); assertEq(incrementAmount, morphToken.inflation(1)); - hevm.stopPrank(); } function test_burn_notOwner_reverts() public { @@ -301,9 +305,10 @@ contract MorphTokenTest is L2StakingBaseTest { } function test_transferFrom_check_reverts() public { - hevm.prank(multisig); + hevm.startPrank(multisig); bool isApprove = morphToken.approve(alice, 100 ether); assert(isApprove); + hevm.stopPrank(); hevm.startPrank(alice); hevm.expectRevert("insufficient allowance"); @@ -312,31 +317,31 @@ contract MorphTokenTest is L2StakingBaseTest { } function test_transferFrom_succeeds() public { - hevm.prank(multisig); + hevm.startPrank(multisig); bool isApprove = morphToken.approve(alice, 100 ether); assert(isApprove); + hevm.stopPrank(); uint256 beforeBalance = morphToken.balanceOf(multisig); - hevm.prank(alice); - + hevm.startPrank(alice); hevm.expectEmit(true, true, true, true); emit IERC20Upgradeable.Transfer(multisig, bob, 5 ether); assert(morphToken.transferFrom(multisig, bob, 5 ether)); uint256 afterBalance = morphToken.balanceOf(multisig); assertEq(beforeBalance - afterBalance, 5 ether); + hevm.stopPrank(); } function test_transferFrom_zeroAmount_succeeds() public { uint256 beforeBalance = morphToken.balanceOf(multisig); - hevm.prank(alice); - + hevm.startPrank(alice); hevm.expectEmit(true, true, true, true); emit IERC20Upgradeable.Transfer(multisig, bob, 0); - assert(morphToken.transferFrom(multisig, bob, 0)); uint256 afterBalance = morphToken.balanceOf(multisig); assertEq(beforeBalance, afterBalance); + hevm.stopPrank(); } function test_increaseAllowance_check_reverts() public { @@ -413,21 +418,21 @@ contract MorphTokenTest is L2StakingBaseTest { } function test_inflation_succeeds() public { - hevm.startPrank(Predeploys.RECORD); + hevm.startPrank(Predeploys.SYSTEM); uint256 beforeTotal = morphToken.totalSupply(); - hevm.warp(block.timestamp + rewardStartTime * 2); - morphToken.mintInflations(0); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); + morphToken.mintInflations(); uint256 afterTotal = morphToken.totalSupply(); assertEq(afterTotal - beforeTotal, morphToken.inflation(0)); hevm.stopPrank(); } function test_inflationMintedEpochs_succeeds() public { - hevm.startPrank(Predeploys.RECORD); + hevm.startPrank(Predeploys.SYSTEM); uint256 beforeTotal = morphToken.totalSupply(); - hevm.warp(block.timestamp + rewardStartTime * 2); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); assertEq(morphToken.inflationMintedEpochs(), 0); - morphToken.mintInflations(0); + morphToken.mintInflations(); uint256 afterTotal = morphToken.totalSupply(); assertEq(afterTotal - beforeTotal, morphToken.inflation(0)); assertEq(morphToken.inflationMintedEpochs(), 1); @@ -435,9 +440,10 @@ contract MorphTokenTest is L2StakingBaseTest { } function test_transfer_check_reverts() public { - hevm.prank(address(0)); + hevm.startPrank(address(0)); hevm.expectRevert("transfer from the zero address"); morphToken.transfer(alice, 10 ether); + hevm.stopPrank(); hevm.startPrank(multisig); hevm.expectRevert("transfer to the zero address"); @@ -457,9 +463,10 @@ contract MorphTokenTest is L2StakingBaseTest { } function test_allowance_succeeds() public { - hevm.prank(multisig); + hevm.startPrank(multisig); bool success = morphToken.transfer(alice, 100 ether); assert(success); + hevm.stopPrank(); hevm.startPrank(alice); assert(morphToken.approve(bob, 20 ether)); @@ -468,57 +475,92 @@ contract MorphTokenTest is L2StakingBaseTest { assertEq(morphToken.allowance(alice, bob), 25 ether); hevm.stopPrank(); - hevm.prank(bob); + hevm.startPrank(bob); assert(morphToken.transferFrom(alice, multisig, 10 ether)); - assertEq(morphToken.balanceOf(alice), 90 ether); + hevm.stopPrank(); } function test_mintInflations_errEpochIndex_reverts() public { - uint256 morphBalance = 20 ether; + hevm.warp(rewardStartTime - 100); address firstStaker = address(uint160(beginSeq)); address secondStaker = address(uint160(beginSeq + 1)); address thirdStaker = address(uint160(beginSeq + 2)); hevm.startPrank(multisig); - morphToken.transfer(bob, morphBalance); - morphToken.transfer(alice, morphBalance); + morphToken.transfer(bob, 20 ether); + morphToken.transfer(alice, 20 ether); hevm.stopPrank(); - hevm.expectRevert("only record contract allowed"); - hevm.prank(alice); - morphToken.mintInflations(0); + hevm.startPrank(alice); + hevm.expectRevert("only system address allowed"); + morphToken.mintInflations(); + hevm.stopPrank(); - hevm.expectRevert("reward is not started yet"); - hevm.prank(address(record)); - morphToken.mintInflations(0); + hevm.startPrank(address(system)); + hevm.expectRevert(IL2Staking.ErrRewardNotStarted.selector); + morphToken.mintInflations(); + hevm.stopPrank(); hevm.startPrank(alice); + assertEq(l2Staking.candidateNumber(), 0); morphToken.approve(address(l2Staking), type(uint256).max); - l2Staking.delegateStake(firstStaker, 5 ether); - l2Staking.delegateStake(secondStaker, 5 ether); - l2Staking.delegateStake(thirdStaker, 5 ether); + // console.log("........................................"); + // console.log("before delegate"); + // (uint256 amount1, ) = l2Staking.delegateeDelegations(firstStaker); + // (uint256 amount2, ) = l2Staking.delegateeDelegations(secondStaker); + // (uint256 amount3, ) = l2Staking.delegateeDelegations(thirdStaker); + // console.log(amount1); + // console.log(amount2); + // console.log(amount3); + // console.log("........................................"); + l2Staking.delegate(firstStaker, 5 ether); + l2Staking.delegate(secondStaker, 5 ether); + l2Staking.delegate(thirdStaker, 5 ether); + // console.log("........................................"); + // console.log("after delegated"); + // (amount1, ) = l2Staking.delegateeDelegations(firstStaker); + // (amount2, ) = l2Staking.delegateeDelegations(secondStaker); + // (amount3, ) = l2Staking.delegateeDelegations(thirdStaker); + // console.log(amount1); + // console.log(amount2); + // console.log(amount3); + // console.log("........................................"); + assertEq(l2Staking.candidateNumber(), 3); + hevm.stopPrank(); + + // start reward before start time + hevm.startPrank(multisig); + hevm.expectRevert(IL2Staking.ErrStartTimeNotReached.selector); + hevm.warp(rewardStartTime - 1); + l2Staking.startReward(); hevm.stopPrank(); - uint256 time = REWARD_EPOCH; - hevm.warp(time); - // start reward - hevm.prank(multisig); + hevm.startPrank(multisig); + hevm.warp(rewardStartTime); l2Staking.startReward(); + hevm.stopPrank(); - hevm.expectRevert("the specified time has not yet been reached"); - hevm.prank(address(record)); - morphToken.mintInflations(0); + hevm.startPrank(address(system)); + hevm.expectRevert("no inflations yet"); + morphToken.mintInflations(); + hevm.stopPrank(); // epoch update - hevm.warp(time * 2); + assertEq(l2Staking.currentEpoch(), 0); + hevm.warp(rewardStartTime + REWARD_EPOCH * 1); assertEq(l2Staking.currentEpoch(), 1); + hevm.warp(rewardStartTime + REWARD_EPOCH * 2); + assertEq(l2Staking.currentEpoch(), 2); - hevm.prank(address(record)); + hevm.startPrank(address(system)); hevm.expectEmit(true, true, false, true); emit IMorphToken.InflationMinted(0, 159653587452900000000000); - morphToken.mintInflations(0); + hevm.expectEmit(true, true, false, true); + emit IMorphToken.InflationMinted(1, 159679076720886580788309); + morphToken.mintInflations(); + hevm.stopPrank(); } } diff --git a/contracts/contracts/test/Record.t.sol b/contracts/contracts/test/Record.t.sol deleted file mode 100644 index cafd2d474..000000000 --- a/contracts/contracts/test/Record.t.sol +++ /dev/null @@ -1,365 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity =0.8.24; -import {ITransparentUpgradeableProxy, TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; - -import {L2StakingBaseTest} from "./base/L2StakingBase.t.sol"; -import {IRecord} from "../l2/staking/IRecord.sol"; -import {Record} from "../l2/staking/Record.sol"; -import {Types} from "../libraries/common/Types.sol"; - -contract RecordTest is L2StakingBaseTest { - function setUp() public virtual override { - super.setUp(); - } - - /** - * @notice initialize: re-initialize - */ - function test_initialize_onlyOnce_reverts() public { - hevm.expectRevert("Initializable: contract is already initialized"); - hevm.prank(multisig); - record.initialize(multisig, address(0), 1); - } - - /** - * @notice initialize: Reverts if next batch submission index is zero. - */ - function test_initialize_zeroNextBatchSubmissionIndex_reverts() public { - // Deploy a TransparentUpgradeableProxy contract for recordProxyTemp. - TransparentUpgradeableProxy recordProxyTemp = new TransparentUpgradeableProxy( - address(emptyContract), - address(multisig), - new bytes(0) - ); - - // Deploy Record implementation. - Record recordImplTemp = new Record(); - - Types.StakerInfo[] memory stakerInfos = new Types.StakerInfo[](SEQUENCER_SIZE); - for (uint256 i = 0; i < SEQUENCER_SIZE; i++) { - address user = address(uint160(beginSeq + i)); - Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(user); - stakerInfos[i] = stakerInfo; - sequencerAddresses.push(stakerInfo.addr); - } - - // Expect revert due to invalid next batch submission index. - hevm.expectRevert("invalid next batch submission index"); - hevm.startPrank(multisig); - - // Initialize the proxy with the new implementation. - ITransparentUpgradeableProxy(address(recordProxyTemp)).upgradeToAndCall( - address(recordImplTemp), - abi.encodeCall(Record.initialize, (multisig, oracleAddress, 0)) - ); - hevm.stopPrank(); - } - - /** - * @notice initialize: Initializes the Record contract successfully. - */ - function test_initialize_succeeds() public { - // Deploy a TransparentUpgradeableProxy contract for recordProxyTemp. - TransparentUpgradeableProxy recordProxyTemp = new TransparentUpgradeableProxy( - address(emptyContract), - address(multisig), - new bytes(0) - ); - - // Deploy Record implementation. - Record recordImplTemp = new Record(); - - Types.StakerInfo[] memory stakerInfos = new Types.StakerInfo[](SEQUENCER_SIZE); - for (uint256 i = 0; i < SEQUENCER_SIZE; i++) { - address user = address(uint160(beginSeq + i)); - Types.StakerInfo memory stakerInfo = ffi.generateStakerInfo(user); - stakerInfos[i] = stakerInfo; - sequencerAddresses.push(stakerInfo.addr); - } - - hevm.startPrank(multisig); - - // Initialize the proxy with the new implementation. - ITransparentUpgradeableProxy(address(recordProxyTemp)).upgradeToAndCall( - address(recordImplTemp), - abi.encodeCall(Record.initialize, (multisig, oracleAddress, nextBatchSubmissionIndex)) - ); - hevm.stopPrank(); - - // Cast the proxy address to the Record contract type to call its methods. - Record recordTemp = Record(payable(address(recordProxyTemp))); - - // Verify that the oracle address and nextBatchSubmissionIndex are correctly initialized. - assertEq(recordTemp.oracle(), oracleAddress); - assertEq(recordTemp.nextBatchSubmissionIndex(), nextBatchSubmissionIndex); - } - - /** - * @notice setOracleAddress: check params - */ - function test_setOracleAddress_invalidAddress_reverts() public { - hevm.expectRevert("invalid oracle address"); - hevm.prank(multisig); - record.setOracleAddress(address(0)); - } - - /** - * @notice setOracleAddress: check owner - */ - function test_owner_onlyOwner_reverts() public { - hevm.expectRevert("Ownable: caller is not the owner"); - hevm.prank(alice); - record.setOracleAddress(address(0)); - } - - /** - * @notice setLatestRewardEpochBlock: check params - */ - function test_setLatestRewardEpochBlock_paramsCheck_reverts() public { - hevm.expectRevert("only oracle allowed"); - hevm.prank(multisig); - record.setLatestRewardEpochBlock(0); - - hevm.expectRevert("invalid latest block"); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(0); - - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(100); - - hevm.expectRevert("already set"); - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(100); - } - - /** - * @notice recordFinalizedBatchSubmissions - * 1. check owner - * 2. check params - */ - function test_recordFinalizedBatchSubmissions_paramsCheck_reverts() public { - IRecord.BatchSubmission[] memory submissions = new IRecord.BatchSubmission[](0); - - hevm.expectRevert("only oracle allowed"); - hevm.prank(multisig); - record.recordFinalizedBatchSubmissions(submissions); - - hevm.expectRevert("empty batch submissions"); - hevm.prank(oracleAddress); - record.recordFinalizedBatchSubmissions(submissions); - - submissions = new IRecord.BatchSubmission[](1); - hevm.expectRevert("invalid index"); - hevm.prank(oracleAddress); - record.recordFinalizedBatchSubmissions(submissions); - - // recordFinalizedBatchSubmissions - IRecord.BatchSubmission memory submission = IRecord.BatchSubmission( - nextBatchSubmissionIndex, - address(0), - 0, - 1, - 0, - 0 - ); - submissions = new IRecord.BatchSubmission[](1); - submissions[0] = submission; - hevm.expectEmit(true, true, false, false); - emit IRecord.BatchSubmissionsUploaded(1, 1); - hevm.prank(oracleAddress); - record.recordFinalizedBatchSubmissions(submissions); - - // Verify that the nextBatchSubmissionIndex updated correctly. - assertEq(record.nextBatchSubmissionIndex(), nextBatchSubmissionIndex + 1); - } - - /** - * @notice recordRollupEpochs - * 1. check owner - * 2. check params - */ - function test_recordRollupEpochs_paramsCheck_reverts() public { - IRecord.RollupEpochInfo[] memory epochInfos = new IRecord.RollupEpochInfo[](0); - - hevm.expectRevert("only oracle allowed"); - hevm.prank(multisig); - record.recordRollupEpochs(epochInfos); - - hevm.expectRevert("empty rollup epochs"); - hevm.prank(oracleAddress); - record.recordRollupEpochs(epochInfos); - - epochInfos = new IRecord.RollupEpochInfo[](1); - IRecord.RollupEpochInfo memory epochInfo = IRecord.RollupEpochInfo( - 1, // invalid index - address(0), - 0, - 0, - 0 - ); - epochInfos[0] = epochInfo; - hevm.expectRevert("invalid index"); - hevm.prank(oracleAddress); - record.recordRollupEpochs(epochInfos); - - // recordRollupEpochs - epochInfo = IRecord.RollupEpochInfo(0, address(0), 0, 0, 0); - epochInfos[0] = epochInfo; - hevm.expectEmit(true, true, false, false); - emit IRecord.RollupEpochsUploaded(0, 1); - hevm.prank(oracleAddress); - record.recordRollupEpochs(epochInfos); - - // Verify that the nextRollupEpochIndex updated correctly. - assertEq(record.nextRollupEpochIndex(), 1); - } - - /** - * @notice recordRewardEpochs: check owner - */ - function test_recordRewardEpochs_onlyOwner_reverts() public { - uint256 sequencerSize = sequencer.getSequencerSet2Size(); - address[] memory sequencers = sequencer.getSequencerSet2(); - uint256[] memory sequencerBlocks = new uint256[](sequencerSize); - uint256[] memory sequencerRatios = new uint256[](sequencerSize); - uint256[] memory sequencerCommissions = new uint256[](sequencerSize); - - for (uint256 i = 0; i < sequencerSize; i++) { - sequencerBlocks[i] = 0; - sequencerRatios[i] = SEQUENCER_RATIO_PRECISION / sequencerSize; - sequencerCommissions[i] = 1; - } - - IRecord.RewardEpochInfo[] memory rewardEpochInfos = new IRecord.RewardEpochInfo[](1); - - rewardEpochInfos[0] = IRecord.RewardEpochInfo( - 0, - 1, - sequencers, - sequencerBlocks, - sequencerRatios, - sequencerCommissions - ); - - hevm.expectRevert("only oracle allowed"); - hevm.prank(multisig); - record.recordRewardEpochs(rewardEpochInfos); - } - - /** - * @notice recordRewardEpochs: check params - */ - function test_recordRewardEpochs_paramsCheck_reverts() public { - uint256 sequencerSize = sequencer.getSequencerSet2Size(); - address[] memory sequencers = sequencer.getSequencerSet2(); - uint256[] memory sequencerBlocks = new uint256[](sequencerSize); - uint256[] memory sequencerRatios = new uint256[](sequencerSize); - uint256[] memory sequencerCommissions = new uint256[](sequencerSize); - - for (uint256 i = 0; i < sequencerSize; i++) { - sequencerBlocks[i] = 1; - sequencerRatios[i] = SEQUENCER_RATIO_PRECISION / sequencerSize; - sequencerCommissions[i] = 1; - } - - IRecord.RewardEpochInfo[] memory rewardEpochInfos = new IRecord.RewardEpochInfo[](0); - - hevm.expectRevert("empty reward epochs"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - - // greater than minted epoch - rewardEpochInfos = new IRecord.RewardEpochInfo[](2); - - hevm.expectRevert("start block should be set"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - - hevm.prank(oracleAddress); - record.setLatestRewardEpochBlock(1); - - hevm.expectRevert("reward is not started yet"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - - // update epoch - hevm.warp(rewardStartTime * 2); - rewardEpochInfos = new IRecord.RewardEpochInfo[](1); - rewardEpochInfos[0] = IRecord.RewardEpochInfo( - 0, - 1, // total block not equal - sequencers, - sequencerBlocks, - sequencerRatios, - sequencerCommissions - ); - hevm.expectRevert("invalid sequencers blocks"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - - // invalide commission rate - sequencerCommissions = new uint256[](sequencerSize); - for (uint256 i = 0; i < sequencerSize; i++) { - sequencerCommissions[i] = 21; - } - rewardEpochInfos[0] = IRecord.RewardEpochInfo( - 0, - 1, // total block not equal - sequencers, - sequencerBlocks, - sequencerRatios, - sequencerCommissions - ); - - hevm.expectRevert("invalid sequencers commission"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - - // invalide sequencers ratios - sequencerRatios = new uint256[](sequencerSize); - sequencerCommissions = new uint256[](sequencerSize); - for (uint256 i = 0; i < sequencerSize; i++) { - sequencerRatios[i] = SEQUENCER_RATIO_PRECISION / sequencerSize + 1; - sequencerCommissions[i] = 2; - } - rewardEpochInfos[0] = IRecord.RewardEpochInfo( - 0, - 3, // total block not equal - sequencers, - sequencerBlocks, - sequencerRatios, - sequencerCommissions - ); - - hevm.expectRevert("invalid sequencers ratios"); - hevm.prank(oracleAddress); - record.recordRewardEpochs(rewardEpochInfos); - } - - /** - * @notice getBatchSubmissions: check params - */ - function test_getBatchSubmissions_paramsCheck_reverts() public { - hevm.expectRevert("invalid index"); - hevm.prank(oracleAddress); - record.getBatchSubmissions(2, 1); - } - - /** - * @notice getRollupEpochs: check params - */ - function test_getRollupEpochs_paramsCheck_reverts() public { - hevm.expectRevert("invalid index"); - hevm.prank(oracleAddress); - record.getRollupEpochs(2, 1); - } - - /** - * @notice getRewardEpochs: check params - */ - function test_getRewardEpochs_paramsCheck_reverts() public { - hevm.expectRevert("invalid index"); - hevm.prank(oracleAddress); - record.getRewardEpochs(2, 1); - } -} diff --git a/contracts/contracts/test/base/L2StakingBase.t.sol b/contracts/contracts/test/base/L2StakingBase.t.sol index 8c9cef5f9..3c67c1a4c 100644 --- a/contracts/contracts/test/base/L2StakingBase.t.sol +++ b/contracts/contracts/test/base/L2StakingBase.t.sol @@ -8,24 +8,22 @@ import {Types} from "../../libraries/common/Types.sol"; import {MorphToken} from "../../l2/system/MorphToken.sol"; import {L2Staking} from "../../l2/staking/L2Staking.sol"; import {Sequencer} from "../../l2/staking/Sequencer.sol"; -import {Distribute} from "../../l2/staking/Distribute.sol"; -import {Record} from "../../l2/staking/Record.sol"; import {Gov} from "../../l2/staking/Gov.sol"; import {L2MessageBaseTest} from "./L2MessageBase.t.sol"; contract L2StakingBaseTest is L2MessageBaseTest { uint256 public constant SEQUENCER_RATIO_PRECISION = 1e8; uint256 public constant INFLATION_RATIO_PRECISION = 1e16; - uint256 public constant REWARD_EPOCH = 86400; uint256 public beginSeq = 10; - uint256 public version = 0; bytes[] public sequencerBLSKeys; address[] public sequencerAddresses; uint256 public constant SEQUENCER_SIZE = 3; uint256 public constant NEXT_EPOCH_START = 1700000000; + uint256 public constant UNDELEGATE_LOCKED_EPOCHS = 14; + uint256 public constant REWARD_EPOCH = 86400; uint256 public rewardStartTime = 86400; // Sequencer config @@ -40,18 +38,10 @@ contract L2StakingBaseTest is L2MessageBaseTest { // Morph token MorphToken public morphToken; - // Distribute - Distribute public distribute; - - // Record - Record public record; - - //Oracle address - address public oracleAddress = address(1000); - uint256 public nextBatchSubmissionIndex = 1; + // system address + address system = Predeploys.SYSTEM; uint256 public constant VOTING_DURATION = 1000; - uint256 public constant ROLLUP_EPOCH = 1000; uint256 public constant MAX_CHUNKS = 1000000000; function setUp() public virtual override { @@ -73,34 +63,20 @@ contract L2StakingBaseTest is L2MessageBaseTest { Predeploys.MORPH_TOKEN, address(new TransparentUpgradeableProxy(address(emptyContract), address(multisig), new bytes(0))).code ); - hevm.etch( - Predeploys.DISTRIBUTE, - address(new TransparentUpgradeableProxy(address(emptyContract), address(multisig), new bytes(0))).code - ); - hevm.etch( - Predeploys.RECORD, - address(new TransparentUpgradeableProxy(address(emptyContract), address(multisig), new bytes(0))).code - ); TransparentUpgradeableProxy sequencerProxy = TransparentUpgradeableProxy(payable(Predeploys.SEQUENCER)); TransparentUpgradeableProxy govProxy = TransparentUpgradeableProxy(payable(Predeploys.GOV)); TransparentUpgradeableProxy l2StakingProxy = TransparentUpgradeableProxy(payable(Predeploys.L2_STAKING)); TransparentUpgradeableProxy morphTokenProxy = TransparentUpgradeableProxy(payable(Predeploys.MORPH_TOKEN)); - TransparentUpgradeableProxy distributeProxy = TransparentUpgradeableProxy(payable(Predeploys.DISTRIBUTE)); - TransparentUpgradeableProxy recordProxy = TransparentUpgradeableProxy(payable(Predeploys.RECORD)); hevm.store(address(sequencerProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); hevm.store(address(govProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); hevm.store(address(l2StakingProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); hevm.store(address(morphTokenProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); - hevm.store(address(distributeProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); - hevm.store(address(recordProxy), bytes32(PROXY_OWNER_KEY), bytes32(abi.encode(address(multisig)))); hevm.startPrank(multisig); // deploy impl contracts MorphToken morphTokenImpl = new MorphToken(); L2Staking l2StakingImpl = new L2Staking(payable(NON_ZERO_ADDRESS)); Sequencer sequencerImpl = new Sequencer(); - Distribute distributeImpl = new Distribute(); - Record recordImpl = new Record(); Gov govImpl = new Gov(); // upgrade proxy @@ -123,8 +99,7 @@ contract L2StakingBaseTest is L2MessageBaseTest { multisig, VOTING_DURATION, // _votingDuration 0, // _batchBlockInterval - finalizationPeriodSeconds, // _batchTimeout - ROLLUP_EPOCH // rollupEpoch + finalizationPeriodSeconds // _batchTimeout ) ) ); @@ -133,35 +108,23 @@ contract L2StakingBaseTest is L2MessageBaseTest { address(l2StakingImpl), abi.encodeCall( L2Staking.initialize, - (multisig, SEQUENCER_SIZE * 2, ROLLUP_EPOCH, rewardStartTime, stakerInfos) + (multisig, SEQUENCER_SIZE * 2, UNDELEGATE_LOCKED_EPOCHS, rewardStartTime, stakerInfos) ) ); ITransparentUpgradeableProxy(address(morphTokenProxy)).upgradeToAndCall( address(morphTokenImpl), abi.encodeCall(MorphToken.initialize, ("Morph", "MPH", multisig, 1000000000 ether, 1596535874529)) ); - ITransparentUpgradeableProxy(address(distributeProxy)).upgradeToAndCall( - address(distributeImpl), - abi.encodeCall(Distribute.initialize, (multisig)) - ); - ITransparentUpgradeableProxy(address(recordProxy)).upgradeToAndCall( - address(recordImpl), - abi.encodeCall(Record.initialize, (multisig, oracleAddress, nextBatchSubmissionIndex)) - ); // set address sequencer = Sequencer(payable(address(sequencerProxy))); gov = Gov(payable(address(govProxy))); l2Staking = L2Staking(payable(address(l2StakingProxy))); - distribute = Distribute(payable(address(distributeProxy))); - record = Record(payable(address(recordProxy))); morphToken = MorphToken(payable(address(morphTokenProxy))); _changeAdmin(address(sequencer)); _changeAdmin(address(gov)); _changeAdmin(address(l2Staking)); - _changeAdmin(address(distribute)); - _changeAdmin(address(record)); _changeAdmin(address(morphToken)); hevm.stopPrank(); diff --git a/contracts/go.mod b/contracts/go.mod index cced1fb2e..cc81c5373 100644 --- a/contracts/go.mod +++ b/contracts/go.mod @@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/iden3/go-iden3-crypto v0.0.16 - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de + github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 github.com/stretchr/testify v1.9.0 ) diff --git a/contracts/go.sum b/contracts/go.sum index d70de2f97..ea99904f2 100644 --- a/contracts/go.sum +++ b/contracts/go.sum @@ -25,8 +25,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/contracts/src/constants.ts b/contracts/src/constants.ts index dbebd35a9..61f75fd4f 100644 --- a/contracts/src/constants.ts +++ b/contracts/src/constants.ts @@ -16,13 +16,12 @@ export const predeploys = { GasPriceOracle: "0x530000000000000000000000000000000000000f", L2WETHGateway: "0x5300000000000000000000000000000000000010", L2WETH: "0x5300000000000000000000000000000000000011", - Record: "0x5300000000000000000000000000000000000012", MorphToken: "0x5300000000000000000000000000000000000013", - Distribute: "0x5300000000000000000000000000000000000014", L2Staking: "0x5300000000000000000000000000000000000015", L2CustomERC20Gateway: "0x5300000000000000000000000000000000000016", Sequencer: "0x5300000000000000000000000000000000000017", L2ReverseERC20Gateway: "0x5300000000000000000000000000000000000018", L2WithdrawLockERC20Gateway: "0x5300000000000000000000000000000000000019", L2USDCGateway: "0x5300000000000000000000000000000000000020", -}; + System: "0x5300000000000000000000000000000000000021", +} diff --git a/contracts/src/deploy-config/l1.ts b/contracts/src/deploy-config/l1.ts index 0aa7ee787..20f9d5186 100644 --- a/contracts/src/deploy-config/l1.ts +++ b/contracts/src/deploy-config/l1.ts @@ -27,7 +27,7 @@ const config = { rollupProposer: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', rollupChallenger: '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65', // genesis config - batchHeader: '0x0000000000000000000000000000000000000000000000000043a758882ae97327ffcc63373e26fcd144a5a738eac834c167175d69713780c0010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c444014000000000000000000000000000000000000000000000000000000000000000020cd420e20d610897b8f2c5ac5259ab8b57cce1074212cec2815b2b73ff93d9f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + batchHeader: '0x0000000000000000000000000000000000000000000000000008b8064c1ee3eed77f886a1f21e165a487a2eca25e8f02069d0465435553beb6010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440140000000000000000000000000000000000000000000000000000000000000000113dfd4bd93b94adbd2094e94bad1c77a09f3c8ab1219da123dbd09ad635b487000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', // staking config // staking Cross-Chain config diff --git a/contracts/tasks/check.ts b/contracts/tasks/check.ts index 406b7b6f9..2f18f2d38 100644 --- a/contracts/tasks/check.ts +++ b/contracts/tasks/check.ts @@ -1,286 +1,317 @@ -import "@nomiclabs/hardhat-web3"; -import "@nomiclabs/hardhat-ethers"; -import "@nomiclabs/hardhat-waffle"; - -import { task } from "hardhat/config"; -import { ethers } from "ethers"; -import { predeploys } from "../src/constants"; - -task("check-l2") - .setAction(async (taskArgs, hre) => { - let ContractAddresses = [] - let keys = Object.keys(predeploys); - - keys.forEach((key) => { - ContractAddresses.push(predeploys[key]) - }); - const ProxyFactoryName = 'ITransparentUpgradeableProxy' - for (let i = 0; i < ContractAddresses.length; i++) { - if ( - ContractAddresses[i].toLocaleLowerCase() === predeploys.MorphStandardERC20.toLocaleLowerCase() - || ContractAddresses[i].toLocaleLowerCase() === predeploys.L2WETH.toLocaleLowerCase() - || ContractAddresses[i].toLocaleLowerCase() === predeploys.MorphToken.toLocaleLowerCase() - ) { - continue - } - const proxy = await hre.ethers.getContractAt(ProxyFactoryName, ContractAddresses[i]) - const temp = new ethers.Contract( - proxy.address, - proxy.interface, - proxy.provider - ) - const actual = await temp.callStatic['implementation']({ - from: predeploys.ProxyAdmin, - }) - console.log(`implementation is: ${actual}`) - const adminAddr = await temp.callStatic['admin']({ - from: predeploys.ProxyAdmin, - }) - - console.log(`implementation is equal ProxyAdmin: ${adminAddr.toLowerCase() == predeploys.ProxyAdmin.toLowerCase()}`) - } - }); - -task("check-l2-status") - .setAction(async (taskArgs, hre) => { - const mpFactory = await hre.ethers.getContractFactory('L2ToL1MessagePasser') - const mpContract = mpFactory.attach(predeploys.L2ToL1MessagePasser) - const messageRoot = await mpContract.messageRoot() - console.log(`L2ToL1MessagePasser params check \n root set status ${messageRoot == '0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757'}`) - console.log('-----------------------------------\n') - - const gwrFactory = await hre.ethers.getContractFactory('L2GatewayRouter') - const gwrContract = gwrFactory.attach(predeploys.L2GatewayRouter) - let owner = await gwrContract.owner() - let ethGateway = await gwrContract.ethGateway() - let defaultERC20Gateway = await gwrContract.defaultERC20Gateway() - console.log(`L2GatewayRouter params check \n owner ${owner} \n ETHGateway set ${ethGateway == predeploys.L2ETHGateway} \n ERC20Gateway set ${defaultERC20Gateway == predeploys.L2StandardERC20Gateway}`) - console.log('-----------------------------------\n') - - const l2StakingFactory = await hre.ethers.getContractFactory('L2Staking') - const l2StakingContract = l2StakingFactory.attach(predeploys.L2Staking) - owner = await l2StakingContract.owner() - let morphTokenAddr = await l2StakingContract.MORPH_TOKEN_CONTRACT() - let sequencerAddr = await l2StakingContract.SEQUENCER_CONTRACT() - let distributeAddr = await l2StakingContract.DISTRIBUTE_CONTRACT() - let sequencerSetMaxSize = await l2StakingContract.sequencerSetMaxSize() - let unDelegateLockEpochs = await l2StakingContract.undelegateLockEpochs() - let rewardStartTime = await l2StakingContract.rewardStartTime() - let latestSequencerSetSize = await l2StakingContract.latestSequencerSetSize() - console.log(`L2Staking params check \n owner ${owner} \n morphToken ${morphTokenAddr == predeploys.MorphToken} \n sequencerAddr ${sequencerAddr == predeploys.Sequencer} \n distributeAddr ${distributeAddr == predeploys.Distribute}`) - console.log(` sequencerSetMaxSize ${sequencerSetMaxSize} \n unDelegateLockEpochs ${unDelegateLockEpochs} \n rewardStartTime ${rewardStartTime} \n latestSequencerSetSize ${latestSequencerSetSize}`) - for (let i = 0; i < latestSequencerSetSize.toNumber(); i++) { - let stakerAddr = await l2StakingContract.stakerAddresses(i) - console.log(` has staker ${stakerAddr}`) +import "@nomiclabs/hardhat-web3" +import "@nomiclabs/hardhat-ethers" +import "@nomiclabs/hardhat-waffle" + +import { task } from "hardhat/config" +import { ethers } from "ethers" +import { predeploys } from "../src/constants" + +task("check-l2").setAction(async (taskArgs, hre) => { + let ContractAddresses = [] + let keys = Object.keys(predeploys) + + keys.forEach((key) => { + ContractAddresses.push(predeploys[key]) + }) + const ProxyFactoryName = "ITransparentUpgradeableProxy" + for (let i = 0; i < ContractAddresses.length; i++) { + if ( + ContractAddresses[i].toLocaleLowerCase() === predeploys.MorphStandardERC20.toLocaleLowerCase() || + ContractAddresses[i].toLocaleLowerCase() === predeploys.L2WETH.toLocaleLowerCase() || + ContractAddresses[i].toLocaleLowerCase() === predeploys.MorphToken.toLocaleLowerCase() + ) { + continue } - console.log('-----------------------------------\n') - - const sequencerFactory = await hre.ethers.getContractFactory('Sequencer') - const sequencerContract = sequencerFactory.attach(predeploys.Sequencer) - let stakingAddr = await sequencerContract.L2_STAKING_CONTRACT() - owner = await sequencerContract.owner() - let set0 = await sequencerContract.getSequencerSet0() - let set1 = await sequencerContract.getSequencerSet1() - let set2 = await sequencerContract.getSequencerSet2() - let updateTime = await sequencerContract.updateTime() - console.log(`Sequencer params check \n owner ${owner} \n staking ${stakingAddr == predeploys.L2Staking} \n updateTime ${updateTime}`) - console.log(` set0 ${set0} \n set1 ${set1} \n set2 ${set2}`) - console.log('-----------------------------------\n') - - const distributeFactory = await hre.ethers.getContractFactory('Distribute') - const distributeContract = distributeFactory.attach(predeploys.Distribute) - owner = await distributeContract.owner() - morphTokenAddr = await distributeContract.MORPH_TOKEN_CONTRACT() - let l2StakingAddr = await distributeContract.L2_STAKING_CONTRACT() - let recordAddr = await distributeContract.RECORD_CONTRACT() - console.log(`Distribute params check \n owner ${owner} \n morphTokenAddr ${morphTokenAddr == predeploys.MorphToken} \n l2Staking ${l2StakingAddr == predeploys.L2Staking} \n record ${recordAddr == predeploys.Record}`) - console.log('-----------------------------------\n') - - const recordFactory = await hre.ethers.getContractFactory('Record') - const recordContract = recordFactory.attach(predeploys.Record) - owner = await recordContract.owner() - l2StakingAddr = await recordContract.L2_STAKING_CONTRACT() - morphTokenAddr = await recordContract.MORPH_TOKEN_CONTRACT() - sequencerAddr = await recordContract.SEQUENCER_CONTRACT() - distributeAddr = await recordContract.DISTRIBUTE_CONTRACT() - let govAddr = await recordContract.GOV_CONTRACT() - let oracle = await recordContract.oracle() - let nextBatchSubmissionIndex = await recordContract.nextBatchSubmissionIndex() - console.log(`Record params check \n owner ${owner} \n morphTokenAddr ${morphTokenAddr == predeploys.MorphToken} \n l2Staking ${l2StakingAddr == predeploys.L2Staking} \n sequencer ${sequencerAddr == predeploys.Sequencer} \n distributeAddr ${distributeAddr == predeploys.Distribute} \n gov ${govAddr == predeploys.Gov}`) - console.log(` oracle ${oracle} \n nextBatchSubmissionIndex ${nextBatchSubmissionIndex}`) - console.log('-----------------------------------\n') - - const govFactory = await hre.ethers.getContractFactory('Gov') - const govContract = govFactory.attach(predeploys.Gov) - owner = await govContract.owner() - const votingDuration = await govContract.votingDuration() - const batchBlockInterval = await govContract.batchBlockInterval() - const batchMaxBytes = await govContract.batchMaxBytes() - const batchTimeout = await govContract.batchTimeout() - const rollupEpoch = await govContract.rollupEpoch() - const maxChunks = await govContract.maxChunks() - console.log(`Gov params check \n owner ${owner} \n votingDuration ${votingDuration} \n batchMaxBytes ${batchMaxBytes} \n batchBlockInterval ${batchBlockInterval} \n batchTimeout ${batchTimeout} \n rollupEpoch ${rollupEpoch} \n maxChunks ${maxChunks}`) - console.log('-----------------------------------\n') - - const ethgwFactory = await hre.ethers.getContractFactory('L2ETHGateway') - const ethgwContract = ethgwFactory.attach(predeploys.L2ETHGateway) - owner = await ethgwContract.owner() - let router = await ethgwContract.router() - let messenger = await ethgwContract.messenger() - let counterpart = await ethgwContract.counterpart() - console.log(`L2ETHGateway params check \n owner ${owner} \n router ${router == predeploys.L2GatewayRouter} \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const wethgwFactory = await hre.ethers.getContractFactory('L2WETHGateway') - const wethgwContract = wethgwFactory.attach(predeploys.L2WETHGateway) - owner = await wethgwContract.owner() - router = await wethgwContract.router() - messenger = await wethgwContract.messenger() - counterpart = await wethgwContract.counterpart() - console.log(`L2WETHGateway params check \n owner ${owner} \n router ${router == predeploys.L2GatewayRouter} \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const cdmFactory = await hre.ethers.getContractFactory('L2CrossDomainMessenger') - const cdmContract = cdmFactory.attach(predeploys.L2CrossDomainMessenger) - owner = await cdmContract.owner() - let paused = await cdmContract.paused() - let xDomainMessageSender = await cdmContract.xDomainMessageSender() - counterpart = await cdmContract.counterpart() - let feeVault = await cdmContract.feeVault() - console.log(`L2CrossDomainMessenger params check \n owner ${owner} \n paused ${paused == false} \n xDomainMessageSender ${xDomainMessageSender} \n counterpart ${counterpart} \n feeVault ${feeVault}`) - console.log('-----------------------------------\n') - - const segwFactory = await hre.ethers.getContractFactory('L2StandardERC20Gateway') - const segwContract = segwFactory.attach(predeploys.L2StandardERC20Gateway) - const tokenFactory = await segwContract.tokenFactory() - owner = await segwContract.owner() - router = await segwContract.router() - messenger = await segwContract.messenger() - counterpart = await segwContract.counterpart() - console.log(`L2StandardERC20Gateway params check \n owner ${owner} \n tokenFactory ${tokenFactory == predeploys.MorphStandardERC20Factory} \n router ${router == predeploys.L2GatewayRouter} \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const gw721Factory = await hre.ethers.getContractFactory('L2ERC721Gateway') - const gw721Contract = gw721Factory.attach(predeploys.L2ERC721Gateway) - owner = await gw721Contract.owner() - router = await gw721Contract.router() - messenger = await gw721Contract.messenger() - counterpart = await gw721Contract.counterpart() - console.log(`L2ERC721Gateway params check \n owner ${owner} \n tokenFactory ${router == ethers.constants.AddressZero} \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const txFeeFactory = await hre.ethers.getContractFactory('L2TxFeeVault') - const txFeeContract = txFeeFactory.attach(predeploys.L2TxFeeVault) - owner = await txFeeContract.owner() - const minWithdrawAmount = await txFeeContract.minWithdrawAmount() - const recipient = await txFeeContract.recipient() - console.log(`L2TxFeeVault params check \n owner ${owner} \n minWithdrawAmount ${minWithdrawAmount} \n recipient ${recipient}`) - console.log('-----------------------------------\n') - - const paFactory = await hre.ethers.getContractFactory('ProxyAdmin') - const paContract = paFactory.attach(predeploys.ProxyAdmin) - owner = await paContract.owner() - console.log(`ProxyAdmin params check \n owner ${owner}`) - console.log('-----------------------------------\n') - - const gw1155Factory = await hre.ethers.getContractFactory('L2ERC1155Gateway') - const gw1155Contract = gw1155Factory.attach(predeploys.L2ERC1155Gateway) - owner = await gw1155Contract.owner() - router = await gw1155Contract.router() - messenger = await gw1155Contract.messenger() - counterpart = await gw1155Contract.counterpart() - console.log(`L2ERC1155Gateway params check \n owner ${owner} \n tokenFactory ${router == ethers.constants.AddressZero} \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const ms20Factory = await hre.ethers.getContractFactory('MorphStandardERC20') - const ms20Contract = ms20Factory.attach(predeploys.MorphStandardERC20) - let name = await ms20Contract.name() - let symbol = await ms20Contract.symbol() - let decimals = await ms20Contract.decimals() - let gateway = await ms20Contract.gateway() - counterpart = await ms20Contract.counterpart() - console.log(`MorphStandardERC20 params check \n name ${name} \n symbol ${symbol} \n decimals ${decimals} \n gateway ${gateway} \n counterpart ${counterpart}`) - console.log('-----------------------------------\n') - - const ms20fFactory = await hre.ethers.getContractFactory('MorphStandardERC20Factory') - const ms20fContract = ms20fFactory.attach(predeploys.MorphStandardERC20Factory) - owner = await ms20fContract.owner() - const implementation = await ms20fContract.implementation() - console.log(`MorphStandardERC20Factory params check \n owner ${owner == predeploys.L2StandardERC20Gateway} \n implementation ${implementation.toLowerCase() == predeploys.MorphStandardERC20.toLowerCase()}`) - console.log('-----------------------------------\n') - - const gpoFactory = await hre.ethers.getContractFactory('GasPriceOracle') - const gpoContract = gpoFactory.attach(predeploys.GasPriceOracle) - owner = await gpoContract.owner() - const overhead = await gpoContract.overhead() - const scalar = await gpoContract.scalar() - const l1BaseFee = await gpoContract.l1BaseFee() - const allowListEnabled = await gpoContract.allowListEnabled() - console.log(`GasPriceOracle params check \n owner ${owner} \n overhead ${overhead} \n scalar ${scalar} \n l1BaseFee ${l1BaseFee} \n allowListEnabled ${allowListEnabled}`) - console.log('-----------------------------------\n') - - const morphTokenFactory = await hre.ethers.getContractFactory('MorphToken') - const morphTokenContract = morphTokenFactory.attach(predeploys.MorphToken) - owner = await morphTokenContract.owner() - l2StakingAddr = await morphTokenContract.L2_STAKING_CONTRACT() - distributeAddr = await morphTokenContract.DISTRIBUTE_CONTRACT() - recordAddr = await morphTokenContract.RECORD_CONTRACT() - name = await morphTokenContract.name() - symbol = await morphTokenContract.symbol() - let totalSupply = await morphTokenContract.totalSupply() - let balances = await morphTokenContract.balanceOf(owner) - console.log(`MorphToken params check \n owner ${owner} \n l2Staking ${l2StakingAddr == predeploys.L2Staking} \n distribute ${distributeAddr == predeploys.Distribute} \n record ${recordAddr == predeploys.Record}`) - console.log(` name ${name} \n symbol ${symbol} \n totalSupply ${totalSupply} \n balances ${balances}`) - console.log('-----------------------------------\n') - }); - -task("deposit-l1-eth") - .setAction(async (taskArgs, hre) => { - const routerFactory = await hre.ethers.getContractFactory('L1GatewayRouter') - const router = routerFactory.attach('0xa513e6e4b8f2a923d98304ec87f64353c4d5c853') - const res = await router["depositETH(uint256,uint256)"](hre.ethers.utils.parseEther('1'), 110000, { value: hre.ethers.utils.parseEther('1.1') }) - const receipt = await res.wait() - console.log(`Deposit\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${receipt.status == 1}`) - }); - -task("withdraw-l2-eth") - .setAction(async (taskArgs, hre) => { - const routerFactory = await hre.ethers.getContractFactory('L2GatewayRouter') - const router = routerFactory.attach(predeploys.L2GatewayRouter) - const res = await router["withdrawETH(uint256,uint256)"](1000, 110000, { value: 1000 }) - const receipt = await res.wait() - console.log(`Deposit\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${receipt.status == 1}`) - }); - -task("deposit-l1-gateway-eth") - .setAction(async (taskArgs, hre) => { - const Factory = await hre.ethers.getContractFactory('L1ETHGateway') - const contract = Factory.attach("0x2279b7a0a67db372996a5fab50d91eaa73d2ebe6") - const res = await contract["depositETH(uint256,uint256)"](hre.ethers.utils.parseEther('1'), 110000, { value: hre.ethers.utils.parseEther('1.1') }) - const rec = await res.wait() - console.log(`Deposit status ${rec.status == 1}`) - }); - -task("deploy-token") - .setAction(async (taskArgs, hre) => { - console.log("Deploy ERC20 token") - const Factory = await hre.ethers.getContractFactory('MockERC20') - const token = await Factory.deploy("Test Token", "test", 18) - const rec = await token.deployed() - console.log(`Token deployed at address ${token.address}, deploy txHash: ${rec.deployTransaction.hash}`) - }); + const proxy = await hre.ethers.getContractAt(ProxyFactoryName, ContractAddresses[i]) + const temp = new ethers.Contract(proxy.address, proxy.interface, proxy.provider) + const actual = await temp.callStatic["implementation"]({ + from: predeploys.ProxyAdmin, + }) + console.log(`implementation is: ${actual}`) + const adminAddr = await temp.callStatic["admin"]({ + from: predeploys.ProxyAdmin, + }) + + console.log( + `implementation is equal ProxyAdmin: ${adminAddr.toLowerCase() == predeploys.ProxyAdmin.toLowerCase()}` + ) + } +}) + +task("check-l2-status").setAction(async (taskArgs, hre) => { + const mpFactory = await hre.ethers.getContractFactory("L2ToL1MessagePasser") + const mpContract = mpFactory.attach(predeploys.L2ToL1MessagePasser) + const messageRoot = await mpContract.messageRoot() + console.log( + `L2ToL1MessagePasser params check \n root set status ${ + messageRoot == "0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757" + }` + ) + console.log("-----------------------------------\n") + + const gwrFactory = await hre.ethers.getContractFactory("L2GatewayRouter") + const gwrContract = gwrFactory.attach(predeploys.L2GatewayRouter) + let owner = await gwrContract.owner() + let ethGateway = await gwrContract.ethGateway() + let defaultERC20Gateway = await gwrContract.defaultERC20Gateway() + console.log( + `L2GatewayRouter params check \n owner ${owner} \n ETHGateway set ${ + ethGateway == predeploys.L2ETHGateway + } \n ERC20Gateway set ${defaultERC20Gateway == predeploys.L2StandardERC20Gateway}` + ) + console.log("-----------------------------------\n") + + const l2StakingFactory = await hre.ethers.getContractFactory("L2Staking") + const l2StakingContract = l2StakingFactory.attach(predeploys.L2Staking) + owner = await l2StakingContract.owner() + let morphTokenAddr = await l2StakingContract.MORPH_TOKEN_CONTRACT() + let sequencerAddr = await l2StakingContract.SEQUENCER_CONTRACT() + let sequencerSetMaxSize = await l2StakingContract.sequencerSetMaxSize() + let unDelegateLockEpochs = await l2StakingContract.undelegateLockEpochs() + let rewardStartTime = await l2StakingContract.rewardStartTime() + let latestSequencerSetSize = await l2StakingContract.latestSequencerSetSize() + console.log( + `L2Staking params check \n owner ${owner} \n morphToken ${ + morphTokenAddr == predeploys.MorphToken + } \n sequencerAddr ${sequencerAddr == predeploys.Sequencer}` + ) + console.log( + ` sequencerSetMaxSize ${sequencerSetMaxSize} \n unDelegateLockEpochs ${unDelegateLockEpochs} \n rewardStartTime ${rewardStartTime} \n latestSequencerSetSize ${latestSequencerSetSize}` + ) + for (let i = 0; i < latestSequencerSetSize.toNumber(); i++) { + let stakerAddr = await l2StakingContract.stakerAddresses(i) + console.log(` has staker ${stakerAddr}`) + } + console.log("-----------------------------------\n") + + const sequencerFactory = await hre.ethers.getContractFactory("Sequencer") + const sequencerContract = sequencerFactory.attach(predeploys.Sequencer) + let stakingAddr = await sequencerContract.L2_STAKING_CONTRACT() + owner = await sequencerContract.owner() + let set0 = await sequencerContract.getSequencerSet0() + let set1 = await sequencerContract.getSequencerSet1() + let set2 = await sequencerContract.getSequencerSet2() + let updateTime = await sequencerContract.updateTime() + console.log( + `Sequencer params check \n owner ${owner} \n staking ${ + stakingAddr == predeploys.L2Staking + } \n updateTime ${updateTime}` + ) + console.log(` set0 ${set0} \n set1 ${set1} \n set2 ${set2}`) + console.log("-----------------------------------\n") + + const govFactory = await hre.ethers.getContractFactory("Gov") + const govContract = govFactory.attach(predeploys.Gov) + owner = await govContract.owner() + const votingDuration = await govContract.votingDuration() + const batchBlockInterval = await govContract.batchBlockInterval() + const batchTimeout = await govContract.batchTimeout() + console.log( + `Gov params check \n owner ${owner} \n votingDuration ${votingDuration} \n batchBlockInterval ${batchBlockInterval} \n batchTimeout ${batchTimeout}` + ) + console.log("-----------------------------------\n") + + const ethgwFactory = await hre.ethers.getContractFactory("L2ETHGateway") + const ethgwContract = ethgwFactory.attach(predeploys.L2ETHGateway) + owner = await ethgwContract.owner() + let router = await ethgwContract.router() + let messenger = await ethgwContract.messenger() + let counterpart = await ethgwContract.counterpart() + console.log( + `L2ETHGateway params check \n owner ${owner} \n router ${router == predeploys.L2GatewayRouter} \n messenger ${ + messenger == predeploys.L2CrossDomainMessenger + } \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const wethgwFactory = await hre.ethers.getContractFactory("L2WETHGateway") + const wethgwContract = wethgwFactory.attach(predeploys.L2WETHGateway) + owner = await wethgwContract.owner() + router = await wethgwContract.router() + messenger = await wethgwContract.messenger() + counterpart = await wethgwContract.counterpart() + console.log( + `L2WETHGateway params check \n owner ${owner} \n router ${router == predeploys.L2GatewayRouter} \n messenger ${ + messenger == predeploys.L2CrossDomainMessenger + } \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const cdmFactory = await hre.ethers.getContractFactory("L2CrossDomainMessenger") + const cdmContract = cdmFactory.attach(predeploys.L2CrossDomainMessenger) + owner = await cdmContract.owner() + let paused = await cdmContract.paused() + let xDomainMessageSender = await cdmContract.xDomainMessageSender() + counterpart = await cdmContract.counterpart() + let feeVault = await cdmContract.feeVault() + console.log( + `L2CrossDomainMessenger params check \n owner ${owner} \n paused ${ + paused == false + } \n xDomainMessageSender ${xDomainMessageSender} \n counterpart ${counterpart} \n feeVault ${feeVault}` + ) + console.log("-----------------------------------\n") + + const segwFactory = await hre.ethers.getContractFactory("L2StandardERC20Gateway") + const segwContract = segwFactory.attach(predeploys.L2StandardERC20Gateway) + const tokenFactory = await segwContract.tokenFactory() + owner = await segwContract.owner() + router = await segwContract.router() + messenger = await segwContract.messenger() + counterpart = await segwContract.counterpart() + console.log( + `L2StandardERC20Gateway params check \n owner ${owner} \n tokenFactory ${ + tokenFactory == predeploys.MorphStandardERC20Factory + } \n router ${router == predeploys.L2GatewayRouter} \n messenger ${ + messenger == predeploys.L2CrossDomainMessenger + } \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const gw721Factory = await hre.ethers.getContractFactory("L2ERC721Gateway") + const gw721Contract = gw721Factory.attach(predeploys.L2ERC721Gateway) + owner = await gw721Contract.owner() + router = await gw721Contract.router() + messenger = await gw721Contract.messenger() + counterpart = await gw721Contract.counterpart() + console.log( + `L2ERC721Gateway params check \n owner ${owner} \n tokenFactory ${ + router == ethers.constants.AddressZero + } \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const txFeeFactory = await hre.ethers.getContractFactory("L2TxFeeVault") + const txFeeContract = txFeeFactory.attach(predeploys.L2TxFeeVault) + owner = await txFeeContract.owner() + const minWithdrawAmount = await txFeeContract.minWithdrawAmount() + const recipient = await txFeeContract.recipient() + console.log( + `L2TxFeeVault params check \n owner ${owner} \n minWithdrawAmount ${minWithdrawAmount} \n recipient ${recipient}` + ) + console.log("-----------------------------------\n") + + const paFactory = await hre.ethers.getContractFactory("ProxyAdmin") + const paContract = paFactory.attach(predeploys.ProxyAdmin) + owner = await paContract.owner() + console.log(`ProxyAdmin params check \n owner ${owner}`) + console.log("-----------------------------------\n") + + const gw1155Factory = await hre.ethers.getContractFactory("L2ERC1155Gateway") + const gw1155Contract = gw1155Factory.attach(predeploys.L2ERC1155Gateway) + owner = await gw1155Contract.owner() + router = await gw1155Contract.router() + messenger = await gw1155Contract.messenger() + counterpart = await gw1155Contract.counterpart() + console.log( + `L2ERC1155Gateway params check \n owner ${owner} \n tokenFactory ${ + router == ethers.constants.AddressZero + } \n messenger ${messenger == predeploys.L2CrossDomainMessenger} \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const ms20Factory = await hre.ethers.getContractFactory("MorphStandardERC20") + const ms20Contract = ms20Factory.attach(predeploys.MorphStandardERC20) + let name = await ms20Contract.name() + let symbol = await ms20Contract.symbol() + let decimals = await ms20Contract.decimals() + let gateway = await ms20Contract.gateway() + counterpart = await ms20Contract.counterpart() + console.log( + `MorphStandardERC20 params check \n name ${name} \n symbol ${symbol} \n decimals ${decimals} \n gateway ${gateway} \n counterpart ${counterpart}` + ) + console.log("-----------------------------------\n") + + const ms20fFactory = await hre.ethers.getContractFactory("MorphStandardERC20Factory") + const ms20fContract = ms20fFactory.attach(predeploys.MorphStandardERC20Factory) + owner = await ms20fContract.owner() + const implementation = await ms20fContract.implementation() + console.log( + `MorphStandardERC20Factory params check \n owner ${ + owner == predeploys.L2StandardERC20Gateway + } \n implementation ${implementation.toLowerCase() == predeploys.MorphStandardERC20.toLowerCase()}` + ) + console.log("-----------------------------------\n") + + const gpoFactory = await hre.ethers.getContractFactory("GasPriceOracle") + const gpoContract = gpoFactory.attach(predeploys.GasPriceOracle) + owner = await gpoContract.owner() + const overhead = await gpoContract.overhead() + const scalar = await gpoContract.scalar() + const l1BaseFee = await gpoContract.l1BaseFee() + const allowListEnabled = await gpoContract.allowListEnabled() + console.log( + `GasPriceOracle params check \n owner ${owner} \n overhead ${overhead} \n scalar ${scalar} \n l1BaseFee ${l1BaseFee} \n allowListEnabled ${allowListEnabled}` + ) + console.log("-----------------------------------\n") + + const morphTokenFactory = await hre.ethers.getContractFactory("MorphToken") + const morphTokenContract = morphTokenFactory.attach(predeploys.MorphToken) + owner = await morphTokenContract.owner() + l2StakingAddr = await morphTokenContract.L2_STAKING_CONTRACT() + name = await morphTokenContract.name() + symbol = await morphTokenContract.symbol() + let totalSupply = await morphTokenContract.totalSupply() + let balances = await morphTokenContract.balanceOf(owner) + console.log(`MorphToken params check \n owner ${owner} \n l2Staking ${l2StakingAddr == predeploys.L2Staking}`) + console.log(` name ${name} \n symbol ${symbol} \n totalSupply ${totalSupply} \n balances ${balances}`) + console.log("-----------------------------------\n") +}) + +task("deposit-l1-eth").setAction(async (taskArgs, hre) => { + const routerFactory = await hre.ethers.getContractFactory("L1GatewayRouter") + const router = routerFactory.attach("0xa513e6e4b8f2a923d98304ec87f64353c4d5c853") + const res = await router["depositETH(uint256,uint256)"](hre.ethers.utils.parseEther("1"), 110000, { + value: hre.ethers.utils.parseEther("1.1"), + }) + const receipt = await res.wait() + console.log( + `Deposit\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${ + receipt.status == 1 + }` + ) +}) + +task("withdraw-l2-eth").setAction(async (taskArgs, hre) => { + const routerFactory = await hre.ethers.getContractFactory("L2GatewayRouter") + const router = routerFactory.attach(predeploys.L2GatewayRouter) + const res = await router["withdrawETH(uint256,uint256)"](1000, 110000, { value: 1000 }) + const receipt = await res.wait() + console.log( + `Deposit\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${ + receipt.status == 1 + }` + ) +}) + +task("deposit-l1-gateway-eth").setAction(async (taskArgs, hre) => { + const Factory = await hre.ethers.getContractFactory("L1ETHGateway") + const contract = Factory.attach("0x2279b7a0a67db372996a5fab50d91eaa73d2ebe6") + const res = await contract["depositETH(uint256,uint256)"](hre.ethers.utils.parseEther("1"), 110000, { + value: hre.ethers.utils.parseEther("1.1"), + }) + const rec = await res.wait() + console.log(`Deposit status ${rec.status == 1}`) +}) + +task("deploy-token").setAction(async (taskArgs, hre) => { + console.log("Deploy ERC20 token") + const Factory = await hre.ethers.getContractFactory("MockERC20") + const token = await Factory.deploy("Test Token", "test", 18) + const rec = await token.deployed() + console.log(`Token deployed at address ${token.address}, deploy txHash: ${rec.deployTransaction.hash}`) +}) task("deposit-erc20-token") - .addParam('l1token') - .addParam('balance') + .addParam("l1token") + .addParam("balance") .setAction(async (taskArgs, hre) => { const signers = await hre.ethers.getSigners() console.log(`signer ${signers[0].address}`) - const l1RouterAddr = '0xa513e6e4b8f2a923d98304ec87f64353c4d5c853' + const l1RouterAddr = "0xa513e6e4b8f2a923d98304ec87f64353c4d5c853" - const routerFactory = await hre.ethers.getContractFactory('L1GatewayRouter') + const routerFactory = await hre.ethers.getContractFactory("L1GatewayRouter") const router = routerFactory.attach(l1RouterAddr) - const tokenFactory = await hre.ethers.getContractFactory('MockERC20') + const tokenFactory = await hre.ethers.getContractFactory("MockERC20") const l1token = tokenFactory.attach(taskArgs.l1token) // mint and approve @@ -299,93 +330,89 @@ task("deposit-erc20-token") console.log(`approve ${rec.status == 1}: router ${router.address} has allowance ${allowance}`) // first deposit require gasLimit > 410000 - res = await router["depositERC20(address,uint256,uint256)"](l1token.address, allowance, 420000, { value: hre.ethers.utils.parseEther('1') }) + res = await router["depositERC20(address,uint256,uint256)"](l1token.address, allowance, 420000, { + value: hre.ethers.utils.parseEther("1"), + }) rec = await res.wait() - console.log(`Deposit\n from ${rec.from}\n blockNum ${rec.blockNumber}\n tx ${rec.transactionHash}\n status ${rec.status == 1}`) - }); + console.log( + `Deposit\n from ${rec.from}\n blockNum ${rec.blockNumber}\n tx ${rec.transactionHash}\n status ${ + rec.status == 1 + }` + ) + }) task("erc20Balances") - .addParam('token') - .addParam('address') + .addParam("token") + .addParam("address") .setAction(async (taskArgs, hre) => { - const tokenFactory = await hre.ethers.getContractFactory('MockERC20') + const tokenFactory = await hre.ethers.getContractFactory("MockERC20") const token = tokenFactory.attach(taskArgs.token) const balance = await token.balanceOf(taskArgs.address) console.log(`${taskArgs.address} has ${balance}`) - }); + }) task("getBalances") - .addParam('address') + .addParam("address") .setAction(async (taskArgs, hre) => { console.log(`${taskArgs.address} has ${await hre.waffle.provider.getBalance(taskArgs.address)}`) - }); - -task("withdraw-l2-eth") - .setAction(async (taskArgs, hre) => { - const Factory = await hre.ethers.getContractFactory('L2GatewayRouter') - const contract = Factory.attach(predeploys.L2GatewayRouter) - const res = await contract["withdrawETH(uint256,uint256)"]( - ethers.utils.parseEther('1'), - 0, - { value: ethers.utils.parseEther('1'), } - ) - const receipt = await res.wait() - console.log(`Withdraw\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${receipt.status == 1}`) - }); - -task("getSequencerAddresses") - .setAction(async (taskArgs, hre) => { - const factory = await hre.ethers.getContractFactory('Sequencer') - const contract = factory.attach('0x5300000000000000000000000000000000000017') - const res = await contract.getCurrentSequencerSet() - - console.log(`getCurrentSequencerSet : ${res}`) - }); - -task("rollupEpoch") - .setAction(async (taskArgs, hre) => { - const factory = await hre.ethers.getContractFactory('Gov') - const contract = factory.attach('0x5300000000000000000000000000000000000004') - const res = await contract.rollupEpoch() - - console.log(`rollupEpoch : ${res}`) - }); + }) + +task("withdraw-l2-eth").setAction(async (taskArgs, hre) => { + const Factory = await hre.ethers.getContractFactory("L2GatewayRouter") + const contract = Factory.attach(predeploys.L2GatewayRouter) + const res = await contract["withdrawETH(uint256,uint256)"](ethers.utils.parseEther("1"), 0, { + value: ethers.utils.parseEther("1"), + }) + const receipt = await res.wait() + console.log( + `Withdraw\n from ${receipt.from}\n blockNum ${receipt.blockNumber}\n tx ${receipt.transactionHash}\n status ${ + receipt.status == 1 + }` + ) +}) + +task("getSequencerAddresses").setAction(async (taskArgs, hre) => { + const factory = await hre.ethers.getContractFactory("Sequencer") + const contract = factory.attach("0x5300000000000000000000000000000000000017") + const res = await contract.getCurrentSequencerSet() + + console.log(`getCurrentSequencerSet : ${res}`) +}) task("l2withdrawLock-deploy") - .addParam('l1Gateway') + .addParam("l1Gateway") .setAction(async (taskArgs, hre) => { - const factoryF = await hre.ethers.getContractFactory('L2WithdrawLockERC20Gateway') + const factoryF = await hre.ethers.getContractFactory("L2WithdrawLockERC20Gateway") const fc = await factoryF.deploy() await fc.deployed() const signer = await hre.ethers.provider.getSigner().getAddress() - const ProxyFactoryF = await hre.ethers.getContractFactory('TransparentUpgradeableProxy') + const ProxyFactoryF = await hre.ethers.getContractFactory("TransparentUpgradeableProxy") const proxy = await ProxyFactoryF.deploy( fc.address, signer, - factoryF.interface.encodeFunctionData('initialize', [ + factoryF.interface.encodeFunctionData("initialize", [ taskArgs.l1Gateway, - '0x5300000000000000000000000000000000000002', - '0x5300000000000000000000000000000000000007' + "0x5300000000000000000000000000000000000002", + "0x5300000000000000000000000000000000000007", ]) ) await proxy.deployed() console.log(`L2WithdrawLockERC20Gateway deployed at ${fc.address}`) - }); + }) -task("l2factory-deploy") - .setAction(async (taskArgs, hre) => { - const factoryF = await hre.ethers.getContractFactory('MorphStandardERC20Factory') - const fc = await factoryF.deploy(predeploys.MorphStandardERC20) - await fc.deployed() - console.log(`MorphStandardERC20Factory deployed at ${fc.address}`) - }); +task("l2factory-deploy").setAction(async (taskArgs, hre) => { + const factoryF = await hre.ethers.getContractFactory("MorphStandardERC20Factory") + const fc = await factoryF.deploy(predeploys.MorphStandardERC20) + await fc.deployed() + console.log(`MorphStandardERC20Factory deployed at ${fc.address}`) +}) task("l2token-deploy-check") .addParam("factory") .addParam("l1token") .setAction(async (taskArgs, hre) => { - const factoryF = await hre.ethers.getContractFactory('MorphStandardERC20Factory') + const factoryF = await hre.ethers.getContractFactory("MorphStandardERC20Factory") const fc = factoryF.attach(taskArgs.factory) let l2Addr = await fc.computeL2TokenAddress(predeploys.L2StandardERC20Gateway, taskArgs.l1token) let code = await hre.ethers.provider.getCode(l2Addr) @@ -396,4 +423,4 @@ task("l2token-deploy-check") console.log(`rec : ${rec.status == 1}`) let codeAfter = await hre.ethers.provider.getCode(l2Addr) console.log(`L2TokenAddress : ${l2Addr}, code ${codeAfter}`) - }); \ No newline at end of file + }) diff --git a/contracts/tasks/staking_upgrade.ts b/contracts/tasks/staking_upgrade.ts index d9f5e2e7b..2f1c729df 100644 --- a/contracts/tasks/staking_upgrade.ts +++ b/contracts/tasks/staking_upgrade.ts @@ -2,14 +2,14 @@ import "@nomiclabs/hardhat-web3" import "@nomiclabs/hardhat-ethers" import "@nomiclabs/hardhat-waffle" -import fs from "fs"; +import fs from "fs" import assert from "assert" import { task } from "hardhat/config" import { ethers } from "ethers" import { assertContractVariable, getContractAddressByName, awaitCondition, storage } from "../src/deploy-utils" import { ImplStorageName, ProxyStorageName, ContractFactoryName } from "../src/types" import { predeploys } from "../src" -import { hexlify } from "ethers/lib/utils"; +import { hexlify } from "ethers/lib/utils" task("rollup-deploy-init") .addParam("storagepath") @@ -64,20 +64,26 @@ task("rollup-deploy-init") const Factory = await hre.ethers.getContractFactory(ZkEvmVerifierV1ContractFactoryName) const contract = await Factory.deploy(config.programVkey) await contract.deployed() - console.log("%s=%s ; TX_HASH: %s", ZkEvmVerifierV1ImplStorageName, contract.address.toLocaleLowerCase(), contract.deployTransaction.hash); + console.log( + "%s=%s ; TX_HASH: %s", + ZkEvmVerifierV1ImplStorageName, + contract.address.toLocaleLowerCase(), + contract.deployTransaction.hash + ) let blockNumber = await hre.ethers.provider.getBlockNumber() console.log("BLOCK_NUMBER: %s", blockNumber) - let err = await storage(newPath, ZkEvmVerifierV1ImplStorageName, contract.address.toLocaleLowerCase(), blockNumber || 0) - if (err != '') { + let err = await storage( + newPath, + ZkEvmVerifierV1ImplStorageName, + contract.address.toLocaleLowerCase(), + blockNumber || 0 + ) + if (err != "") { return err } - // deploy MultipleVersionRollupVerifier - const ZkEvmVerifierV1Address = getContractAddressByName( - newPath, - ImplStorageName.ZkEvmVerifierV1StorageName - ) + const ZkEvmVerifierV1Address = getContractAddressByName(newPath, ImplStorageName.ZkEvmVerifierV1StorageName) const MultipleVersionRollupVerifierFactoryName = ContractFactoryName.MultipleVersionRollupVerifier const MultipleVersionRollupVerifierImplStorageName = ImplStorageName.MultipleVersionRollupVerifierStorageName @@ -231,10 +237,7 @@ task("rollup-import-genesis-batch") } let res = await Rollup.importGenesisBatch(batchHeader) let rec = await res.wait() - console.log( - `importGenesisBatch(%s) ${rec.status == 1 ? "success" : "failed"}`, - batchHeader, - ) + console.log(`importGenesisBatch(%s) ${rec.status == 1 ? "success" : "failed"}`, batchHeader) res = await Rollup.addChallenger(challenger) rec = await res.wait() console.log(`addChallenger(%s) ${rec.status == 1 ? "success" : "failed"}`, challenger) @@ -382,7 +385,6 @@ task("l1cdm-upgrade") } }) - task("l1staking-deploy-init") .addParam("storagepath") .addParam("newpath") @@ -397,7 +399,10 @@ task("l1staking-deploy-init") const L1StakingProxyStorageName = ProxyStorageName.L1StakingProxyStorageName const WhitelistImplAddress = getContractAddressByName(storagePath, ImplStorageName.Whitelist) const EmptyContractAddr = getContractAddressByName(storagePath, ImplStorageName.EmptyContract) - const L1CrossDomainMessengerProxyAddress = getContractAddressByName(storagePath, ProxyStorageName.L1CrossDomainMessengerProxyStorageName) + const L1CrossDomainMessengerProxyAddress = getContractAddressByName( + storagePath, + ProxyStorageName.L1CrossDomainMessengerProxyStorageName + ) // deploy L1Staking proxy { @@ -406,7 +411,12 @@ task("l1staking-deploy-init") const proxy = await ProxyFactory.deploy(EmptyContractAddr, await deployer.getAddress(), "0x") await proxy.deployed() const blockNumber = await hre.ethers.provider.getBlockNumber() - const err = await storage(newPath, L1StakingProxyStorageName, proxy.address.toLocaleLowerCase(), blockNumber || 0) + const err = await storage( + newPath, + L1StakingProxyStorageName, + proxy.address.toLocaleLowerCase(), + blockNumber || 0 + ) if (err != "") { console.log(`deploy L1Staking proxy failed ${err}`) return err @@ -419,21 +429,23 @@ task("l1staking-deploy-init") const Factory = await hre.ethers.getContractFactory(ContractFactoryName.L1Staking) const contract = await Factory.deploy(L1CrossDomainMessengerProxyAddress) await contract.deployed() - console.log("%s=%s ; TX_HASH: %s", ImplStorageName.L1StakingStorageName, contract.address.toLocaleLowerCase(), contract.deployTransaction.hash); - await assertContractVariable( - contract, - 'MESSENGER', - L1CrossDomainMessengerProxyAddress - ) - await assertContractVariable( - contract, - 'OTHER_STAKING', - predeploys.L2Staking.toLowerCase() + console.log( + "%s=%s ; TX_HASH: %s", + ImplStorageName.L1StakingStorageName, + contract.address.toLocaleLowerCase(), + contract.deployTransaction.hash ) + await assertContractVariable(contract, "MESSENGER", L1CrossDomainMessengerProxyAddress) + await assertContractVariable(contract, "OTHER_STAKING", predeploys.L2Staking.toLowerCase()) const blockNumber = await hre.ethers.provider.getBlockNumber() console.log("BLOCK_NUMBER: %s", blockNumber) - const err = await storage(newPath, ImplStorageName.L1StakingStorageName, contract.address.toLocaleLowerCase(), blockNumber || 0) - if (err != '') { + const err = await storage( + newPath, + ImplStorageName.L1StakingStorageName, + contract.address.toLocaleLowerCase(), + blockNumber || 0 + ) + if (err != "") { console.log(`deploy L1Staking implementation failed ${err}`) return err } @@ -446,9 +458,13 @@ task("l1staking-deploy-init") const L1StakingProxyAddress = getContractAddressByName(newPath, ProxyStorageName.L1StakingProxyStorageName) const L1StakingImplAddress = getContractAddressByName(newPath, ImplStorageName.L1StakingStorageName) const L1StakingFactory = await hre.ethers.getContractFactory(ContractFactoryName.L1Staking) - const IL1StakingProxy = await hre.ethers.getContractAt(ContractFactoryName.DefaultProxyInterface, L1StakingProxyAddress, deployer) + const IL1StakingProxy = await hre.ethers.getContractAt( + ContractFactoryName.DefaultProxyInterface, + L1StakingProxyAddress, + deployer + ) - console.log('Upgrading the Staking proxy...') + console.log("Upgrading the Staking proxy...") const admin: string = config.contractAdmin const stakingChallengerRewardPercentage: number = config.stakingChallengerRewardPercentage const limit: number = config.stakingMinDeposit @@ -456,22 +472,23 @@ task("l1staking-deploy-init") const gasLimitAdd: number = config.stakingCrossChainGaslimitAdd const gasLimitRemove: number = config.stakingCrossChainGaslimitRemove - if (!ethers.utils.isAddress(admin) - || lock <= 0 - || limit <= 0 - || gasLimitAdd <= 0 - || gasLimitRemove <= 0 - || stakingChallengerRewardPercentage > 100 - || stakingChallengerRewardPercentage <= 0 + if ( + !ethers.utils.isAddress(admin) || + lock <= 0 || + limit <= 0 || + gasLimitAdd <= 0 || + gasLimitRemove <= 0 || + stakingChallengerRewardPercentage > 100 || + stakingChallengerRewardPercentage <= 0 ) { - console.error('please check your address') - return '' + console.error("please check your address") + return "" } // Upgrade and initialize the proxy. await IL1StakingProxy.upgradeToAndCall( L1StakingImplAddress, - L1StakingFactory.interface.encodeFunctionData('initialize', [ + L1StakingFactory.interface.encodeFunctionData("initialize", [ RollupProxyAddress, hre.ethers.utils.parseEther(limit.toString()), hre.ethers.utils.parseEther(lock.toString()), @@ -484,56 +501,29 @@ task("l1staking-deploy-init") await awaitCondition( async () => { return ( - (await IL1StakingProxy.implementation()).toLocaleLowerCase() === L1StakingImplAddress.toLocaleLowerCase() + (await IL1StakingProxy.implementation()).toLocaleLowerCase() === + L1StakingImplAddress.toLocaleLowerCase() ) }, 3000, 1000 ) - const contractTmp = new ethers.Contract( - L1StakingProxyAddress, - L1StakingFactory.interface, - deployer, - ) + const contractTmp = new ethers.Contract(L1StakingProxyAddress, L1StakingFactory.interface, deployer) + await assertContractVariable(contractTmp, "rollupContract", RollupProxyAddress) + await assertContractVariable(contractTmp, "rewardPercentage", stakingChallengerRewardPercentage) + await assertContractVariable(contractTmp, "stakingValue", hre.ethers.utils.parseEther(limit.toString())) await assertContractVariable( contractTmp, - 'rollupContract', - RollupProxyAddress - ) - await assertContractVariable( - contractTmp, - 'rewardPercentage', - stakingChallengerRewardPercentage - ) - await assertContractVariable( - contractTmp, - 'stakingValue', - hre.ethers.utils.parseEther(limit.toString()) - ) - await assertContractVariable( - contractTmp, - 'withdrawalLockBlocks', + "withdrawalLockBlocks", hre.ethers.utils.parseEther(lock.toString()) ) - await assertContractVariable( - contractTmp, - 'gasLimitAddStaker', - gasLimitAdd - ) - await assertContractVariable( - contractTmp, - 'gasLimitRemoveStakers', - gasLimitRemove - ) - await assertContractVariable( - contractTmp, - 'owner', - await deployer.getAddress(), - ) + await assertContractVariable(contractTmp, "gasLimitAddStaker", gasLimitAdd) + await assertContractVariable(contractTmp, "gasLimitRemoveStakers", gasLimitRemove) + await assertContractVariable(contractTmp, "owner", await deployer.getAddress()) // Wait for the transaction to execute properly. - console.log('StakingProxy upgrade success') + console.log("StakingProxy upgrade success") } // ------------------ Admin transfer ----------------- @@ -571,15 +561,19 @@ task("l1staking-deploy-init") // set L1Staking address to gasPriceOracle whitelist { const L1StakingProxyAddress = getContractAddressByName(newPath, ProxyStorageName.L1StakingProxyStorageName) - const WhitelistCheckerImpl = await hre.ethers.getContractAt(ContractFactoryName.Whitelist, WhitelistImplAddress, deployer) + const WhitelistCheckerImpl = await hre.ethers.getContractAt( + ContractFactoryName.Whitelist, + WhitelistImplAddress, + deployer + ) let addList = [L1StakingProxyAddress] const res = await WhitelistCheckerImpl.updateWhitelistStatus(addList, true) await res.wait() for (let i = 0; i < addList.length; i++) { let res = await WhitelistCheckerImpl.isSenderAllowed(addList[i]) if (res != true) { - console.error('whitelist check failed') - return '' + console.error("whitelist check failed") + return "" } } console.log(`add ${addList} to whitelist success`) @@ -588,7 +582,11 @@ task("l1staking-deploy-init") // set staker whitelist { const L1StakingProxyAddress = getContractAddressByName(newPath, ProxyStorageName.L1StakingProxyStorageName) - const L1Staking = await hre.ethers.getContractAt(ContractFactoryName.L1Staking, L1StakingProxyAddress, deployer) + const L1Staking = await hre.ethers.getContractAt( + ContractFactoryName.L1Staking, + L1StakingProxyAddress, + deployer + ) const whiteListAdd = config.l2SequencerAddresses // set sequencer to white list await L1Staking.updateWhitelist(whiteListAdd, []) @@ -596,9 +594,7 @@ task("l1staking-deploy-init") // Wait for the transaction to execute properly. await awaitCondition( async () => { - return ( - await L1Staking.whitelist(config.l2SequencerAddresses[i]) === true - ) + return (await L1Staking.whitelist(config.l2SequencerAddresses[i])) === true }, 3000, 1000 @@ -644,7 +640,7 @@ task("check-params") }) // test command -// rm -rf ./deployFile.json && \ +// rm -rf ./deployFile.json && \ // yarn hardhat deploy --storagepath ./deployFile.json --network l1 && \ // yarn hardhat initialize --storagepath ./deployFile.json --network l1 && \ // yarn hardhat fund --network l1 && \ @@ -658,87 +654,74 @@ task("check-params") // yarn hardhat register --storagepath ./newFile.json --network l1 // immutable upgrade test -task("impl-test") - .setAction(async (taskArgs, hre) => { - const deployer = hre.ethers.provider.getSigner() - const V1Factory = await hre.ethers.getContractFactory("TestUpgradeV1") - const V2Factory = await hre.ethers.getContractFactory("TestUpgradeV2") - - const v1Impl = await V1Factory.deploy() - await v1Impl.deployed() - const v2Impl = await V2Factory.deploy() - await v2Impl.deployed() - console.log(`V1 and V2 impl deploy success and v1: ${v1Impl.address} , v2: ${v2Impl.address}`) - - const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) - const proxyAdmin = await ProxyAdminFactory.deploy() - await proxyAdmin.deployed() - const ProxyFactory = await hre.ethers.getContractFactory(ContractFactoryName.DefaultProxy) - const proxy = await ProxyFactory.deploy(v1Impl.address, await deployer.getAddress(), "0x") - await proxy.deployed() - const IProxyContract = await hre.ethers.getContractAt( - ContractFactoryName.DefaultProxyInterface, - proxy.address, - deployer - ) - - // transfer owner to proxy admin - { - const res = await IProxyContract.changeAdmin(proxyAdmin.address) - const rec = await res.wait() - console.log(`proxy admin change to proxy admin ${rec.status === 1}`) - } - - const consoleParams = async (factory) => { - const contractTmp = new ethers.Contract( - proxy.address, - factory.interface, - hre.ethers.provider, - ) - let va = await contractTmp.va({ from: hre.ethers.constants.AddressZero }) - let vb = await contractTmp.vb({ from: hre.ethers.constants.AddressZero }) - let vc = await contractTmp.vc({ from: hre.ethers.constants.AddressZero }) - let version = await contractTmp.version({ from: hre.ethers.constants.AddressZero }) - console.log(`va ${va} ; vb ${vb} ; vc ${vc} ; version ${version}`) - } - let contract = new ethers.Contract( - proxy.address, - V1Factory.interface, - deployer, - ) - let res = await contract.setVersion(100) - let rec = await res.wait() - console.log(`update version to 100 ${rec.status === 1}`) - await consoleParams(V1Factory) - - // upgrade - { - const res = await proxyAdmin.upgrade(proxy.address, v2Impl.address) - const rec = await res.wait() - console.log(`upgrade to v2 impl ${rec.status === 1}`) - } - contract = new ethers.Contract( - proxy.address, - V2Factory.interface, - deployer, - ) - res = await contract.setVersion(101) - rec = await res.wait() - console.log(`update version to 101 ${rec.status === 1}`) - res = await contract.setOtherVersion(99) - rec = await res.wait() - console.log(`update otherVersion to 99 ${rec.status === 1}`) - console.log("upgrade success") - await consoleParams(V2Factory) - }) +task("impl-test").setAction(async (taskArgs, hre) => { + const deployer = hre.ethers.provider.getSigner() + const V1Factory = await hre.ethers.getContractFactory("TestUpgradeV1") + const V2Factory = await hre.ethers.getContractFactory("TestUpgradeV2") + + const v1Impl = await V1Factory.deploy() + await v1Impl.deployed() + const v2Impl = await V2Factory.deploy() + await v2Impl.deployed() + console.log(`V1 and V2 impl deploy success and v1: ${v1Impl.address} , v2: ${v2Impl.address}`) + + const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) + const proxyAdmin = await ProxyAdminFactory.deploy() + await proxyAdmin.deployed() + const ProxyFactory = await hre.ethers.getContractFactory(ContractFactoryName.DefaultProxy) + const proxy = await ProxyFactory.deploy(v1Impl.address, await deployer.getAddress(), "0x") + await proxy.deployed() + const IProxyContract = await hre.ethers.getContractAt( + ContractFactoryName.DefaultProxyInterface, + proxy.address, + deployer + ) + + // transfer owner to proxy admin + { + const res = await IProxyContract.changeAdmin(proxyAdmin.address) + const rec = await res.wait() + console.log(`proxy admin change to proxy admin ${rec.status === 1}`) + } + + const consoleParams = async (factory) => { + const contractTmp = new ethers.Contract(proxy.address, factory.interface, hre.ethers.provider) + let va = await contractTmp.va({ from: hre.ethers.constants.AddressZero }) + let vb = await contractTmp.vb({ from: hre.ethers.constants.AddressZero }) + let vc = await contractTmp.vc({ from: hre.ethers.constants.AddressZero }) + let version = await contractTmp.version({ from: hre.ethers.constants.AddressZero }) + console.log(`va ${va} ; vb ${vb} ; vc ${vc} ; version ${version}`) + } + let contract = new ethers.Contract(proxy.address, V1Factory.interface, deployer) + let res = await contract.setVersion(100) + let rec = await res.wait() + console.log(`update version to 100 ${rec.status === 1}`) + await consoleParams(V1Factory) + + // upgrade + { + const res = await proxyAdmin.upgrade(proxy.address, v2Impl.address) + const rec = await res.wait() + console.log(`upgrade to v2 impl ${rec.status === 1}`) + } + contract = new ethers.Contract(proxy.address, V2Factory.interface, deployer) + res = await contract.setVersion(101) + rec = await res.wait() + console.log(`update version to 101 ${rec.status === 1}`) + res = await contract.setOtherVersion(99) + rec = await res.wait() + console.log(`update otherVersion to 99 ${rec.status === 1}`) + console.log("upgrade success") + await consoleParams(V2Factory) +}) // ------------------------------------ L2 Upgrade ------------------------------------ task("gov-upgrade") .addParam("l2config") .setAction(async (taskArgs, hre) => { - const data = fs.readFileSync(taskArgs.l2config); + const data = fs.readFileSync(taskArgs.l2config) // @ts-ignore - const l2Config = JSON.parse(data); + const l2Config = JSON.parse(data) const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) const proxyAdmin = ProxyAdminFactory.attach(predeploys.ProxyAdmin) @@ -748,42 +731,22 @@ task("gov-upgrade") const res = await proxyAdmin.upgradeAndCall( predeploys.Gov, newGovImpl.address, - GovFactory.interface.encodeFunctionData('initializeV2', [ + GovFactory.interface.encodeFunctionData("initializeV2", [ l2Config.govVotingDuration, l2Config.govBatchBlockInterval, - l2Config.govBatchMaxBytes, l2Config.govBatchTimeout, - l2Config.govBatchMaxChunks, - l2Config.govRollupEpoch, ]) ) const rec = await res.wait() console.log(`gov upgrade ${rec.status === 1}`) }) -task("distribute-deploy") - .setAction(async (taskArgs, hre) => { - const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) - const proxyAdmin = ProxyAdminFactory.attach(predeploys.ProxyAdmin) - - const DistributeFactory = await hre.ethers.getContractFactory("Distribute") - const distribute = await DistributeFactory.deploy() - await distribute.deployed() - const res = await proxyAdmin.upgradeAndCall( - predeploys.Distribute, - distribute.address, - DistributeFactory.interface.encodeFunctionData('initialize', []) - ) - const rec = await res.wait() - console.log(`distribute upgrade ${rec.status === 1}, new impl ${distribute.address}`) - }) - task("morph-token-deploy") .addParam("l2config") .setAction(async (taskArgs, hre) => { - const data = fs.readFileSync(taskArgs.l2config); + const data = fs.readFileSync(taskArgs.l2config) // @ts-ignore - const l2Config = JSON.parse(data); + const l2Config = JSON.parse(data) const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) const proxyAdmin = ProxyAdminFactory.attach(predeploys.ProxyAdmin) @@ -794,7 +757,7 @@ task("morph-token-deploy") const res = await proxyAdmin.upgradeAndCall( predeploys.MorphToken, morphToken.address, - MorphTokenFactory.interface.encodeFunctionData('initialize', [ + MorphTokenFactory.interface.encodeFunctionData("initialize", [ l2Config.morphTokenName, l2Config.morphTokenSymbol, l2Config.morphTokenOwner, @@ -809,9 +772,9 @@ task("morph-token-deploy") task("sequencer-deploy") .addParam("l2config") .setAction(async (taskArgs, hre) => { - const data = fs.readFileSync(taskArgs.l2config); + const data = fs.readFileSync(taskArgs.l2config) // @ts-ignore - const l2Config = JSON.parse(data); + const l2Config = JSON.parse(data) const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) const proxyAdmin = ProxyAdminFactory.attach(predeploys.ProxyAdmin) @@ -827,47 +790,20 @@ task("sequencer-deploy") const res = await proxyAdmin.upgradeAndCall( predeploys.Sequencer, sequencer.address, - SequencerFactory.interface.encodeFunctionData( - 'initialize', - [addresses]) + SequencerFactory.interface.encodeFunctionData("initialize", [addresses]) ) const rec = await res.wait() console.log(`sequencer upgrade ${rec.status === 1}, new impl ${sequencer.address}`) }) -task("record-deploy") - .addParam("l2config") - .setAction(async (taskArgs, hre) => { - const data = fs.readFileSync(taskArgs.l2config); - // @ts-ignore - const l2Config = JSON.parse(data); - - const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) - const proxyAdmin = ProxyAdminFactory.attach(predeploys.ProxyAdmin) - - const RecordFactory = await hre.ethers.getContractFactory("Record") - const record = await RecordFactory.deploy() - await record.deployed() - const res = await proxyAdmin.upgradeAndCall( - predeploys.Record, - record.address, - RecordFactory.interface.encodeFunctionData('initialize', [ - l2Config.recordOracleAddress, - l2Config.recordNextBatchSubmissionIndex, - ]) - ) - const rec = await res.wait() - console.log(`Record upgrade ${rec.status === 1}, new impl ${record.address}`) - }) - task("l2-staking-deploy") .addParam("newpath") .addParam("l2config") .setAction(async (taskArgs, hre) => { const newPath = taskArgs.newpath - const data = fs.readFileSync(taskArgs.l2config); + const data = fs.readFileSync(taskArgs.l2config) // @ts-ignore - const l2Config = JSON.parse(data); + const l2Config = JSON.parse(data) const L1StakingProxyAddr = getContractAddressByName(newPath, ProxyStorageName.L1StakingProxyStorageName) const ProxyAdminFactory = await hre.ethers.getContractFactory(ContractFactoryName.ProxyAdmin) @@ -889,7 +825,7 @@ task("l2-staking-deploy") const res = await proxyAdmin.upgradeAndCall( predeploys.L2Staking, staking.address, - L2StakingFactory.interface.encodeFunctionData('initialize', [ + L2StakingFactory.interface.encodeFunctionData("initialize", [ l2Config.l2StakingSequencerMaxSize, l2Config.l2StakingUnDelegatedLockEpochs, l2Config.l2StakingRewardStartTime, diff --git a/go-ethereum b/go-ethereum index de5160c10..6f1d6b6d7 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit de5160c106deeae615de11c6b72dc64109d18767 +Subproject commit 6f1d6b6d7fbc9228e3be08e0fdb314fb4717e6c5 diff --git a/go.work b/go.work index a223f15ce..26ccd0560 100644 --- a/go.work +++ b/go.work @@ -6,6 +6,5 @@ use ( ./node ./ops/l2-genesis ./ops/tools - ./oracle ./tx-submitter ) diff --git a/go.work.sum b/go.work.sum index e42173204..1124b5c4b 100644 --- a/go.work.sum +++ b/go.work.sum @@ -765,10 +765,8 @@ github.com/morph-l2/go-ethereum v1.10.14-0.20241028101924-8c247ffe3315 h1:egBq7X github.com/morph-l2/go-ethereum v1.10.14-0.20241028101924-8c247ffe3315/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/morph-l2/go-ethereum v1.10.14-0.20241224100051-1582a364edc0 h1:w0RXAFr/x9fWNgQkcrmSnZseYCNkbBFDWgEIfSqhCeY= github.com/morph-l2/go-ethereum v1.10.14-0.20241224100051-1582a364edc0/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= -github.com/morph-l2/tendermint v0.3.1 h1:yqyM3/p9sCNmFSsIFeIxS5RBgXHWqbtyNHx16I9cIZ0= -github.com/morph-l2/tendermint v0.3.1/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= +github.com/morph-l2/go-ethereum v1.10.14-0.20250425070859-09af684fe1f3 h1:JKzLjIra43KfRXDDZEcypcFOZixWMnXtFmLaxUOStYY= +github.com/morph-l2/go-ethereum v1.10.14-0.20250425070859-09af684fe1f3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/node/core/batch.go b/node/core/batch.go index 987c4bf03..aac9355f4 100644 --- a/node/core/batch.go +++ b/node/core/batch.go @@ -178,13 +178,7 @@ func (e *Executor) CalculateCapWithProposalBlock(currentBlockBytes []byte, curre return false, err } - var exceeded bool - if e.isBatchUpgraded(block.Timestamp) { - exceeded, err = e.batchingCache.batchData.WillExceedCompressedSizeLimit(e.batchingCache.currentBlockContext, e.batchingCache.currentTxsPayload) - } else { - exceeded, err = e.batchingCache.batchData.EstimateCompressedSizeWithNewPayload(e.batchingCache.currentTxsPayload) - } - return exceeded, err + return e.batchingCache.batchData.WillExceedCompressedSizeLimit(e.batchingCache.currentBlockContext, e.batchingCache.currentTxsPayload) } func (e *Executor) AppendBlsData(height int64, batchHash []byte, data l2node.BlsData) error { @@ -347,7 +341,3 @@ func (e *Executor) ConvertBlsData(blsData l2node.BlsData) (*eth.BatchSignature, } return &bs, nil } - -func (e *Executor) isBatchUpgraded(blockTime uint64) bool { - return blockTime >= e.UpgradeBatchTime -} diff --git a/node/core/batch_seal.go b/node/core/batch_seal.go index be02cdfe1..40ab8ddac 100644 --- a/node/core/batch_seal.go +++ b/node/core/batch_seal.go @@ -61,7 +61,7 @@ func (e *Executor) SealBatch() ([]byte, []byte, error) { } // handleBatchSealing determines which version to use for compression and calculates the data hash. -func (e *Executor) handleBatchSealing(blockTimestamp uint64) ([]byte, common.Hash, error) { +func (e *Executor) handleBatchSealing(_ uint64) ([]byte, common.Hash, error) { var ( compressedPayload []byte batchDataHash common.Hash @@ -69,29 +69,17 @@ func (e *Executor) handleBatchSealing(blockTimestamp uint64) ([]byte, common.Has ) // Check if the batch should use the upgraded version - if e.isBatchUpgraded(blockTimestamp) { - compressedPayload, err = types.CompressBatchBytes(e.batchingCache.batchData.TxsPayloadV2()) - if err != nil { - return nil, common.Hash{}, fmt.Errorf("failed to compress upgraded payload: %w", err) - } - - if len(compressedPayload) <= types.MaxBlobBytesSize { - batchDataHash, err = e.batchingCache.batchData.DataHashV2() - if err != nil { - return nil, common.Hash{}, fmt.Errorf("failed to calculate upgraded data hash: %w", err) - } - return compressedPayload, batchDataHash, nil - } + compressedPayload, err = types.CompressBatchBytes(e.batchingCache.batchData.TxsPayloadV2()) + if err != nil { + return nil, common.Hash{}, fmt.Errorf("failed to compress upgraded payload: %w", err) } - // Fallback to old version if upgraded is not used - compressedPayload, err = types.CompressBatchBytes(e.batchingCache.batchData.TxsPayload()) + batchDataHash, err = e.batchingCache.batchData.DataHashV2() if err != nil { - return nil, common.Hash{}, fmt.Errorf("failed to compress payload: %w", err) + return nil, common.Hash{}, fmt.Errorf("failed to calculate upgraded data hash: %w", err) } - batchDataHash = e.batchingCache.batchData.DataHash() - return compressedPayload, batchDataHash, nil + } // createBatchHeader creates a BatchHeader from the given parameters. @@ -107,27 +95,23 @@ func (e *Executor) createBatchHeader(dataHash common.Hash, sidecar *eth.BlobTxSi parentBatchIndex, _ := e.batchingCache.parentBatchHeader.BatchIndex() parentBatchHash, _ := e.batchingCache.parentBatchHeader.Hash() - batchHeaderV0 := types.BatchHeaderV0{ - BatchIndex: parentBatchIndex + 1, - L1MessagePopped: l1MessagePopped, - TotalL1MessagePopped: e.batchingCache.totalL1MessagePopped, - DataHash: dataHash, - BlobVersionedHash: blobHashes[0], - PrevStateRoot: e.batchingCache.prevStateRoot, - PostStateRoot: e.batchingCache.postStateRoot, - WithdrawalRoot: e.batchingCache.withdrawRoot, - SequencerSetVerifyHash: sequencerSetVerifyHash, - ParentBatchHash: parentBatchHash, - } - if e.isBatchUpgraded(blockTimestamp) { - batchHeaderV1 := types.BatchHeaderV1{ - BatchHeaderV0: batchHeaderV0, - LastBlockNumber: e.batchingCache.lastPackedBlockHeight, - } - return batchHeaderV1.Bytes() - } - return batchHeaderV0.Bytes() + batchHeaderV1 := types.BatchHeaderV1{ + BatchHeaderV0: types.BatchHeaderV0{ + BatchIndex: parentBatchIndex + 1, + L1MessagePopped: l1MessagePopped, + TotalL1MessagePopped: e.batchingCache.totalL1MessagePopped, + DataHash: dataHash, + BlobVersionedHash: blobHashes[0], + PrevStateRoot: e.batchingCache.prevStateRoot, + PostStateRoot: e.batchingCache.postStateRoot, + WithdrawalRoot: e.batchingCache.withdrawRoot, + SequencerSetVerifyHash: sequencerSetVerifyHash, + ParentBatchHash: parentBatchHash, + }, + LastBlockNumber: e.batchingCache.lastPackedBlockHeight, + } + return batchHeaderV1.Bytes() } // logSealedBatch logs the details of the sealed batch for debugging purposes. diff --git a/node/core/config.go b/node/core/config.go index f14d66488..7ec217176 100644 --- a/node/core/config.go +++ b/node/core/config.go @@ -22,9 +22,19 @@ import ( "morph-l2/node/types" ) +type UpgradeConfig struct { + BatchTime uint64 + Morph204Time uint64 +} + var ( - MainnetUpgradeBatchTime uint64 = 2000 - HoleskyUpgradeBatchTime uint64 = 350000 + MainnetUpgradeConfig = UpgradeConfig{ + Morph204Time: 0, + } + + HoleskyUpgradeConfig = UpgradeConfig{ + Morph204Time: 0, + } ) type Config struct { @@ -34,7 +44,7 @@ type Config struct { GovAddress common.Address `json:"gov_address"` L2StakingAddress common.Address `json:"l2staking_address"` MaxL1MessageNumPerBlock uint64 `json:"max_l1_message_num_per_block"` - UpgradeBatchTime uint64 `json:"upgrade_batch_time"` + UpgradeConfig *UpgradeConfig `json:"upgrade_config"` DevSequencer bool `json:"dev_sequencer"` Logger tmlog.Logger `json:"logger"` } @@ -157,15 +167,25 @@ func (c *Config) SetCliContext(ctx *cli.Context) error { c.DevSequencer = ctx.GlobalBool(flags.DevSequencer.Name) } - // setup batch upgrade index + // setup upgrade config switch { case ctx.GlobalIsSet(flags.MainnetFlag.Name): - c.UpgradeBatchTime = MainnetUpgradeBatchTime + c.UpgradeConfig = &MainnetUpgradeConfig case ctx.GlobalIsSet(flags.HoleskyFlag.Name): - c.UpgradeBatchTime = HoleskyUpgradeBatchTime - case ctx.GlobalIsSet(flags.UpgradeBatchTime.Name): - c.UpgradeBatchTime = ctx.GlobalUint64(flags.UpgradeBatchTime.Name) - logger.Info("set UpgradeBatchTime: ", ctx.GlobalUint64(flags.UpgradeBatchTime.Name)) + c.UpgradeConfig = &HoleskyUpgradeConfig + } + if c.UpgradeConfig == nil { + c.UpgradeConfig = &UpgradeConfig{} + if ctx.GlobalIsSet(flags.UpgradeBatchTime.Name) { + logger.Info("set UpgradeBatchTime: ", ctx.GlobalUint64(flags.UpgradeBatchTime.Name)) + upgradeBatchTime := ctx.GlobalUint64(flags.UpgradeBatchTime.Name) + c.UpgradeConfig.BatchTime = upgradeBatchTime + } + if ctx.GlobalIsSet(flags.Morph204Time.Name) { + logger.Info("set Morph204Time: ", ctx.GlobalUint64(flags.Morph204Time.Name)) + morph204Time := ctx.GlobalUint64(flags.Morph204Time.Name) + c.UpgradeConfig.Morph204Time = morph204Time + } } return nil diff --git a/node/core/executor.go b/node/core/executor.go index a7209526e..2c9742f33 100644 --- a/node/core/executor.go +++ b/node/core/executor.go @@ -120,7 +120,7 @@ func NewExecutor(newSyncFunc NewSyncerFunc, config *Config, tmPubKey crypto.PubK devSequencer: config.DevSequencer, rollupABI: rollupAbi, batchingCache: NewBatchingCache(), - UpgradeBatchTime: config.UpgradeBatchTime, + UpgradeBatchTime: config.UpgradeConfig.BatchTime, logger: logger, metrics: PrometheusMetrics("morphnode"), } @@ -175,7 +175,16 @@ func (e *Executor) RequestBlockData(height int64) (txs [][]byte, blockMeta []byt l1MsgTx := tx.AsL1MessageTx() e.logger.Info("[debug]queueIndex in transactions: ", "queueIndex", l1MsgTx.QueueIndex, "gas", l1MsgTx.Gas, "hash", tx.Hash().String()) } - l2Block, err := e.l2Client.AssembleL2Block(context.Background(), big.NewInt(height), transactions) + + var tmKey [32]byte + copy(tmKey[:], e.tmPubKey) + val, found := e.valsByTmKey[tmKey] + if !found { + e.logger.Error("no address found for this proposer", "public key", hexutil.Encode(tmKey[:])) + return nil, nil, false, errors.New("no address found for this proposer") + } + coinbase := val.address + l2Block, err := e.l2Client.AssembleL2Block(context.Background(), big.NewInt(height), coinbase, transactions) if err != nil { e.logger.Error("failed to assemble block", "height", height, "error", err) return diff --git a/node/derivation/batch_info.go b/node/derivation/batch_info.go index 4c1470aa0..6c0c9a937 100644 --- a/node/derivation/batch_info.go +++ b/node/derivation/batch_info.go @@ -17,6 +17,11 @@ import ( "morph-l2/node/zstd" ) +const ( + // BlockContextLegacyLength is the length of a legacy block context without coinbase + BlockContextLegacyLength = 60 +) + type BlockContext struct { Number uint64 `json:"number"` Timestamp uint64 `json:"timestamp"` @@ -24,6 +29,7 @@ type BlockContext struct { GasLimit uint64 txsNum uint16 l1MsgNum uint16 + coinbase common.Address SafeL2Data *catalyst.SafeL2Data L2TxHashes []byte @@ -37,14 +43,19 @@ func (b *BlockContext) Decode(bc []byte) error { return err } b.Number = wb.Number - b.Timestamp = wb.Timestamp b.BaseFee = wb.BaseFee b.GasLimit = wb.GasLimit b.txsNum = txsNum b.l1MsgNum = l1MsgNum + b.Timestamp = wb.Timestamp + b.coinbase = wb.Miner return nil } +func decodeCoinbase(bc []byte) (common.Address, error) { + return types.DecodeCoinbase(bc) +} + type BatchInfo struct { batchIndex uint64 blockNum uint64 @@ -79,143 +90,165 @@ func (bi *BatchInfo) TxNum() uint64 { } // ParseBatch This method is externally referenced for parsing Batch -func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch) error { +func (bi *BatchInfo) ParseBatch(batch geth.RPCRollupBatch, morph204Time uint64) error { + if len(batch.Sidecar.Blobs) == 0 { + return fmt.Errorf("blobs length can not be zero") + } + + // Parse parent batch header parentBatchHeader := types.BatchHeaderBytes(batch.ParentBatchHeader) parentBatchIndex, err := parentBatchHeader.BatchIndex() if err != nil { - return fmt.Errorf("decode batch header index error:%v", err) + return fmt.Errorf("decode batch header index error: %v", err) } + totalL1MessagePopped, err := parentBatchHeader.TotalL1MessagePopped() if err != nil { - return fmt.Errorf("decode batch header totalL1MessagePopped error:%v", err) + return fmt.Errorf("decode batch header totalL1MessagePopped error: %v", err) } + + // Initialize batch info fields bi.parentTotalL1MessagePopped = totalL1MessagePopped bi.root = batch.PostStateRoot bi.batchIndex = parentBatchIndex + 1 bi.withdrawalRoot = batch.WithdrawRoot bi.version = uint64(batch.Version) + tq := newTxQueue() - var rawBlockContexts hexutil.Bytes - var txsData []byte + var rawBlockContextsAndTxs hexutil.Bytes + + // Handle version upgrade scenario + blobData, err := types.RetrieveBlobBytes(&batch.Sidecar.Blobs[0]) + if err != nil { + return fmt.Errorf("retrieve blob bytes error: %v", err) + } + + batchBytes, err := zstd.DecompressBatchBytes(blobData) + if err != nil { + return fmt.Errorf("decompress batch bytes error: %v", err) + } + + // Calculate block count based on version var blockCount uint64 if batch.Version > 0 { - parentVersion, err := parentBatchHeader.Version() - if err != nil { - return fmt.Errorf("decode batch header version error:%v", err) - } - if parentVersion == 0 { - if len(batch.Sidecar.Blobs) == 0 { - return fmt.Errorf("blobs length can not be zero") - } - blobData, err := types.RetrieveBlobBytes(&batch.Sidecar.Blobs[0]) - if err != nil { - return err - } - batchBytes, err := zstd.DecompressBatchBytes(blobData) - if err != nil { - return fmt.Errorf("decompress batch bytes error:%v", err) - } - var startBlock BlockContext - if err := startBlock.Decode(batchBytes[:60]); err != nil { - return fmt.Errorf("decode chunk block context error:%v", err) - } - blockCount = batch.LastBlockNumber - startBlock.Number + 1 - } else { - parentBatchBlock, err := parentBatchHeader.LastBlockNumber() - if err != nil { - return fmt.Errorf("decode batch header lastBlockNumber error:%v", err) - } - blockCount = batch.LastBlockNumber - parentBatchBlock + rawBlockContextsAndTxs = batchBytes + // Ensure we have enough data for block context + if len(batchBytes) < 60 { + return fmt.Errorf("insufficient batch bytes for block context, got %d bytes", len(batchBytes)) } - } - // If BlockContexts is not nil, the block context should not be included in the blob. - // Therefore, the required length must be zero. - length := blockCount * 60 - for _, blob := range batch.Sidecar.Blobs { - blobCopy := blob - blobData, err := types.RetrieveBlobBytes(&blobCopy) - if err != nil { - return err + var startBlock BlockContext + // coinbase does not enter batch at this time + if err := startBlock.Decode(batchBytes[:60]); err != nil { + return fmt.Errorf("decode chunk block context error: %v", err) } - batchBytes, err := zstd.DecompressBatchBytes(blobData) - if err != nil { - return err - } - reader := bytes.NewReader(batchBytes) - if batch.BlockContexts == nil { - if len(batchBytes) < int(length) { - rawBlockContexts = append(rawBlockContexts, batchBytes...) - length -= uint64(len(batchBytes)) - reader.Reset(nil) - } else { - bcBytes := make([]byte, length) - _, err = reader.Read(bcBytes) - if err != nil { - return fmt.Errorf("read block context error:%s", err.Error()) - } - rawBlockContexts = append(rawBlockContexts, bcBytes...) - length = 0 - } - } - data, err := io.ReadAll(reader) - if err != nil { - return fmt.Errorf("read txBytes error:%s", err.Error()) + + blockCount = batch.LastBlockNumber - startBlock.Number + 1 + } else { + // First 2 bytes contain the block count + if len(batch.BlockContexts) < 2 { + return fmt.Errorf("insufficient block contexts data: %d bytes", len(batch.BlockContexts)) } - txsData = append(txsData, data...) - } - if batch.BlockContexts != nil { + blockCount = uint64(binary.BigEndian.Uint16(batch.BlockContexts[:2])) - rawBlockContexts = batch.BlockContexts[2 : 60*blockCount+2] + rawBlockContextsAndTxs = append(rawBlockContextsAndTxs, batch.BlockContexts[2:]...) + rawBlockContextsAndTxs = append(rawBlockContextsAndTxs, batchBytes...) } - data, err := types.DecodeTxsFromBytes(txsData) - if err != nil { - return err - } - tq.enqueue(data) + var txsNum uint64 - var l1MsgNum uint64 blockContexts := make([]*BlockContext, int(blockCount)) + + reader := bytes.NewReader(rawBlockContextsAndTxs) + // Process block contexts for i := 0; i < int(blockCount); i++ { var block BlockContext - if err := block.Decode(rawBlockContexts[i*60 : i*60+60]); err != nil { - return fmt.Errorf("decode chunk block context error:%v", err) + bcBytes := make([]byte, BlockContextLegacyLength) + _, err = reader.Read(bcBytes) + if err != nil { + return fmt.Errorf("read block context numberAndTimeBytes error:%s", err.Error()) + } + if err := block.Decode(bcBytes); err != nil { + return fmt.Errorf("decode number and timestamp error: %v", err) } + // handle coinbase + if morph204Time == 0 || block.Timestamp >= morph204Time { + coinbaseBytes := make([]byte, common.AddressLength) + _, err = reader.Read(coinbaseBytes) + if err != nil { + return fmt.Errorf("read skipped block context error:%s", err.Error()) + } + + coinbase, err := decodeCoinbase(coinbaseBytes) + if err != nil { + return err + } + block.coinbase = coinbase + } + + // Set boundary block numbers if i == 0 { bi.firstBlockNumber = block.Number } if i == int(blockCount)-1 { bi.lastBlockNumber = block.Number } + + // Setup SafeL2Data var safeL2Data catalyst.SafeL2Data safeL2Data.Number = block.Number safeL2Data.GasLimit = block.GasLimit safeL2Data.BaseFee = block.BaseFee safeL2Data.Timestamp = block.Timestamp + safeL2Data.Miner = block.coinbase + + // Handle zero BaseFee case if block.BaseFee != nil && block.BaseFee.Cmp(big.NewInt(0)) == 0 { safeL2Data.BaseFee = nil } + + // Validate transaction numbers if block.txsNum < block.l1MsgNum { - return fmt.Errorf("txsNum must be or equal to or greater than l1MsgNum,txsNum:%v,l1MsgNum:%v", block.txsNum, block.l1MsgNum) + return fmt.Errorf("txsNum must be greater than or equal to l1MsgNum, txsNum: %v, l1MsgNum: %v", + block.txsNum, block.l1MsgNum) } - var txs []*eth.Transaction - var err error - if len(batch.Sidecar.Blobs) != 0 { - txs, err = tq.dequeue(int(block.txsNum) - int(block.l1MsgNum)) - if err != nil { - return fmt.Errorf("decode txsPayload error:%v", err) - } - } - txsNum += uint64(block.txsNum) - l1MsgNum += uint64(block.l1MsgNum) - // l1 transactions will be inserted later in front of L2 transactions - safeL2Data.Transactions = encodeTransactions(txs) - block.SafeL2Data = &safeL2Data + block.SafeL2Data = &safeL2Data blockContexts[i] = &block } + // Read transaction data + txsData, err := io.ReadAll(reader) + if err != nil { + return fmt.Errorf("read transaction data error: %s", err.Error()) + } + + // Decode transactions + data, err := types.DecodeTxsFromBytes(txsData) + if err != nil { + return fmt.Errorf("decode transactions error: %v", err) + } + + // Process transactions + tq.enqueue(data) + for i := 0; i < int(blockCount); i++ { + // Skip if index is out of bounds + if i >= len(blockContexts) { + return fmt.Errorf("block context index out of bounds: %d >= %d", i, len(blockContexts)) + } + + txCount := int(blockContexts[i].txsNum) - int(blockContexts[i].l1MsgNum) + txs, err := tq.dequeue(txCount) + if err != nil { + return fmt.Errorf("decode transaction payload error: %v", err) + } + + txsNum += uint64(blockContexts[i].txsNum) + // l1 transactions will be inserted later in front of L2 transactions + blockContexts[i].SafeL2Data.Transactions = encodeTransactions(txs) + } + bi.txNum += txsNum bi.blockContexts = blockContexts + return nil } diff --git a/node/derivation/config.go b/node/derivation/config.go index 439acbc42..4dcacd696 100644 --- a/node/derivation/config.go +++ b/node/derivation/config.go @@ -44,6 +44,7 @@ type Config struct { MetricsPort uint64 `json:"metrics_port"` MetricsHostname string `json:"metrics_hostname"` MetricsServerEnable bool `json:"metrics_server_enable"` + Morph204Time uint64 `json:"upgrade_time"` } func DefaultConfig() *Config { @@ -91,6 +92,10 @@ func (c *Config) SetCliContext(ctx *cli.Context) error { c.BaseHeight = ctx.GlobalUint64(flags.DerivationBaseHeight.Name) } + if ctx.GlobalIsSet(flags.Morph204Time.Name) { + c.Morph204Time = ctx.GlobalUint64(flags.Morph204Time.Name) + } + if ctx.GlobalIsSet(flags.DerivationPollInterval.Name) { c.PollInterval = ctx.GlobalDuration(flags.DerivationPollInterval.Name) if c.PollInterval == 0 { diff --git a/node/derivation/derivation.go b/node/derivation/derivation.go index a3fc43fbe..282b187a6 100644 --- a/node/derivation/derivation.go +++ b/node/derivation/derivation.go @@ -61,6 +61,7 @@ type Derivation struct { fetchBlockRange uint64 pollInterval time.Duration logProgressInterval time.Duration + morph204Time uint64 // Timestamp threshold for block context format stop chan struct{} } @@ -135,6 +136,7 @@ func NewDerivationClient(ctx context.Context, cfg *Config, syncer *sync.Syncer, fetchBlockRange: cfg.FetchBlockRange, pollInterval: cfg.PollInterval, logProgressInterval: cfg.LogProgressInterval, + morph204Time: cfg.Morph204Time, metrics: metrics, l1BeaconClient: l1BeaconClient, L2ToL1MessagePasser: msgPasser, @@ -409,7 +411,8 @@ func (d *Derivation) UnPackData(data []byte) (geth.RPCRollupBatch, error) { func (d *Derivation) parseBatch(batch geth.RPCRollupBatch, l2Height uint64) (*BatchInfo, error) { batchInfo := new(BatchInfo) - if err := batchInfo.ParseBatch(batch); err != nil { + // Set the derivation reference to access configuration + if err := batchInfo.ParseBatch(batch, d.morph204Time); err != nil { return nil, fmt.Errorf("parse batch error:%v", err) } if err := d.handleL1Message(batchInfo, batchInfo.parentTotalL1MessagePopped, l2Height); err != nil { diff --git a/node/derivation/derivation_test.go b/node/derivation/derivation_test.go index 653ce96ce..ed815791b 100644 --- a/node/derivation/derivation_test.go +++ b/node/derivation/derivation_test.go @@ -34,16 +34,11 @@ func TestUnPackData(t *testing.T) { require.Error(t, err) legacyTxData, err := hexutil.Decode(legacyData) require.NoError(t, err) - legacyBatch, err := d.UnPackData(legacyTxData) - require.NoError(t, err) - LegacyBatchInfo := new(BatchInfo) - err = LegacyBatchInfo.ParseBatch(legacyBatch) + _, err = d.UnPackData(legacyTxData) require.NoError(t, err) beforeMoveBctxTxData, err := hexutil.Decode(beforeMoveBctxData) require.NoError(t, err) - beforeMoveBctxBatch, err := d.UnPackData(beforeMoveBctxTxData) - require.NoError(t, err) - beforeMoveBctxBatchInfo := new(BatchInfo) - err = beforeMoveBctxBatchInfo.ParseBatch(beforeMoveBctxBatch) + _, err = d.UnPackData(beforeMoveBctxTxData) require.NoError(t, err) + } diff --git a/node/flags/flags.go b/node/flags/flags.go index 7ea7c21b2..b58c22047 100644 --- a/node/flags/flags.go +++ b/node/flags/flags.go @@ -198,7 +198,7 @@ var ( DerivationBaseHeight = cli.Uint64Flag{ Name: "derivation.baseHeight", - Usage: "The starting height of l2 derive, usually the node snapshot or other trusted starting height, before which stateRoot will not be checked", + Usage: "L2 snapshot base block height", EnvVar: prefixEnvVar("DERIVATION_BASE_HEIGHT"), } @@ -220,12 +220,23 @@ var ( EnvVar: prefixEnvVar("DERIVATION_FETCH_BLOCK_RANGE"), } + DerivationConfirmations = cli.Int64Flag{ + Name: "derivation.confirmations", + Usage: "The number of confirmations needed on L1 for finalization. If not set, the default value is l1.confirmations", + EnvVar: prefixEnvVar("DERIVATION_CONFIRMATIONS"), + } + // Batch rules UpgradeBatchTime = cli.Uint64Flag{ Name: "upgrade.batchTime", Usage: "Batch index at which the sequencers start to upgrade the batch format", EnvVar: prefixEnvVar("UPGRADE_BATCH_TIME"), } + Morph204Time = cli.Uint64Flag{ + Name: "morph204Time", + Usage: "Morph 204 upgrade time", + EnvVar: prefixEnvVar("MORPH_204_TIME"), + } MainnetFlag = cli.BoolFlag{ Name: "mainnet", Usage: "Morph mainnet", @@ -235,11 +246,6 @@ var ( Usage: "Morph Holesky", } - DerivationConfirmations = cli.Int64Flag{ - Name: "derivation.confirmations", - Usage: "The number of confirmations needed on L1 for finalization. If not set, the default value is l1.confirmations", - EnvVar: prefixEnvVar("DERIVATION_CONFIRMATIONS"), - } // Logger LogLevel = &cli.StringFlag{ Name: "log.level", @@ -343,6 +349,7 @@ var Flags = []cli.Flag{ L1BeaconAddr, // batch rules + Morph204Time, UpgradeBatchTime, MainnetFlag, HoleskyFlag, diff --git a/node/go.mod b/node/go.mod index d298192af..2ba385900 100644 --- a/node/go.mod +++ b/node/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v1.0.2 github.com/klauspost/compress v1.17.9 - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de + github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 github.com/prometheus/client_golang v1.17.0 github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.9.0 diff --git a/node/go.sum b/node/go.sum index c83da4eb5..15d396573 100644 --- a/node/go.sum +++ b/node/go.sum @@ -360,8 +360,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 h1:qhBMCyTQ/ezOpeqHGKjr4qSN/B/bGFByuYjQqDt5wiw= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/node/sequencer/mock/sequencer.go b/node/sequencer/mock/sequencer.go index 55e9e6017..42426dc31 100644 --- a/node/sequencer/mock/sequencer.go +++ b/node/sequencer/mock/sequencer.go @@ -5,6 +5,7 @@ import ( "math/big" "time" + "github.com/morph-l2/go-ethereum/common" "github.com/morph-l2/go-ethereum/log" node "morph-l2/node/core" @@ -39,7 +40,7 @@ func (s *Sequencer) Start() { select { case <-blockTicker.C: log.Info("start to build new block", "block number", s.currentBlock+1) - l2Data, err := s.engine.L2Client().AssembleL2Block(context.Background(), big.NewInt(s.currentBlock+1), nil) + l2Data, err := s.engine.L2Client().AssembleL2Block(context.Background(), big.NewInt(s.currentBlock+1), common.Address{}, nil) if err != nil { log.Error("error assembling block", "error", err) continue diff --git a/node/types/consensus_message.go b/node/types/consensus_message.go index 94742380b..58d479257 100644 --- a/node/types/consensus_message.go +++ b/node/types/consensus_message.go @@ -105,7 +105,7 @@ func (wb *WrappedBlock) UnmarshalBinary(b []byte) error { } func (wb *WrappedBlock) BlockContextBytes(txsNum, l1MsgNum int) []byte { - // Number(8) || Timestamp(8) || BaseFee(32) || GasLimit(8) || numTxs(2) || numL1Messages(2) + // Number(8) || Timestamp(8) || BaseFee(32) || GasLimit(8) || numTxs(2) || numL1Messages(2) || Miner(20) blsBytes := make([]byte, 60) copy(blsBytes[:8], Uint64ToBigEndianBytes(wb.Number)) copy(blsBytes[8:16], Uint64ToBigEndianBytes(wb.Timestamp)) @@ -118,6 +118,11 @@ func (wb *WrappedBlock) BlockContextBytes(txsNum, l1MsgNum int) []byte { copy(blsBytes[56:58], Uint16ToBigEndianBytes(uint16(txsNum))) copy(blsBytes[58:60], Uint16ToBigEndianBytes(uint16(l1MsgNum))) + if wb.Miner != types.EmptyAddress { + blsBytes = append(blsBytes, make([]byte, common.AddressLength)...) + copy(blsBytes[60:], wb.Miner.Bytes()) + } + return blsBytes } @@ -147,6 +152,13 @@ func (wb *WrappedBlock) DecodeBlockContext(bc []byte) (uint16, uint16, error) { return txsNum, l1MsgNum, nil } +func DecodeCoinbase(bc []byte) (common.Address, error) { + if len(bc) != common.AddressLength { + return common.Address{}, fmt.Errorf("invalid bytes length expect 20 have %v", len(bc)) + } + return common.BytesToAddress(bc), nil +} + func WrappedBlockFromBytes(blockBytes []byte) (*WrappedBlock, error) { var curBlock = new(WrappedBlock) if err := curBlock.UnmarshalBinary(blockBytes); err != nil { diff --git a/node/types/retryable_client.go b/node/types/retryable_client.go index 3d3ad949d..cc99f0617 100644 --- a/node/types/retryable_client.go +++ b/node/types/retryable_client.go @@ -45,9 +45,9 @@ func NewRetryableClient(authClient *authclient.Client, ethClient *ethclient.Clie } } -func (rc *RetryableClient) AssembleL2Block(ctx context.Context, number *big.Int, transactions eth.Transactions) (ret *catalyst.ExecutableL2Data, err error) { +func (rc *RetryableClient) AssembleL2Block(ctx context.Context, number *big.Int, coinbase common.Address, transactions eth.Transactions) (ret *catalyst.ExecutableL2Data, err error) { if retryErr := backoff.Retry(func() error { - resp, respErr := rc.authClient.AssembleL2Block(ctx, number, transactions) + resp, respErr := rc.authClient.AssembleL2Block(ctx, number, coinbase, transactions) if respErr != nil { rc.logger.Info("failed to AssembleL2Block", "error", respErr) if retryableError(respErr) { diff --git a/ops/docker/Dockerfile.l1-beacon b/ops/docker/Dockerfile.l1-beacon index a48869810..0f567bcd9 100644 --- a/ops/docker/Dockerfile.l1-beacon +++ b/ops/docker/Dockerfile.l1-beacon @@ -1,5 +1,6 @@ FROM --platform=linux/amd64 ubuntu:20.04 as chain-genesis RUN apt-get update && ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && apt-get install build-essential curl wget git make pkg-config -y +RUN date RUN curl -o prysmctl -fLO https://github.com/prysmaticlabs/prysm/releases/download/v4.2.1/prysmctl-v4.2.1-linux-amd64 RUN chmod +x prysmctl COPY ops/docker/consensus /consensus diff --git a/ops/docker/Dockerfile.staking-oracle b/ops/docker/Dockerfile.staking-oracle deleted file mode 100644 index 5d78373ee..000000000 --- a/ops/docker/Dockerfile.staking-oracle +++ /dev/null @@ -1,18 +0,0 @@ -FROM ghcr.io/morph-l2/go-ubuntu-builder:go-1.22-ubuntu as builder - -# Copy source code and build application -COPY . /morph -WORKDIR /morph/oracle -RUN make build - -# Deploy stage using the same base image (morph/go-ubuntu-builder:go-1.22-ubuntu) -FROM ghcr.io/morph-l2/go-ubuntu-builder:go-1.22-ubuntu - -# Install only necessary dependencies (e.g., ca-certificates for networking) -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* - -# Copy the built binary from the builder stage -COPY --from=builder /morph/oracle/build/bin/staking-oracle /usr/local/bin/ - -# Set the default command to run the staking oracle -CMD ["staking-oracle"] \ No newline at end of file diff --git a/ops/docker/docker-compose-4nodes.yml b/ops/docker/docker-compose-4nodes.yml index 7353ee639..1606bfff6 100644 --- a/ops/docker/docker-compose-4nodes.yml +++ b/ops/docker/docker-compose-4nodes.yml @@ -250,6 +250,7 @@ services: command: > morphnode --home $NODE_DATA_DIR +## --log.level="consensus:debug,*:info" node-1: container_name: node-1 @@ -651,31 +652,3 @@ services: - L1_ROLLUP=${MORPH_ROLLUP:-0x6900000000000000000000000000000000000010} - OVERHEAD_SWITCH=${OVERHEAD_SWITCH} - MAX_OVERHEAD=${MAX_OVERHEAD} - - staking-oracle: - container_name: staking-oracle - depends_on: - node-0: - condition: service_started - build: - context: ../.. - dockerfile: ops/docker/Dockerfile.staking-oracle - image: morph-staking-oracle:latest - restart: unless-stopped - command: staking-oracle - ports: - - "9060:6060" - environment: - # change the env variables to your own - - STAKING_ORACLE_BUILD_ENV=dev - - STAKING_ORACLE_L1_ETH_RPC=${L1_ETH_RPC} - - STAKING_ORACLE_RECORD_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - - STAKING_ORACLE_L2_ETH_RPC=http://morph-geth-0:8545 - - STAKING_ORACLE_L2_TENDERMINT_RPC=http://node-0:26657 - - STAKING_ORACLE_L2_WS_ENDPOINT=http://node-0:26656 - - STAKING_ORACLE_ROLLUP=${MORPH_ROLLUP:-0x6900000000000000000000000000000000000010} - - STAKING_ORACLE_LOG_FILENAME=staking-oracle.log - - STAKING_ORACLE_LOG_FILE_MAX_SIZE=100 #MB - - STAKING_ORACLE_LOG_FILE_MAX_AGE=7 #day - - STAKING_ORACLE_LOG_COMPRESS=true - - STAKING_ORACLE_METRICS_SERVER_ENABLE=true diff --git a/ops/docker/execution/genesis.json b/ops/docker/execution/genesis.json index d492f85bd..2740dd22a 100644 --- a/ops/docker/execution/genesis.json +++ b/ops/docker/execution/genesis.json @@ -15,7 +15,7 @@ "londonBlock": 0, "arrowGlacierBlock": 0, "grayGlacierBlock": 0, - "shanghaiTime": 1707123228, + "shanghaiTime": 0, "cancunTime": 1707123228, "terminalTotalDifficulty": 0, "terminalTotalDifficultyPassed": true diff --git a/ops/l2-genesis/deploy-config/devnet-deploy-config.json b/ops/l2-genesis/deploy-config/devnet-deploy-config.json index 0dfc49866..a19dcc9d5 100644 --- a/ops/l2-genesis/deploy-config/devnet-deploy-config.json +++ b/ops/l2-genesis/deploy-config/devnet-deploy-config.json @@ -1,58 +1,62 @@ { - "l1ChainID": 900, - "l2ChainID": 53077, - - "finalSystemOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "proxyAdminOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - - "BLOCK_SIGNER_PRIVATE_KEY": "3e4bde571b86929bf08e2aaad9a6a1882664cd5e65b96fff7d03e1c4e6dfa15c", - "BLOCK_SIGNER_ADDRESS": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", - - "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", - "sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", - "l2BridgeFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", - "fundDevAccounts": true, - - "l1StartingBlockTag": "earliest", - "maxTxPerBlock": 1000, - - "gasPriceOracleOverhead": 2500, - "gasPriceOracleScalar": 1000000000, - "gasPriceOracleOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - - "govVotingDuration": 1000, - "govBatchBlockInterval": 20, - "govBatchTimeout": 600, - "govRollupEpoch": 100, - - "recordOracleAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "recordNextBatchSubmissionIndex": 1, - - "morphTokenName": "Morph Token", - "morphTokenSymbol": "Morph", - "morphTokenOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "morphTokenInitialSupply": 1000000000, - "morphTokenDailyInflationRate": 1, - - "l2StakingSequencerMaxSize": 4, - "l2StakingUnDelegatedLockEpochs": 2, - "l2StakingRewardStartTime": 1728000000, - "l2StakingAddresses": [ - "0x783698dCDEBdc96785c5c60ED96113612bA09c2b", - "0x310824AA27a29D269d2F9C0a8563C0e3C98dD226", - "0x343C5154FFe47c8a07DF5ea6846404e68E9809A2", - "0xaaC606d51De6A5aBF0d1B9dbd5ed5Ff2Ac2e521B" - ], - "l2StakingTmKeys": [ - "0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb", - "0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935", - "0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040", - "0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a" - ], - "l2StakingBlsKeys": [ - "0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e", - "0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4", - "0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c", - "0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c" - ] + "l1ChainID": 900, + "l2ChainID": 53077, + + "finalSystemOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "proxyAdminOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + + "BLOCK_SIGNER_PRIVATE_KEY": "3e4bde571b86929bf08e2aaad9a6a1882664cd5e65b96fff7d03e1c4e6dfa15c", + "BLOCK_SIGNER_ADDRESS": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", + + "l1FeeVaultRecipient": "0x71bE63f3384f5fb98995898A86B02Fb2426c5788", + "sequencerFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", + "l2BridgeFeeVaultRecipient": "0xfabb0ac9d68b0b445fb7357272ff202c5651694a", + "fundDevAccounts": true, + + "l1StartingBlockTag": "earliest", + "maxTxPerBlock": 1000, + + "gasPriceOracleOverhead": 2500, + "gasPriceOracleScalar": 1000000000, + "gasPriceOracleOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + + "govVotingDuration": 1000, + "govBatchBlockInterval": 20, + "govBatchTimeout": 600, + + "morph203Time": 0, + "morph204Time": 0, + + "morphTokenName": "Morph Token", + "morphTokenSymbol": "Morph", + "morphTokenOwner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "morphTokenInitialSupply": 1000000000, + "morphTokenDailyInflationRate": 1, + "l2StakingSequencerMaxSize": 4, + "l2StakingUnDelegatedLockEpochs": 2, + "l2StakingRewardStartTime": 1764460800, + "l2StakingPks": [ + "0xd99870855d97327d20c666abc78588f1449b1fac76ed0c86c1afb9ce2db85f32", + "0x0890c388c3bf5e04fee1d8f3c117e5f44f435ced7baf7bfd66c10e1f3a3f4b10", + "0x6fd437eef7a83c486bd2e0a802ae071b3912d125ac31ac08f60841fd891559ae", + "0x9ae53aecdaebe4dcbfec96f3123a2a8c53f9596bf4b3d5adc9a388ccb361b4c0" + ], + "l2StakingAddresses": [ + "0x783698dCDEBdc96785c5c60ED96113612bA09c2b", + "0x310824AA27a29D269d2F9C0a8563C0e3C98dD226", + "0x343C5154FFe47c8a07DF5ea6846404e68E9809A2", + "0xaaC606d51De6A5aBF0d1B9dbd5ed5Ff2Ac2e521B" + ], + "l2StakingTmKeys": [ + "0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb", + "0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935", + "0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040", + "0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a" + ], + "l2StakingBlsKeys": [ + "0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e", + "0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4", + "0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c", + "0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c" + ] } diff --git a/ops/l2-genesis/deploy-config/holesky-deploy-config.json b/ops/l2-genesis/deploy-config/holesky-deploy-config.json index b3919b8c5..2322188cc 100644 --- a/ops/l2-genesis/deploy-config/holesky-deploy-config.json +++ b/ops/l2-genesis/deploy-config/holesky-deploy-config.json @@ -20,7 +20,6 @@ "govVotingDuration": 1000, "govBatchBlockInterval": 600, "govBatchTimeout": 1200, - "govRollupEpoch": 600, "l2SequencerAddresses": [ "0x48446b07A04307F320fa34790116d73aD4A51810", "0x48447a9d66D8eAE067e59E3F9f7E6B5f1b5E7581", diff --git a/ops/l2-genesis/deploy-config/mainnet-deploy-config.json b/ops/l2-genesis/deploy-config/mainnet-deploy-config.json index 63c39d356..54739e035 100644 --- a/ops/l2-genesis/deploy-config/mainnet-deploy-config.json +++ b/ops/l2-genesis/deploy-config/mainnet-deploy-config.json @@ -1,57 +1,53 @@ { - "l1ChainID": 1, - "l2ChainID": 2818, - "l2GenesisBlockTimestamp": "0x6715EDE0", + "l1ChainID": 1, + "l2ChainID": 2818, + "l2GenesisBlockTimestamp": "0x6715EDE0", - "finalSystemOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", - "proxyAdminOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", + "finalSystemOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", + "proxyAdminOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", - "l1FeeVaultRecipient": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", - "fundDevAccounts": false, + "l1FeeVaultRecipient": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", + "fundDevAccounts": false, - "l1StartingBlockTag": "earliest", - "maxTxPerBlock": 100, + "l1StartingBlockTag": "earliest", + "maxTxPerBlock": 100, - "gasPriceOracleOverhead": 2500, - "gasPriceOracleScalar": 1000000000, - "gasPriceOracleOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", + "gasPriceOracleOverhead": 2500, + "gasPriceOracleScalar": 1000000000, + "gasPriceOracleOwner": "0x2818a3aF785975a32611155A6eE36C21Cec068ca", - "recordOracleAddress": "0xefb531cd2fbebd784d5d49a7ad06c0200e0d169a", - "recordNextBatchSubmissionIndex": 1, + "govVotingDuration": 86400, + "govBatchBlockInterval": 600, + "govBatchTimeout": 1200, - "govVotingDuration": 86400, - "govBatchBlockInterval": 600, - "govBatchTimeout": 1200, - "govRollupEpoch": 7200, - - "l2StakingSequencerMaxSize": 7, - "l2StakingUnDelegatedLockEpochs": 7, - "l2StakingRewardStartTime": 1764460800, - "l2StakingAddresses": [ - "0x6ab0e960911b50f6d14f249782ac12ec3e7584a0", - "0xbba36cdf020788f0d08d5688c0bee3fb30ce1c80", - "0x34e387b37d3adeaa6d5b92ce30de3af3dca39796", - "0xa59b26db10c5ca26a97aa2fd2e74cb8da9d1eb65", - "0xf834ffbeb6bb3f4841afc6b5fb40b94cd580fa23", - "0x61f2945d4bc9e40b66a6376d1094a50438f613e2", - "0xb6cf39ee72e0127e6ea6059e38b8c197227a6ac7" - ], - "l2StakingTmKeys": [ - "0x2d7dcd2b93fcadef45fcdf65453118aa5d3efae27e3146d50464531b19fcafb4", - "0x4f2e0fba8a3fe709b0d9923e13b69924b90cb889f806d3cefe9a56d924f39839", - "0x89ded1a39b827b7a001fbb6fda9c26441b67bf0a586b8ee52236caf7d2a6ebca", - "0x453ba69628e1103bd1ae68ad6632005276a3508d12ced10fd6915d5551ff0ade", - "0xbe7e711a860955055bbc4974d2aafe2692b0d3eceba7720d28d29b25f34b27a1", - "0x77a1a01759de3b693ec1a8e6d083a05baca61a17faabb175449a63b708056c79", - "0x68ee3f9c25282c71d81e34d4188fc2514a41c97b8cb5d909cc78a624b1e27cba" - ], - "l2StakingBlsKeys": [ - "0x0000000000000000000000000000000012f51a5c0c73b62b6c8202fe87ad03bb3832d46b5bb40dd6b04d27e0c06fd88c1311f72e45a74f6086f85535e96c97db000000000000000000000000000000000f4718daff21bd38aa60e626321a2157e58a1735ed973925d1a4b621f48fa1c1a135f272213e3bc314fc93bd2a45818f0000000000000000000000000000000011701a778ffa03936d021e7df1c89236784e5b1b33fe9b4267d00a5fa72045065afeab3e17222c582d8e4d0070c1b7d7000000000000000000000000000000000d8ed30ff704b3e649243339f8413c6b3ae832f838b15b4a3a060a76166db54c71749ed04f5e7d6c198c80afee05779e", - "0x000000000000000000000000000000000d82cd3d4e3158a90a7108098e4fcaa610d7f89248ef55cfb76162e1ca17d14ba99b88ad79979007718d6e067c4b5d6b00000000000000000000000000000000011ab8cb6920caac25f2c8fb8f60627bb26aa34b9b4809c6f1e2bac4edcddb711bc9fd6c51be34e327218b98f7b35b5f000000000000000000000000000000001034b1945710226066ecffdc768032185322372c27fd4bf2c8a18da1c5f9847bec406e02844b4d33908bc754de0aadcc000000000000000000000000000000001950f84a7bd160796926fe6a680333c6438de1c4c09ca72a4bf23a49d417aa92c71c714d9292cf7417a0621372a55af7", - "0x0000000000000000000000000000000006f73bcdf4d37d9a8153a743f33b8fcb107f282a03ff4793c710ab349b1a71030367824cbe0c2ce332535567bae3f4380000000000000000000000000000000013429873d1c85c2b04c3d777448246c652b42cb3ee7d5e0babdaa811575e900d60a40f072ff4a6666427da742c10c0ee00000000000000000000000000000000191d6589871d0507ea3ed832859ae6f0ee08f534e98f5bae248ba56185ae2b73c0bd71ce61e68201b5a88798deb99a4b0000000000000000000000000000000000068bf679e513bf8ae98b810413e6eacb8d807a2d4d99cfdf5a763689b9b440304fa61f3ea38099a6159c85ff75d75c", - "0x0000000000000000000000000000000000a06305d9bb8f219dd5e7952a1b1e28dc9046c1519160c61e095ba3f22055e4dbd666be91f56f9cc8b1323ad30e992f0000000000000000000000000000000007283abacc35c938d4e78a63ac37d9dc0afa2c68a49b31bfeecd64de4b0dc8f0229deb9fa84a98f80da2cc3cee4ec877000000000000000000000000000000000ec00f4cbc86123a6bc8283005d4bee8c689945ae8f537bc0e902b4cdc0cb594abd96cd1152c052f92bfc6afa8643ff2000000000000000000000000000000000470fb0e9942ceb13b5c084332912846b57ff6bfc02dd3c7599878c8f44f3562f87e82c6669aff725cfc4fecc4997581", - "0x0000000000000000000000000000000017c89dbc153dbb652911407faec5d4df916456f9200fbbfdc1c5f2841d0b212a1303620f936e75d96a4e07e31a2a631d0000000000000000000000000000000010083d366c688cc5de669a7eb4c7aa82b240fa025201a65ab769f92ca2c6d26714dbcb6aa6df05f7a070683be8d2cf8a0000000000000000000000000000000005aa1c78b20a2a63cd53caac3a365378b5875977c812586dc4183ec41b76169048f55a613295bb74348fa93c5850dbaf00000000000000000000000000000000175600d962b389868f8c1209b274b096d72e5e88f0d175be9d42208416b52cd74542bddeb4d0baeb494b4806f1a48117", - "0x0000000000000000000000000000000006d87938374cc807fb96bbef29376ae6699dd6e404339b12be99a693aebe3d6d944ec2b2391b32caf3a6036563d218040000000000000000000000000000000015ef634394272c106d63360fd8410130974783b227545f58648bd1a61950b4a1d1ed893467efa62c03d54bcce8899a2200000000000000000000000000000000021f4baf98ce0cda995437ccda850eefbe51104d3affeabcfd6b8bb0553b3c72ddb8a198c09a8c498a454615885cf9b5000000000000000000000000000000000137c0913470a6d81709be13d3bf43799a24bac69f059ebefce4b4a7c803df667cbbab0f07a616be968261801a217b73", - "0x00000000000000000000000000000000037582fff0906e5d1b5a1dc4da81446781adab4bf434e75021a2b24253d6980e38eacbda118d222f148159e7b377b298000000000000000000000000000000000e8625231bca55b19b533798262f67b8f89bc8add67413e4435ed927ea53b4401d1b01110258826817bf049c7884ac6e000000000000000000000000000000000e17a73086849ef2721940816a2af29abd6c69426087fa2102177b9eb7a3290edb77c79b2ca930fc0d6a8ec1c7c6deec0000000000000000000000000000000008fdeb4e71d8deae9f92c8d1fea245c1d966262b7aedc78b28a920264f38cc3df7b221a5ab44c52c8ee061756163f8b8" - ] + "l2StakingSequencerMaxSize": 7, + "l2StakingUnDelegatedLockEpochs": 7, + "l2StakingRewardStartTime": 1764460800, + "l2StakingAddresses": [ + "0x6ab0e960911b50f6d14f249782ac12ec3e7584a0", + "0xbba36cdf020788f0d08d5688c0bee3fb30ce1c80", + "0x34e387b37d3adeaa6d5b92ce30de3af3dca39796", + "0xa59b26db10c5ca26a97aa2fd2e74cb8da9d1eb65", + "0xf834ffbeb6bb3f4841afc6b5fb40b94cd580fa23", + "0x61f2945d4bc9e40b66a6376d1094a50438f613e2", + "0xb6cf39ee72e0127e6ea6059e38b8c197227a6ac7" + ], + "l2StakingTmKeys": [ + "0x2d7dcd2b93fcadef45fcdf65453118aa5d3efae27e3146d50464531b19fcafb4", + "0x4f2e0fba8a3fe709b0d9923e13b69924b90cb889f806d3cefe9a56d924f39839", + "0x89ded1a39b827b7a001fbb6fda9c26441b67bf0a586b8ee52236caf7d2a6ebca", + "0x453ba69628e1103bd1ae68ad6632005276a3508d12ced10fd6915d5551ff0ade", + "0xbe7e711a860955055bbc4974d2aafe2692b0d3eceba7720d28d29b25f34b27a1", + "0x77a1a01759de3b693ec1a8e6d083a05baca61a17faabb175449a63b708056c79", + "0x68ee3f9c25282c71d81e34d4188fc2514a41c97b8cb5d909cc78a624b1e27cba" + ], + "l2StakingBlsKeys": [ + "0x0000000000000000000000000000000012f51a5c0c73b62b6c8202fe87ad03bb3832d46b5bb40dd6b04d27e0c06fd88c1311f72e45a74f6086f85535e96c97db000000000000000000000000000000000f4718daff21bd38aa60e626321a2157e58a1735ed973925d1a4b621f48fa1c1a135f272213e3bc314fc93bd2a45818f0000000000000000000000000000000011701a778ffa03936d021e7df1c89236784e5b1b33fe9b4267d00a5fa72045065afeab3e17222c582d8e4d0070c1b7d7000000000000000000000000000000000d8ed30ff704b3e649243339f8413c6b3ae832f838b15b4a3a060a76166db54c71749ed04f5e7d6c198c80afee05779e", + "0x000000000000000000000000000000000d82cd3d4e3158a90a7108098e4fcaa610d7f89248ef55cfb76162e1ca17d14ba99b88ad79979007718d6e067c4b5d6b00000000000000000000000000000000011ab8cb6920caac25f2c8fb8f60627bb26aa34b9b4809c6f1e2bac4edcddb711bc9fd6c51be34e327218b98f7b35b5f000000000000000000000000000000001034b1945710226066ecffdc768032185322372c27fd4bf2c8a18da1c5f9847bec406e02844b4d33908bc754de0aadcc000000000000000000000000000000001950f84a7bd160796926fe6a680333c6438de1c4c09ca72a4bf23a49d417aa92c71c714d9292cf7417a0621372a55af7", + "0x0000000000000000000000000000000006f73bcdf4d37d9a8153a743f33b8fcb107f282a03ff4793c710ab349b1a71030367824cbe0c2ce332535567bae3f4380000000000000000000000000000000013429873d1c85c2b04c3d777448246c652b42cb3ee7d5e0babdaa811575e900d60a40f072ff4a6666427da742c10c0ee00000000000000000000000000000000191d6589871d0507ea3ed832859ae6f0ee08f534e98f5bae248ba56185ae2b73c0bd71ce61e68201b5a88798deb99a4b0000000000000000000000000000000000068bf679e513bf8ae98b810413e6eacb8d807a2d4d99cfdf5a763689b9b440304fa61f3ea38099a6159c85ff75d75c", + "0x0000000000000000000000000000000000a06305d9bb8f219dd5e7952a1b1e28dc9046c1519160c61e095ba3f22055e4dbd666be91f56f9cc8b1323ad30e992f0000000000000000000000000000000007283abacc35c938d4e78a63ac37d9dc0afa2c68a49b31bfeecd64de4b0dc8f0229deb9fa84a98f80da2cc3cee4ec877000000000000000000000000000000000ec00f4cbc86123a6bc8283005d4bee8c689945ae8f537bc0e902b4cdc0cb594abd96cd1152c052f92bfc6afa8643ff2000000000000000000000000000000000470fb0e9942ceb13b5c084332912846b57ff6bfc02dd3c7599878c8f44f3562f87e82c6669aff725cfc4fecc4997581", + "0x0000000000000000000000000000000017c89dbc153dbb652911407faec5d4df916456f9200fbbfdc1c5f2841d0b212a1303620f936e75d96a4e07e31a2a631d0000000000000000000000000000000010083d366c688cc5de669a7eb4c7aa82b240fa025201a65ab769f92ca2c6d26714dbcb6aa6df05f7a070683be8d2cf8a0000000000000000000000000000000005aa1c78b20a2a63cd53caac3a365378b5875977c812586dc4183ec41b76169048f55a613295bb74348fa93c5850dbaf00000000000000000000000000000000175600d962b389868f8c1209b274b096d72e5e88f0d175be9d42208416b52cd74542bddeb4d0baeb494b4806f1a48117", + "0x0000000000000000000000000000000006d87938374cc807fb96bbef29376ae6699dd6e404339b12be99a693aebe3d6d944ec2b2391b32caf3a6036563d218040000000000000000000000000000000015ef634394272c106d63360fd8410130974783b227545f58648bd1a61950b4a1d1ed893467efa62c03d54bcce8899a2200000000000000000000000000000000021f4baf98ce0cda995437ccda850eefbe51104d3affeabcfd6b8bb0553b3c72ddb8a198c09a8c498a454615885cf9b5000000000000000000000000000000000137c0913470a6d81709be13d3bf43799a24bac69f059ebefce4b4a7c803df667cbbab0f07a616be968261801a217b73", + "0x00000000000000000000000000000000037582fff0906e5d1b5a1dc4da81446781adab4bf434e75021a2b24253d6980e38eacbda118d222f148159e7b377b298000000000000000000000000000000000e8625231bca55b19b533798262f67b8f89bc8add67413e4435ed927ea53b4401d1b01110258826817bf049c7884ac6e000000000000000000000000000000000e17a73086849ef2721940816a2af29abd6c69426087fa2102177b9eb7a3290edb77c79b2ca930fc0d6a8ec1c7c6deec0000000000000000000000000000000008fdeb4e71d8deae9f92c8d1fea245c1d966262b7aedc78b28a920264f38cc3df7b221a5ab44c52c8ee061756163f8b8" + ] } diff --git a/ops/l2-genesis/deploy-config/qanet-deploy-config.json b/ops/l2-genesis/deploy-config/qanet-deploy-config.json index 6bb1d033e..dfb884e22 100644 --- a/ops/l2-genesis/deploy-config/qanet-deploy-config.json +++ b/ops/l2-genesis/deploy-config/qanet-deploy-config.json @@ -1,62 +1,58 @@ { - "l1ChainID": 900, - "l2ChainID": 53077, - - "finalSystemOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", - "proxyAdminOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", - - "BLOCK_SIGNER_PRIVATE_KEY": "3e4bde571b86929bf08e2aaad9a6a1882664cd5e65b96fff7d03e1c4e6dfa15c", - "BLOCK_SIGNER_ADDRESS": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", - - "l1FeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", - "sequencerFeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", - "l2BridgeFeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", - "fundDevAccounts": false, - - "l1StartingBlockTag": "earliest", - "maxTxPerBlock": 1000, - "maxTxPayloadBytesPerBlock": 122880, - - "gasPriceOracleOverhead": 2500, - "gasPriceOracleScalar": 1000000000, - "gasPriceOracleOwner": "0x71612D2b36859fbad5865085be7c9dEB026bBCbC", - - "govVotingDuration": 1000, - "govBatchBlockInterval": 600, - "govBatchTimeout": 1200, - "govRollupEpoch": 100, - - "l2GenesisBlockGasLimit": "0xbebc200", - "useMPT": false, - - "recordOracleAddress": "0x7161F66BDf7C980B61b426122BBEfff813c0cdF0", - "recordNextBatchSubmissionIndex": 1, - - "morphTokenName": "Morph Token", - "morphTokenSymbol": "Morph", - "morphTokenOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", - "morphTokenInitialSupply": 1000000000, - "morphTokenDailyInflationRate": 1596535874529, - - "l2StakingSequencerMaxSize": 4, - "l2StakingUnDelegatedLockEpochs": 2, - "l2StakingRewardStartTime": 1728000000, - "l2StakingAddresses": [ - "0x675cfc328f9f2e79a51e499b2be44462270572fe", - "0xb096665645994775eeba8aa114752d569734dcb4", - "0x3a587733d38e5487d2a7e81d84625f25c99ab3a1", - "0xb6346ded94fc61b637763610d0c59846b7781080" - ], - "l2StakingTmKeys": [ - "0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb", - "0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935", - "0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040", - "0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a" - ], - "l2StakingBlsKeys": [ - "0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e", - "0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4", - "0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c", - "0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c" - ] -} \ No newline at end of file + "l1ChainID": 900, + "l2ChainID": 53077, + + "finalSystemOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", + "proxyAdminOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", + + "BLOCK_SIGNER_PRIVATE_KEY": "3e4bde571b86929bf08e2aaad9a6a1882664cd5e65b96fff7d03e1c4e6dfa15c", + "BLOCK_SIGNER_ADDRESS": "0xca062b0fd91172d89bcd4bb084ac4e21972cc467", + + "l1FeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", + "sequencerFeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", + "l2BridgeFeeVaultRecipient": "0x716170D0687c3d31CC10DebE0dAa1DDD3FE3D792", + "fundDevAccounts": false, + + "l1StartingBlockTag": "earliest", + "maxTxPerBlock": 1000, + "maxTxPayloadBytesPerBlock": 122880, + + "gasPriceOracleOverhead": 2500, + "gasPriceOracleScalar": 1000000000, + "gasPriceOracleOwner": "0x71612D2b36859fbad5865085be7c9dEB026bBCbC", + + "govVotingDuration": 1000, + "govBatchBlockInterval": 600, + "govBatchTimeout": 1200, + + "l2GenesisBlockGasLimit": "0xbebc200", + "useMPT": false, + + "morphTokenName": "Morph Token", + "morphTokenSymbol": "Morph", + "morphTokenOwner": "0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E", + "morphTokenInitialSupply": 1000000000, + "morphTokenDailyInflationRate": 1596535874529, + + "l2StakingSequencerMaxSize": 4, + "l2StakingUnDelegatedLockEpochs": 2, + "l2StakingRewardStartTime": 1764460800, + "l2StakingAddresses": [ + "0x675cfc328f9f2e79a51e499b2be44462270572fe", + "0xb096665645994775eeba8aa114752d569734dcb4", + "0x3a587733d38e5487d2a7e81d84625f25c99ab3a1", + "0xb6346ded94fc61b637763610d0c59846b7781080" + ], + "l2StakingTmKeys": [ + "0x5280d0eee2a64d3ad29480d15ffd1b048ce5908f180b5ccd65cc3dcf00941abb", + "0xb798eb74c06721d54c659e9ea2bc232a7f95e96d234cc87186b2ab8f43db6935", + "0xecffad01129786ba9c6293aa664f952894dc4019762804799dfa1ffb6e4ed040", + "0x8d29695bb4157c6960adb486be1d9a0c9f728524d09bffcc4f8932ed15221c4a" + ], + "l2StakingBlsKeys": [ + "0x00000000000000000000000000000000095ad465c2895ee825c7d4f1b60a18734db57d4108369e47c6e3a94ee15846f825c06dad5d98f503bd31ece1d9f94b11000000000000000000000000000000000c5d6ba04bc9b9674dd2acbfc5caed3976c1b8be2ec90a03d78dffe924648b4fba82225aff43c744310c6a60185b75ac000000000000000000000000000000000fce6be001c871a11b9db1c6c15f0a6999de5646941a74486206dc784f0b3ffe11799212f3f44ef754b4a0f1ecf85639000000000000000000000000000000000b2f06634e5ea719682c30911c94dfb560f0b7656b5c34a871ea035e3fe7b041885420f8fe1e251f1cce5cdb7514869e", + "0x0000000000000000000000000000000010173aeac4ff317e8e60493f962b91dbd27614e1f6594e17d18a02968bd1fd698b6703092ab8622cd22d6948d9421156000000000000000000000000000000000801aea15697ab4d7a808be45377e4f0d2f54857fdc04031e476402ff16c66a6cbcc5f09a84bf85400c8afbabed006600000000000000000000000000000000015fc71b2c4e81148274e6169c9c9aace8c34fa6030547650242b6c32527dd23a996416e32640bce4f495a0afabc7dbb900000000000000000000000000000000088c4a0dffccc96bce47aef0e176b129457a5f3ae1651b132ddb418e9f7b5850a38c6fec1be6d169eb88dc1619648bf4", + "0x0000000000000000000000000000000003fd9468a8ceffc1b696874517777ef8bfdc9a1bade95c480ee2624903e648c1caf01c65de5b4fda8876a3a0e8d9f0890000000000000000000000000000000004c02f3609a0f61d12fe737dcbb047d5253bd3ff905b55c0e0f932b476fd77d172a58b72ef0f506407870988dd6038220000000000000000000000000000000017fa5765899f60f7a58f8ccdaaa295cde55992231710672692ba6a71a4faa9572f728f438ded65576a570d57e19fd304000000000000000000000000000000001226138813bde98af3464ed03649d8c731bc4e5cb3d26b53bf7483f4105d18bbb3f19e23905119e156e7d003d2fd125c", + "0x00000000000000000000000000000000109bf02a2636c0dc1968b0a50db77251eb090c3e9f51e2a2bc60c4ac72213f41f01f0a34e92c2e0625bd62e28e27edb500000000000000000000000000000000139969bd92522113c0615659874d1fae311ad8152d0584c7b57ffc14927067486dcf86413c5684fccc1163ee2d45c1c1000000000000000000000000000000000f172603f70a0730d100ad6d28bde477195987062e8ade83b82d093935d956ff20ca768c26263577b094f1cb756adc400000000000000000000000000000000010dde3acca00b4ff1b4976500a8f97e92246f43f78cadc95c4993dfc4f4c501c33d42a4bf52587f4931287b59623149c" + ] +} diff --git a/ops/l2-genesis/deploy-config/testnet-deploy-config.json b/ops/l2-genesis/deploy-config/testnet-deploy-config.json index 27cd48bc3..b7361458e 100644 --- a/ops/l2-genesis/deploy-config/testnet-deploy-config.json +++ b/ops/l2-genesis/deploy-config/testnet-deploy-config.json @@ -1,56 +1,53 @@ { - "l1ChainID": 11155111, - "l2ChainID": 2710, - "l2GenesisBlockTimestamp": "0x65AF1DA0", - "baseFeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", - "l1FeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", - "sequencerFeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", - "proxyAdminOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", - "gasPriceOracleOverhead": 2500, - "gasPriceOracleScalar": 1150000000, - "gasPriceOracleOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", - "governanceTokenSymbol": "MORPH", - "governanceTokenName": "Morph", - "governanceTokenOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", - "l1StartingBlockTag": "earliest", - "fundDevAccounts": false, - "maxTxPerBlock": 100, + "l1ChainID": 11155111, + "l2ChainID": 2710, + "l2GenesisBlockTimestamp": "0x65AF1DA0", + "baseFeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", + "l1FeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", + "sequencerFeeVaultRecipient": "0x77772Fb3715C4B8FC621e23Eda5ABbb34a9D6EAd", + "proxyAdminOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", + "gasPriceOracleOverhead": 2500, + "gasPriceOracleScalar": 1150000000, + "gasPriceOracleOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", + "governanceTokenSymbol": "MORPH", + "governanceTokenName": "Morph", + "governanceTokenOwner": "0x7777519b6680965136155F8EdA5D865Fc775528E", + "l1StartingBlockTag": "earliest", + "fundDevAccounts": false, + "maxTxPerBlock": 100, - "stakingSequencerSize": 7, - "stakingLockNumber": 3, + "stakingSequencerSize": 7, + "stakingLockNumber": 3, - "govVotingDuration": 1000, - "govBatchBlockInterval": 600, - "govBatchMaxBytes": 124928, - "govBatchTimeout": 1200, - "govRollupEpoch": 600, - "govBatchMaxChunks": 15, + "govVotingDuration": 1000, + "govBatchBlockInterval": 600, + "govBatchTimeout": 1200, - "l2SequencerAddresses": [ - "0xfd0043f13c5586E6B97e984a3E233CFDB39A5125", - "0x58bA3ec73524832a642d34808fe93816437264a9", - "0x1e7Aa39A5153813deE8209d365bD4e830A8a8e63", - "0x986929D12382876fdeD38eA1ee3847161d7Eb9b7", - "0xd774Bce3D786A692A03EF915bD135A814daf2D58", - "0xA321f3696dEc1ea4Dbd5BA2b777a8EEC4f09e148", - "0x07A2Ba25526a564f972ebEAFECca8fA978aae55F" - ], - "l2SequencerTmKeys": [ - "0xa599b93e87801f8fb19442df0fb07cd1729f31fd5a6261341ef0b41bc3ad5122", - "0xc1ecf69700b972cf40c8753055ad3a09deb9bafcdd2b99f35f8a6926e3db5b67", - "0xe2289ba44bc6eb371eccc203b2f69d42c064a6bbafd1708d98f6cb987bb30736", - "0x6490e859fd1d73df2d0459f3913cdabc45b37e1acd1deaeef591b423089f5969", - "0x7a72e99f75214284f8609101ebbc2410981fd04ee79ba1cbb8a921d8a19780a2", - "0x53eb51bafdd2e2365bc03d773da22f083a4617b799c107f0aacb524e4a7d8d45", - "0xc503fa8024801efbe1f5468d7202facce2132f8e45439b6d6e57be63940f9189" - ], - "l2SequencerBlsKeys": [ - "0x0000000000000000000000000000000008d446bfcf1d9c8be39ed09b11faf4604ae30f69d598fa5c0fd1d093b01793ca27b981efc9469090826d529d7be87477000000000000000000000000000000000a786c32ffeb508a318f56aa732e7451da571033ae96ec20c4eff9e35e86ab6dc2db4d2aa945fadcd54fb4dc5416657e0000000000000000000000000000000007b81fb3110ff3669a9bbbc701140fa2aba51b25282944ee6b949aeed0c7db12b51cef337d485939b4514bca4164c011000000000000000000000000000000000ecc4bedb5d2e3250c6c4d333107eaa00abe96197ef282f8225ba0d3de5329511c492914d25f05f6c07c4798d00892a0", - "0x0000000000000000000000000000000010b0c1a6a58fc8ce7af702f5a3c2e8efe4d28deb5f3fcef59ec9cbd4ff9c241e3ec745ba64f12b481625cf5ad937e40d000000000000000000000000000000000e12918a26de24f7c821af9f6422a5fecc485099364354884dee843b62717568210468cd373e5fc34870b534e96ff5120000000000000000000000000000000005a86a84e149a412b32ea1855730698b43a6794994f42449eb6aef6c1fdf0a826e2fdfaf07276589804ea65470551e00000000000000000000000000000000001320516e63304cbe5981cb42f848e4a83ad34b43be890ee9047f7d735c9b4876d6decf2b8c69462f47866ea72321979c", - "0x000000000000000000000000000000000416c03a752d2c0f0567db5b16c45a10dafaf911a49e2db3bb7c34eb94a02daeb555b802ebfe2f58061ec402008c1b5b0000000000000000000000000000000005664b82b25c9db3f90ac841af8c1ac8bc593f3eb0e63f28e4218fc45c8dfb804899714324ac5e012e29e722a85320a90000000000000000000000000000000007e587cdf757991db4cbedc396a0904adb4ab22088412a5e4f15ec120b8a5658965efddf2de9b931b8c8c2f650721f870000000000000000000000000000000006c21c0e467b5f548cc4e010b4f438efb29fd06144732fcd10fd9cc414c76ae37dffe0c290e0ab0bad8d6b99e3eb4a11", - "0x00000000000000000000000000000000127964288ad423ab900d1e2085b648a4b2e608b03c131360729630ab0e495ce790507bb4e2356ad19f4acc4862ff11300000000000000000000000000000000005a1ef5fbc311a7b189b0cb71f7431bce6d24c8f69ba012ed7efa41290296b1252e5b8bd1439bdd6f2995c3c271e18c600000000000000000000000000000000111872272dc1962e968a3f04ad22a5daf61b1bffc0c955ac977848e48b1d8f78fa8a1eea30682967b8505714ac1acf2700000000000000000000000000000000177349858cf03976c38c4d75075d46044baea470f84688bd4ccda3d5c84125ae10c5bbd2b2a721d340f1576fb9b6daad", - "0x000000000000000000000000000000000809aedcfa10e959973e8cbb8882ca654b1a161c5062e79b973863d685613971e2f4c938dd243e3be8e5084179d9085000000000000000000000000000000000198be3927ee9a75d932d14195dcbbc62df88116859d6658dcc61b7b7bd48c116021abe4ad4a589e904a68214c4f798760000000000000000000000000000000010828cea18edbe9c66c4429ca46faee210cfd19d8231a4d8cea8dcd9d51b7b8572f4c83b9d75e963f9ee32286537ff860000000000000000000000000000000000f96b8cf7c3733712f33e61e6cb4f4248ae3eccc12566b1fe6cdfceeef702b987842bbcc4f3fa872366294c3132e0aa", - "0x0000000000000000000000000000000011d3781ed4b75e002b1248cc88f3c6d14356e026520518ca64845a295c2bf6ef5b5aac7f387338b16d7b35af349e8d2d00000000000000000000000000000000165ded3bb263e31c18ca1571def34fa7d4b27c789c4ef75136b63208e0f90bcc83d0d0deeb5a4684a2fc8a9fb142d0ee0000000000000000000000000000000012a01cead027fb7e22677fa16017054498eedf4f5a1c2b58f8ef48f7ac502ae2018336b326322acf3d952ed71b91025d000000000000000000000000000000000dfd0c585099e1d6b7826f0e6bdcce3220efd5687d585a2889d74548eca4bcd7b6f9166c800ef5e2eea578b6bfb31d57", - "0x0000000000000000000000000000000019d09b98ebea07d6b17bd98eeeb71f06a8033c197ed79383c32da28969cbae31a3acc2a9f667b2e1f34f1b1a22c7907600000000000000000000000000000000141becd55b186ff31d2ce6844c915bd6d89a4f8efaa4807f627f8ebf13f758ebea1ec1f4f55ddb033f584fbc7c48cde3000000000000000000000000000000000464814e2a7276b674ce82065038df7368782165eafaff6ce3eee87bb32d6cfc2a75106a618a3c602340b4ee51d1cff5000000000000000000000000000000000f1651ce08ae92dcb99eb9486b28ca9bd4965560fb9ef86f987c49e922a2fa0a98e43d10e2eb06862efa0503fbb0d409" - ] + "l2SequencerAddresses": [ + "0xfd0043f13c5586E6B97e984a3E233CFDB39A5125", + "0x58bA3ec73524832a642d34808fe93816437264a9", + "0x1e7Aa39A5153813deE8209d365bD4e830A8a8e63", + "0x986929D12382876fdeD38eA1ee3847161d7Eb9b7", + "0xd774Bce3D786A692A03EF915bD135A814daf2D58", + "0xA321f3696dEc1ea4Dbd5BA2b777a8EEC4f09e148", + "0x07A2Ba25526a564f972ebEAFECca8fA978aae55F" + ], + "l2SequencerTmKeys": [ + "0xa599b93e87801f8fb19442df0fb07cd1729f31fd5a6261341ef0b41bc3ad5122", + "0xc1ecf69700b972cf40c8753055ad3a09deb9bafcdd2b99f35f8a6926e3db5b67", + "0xe2289ba44bc6eb371eccc203b2f69d42c064a6bbafd1708d98f6cb987bb30736", + "0x6490e859fd1d73df2d0459f3913cdabc45b37e1acd1deaeef591b423089f5969", + "0x7a72e99f75214284f8609101ebbc2410981fd04ee79ba1cbb8a921d8a19780a2", + "0x53eb51bafdd2e2365bc03d773da22f083a4617b799c107f0aacb524e4a7d8d45", + "0xc503fa8024801efbe1f5468d7202facce2132f8e45439b6d6e57be63940f9189" + ], + "l2SequencerBlsKeys": [ + "0x0000000000000000000000000000000008d446bfcf1d9c8be39ed09b11faf4604ae30f69d598fa5c0fd1d093b01793ca27b981efc9469090826d529d7be87477000000000000000000000000000000000a786c32ffeb508a318f56aa732e7451da571033ae96ec20c4eff9e35e86ab6dc2db4d2aa945fadcd54fb4dc5416657e0000000000000000000000000000000007b81fb3110ff3669a9bbbc701140fa2aba51b25282944ee6b949aeed0c7db12b51cef337d485939b4514bca4164c011000000000000000000000000000000000ecc4bedb5d2e3250c6c4d333107eaa00abe96197ef282f8225ba0d3de5329511c492914d25f05f6c07c4798d00892a0", + "0x0000000000000000000000000000000010b0c1a6a58fc8ce7af702f5a3c2e8efe4d28deb5f3fcef59ec9cbd4ff9c241e3ec745ba64f12b481625cf5ad937e40d000000000000000000000000000000000e12918a26de24f7c821af9f6422a5fecc485099364354884dee843b62717568210468cd373e5fc34870b534e96ff5120000000000000000000000000000000005a86a84e149a412b32ea1855730698b43a6794994f42449eb6aef6c1fdf0a826e2fdfaf07276589804ea65470551e00000000000000000000000000000000001320516e63304cbe5981cb42f848e4a83ad34b43be890ee9047f7d735c9b4876d6decf2b8c69462f47866ea72321979c", + "0x000000000000000000000000000000000416c03a752d2c0f0567db5b16c45a10dafaf911a49e2db3bb7c34eb94a02daeb555b802ebfe2f58061ec402008c1b5b0000000000000000000000000000000005664b82b25c9db3f90ac841af8c1ac8bc593f3eb0e63f28e4218fc45c8dfb804899714324ac5e012e29e722a85320a90000000000000000000000000000000007e587cdf757991db4cbedc396a0904adb4ab22088412a5e4f15ec120b8a5658965efddf2de9b931b8c8c2f650721f870000000000000000000000000000000006c21c0e467b5f548cc4e010b4f438efb29fd06144732fcd10fd9cc414c76ae37dffe0c290e0ab0bad8d6b99e3eb4a11", + "0x00000000000000000000000000000000127964288ad423ab900d1e2085b648a4b2e608b03c131360729630ab0e495ce790507bb4e2356ad19f4acc4862ff11300000000000000000000000000000000005a1ef5fbc311a7b189b0cb71f7431bce6d24c8f69ba012ed7efa41290296b1252e5b8bd1439bdd6f2995c3c271e18c600000000000000000000000000000000111872272dc1962e968a3f04ad22a5daf61b1bffc0c955ac977848e48b1d8f78fa8a1eea30682967b8505714ac1acf2700000000000000000000000000000000177349858cf03976c38c4d75075d46044baea470f84688bd4ccda3d5c84125ae10c5bbd2b2a721d340f1576fb9b6daad", + "0x000000000000000000000000000000000809aedcfa10e959973e8cbb8882ca654b1a161c5062e79b973863d685613971e2f4c938dd243e3be8e5084179d9085000000000000000000000000000000000198be3927ee9a75d932d14195dcbbc62df88116859d6658dcc61b7b7bd48c116021abe4ad4a589e904a68214c4f798760000000000000000000000000000000010828cea18edbe9c66c4429ca46faee210cfd19d8231a4d8cea8dcd9d51b7b8572f4c83b9d75e963f9ee32286537ff860000000000000000000000000000000000f96b8cf7c3733712f33e61e6cb4f4248ae3eccc12566b1fe6cdfceeef702b987842bbcc4f3fa872366294c3132e0aa", + "0x0000000000000000000000000000000011d3781ed4b75e002b1248cc88f3c6d14356e026520518ca64845a295c2bf6ef5b5aac7f387338b16d7b35af349e8d2d00000000000000000000000000000000165ded3bb263e31c18ca1571def34fa7d4b27c789c4ef75136b63208e0f90bcc83d0d0deeb5a4684a2fc8a9fb142d0ee0000000000000000000000000000000012a01cead027fb7e22677fa16017054498eedf4f5a1c2b58f8ef48f7ac502ae2018336b326322acf3d952ed71b91025d000000000000000000000000000000000dfd0c585099e1d6b7826f0e6bdcce3220efd5687d585a2889d74548eca4bcd7b6f9166c800ef5e2eea578b6bfb31d57", + "0x0000000000000000000000000000000019d09b98ebea07d6b17bd98eeeb71f06a8033c197ed79383c32da28969cbae31a3acc2a9f667b2e1f34f1b1a22c7907600000000000000000000000000000000141becd55b186ff31d2ce6844c915bd6d89a4f8efaa4807f627f8ebf13f758ebea1ec1f4f55ddb033f584fbc7c48cde3000000000000000000000000000000000464814e2a7276b674ce82065038df7368782165eafaff6ce3eee87bb32d6cfc2a75106a618a3c602340b4ee51d1cff5000000000000000000000000000000000f1651ce08ae92dcb99eb9486b28ca9bd4965560fb9ef86f987c49e922a2fa0a98e43d10e2eb06862efa0503fbb0d409" + ] } diff --git a/ops/l2-genesis/go.mod b/ops/l2-genesis/go.mod index 9102c3db9..9ef79c2d6 100644 --- a/ops/l2-genesis/go.mod +++ b/ops/l2-genesis/go.mod @@ -6,7 +6,7 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/holiman/uint256 v1.2.4 - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de + github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 github.com/stretchr/testify v1.9.0 github.com/urfave/cli v1.22.14 ) diff --git a/ops/l2-genesis/go.sum b/ops/l2-genesis/go.sum index 38c073c78..9958fce83 100644 --- a/ops/l2-genesis/go.sum +++ b/ops/l2-genesis/go.sum @@ -143,8 +143,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= diff --git a/ops/l2-genesis/morph-chain-ops/genesis/config.go b/ops/l2-genesis/morph-chain-ops/genesis/config.go index 650e283b9..622eb9f7c 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/config.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/config.go @@ -102,7 +102,6 @@ type DeployConfig struct { // Gov configs GovVotingDuration uint64 `json:"govVotingDuration"` GovBatchBlockInterval uint64 `json:"govBatchBlockInterval"` - GovRollupEpoch uint64 `json:"govRollupEpoch"` GovBatchTimeout uint64 `json:"govBatchTimeout"` // L2Staking configs @@ -113,10 +112,6 @@ type DeployConfig struct { L2StakingTmKeys []common.Hash `json:"l2StakingTmKeys"` L2StakingBlsKeys []hexutil.Bytes `json:"l2StakingBlsKeys"` - // Record configs - RecordOracleAddress common.Address `json:"recordOracleAddress"` - RecordNextBatchSubmissionIndex uint64 `json:"recordNextBatchSubmissionIndex"` - // MorphToken configs //MorphTokenOwner common.Address `json:"morphTokenOwner"` //MorphTokenName string `json:"morphTokenName"` @@ -128,6 +123,7 @@ type DeployConfig struct { // Upgrade configs Morph203Time *uint64 `json:"morph203Time,omitempty"` + Morph204Time *uint64 `json:"morph204Time,omitempty"` } // GetDeployedAddresses will get the deployed addresses of deployed L1 contracts @@ -373,9 +369,6 @@ func (d *DeployConfig) Check() error { if d.GovBatchTimeout <= 0 { return fmt.Errorf("GovBatchTimeout must be greater than 0: %w", ErrInvalidDeployConfig) } - if d.GovRollupEpoch <= 0 { - return fmt.Errorf("GovRollupEpoch must be greater than 0: %w", ErrInvalidDeployConfig) - } if d.GasPriceOracleOwner == (common.Address{}) { return fmt.Errorf("GasPriceOracleOwner cannot be address(0): %w", ErrInvalidDeployConfig) } @@ -385,12 +378,6 @@ func (d *DeployConfig) Check() error { if d.GasPriceOracleScalar <= 0 { return fmt.Errorf("GasPriceOracleScalar must be greater than 0: %w", ErrInvalidDeployConfig) } - if d.RecordOracleAddress == (common.Address{}) { - return fmt.Errorf("RecordOracleAddress cannot be address(0): %w", ErrInvalidDeployConfig) - } - if d.RecordNextBatchSubmissionIndex <= 0 { - return fmt.Errorf("RecordNextBatchSubmissionIndex cannot be address(0): %w", ErrInvalidDeployConfig) - } if d.L2StakingSequencerMaxSize <= 0 { return fmt.Errorf("L2StakingSequencerMaxSize must be greater than 0: %w", ErrInvalidDeployConfig) } @@ -454,18 +441,6 @@ func NewL2StorageConfig(config *DeployConfig, baseFee *big.Int) (state.StorageCo // "_initialized": 1, // "_initializing": false, //} - storage["Record"] = state.StorageValues{ - "_initialized": 1, - "_initializing": false, - "_owner": config.FinalSystemOwner, - "oracle": config.RecordOracleAddress, - "nextBatchSubmissionIndex": config.RecordNextBatchSubmissionIndex, - } - storage["Distribute"] = state.StorageValues{ - "_initialized": 1, - "_initializing": false, - "_owner": config.FinalSystemOwner, - } storage["L2Staking"] = state.StorageValues{ "_initialized": 1, "_initializing": false, @@ -481,7 +456,6 @@ func NewL2StorageConfig(config *DeployConfig, baseFee *big.Int) (state.StorageCo "votingDuration": config.GovVotingDuration, "batchBlockInterval": config.GovBatchBlockInterval, "batchTimeout": config.GovBatchTimeout, - "rollupEpoch": config.GovRollupEpoch, } storage["L2ToL1MessagePasser"] = state.StorageValues{ "messageRoot": common.HexToHash("0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757"), diff --git a/ops/l2-genesis/morph-chain-ops/genesis/genesis.go b/ops/l2-genesis/morph-chain-ops/genesis/genesis.go index 3e896273d..95127d848 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/genesis.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/genesis.go @@ -2,6 +2,7 @@ package genesis import ( "errors" + "fmt" "math/big" "time" @@ -35,9 +36,18 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro sequencerFeeVaultReceipt = predeploys.L2TxFeeVaultAddr } - var morph203Time *uint64 + var ( + morph203Time *uint64 + morph204Time *uint64 + ) if config.Morph203Time != nil { morph203Time = config.Morph203Time + fmt.Printf("set morph203Time: %d\n", morph203Time) + } + if config.Morph204Time != nil { + morph204Time = config.Morph204Time + fmt.Printf("set morph204Time: %d\n", morph204Time) + } morphChainConfig := params.ChainConfig{ @@ -61,6 +71,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), Morph203Time: morph203Time, + Morph204Time: morph204Time, TerminalTotalDifficulty: big.NewInt(0), Morph: params.MorphConfig{ UseZktrie: true, diff --git a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go index 56f945ac7..ea43b3200 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go @@ -47,9 +47,6 @@ func Test_BuildL2DeveloperGenesis(t *testing.T) { SequencerFeeVaultRecipient: address1, L2BridgeFeeVaultRecipient: address1, - RecordOracleAddress: address1, - RecordNextBatchSubmissionIndex: 1, - // L2Staking configs L2StakingSequencerMaxSize: 1, L2StakingUnDelegatedLockEpochs: 1, @@ -60,7 +57,6 @@ func Test_BuildL2DeveloperGenesis(t *testing.T) { GovVotingDuration: 1000, GovBatchBlockInterval: 20, - GovRollupEpoch: 600, GovBatchTimeout: 100, // MorphToken diff --git a/ops/l2-genesis/morph-chain-ops/genesis/setters.go b/ops/l2-genesis/morph-chain-ops/genesis/setters.go index a41393383..5e75ae6e4 100644 --- a/ops/l2-genesis/morph-chain-ops/genesis/setters.go +++ b/ops/l2-genesis/morph-chain-ops/genesis/setters.go @@ -82,7 +82,7 @@ func SetImplementations(db vm.StateDB, storage state.StorageConfig, immutable im return err } } else { - if name == "MorphToken" || name == "L2USDCGateway" { + if name == "MorphToken" || name == "L2USDCGateway" || name == "SYSTEM" { continue } err = SetTouchable(db, name, *address, storage, deployResults, slotResults) diff --git a/ops/l2-genesis/morph-chain-ops/immutables/immutables.go b/ops/l2-genesis/morph-chain-ops/immutables/immutables.go index 00faba3b3..1c232bd6c 100644 --- a/ops/l2-genesis/morph-chain-ops/immutables/immutables.go +++ b/ops/l2-genesis/morph-chain-ops/immutables/immutables.go @@ -65,12 +65,6 @@ func BuildMorph(immutable ImmutableConfig, config *InitConfig) (DeploymentResult { Name: "Gov", }, - { - Name: "Distribute", - }, - { - Name: "Record", - }, { Name: "L2Staking", Args: []interface{}{ @@ -239,10 +233,6 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep _, tx, _, err = bindings.DeploySequencer(opts, backend) case "Gov": _, tx, _, err = bindings.DeployGov(opts, backend) - case "Distribute": - _, tx, _, err = bindings.DeployDistribute(opts, backend) - case "Record": - _, tx, _, err = bindings.DeployRecord(opts, backend) case "L2Staking": l1StakingAddr, ok := deployment.Args[0].(common.Address) if !ok { diff --git a/ops/tools/go.mod b/ops/tools/go.mod index d7301b8d3..b67afac63 100644 --- a/ops/tools/go.mod +++ b/ops/tools/go.mod @@ -5,7 +5,7 @@ go 1.22 replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 require ( - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de + github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 github.com/tendermint/tendermint v0.35.9 ) diff --git a/ops/tools/go.sum b/ops/tools/go.sum index e1249465b..9f35b66b6 100644 --- a/ops/tools/go.sum +++ b/ops/tools/go.sum @@ -163,8 +163,8 @@ github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqky github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 h1:qhBMCyTQ/ezOpeqHGKjr4qSN/B/bGFByuYjQqDt5wiw= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= diff --git a/oracle/Dockerfile b/oracle/Dockerfile deleted file mode 100644 index 7a04ec8e6..000000000 --- a/oracle/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Build Geth in a stock Go builder container -FROM golang:1.20-alpine as builder - -RUN apk add --no-cache gcc musl-dev linux-headers git make - -COPY . /staking-oracle - -WORKDIR /staking-oracle - -RUN make staking-oracle - -# Pull Geth into a second stage deploy alpine container -FROM alpine:latest - -RUN apk add --no-cache ca-certificates -COPY --from=builder /staking-oracle/staking-oracle /usr/local/bin/ - -CMD ["staking-oracle"] \ No newline at end of file diff --git a/oracle/Makefile b/oracle/Makefile deleted file mode 100644 index 2aa65c433..000000000 --- a/oracle/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -.PHONY: staking-oracle build clean test lint - -GITCOMMIT := $(shell git rev-parse HEAD) -GITDATE := $(shell git show -s --format='%ct') - -LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT) -LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) -LDFLAGS := -ldflags "$(LDFLAGSSTRING)" - -build: - env GO111MODULE=on CGO_LDFLAGS="-ldl" go build -o build/bin/staking-oracle -v $(LDFLAGS) ./cmd/staking-oracle - -clean: - rm -r build - -test: - go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 ./... - -lint: - GOBIN=$(PWD)/build/bin go run ../build/lint.go diff --git a/oracle/backoff/operation.go b/oracle/backoff/operation.go deleted file mode 100644 index 5e0f7601a..000000000 --- a/oracle/backoff/operation.go +++ /dev/null @@ -1,64 +0,0 @@ -package backoff - -import ( - "context" - "fmt" - "time" -) - -// Operation represents an operation that will be retried -// based on some backoff strategy if it fails. -type Operation func() error - -// ErrFailedPermanently is an error raised by Do when the -// underlying Operation has been retried maxAttempts times. -type ErrFailedPermanently struct { - attempts int - LastErr error -} - -func (e *ErrFailedPermanently) Error() string { - return fmt.Sprintf("operation failed permanently after %d attempts: %v", e.attempts, e.LastErr) -} - -// Do performs the provided Operation up to maxAttempts times -// with delays in between each retry according to the provided -// Strategy. -func Do(maxAttempts int, strategy Strategy, op Operation) error { - return DoCtx(context.Background(), maxAttempts, strategy, op) -} - -func DoCtx(ctx context.Context, maxAttempts int, strategy Strategy, op Operation) error { - if maxAttempts < 1 { - return fmt.Errorf("need at least 1 attempt to run op, but have %d max attempts", maxAttempts) - } - var attempt int - - reattemptCh := make(chan struct{}, 1) - doReattempt := func() { - reattemptCh <- struct{}{} - } - doReattempt() - - for { - select { - case <-ctx.Done(): - return ctx.Err() - case <-reattemptCh: - attempt++ - err := op() - if err == nil { - return nil - } - - if attempt == maxAttempts { - return &ErrFailedPermanently{ - attempts: maxAttempts, - LastErr: err, - } - } - time.AfterFunc(strategy.Duration(attempt-1), doReattempt) - } - - } -} diff --git a/oracle/backoff/operation_test.go b/oracle/backoff/operation_test.go deleted file mode 100644 index 063e9685e..000000000 --- a/oracle/backoff/operation_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package backoff - -import ( - "errors" - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -func TestDo(t *testing.T) { - strategy := Fixed(10 * time.Millisecond) - dummyErr := errors.New("explode") - - start := time.Now() - var i int - require.NoError(t, Do(2, strategy, func() error { - if i == 1 { - return nil - } - - i++ - return dummyErr - })) - require.True(t, time.Since(start) > 10*time.Millisecond) - - start = time.Now() - // add one because the first attempt counts - err := Do(3, strategy, func() error { - return dummyErr - }) - require.Equal(t, dummyErr, err.(*ErrFailedPermanently).LastErr) - require.True(t, time.Since(start) > 20*time.Millisecond) -} diff --git a/oracle/backoff/strategies.go b/oracle/backoff/strategies.go deleted file mode 100644 index a852f37df..000000000 --- a/oracle/backoff/strategies.go +++ /dev/null @@ -1,63 +0,0 @@ -package backoff - -import ( - "math" - "math/rand" - "time" -) - -// Strategy is used to calculate how long a particular Operation -// should wait between attempts. -type Strategy interface { - // Duration returns how long to wait for a given retry attempt. - Duration(attempt int) time.Duration -} - -// ExponentialStrategy performs exponential backoff. The exponential backoff -// function is min(e.Min + (2^attempt * 1000) + randBetween(0, e.MaxJitter), e.Max) -type ExponentialStrategy struct { - // Min is the minimum amount of time to wait between attempts in ms. - Min float64 - - // Max is the maximum amount of time to wait between attempts in ms. - Max float64 - - // MaxJitter is the maximum amount of random jitter to insert between - // attempts in ms. - MaxJitter int -} - -func (e *ExponentialStrategy) Duration(attempt int) time.Duration { - var jitter int - if e.MaxJitter > 0 { - jitter = rand.Intn(e.MaxJitter) - } - dur := e.Min + (math.Pow(2, float64(attempt)) * 1000) - dur += float64(jitter) - if dur > e.Max { - return time.Millisecond * time.Duration(e.Max) - } - - return time.Millisecond * time.Duration(dur) -} - -func Exponential() Strategy { - return &ExponentialStrategy{ - Max: 10000, - MaxJitter: 250, - } -} - -type FixedStrategy struct { - Dur time.Duration -} - -func (f *FixedStrategy) Duration(attempt int) time.Duration { - return f.Dur -} - -func Fixed(dur time.Duration) Strategy { - return &FixedStrategy{ - Dur: dur, - } -} diff --git a/oracle/backoff/strategies_test.go b/oracle/backoff/strategies_test.go deleted file mode 100644 index 2988a3233..000000000 --- a/oracle/backoff/strategies_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package backoff - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -func TestExponential(t *testing.T) { - strategy := &ExponentialStrategy{ - Min: 3000, - Max: 10000, - MaxJitter: 0, - } - - durations := []int{4, 5, 7, 10, 10} - for i, dur := range durations { - require.Equal(t, time.Millisecond*time.Duration(dur*1000), strategy.Duration(i)) - } -} diff --git a/oracle/cmd/staking-oracle/main.go b/oracle/cmd/staking-oracle/main.go deleted file mode 100644 index 7fc0d856a..000000000 --- a/oracle/cmd/staking-oracle/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/morph-l2/go-ethereum/log" - "github.com/morph-l2/go-ethereum/params" - "github.com/urfave/cli" - - "morph-l2/oracle/flags" - "morph-l2/oracle/oracle" -) - -var ( - GitVersion = "" - GitCommit = "" - GitDate = "" -) - -func main() { - - app := cli.NewApp() - app.Flags = flags.Flags - app.Version = fmt.Sprintf("%s-%s", GitVersion, params.VersionWithCommit(GitCommit, GitDate)) - app.Name = "staking-oracle" - app.Usage = "Staking oracle Service" - - app.Action = oracle.Main() - err := app.Run(os.Args) - if err != nil { - log.Crit("Application failed", "message", err) - } -} diff --git a/oracle/config/config.go b/oracle/config/config.go deleted file mode 100644 index 510531db0..000000000 --- a/oracle/config/config.go +++ /dev/null @@ -1,163 +0,0 @@ -package config - -import ( - "fmt" - "time" - - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/log" - "github.com/urfave/cli" - - "morph-l2/oracle/flags" -) - -type Config struct { - /* Required Params */ - - // ChainID identifies the chain being indexed. - ChainID uint64 - - // L1EthRpc is the HTTP provider URL for L1. - L1EthRpc string - - // L2EthRpc is the HTTP provider URL for L1. - L2EthRpc string - - TendermintRpc string - - // PollInterval is the delay between querying L2 for more transaction - // and creating a new batch. - PollInterval time.Duration - - /* Optional Params */ - - // LogLevel is the lowest log level that will be output. - LogLevel string - - // LogTerminal if true, prints to stdout in terminal format, otherwise - // prints using JSON. If SentryEnable is true this flag is ignored, and logs - // are printed using JSON. - LogTerminal bool - - LogFilename string - - LogFileMaxSize int - - LogFileMaxAge int - - LogCompress bool - - // MetricsServerEnable if true, will create a metrics client and log to - // Prometheus. - MetricsServerEnable bool - - // MetricsHostname is the hostname at which the metrics server is running. - MetricsHostname string - - // MetricsPort is the port at which the metrics server is running. - MetricsPort uint64 - - RollupAddr common.Address - - MaxSize uint64 - MinSize uint64 - StartBlock uint64 - PrivKey string - - // external sign - ExternalSign bool - ExternalSignAddress string - ExternalSignAppid string - ExternalSignChain string - ExternalSignUrl string - ExternalSignRsaPriv string -} - -// NewConfig parses the Config from the provided flags or environment variables. -// This method fails if ValidateConfig deems the configuration to be malformed. -func NewConfig(ctx *cli.Context) (Config, error) { - cfg := Config{ - /* Required Flags */ - L1EthRpc: ctx.GlobalString(flags.L1EthRPCFlag.Name), - L2EthRpc: ctx.GlobalString(flags.L2EthRPCFlag.Name), - TendermintRpc: ctx.GlobalString(flags.TendermintFlag.Name), - RollupAddr: common.HexToAddress(ctx.GlobalString(flags.RollupAddress.Name)), - PrivKey: ctx.GlobalString(flags.PrivateKeyFlag.Name), - /* Optional Flags */ - MaxSize: ctx.GlobalUint64(flags.MaxHeaderBatchSizeFlag.Name), - MinSize: ctx.GlobalUint64(flags.MinHeaderBatchSizeFlag.Name), - LogLevel: ctx.GlobalString(flags.LogLevelFlag.Name), - LogTerminal: ctx.GlobalBool(flags.LogTerminalFlag.Name), - MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnableFlag.Name), - MetricsHostname: ctx.GlobalString(flags.MetricsHostnameFlag.Name), - MetricsPort: ctx.GlobalUint64(flags.MetricsPortFlag.Name), - // external sign - ExternalSign: ctx.GlobalBool(flags.ExternalSign.Name), - ExternalSignAppid: ctx.GlobalString(flags.ExternalSignAppid.Name), - ExternalSignAddress: ctx.GlobalString(flags.ExternalSignAddress.Name), - ExternalSignChain: ctx.GlobalString(flags.ExternalSignChain.Name), - ExternalSignUrl: ctx.GlobalString(flags.ExternalSignUrl.Name), - ExternalSignRsaPriv: ctx.GlobalString(flags.ExternalSignRsaPriv.Name), - } - - if ctx.GlobalIsSet(flags.LogFilenameFlag.Name) { - cfg.LogFilename = ctx.GlobalString(flags.LogFilenameFlag.Name) - - maxSize := ctx.GlobalInt(flags.LogFileMaxSizeFlag.Name) - if maxSize < 1 { - return Config{}, fmt.Errorf("wrong log.maxsize set: %d", maxSize) - } - cfg.LogFileMaxSize = maxSize - maxAge := ctx.GlobalInt(flags.LogFileMaxAgeFlag.Name) - if maxAge < 1 { - return Config{}, fmt.Errorf("wrong log.maxage set: %d", maxAge) - } - cfg.LogFileMaxAge = maxAge - cfg.LogCompress = ctx.GlobalBool(flags.LogCompressFlag.Name) - } - - err := ValidateConfig(&cfg) - if err != nil { - return Config{}, err - } - - return cfg, nil -} - -// ValidateConfig ensures additional constraints on the parsed configuration to -// ensure that it is well-formed. -func ValidateConfig(cfg *Config) error { - // Sanity check log level. - if cfg.LogLevel == "" { - cfg.LogLevel = "debug" - } - - _, err := log.LvlFromString(cfg.LogLevel) - if err != nil { - return err - } - - if (cfg.RollupAddr == common.Address{}) { - return fmt.Errorf( - "invalied address,RollupAddress:%v", - cfg.RollupAddr.String(), - ) - } - if cfg.ExternalSign && - (cfg.ExternalSignAddress == "" || - cfg.ExternalSignUrl == "" || - cfg.ExternalSignAppid == "" || - cfg.ExternalSignChain == "" || - cfg.ExternalSignRsaPriv == "") { - return fmt.Errorf("invalid external sign config,ExternalSignAddress:%v,ExternalSignUrl:%v,ExternalSignAppid:%v,ExternalSignChain:%v", - cfg.ExternalSignAddress, - cfg.ExternalSignUrl, - cfg.ExternalSignAppid, - cfg.ExternalSignChain, - ) - } - if !cfg.ExternalSign && cfg.PrivKey == "" { - return fmt.Errorf("invalid privkey") - } - return nil -} diff --git a/oracle/docker-compose.yml b/oracle/docker-compose.yml deleted file mode 100644 index 18e6e8b2c..000000000 --- a/oracle/docker-compose.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: '3.8' - -services: - - staking-oracle: - image: morph-staking-oracle - build: - context: . - dockerfile: Dockerfile - environment: - # Note that you must index goerli with INDEXER_BEDROCK=false first, then - # reindex with INDEXER_BEDROCK=true or seed the database - - STAKING_ORACLE_BUILD_ENV=dev - - STAKING_ORACLE_L1_ETH_RPC=${L1_ETH_RPC} - - STAKING_ORACLE_RECORD_PRIVATE_KEY=${RECORD_PRIVATE_KEY} - - STAKING_ORACLE_L2_ETH_RPC=http://morph-geth-0:8545 - - STAKING_ORACLE_L2_TENDERMINT_RPC=http://node-0:26657 - - STAKING_ORACLE_L2_WS_ENDPOINT=http://node-0:26656 - - STAKING_ORACLE_ROLLUP=${MORPH_ROLLUP:-0x6900000000000000000000000000000000000010} - - STAKING_ORACLE_LOG_FILENAME=staking-oracle.log - - STAKING_ORACLE_LOG_FILE_MAX_SIZE=100 #MB - - STAKING_ORACLE_LOG_FILE_MAX_AGE=7 #day - - STAKING_ORACLE_LOG_COMPRESS=true - - STAKING_ORACLE_METRICS_SERVER_ENABLE=true - ports: - - 6060:6060 diff --git a/oracle/flags/flags.go b/oracle/flags/flags.go deleted file mode 100644 index daaef255f..000000000 --- a/oracle/flags/flags.go +++ /dev/null @@ -1,185 +0,0 @@ -package flags - -import ( - "github.com/urfave/cli" -) - -const envVarPrefix = "STAKING_ORACLE_" - -func prefixEnvVar(name string) string { - return envVarPrefix + name -} - -var ( - /* Required Flags */ - - L1EthRPCFlag = cli.StringFlag{ - Name: "l1-eth-rpc", - Usage: "HTTP provider URL for L1", - Required: true, - EnvVar: prefixEnvVar("L1_ETH_RPC"), - } - L2EthRPCFlag = cli.StringFlag{ - Name: "l2-eth-rpc", - Usage: "HTTP provider URL for L2", - Required: true, - EnvVar: prefixEnvVar("L2_ETH_RPC"), - } - TendermintFlag = cli.StringFlag{ - Name: "l2-tendermint-rpc", - Usage: "HTTP provider Tendermint URL for L2", - Required: true, - EnvVar: prefixEnvVar("L2_TENDERMINT_RPC"), - } - - RollupAddress = cli.StringFlag{ - Name: "rollup-address", - Usage: "Address of the rollup", - Required: true, - EnvVar: prefixEnvVar("ROLLUP"), - } - - PrivateKeyFlag = cli.StringFlag{ - Name: "private-key", - Usage: "The private key to use for sending to the rollup contract", - EnvVar: prefixEnvVar("RECORD_PRIVATE_KEY"), - } - - MaxHeaderBatchSizeFlag = cli.Uint64Flag{ - Name: "max-header-batch-size", - Usage: "The maximum number of headers to request as a batch", - Value: 1000, - EnvVar: prefixEnvVar("MAX_HEADER_BATCH_SIZE"), - } - - MinHeaderBatchSizeFlag = cli.Uint64Flag{ - Name: "min-header-batch-size", - Usage: "The maximum number of headers to request as a batch", - Value: 50, - EnvVar: prefixEnvVar("MIN_HEADER_BATCH_SIZE"), - } - - LogLevelFlag = cli.StringFlag{ - Name: "log-level", - Usage: "The lowest log level that will be output", - Value: "info", - EnvVar: prefixEnvVar("LOG_LEVEL"), - } - LogTerminalFlag = cli.BoolFlag{ - Name: "log-terminal", - Usage: "If true, outputs logs in terminal format, otherwise prints " + - "in JSON format. If SENTRY_ENABLE is set to true, this flag is " + - "ignored and logs are printed using JSON", - EnvVar: prefixEnvVar("LOG_TERMINAL"), - } - LogFilenameFlag = cli.StringFlag{ - Name: "log.filename", - Usage: "The target file for writing logs, backup log files will be retained in the same directory.", - EnvVar: prefixEnvVar("LOG_FILENAME"), - } - LogFileMaxSizeFlag = cli.IntFlag{ - Name: "log.maxsize", - Usage: "The maximum size in megabytes of the log file before it gets rotated. It defaults to 100 megabytes. It is used only when log.filename is provided.", - Value: 100, - EnvVar: prefixEnvVar("LOG_FILE_MAX_SIZE"), - } - LogFileMaxAgeFlag = cli.IntFlag{ - Name: "log.maxage", - Usage: "The maximum number of days to retain old log files based on the timestamp encoded in their filename. It defaults to 30 days. It is used only when log.filename is provided.", - Value: 30, - EnvVar: prefixEnvVar("LOG_FILE_MAX_AGE"), - } - LogCompressFlag = cli.BoolFlag{ - Name: "log.compress", - Usage: "Compress determines if the rotated log files should be compressed using gzip. The default is not to perform compression. It is used only when log.filename is provided.", - EnvVar: prefixEnvVar("LOG_COMPRESS"), - } - MetricsServerEnableFlag = cli.BoolFlag{ - Name: "metrics-server-enable", - Usage: "Whether or not to run the embedded metrics server", - EnvVar: prefixEnvVar("METRICS_SERVER_ENABLE"), - } - MetricsHostnameFlag = cli.StringFlag{ - Name: "metrics-hostname", - Usage: "The hostname of the metrics server", - Value: "0.0.0.0", - EnvVar: prefixEnvVar("METRICS_HOSTNAME"), - } - MetricsPortFlag = cli.Uint64Flag{ - Name: "metrics-port", - Usage: "The port of the metrics server", - Value: 6060, - EnvVar: prefixEnvVar("METRICS_PORT"), - } - - // external sign - ExternalSign = cli.BoolFlag{ - Name: "EXTERNAL_SIGN", - Usage: "Enable external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN"), - } - - // address - ExternalSignAddress = cli.StringFlag{ - Name: "EXTERNAL_SIGN_ADDRESS", - Usage: "The address of the external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN_ADDRESS"), - } - // appid - ExternalSignAppid = cli.StringFlag{ - Name: "EXTERNAL_SIGN_APPID", - Usage: "The appid of the external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN_APPID"), - } - // chain - ExternalSignChain = cli.StringFlag{ - Name: "EXTERNAL_SIGN_CHAIN", - Usage: "The chain of the external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN_CHAIN"), - } - // url - ExternalSignUrl = cli.StringFlag{ - Name: "EXTERNAL_SIGN_URL", - Usage: "The url of the external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN_URL"), - } - ExternalSignRsaPriv = cli.StringFlag{ - Name: "EXTERNAL_RSA_PRIV", - Usage: "The rsa private key of the external sign", - EnvVar: prefixEnvVar("EXTERNAL_SIGN_RSA_PRIV"), - } -) - -var requiredFlags = []cli.Flag{ - L1EthRPCFlag, - L2EthRPCFlag, - TendermintFlag, - RollupAddress, -} - -var optionalFlags = []cli.Flag{ - - LogLevelFlag, - LogTerminalFlag, - LogFilenameFlag, - LogFileMaxSizeFlag, - LogFileMaxAgeFlag, - LogCompressFlag, - MaxHeaderBatchSizeFlag, - MinHeaderBatchSizeFlag, - MetricsServerEnableFlag, - MetricsHostnameFlag, - MetricsPortFlag, - - PrivateKeyFlag, - // external sign - ExternalSign, - ExternalSignAddress, - ExternalSignAppid, - ExternalSignChain, - ExternalSignUrl, - ExternalSignRsaPriv, -} - -// Flags contains the list of configuration options available to the binary. -var Flags = append(requiredFlags, optionalFlags...) diff --git a/oracle/flags/flags_test.go b/oracle/flags/flags_test.go deleted file mode 100644 index ae0bc3d02..000000000 --- a/oracle/flags/flags_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package flags - -import ( - "testing" - - "github.com/stretchr/testify/require" - "github.com/urfave/cli" -) - -// TestRequiredFlagsSetRequired asserts that all flags deemed required properly -// have the Required field set to true. -func TestRequiredFlagsSetRequired(t *testing.T) { - for _, flag := range requiredFlags { - reqFlag, ok := flag.(cli.RequiredFlag) - require.True(t, ok) - require.True(t, reqFlag.IsRequired()) - } -} - -// TestOptionalFlagsDontSetRequired asserts that all flags deemed optional set -// the Required field to false. -func TestOptionalFlagsDontSetRequired(t *testing.T) { - for _, flag := range optionalFlags { - reqFlag, ok := flag.(cli.RequiredFlag) - require.True(t, ok) - require.False(t, reqFlag.IsRequired()) - } -} diff --git a/oracle/go.mod b/oracle/go.mod deleted file mode 100644 index 0a5b7651e..000000000 --- a/oracle/go.mod +++ /dev/null @@ -1,99 +0,0 @@ -module morph-l2/oracle - -go 1.22 - -replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 - -require ( - github.com/go-kit/kit v0.12.0 - github.com/morph-l2/externalsign v0.3.1 - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de - github.com/prometheus/client_golang v1.17.0 - github.com/stretchr/testify v1.9.0 - github.com/tendermint/tendermint v0.35.9 - github.com/urfave/cli v1.22.14 - gopkg.in/natefinch/lumberjack.v2 v2.2.1 -) - -require ( - github.com/VictoriaMetrics/fastcache v1.12.2 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/cosmos/gogoproto v1.4.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect - github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set v1.8.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/edsrzf/mmap-go v1.1.0 // indirect - github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 // indirect - github.com/fjl/memsize v0.0.2 // indirect - github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-resty/resty/v2 v2.13.1 // indirect - github.com/go-stack/stack v1.8.1 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.1 // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/hashicorp/go-bexpr v0.1.13 // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect - github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.4 // indirect - github.com/huin/goupnp v1.3.0 // indirect - github.com/iden3/go-iden3-crypto v0.0.16 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mitchellh/pointerstructure v1.2.1 // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/prometheus/tsdb v0.10.0 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.3 // indirect - github.com/rjeczalik/notify v0.9.3 // indirect - github.com/rs/cors v1.11.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/scroll-tech/zktrie v0.8.4 // indirect - github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/status-im/keycard-go v0.3.2 // indirect - github.com/supranational/blst v0.3.11 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect - github.com/tklauser/go-sysconf v0.3.13 // indirect - github.com/tklauser/numcpus v0.7.0 // indirect - github.com/tyler-smith/go-bip39 v1.1.0 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/time v0.5.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect - google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect - gopkg.in/urfave/cli.v1 v1.20.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - rsc.io/tmplfunc v0.0.3 // indirect -) diff --git a/oracle/go.sum b/oracle/go.sum deleted file mode 100644 index cbef7f1fa..000000000 --- a/oracle/go.sum +++ /dev/null @@ -1,409 +0,0 @@ -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= -github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E= -github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= -github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= -github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/gogoproto v1.4.1 h1:WoyH+0/jbCTzpKNvyav5FL1ZTWsp1im1MxEpJEzKUB8= -github.com/cosmos/gogoproto v1.4.1/go.mod h1:Ac9lzL4vFpBMcptJROQ6dQ4M3pOEK5Z/l0Q9p+LoCr4= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= -github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 h1:B2mpK+MNqgPqk2/KNi1LbqwtZDy5F7iy0mynQiBr8VA= -github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4/go.mod h1:y4GA2JbAUama1S4QwYjC2hefgGLU8Ul0GMtL/ADMF1c= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= -github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= -github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= -github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= -github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= -github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= -github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hashicorp/go-bexpr v0.1.13 h1:HNwp7vZrMpRq8VZXj8VF90LbZpRjQQpim1oJF0DgSwg= -github.com/hashicorp/go-bexpr v0.1.13/go.mod h1:gN7hRKB3s7yT+YvTdnhZVLTENejvhlkZ8UE4YVBS+Q8= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= -github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk= -github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= -github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= -github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morph-l2/externalsign v0.3.1 h1:UYFDZFB0L85A4rDvuwLNBiGEi0kSmg9AZ2v8Q5O4dQo= -github.com/morph-l2/externalsign v0.3.1/go.mod h1:b6NJ4GUiiG/gcSJsp3p8ExsIs4ZdphlrVALASnVoGJE= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= -github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 h1:qhBMCyTQ/ezOpeqHGKjr4qSN/B/bGFByuYjQqDt5wiw= -github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= -github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= -github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= -github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= -github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE= -github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk= -github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/status-im/keycard-go v0.3.2 h1:YusIF/bHx6YZis8UTOJrpZFnTs4IkRBdmJXqdiXkpFE= -github.com/status-im/keycard-go v0.3.2/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= -github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= -github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI= -github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= -github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= -github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= -github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/oracle/metrics/metrics.go b/oracle/metrics/metrics.go deleted file mode 100644 index d026222c2..000000000 --- a/oracle/metrics/metrics.go +++ /dev/null @@ -1,71 +0,0 @@ -package metrics - -import ( - "net" - "net/http" - "strconv" - - "github.com/go-kit/kit/metrics" - "github.com/go-kit/kit/metrics/prometheus" - stdprometheus "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" -) - -const ( - metricsSubsystem = "staking_oracle" -) - -type Metrics struct { - RewardEpoch metrics.Gauge - RollupEpoch metrics.Gauge - BatchEpoch metrics.Gauge -} - -func NewMetrics(namespace string, labelsAndValues ...string) *Metrics { - var labels []string - for i := 0; i < len(labelsAndValues); i += 2 { - labels = append(labels, labelsAndValues[i]) - } - return &Metrics{ - RewardEpoch: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: metricsSubsystem, - Name: "reward_epoch", - Help: "", - }, labels).With(labelsAndValues...), - RollupEpoch: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: metricsSubsystem, - Name: "rollup_epoch", - Help: "", - }, labels).With(labelsAndValues...), - BatchEpoch: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ - Namespace: namespace, - Subsystem: metricsSubsystem, - Name: "batch_epoch", - Help: "", - }, labels).With(labelsAndValues...), - } -} - -func (m *Metrics) SetRewardEpoch(index uint64) { - m.RewardEpoch.Set(float64(index)) -} - -func (m *Metrics) SetRollupEpoch(index uint64) { - m.RollupEpoch.Set(float64(index)) -} - -func (m *Metrics) SetBatchEpoch(index uint64) { - m.BatchEpoch.Set(float64(index)) -} - -func (m *Metrics) Serve(hostname string, port uint64) (*http.Server, error) { - mux := http.NewServeMux() - mux.Handle("/metrics", promhttp.Handler()) - srv := new(http.Server) - srv.Addr = net.JoinHostPort(hostname, strconv.FormatUint(port, 10)) - srv.Handler = mux - err := srv.ListenAndServe() - return srv, err -} diff --git a/oracle/oracle/batch.go b/oracle/oracle/batch.go deleted file mode 100644 index 2384637c9..000000000 --- a/oracle/oracle/batch.go +++ /dev/null @@ -1,304 +0,0 @@ -package oracle - -import ( - "bytes" - "context" - "errors" - "fmt" - "math/big" - "time" - - "morph-l2/bindings/bindings" - "morph-l2/node/derivation" - nodetypes "morph-l2/node/types" - "morph-l2/oracle/backoff" - - "github.com/morph-l2/go-ethereum/accounts/abi/bind" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/go-ethereum/eth" - "github.com/morph-l2/go-ethereum/log" -) - -var BeforeRemoveSkipMapMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_chainID\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ErrZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrorIncorrectBatchLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ErrorNoBlockInBatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"winner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"res\",\"type\":\"string\"}],\"name\":\"ChallengeRes\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ChallengeRewardClaim\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"batchIndex\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"challengeDeposit\",\"type\":\"uint256\"}],\"name\":\"ChallengeState\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"batchHash\",\"type\":\"bytes32\"}],\"name\":\"CommitBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"batchHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"withdrawRoot\",\"type\":\"bytes32\"}],\"name\":\"FinalizeBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ProveRemainingClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"batchHash\",\"type\":\"bytes32\"}],\"name\":\"RevertBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"UpdateChallenger\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPeriod\",\"type\":\"uint256\"}],\"name\":\"UpdateFinalizationPeriodSeconds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPercent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPercent\",\"type\":\"uint256\"}],\"name\":\"UpdateProofRewardPercent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldWindow\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newWindow\",\"type\":\"uint256\"}],\"name\":\"UpdateProofWindow\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldVerifier\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newVerifier\",\"type\":\"address\"}],\"name\":\"UpdateVerifier\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LAYER_2_CHAIN_ID\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"__maxNumTxInChunk\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"addChallenger\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"batchChallengeReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batchChallenged\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchChallengedSuccess\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchDataStore\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"originTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"finalizeTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"signedSequencersBitmap\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchInChallenge\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"batchInsideChallengeWindow\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"batchIndex\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"_batchHash\",\"type\":\"bytes32\"}],\"name\":\"challengeState\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"challenges\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"batchIndex\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"challengeDeposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"challengeSuccess\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"finished\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"claimProveRemaining\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"claimReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"parentBatchHeader\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"blockContexts\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"skippedL1MessageBitmap\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"prevStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"postStateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"withdrawalRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structIRollup.BatchDataInput\",\"name\":\"batchDataInput\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"signedSequencersBitmap\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sequencerSets\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structIRollup.BatchSignatureInput\",\"name\":\"batchSignatureInput\",\"type\":\"tuple\"}],\"name\":\"commitBatch\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"committedBatches\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"batchHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"finalizationPeriodSeconds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_batchHeader\",\"type\":\"bytes\"}],\"name\":\"finalizeBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"batchIndex\",\"type\":\"uint256\"}],\"name\":\"finalizedStateRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_batchHeader\",\"type\":\"bytes\"}],\"name\":\"importGenesisBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"inChallenge\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_l1StakingContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_messageQueue\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_verifier\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_finalizationPeriodSeconds\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_proofWindow\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_proofRewardPercent\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"}],\"name\":\"isBatchFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"challengerAddress\",\"type\":\"address\"}],\"name\":\"isChallenger\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isChallenger\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l1StakingContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastCommittedBatchIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastFinalizedBatchIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageQueue\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proofRewardPercent\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proofWindow\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proveRemaining\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_batchHeader\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_batchProof\",\"type\":\"bytes\"}],\"name\":\"proveState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"removeChallenger\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_batchHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_count\",\"type\":\"uint256\"}],\"name\":\"revertBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"revertReqIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_status\",\"type\":\"bool\"}],\"name\":\"setPause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newPeriod\",\"type\":\"uint256\"}],\"name\":\"updateFinalizePeriodSeconds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newWindow\",\"type\":\"uint256\"}],\"name\":\"updateProofWindow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newProofRewardPercent\",\"type\":\"uint256\"}],\"name\":\"updateRewardPercentage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newVerifier\",\"type\":\"address\"}],\"name\":\"updateVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"verifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"withdrawalRoot\",\"type\":\"bytes32\"}],\"name\":\"withdrawalRoots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"exist\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", -} - -type BatchInfoMap map[common.Hash][]BatchInfo -type RollupBatch struct { - TxCount uint64 -} - -type BatchInfo struct { - BatchIndex uint64 - L1BlockNumber uint64 - L1TxHash common.Hash - L2BlockNumber uint64 - L2BlockCount uint64 - L2TxCount uint64 -} - -func (o *Oracle) GetStartBlock(nextBatchSubmissionIndex *big.Int) (uint64, error) { - if nextBatchSubmissionIndex.Uint64() == 1 { - return o.cfg.StartBlock + 1, nil - } - bs, err := o.record.BatchSubmissions(nil, new(big.Int).Sub(nextBatchSubmissionIndex, big.NewInt(1))) - if err != nil { - return 0, err - } - return bs.RollupBlock.Uint64() + 1, nil -} - -func (o *Oracle) GetBatchSubmission(ctx context.Context, startBlock, nextBatchSubmissionIndex uint64) ([]bindings.IRecordBatchSubmission, error) { - var recordBatchSubmissions []bindings.IRecordBatchSubmission - lastLogs, err := o.fetchRollupLog(ctx, startBlock-1, startBlock-1) - if err != nil { - return nil, fmt.Errorf("fetch rollupLog error:%v", err) - } - if err = o.getBatchSubmissionByLogs(lastLogs, &recordBatchSubmissions, nextBatchSubmissionIndex); err != nil { - return nil, fmt.Errorf("GetBatchSubmissionByLogs error:%v", err) - } - if len(recordBatchSubmissions) == maxBatchSize { - return recordBatchSubmissions, nil - } - for { - batchIndex := nextBatchSubmissionIndex + uint64(len(recordBatchSubmissions)) - endBlock := startBlock + o.cfg.MaxSize - header, err := o.l1Client.HeaderByNumber(o.ctx, nil) - if err != nil { - return nil, fmt.Errorf("get latest header error:%v", err) - } - if startBlock >= header.Number.Uint64() { - time.Sleep(defaultSleepTime) - continue - } - if endBlock >= header.Number.Uint64() { - endBlock = header.Number.Uint64() - } - fetchLogs, err := o.fetchRollupLog(ctx, startBlock, endBlock) - if err != nil { - return nil, fmt.Errorf("fetch rollupLog error:%v", err) - } - if err = o.getBatchSubmissionByLogs(fetchLogs, &recordBatchSubmissions, batchIndex); err != nil { - return nil, fmt.Errorf("GetBatchSubmissionByLogs error:%v", err) - } - if len(recordBatchSubmissions) == maxBatchSize { - return recordBatchSubmissions, nil - } - startBlock = endBlock + 1 - } -} - -func (o *Oracle) getBatchSubmissionByLogs(rLogs []types.Log, recordBatchSubmissions *[]bindings.IRecordBatchSubmission, batchIndex uint64) error { - for _, lg := range rLogs { - tx, pending, err := o.l1Client.TransactionByHash(o.ctx, lg.TxHash) - if err != nil { - return fmt.Errorf("get transaction by hash error:%v", err) - } - signer := types.NewLondonSignerWithEIP4844(tx.ChainId()) - msg, err := tx.AsMessage(signer, tx.GasFeeCap()) - if err != nil { - return err - } - header, err := o.l1Client.HeaderByNumber(context.Background(), big.NewInt(int64(lg.BlockNumber))) - if err != nil { - return fmt.Errorf("get header by number error:%v", err) - } - if pending { - return errors.New("pending transaction") - } - beforeRemoveSkipMapAbi, err := BeforeRemoveSkipMapMetaData.GetAbi() - if err != nil { - return err - } - abi, err := bindings.RollupMetaData.GetAbi() - if err != nil { - return err - } - var batch eth.RPCRollupBatch - if bytes.Equal(tx.Data()[0:4], abi.Methods["commitBatch"].ID) { - args, err := abi.Methods["commitBatch"].Inputs.Unpack(tx.Data()[4:]) - if err != nil { - log.Error("fetch batch info failed", "txHash", lg.TxHash, "blockNumber", lg.BlockNumber, "error", err) - return fmt.Errorf("unpack commitBatch error:%v", err) - } - rollupBatchData := args[0].(struct { - Version uint8 "json:\"version\"" - ParentBatchHeader []uint8 "json:\"parentBatchHeader\"" - BlockContexts []uint8 "json:\"blockContexts\"" - PrevStateRoot [32]uint8 "json:\"prevStateRoot\"" - PostStateRoot [32]uint8 "json:\"postStateRoot\"" - WithdrawalRoot [32]uint8 "json:\"withdrawalRoot\"" - }) - batch = eth.RPCRollupBatch{ - Version: uint(rollupBatchData.Version), - ParentBatchHeader: rollupBatchData.ParentBatchHeader, - BlockContexts: rollupBatchData.BlockContexts, - PrevStateRoot: common.BytesToHash(rollupBatchData.PrevStateRoot[:]), - PostStateRoot: common.BytesToHash(rollupBatchData.PostStateRoot[:]), - WithdrawRoot: common.BytesToHash(rollupBatchData.WithdrawalRoot[:]), - } - } else if bytes.Equal(tx.Data()[0:4], beforeRemoveSkipMapAbi.Methods["commitBatch"].ID) { - args, err := beforeRemoveSkipMapAbi.Methods["commitBatch"].Inputs.Unpack(tx.Data()[4:]) - if err != nil { - log.Error("fetch batch info failed", "txHash", lg.TxHash, "blockNumber", lg.BlockNumber, "error", err) - return fmt.Errorf("unpack commitBatch error:%v", err) - } - - rollupBatchData := args[0].(struct { - Version uint8 "json:\"version\"" - ParentBatchHeader []uint8 "json:\"parentBatchHeader\"" - BlockContexts []uint8 "json:\"blockContexts\"" - SkippedL1MessageBitmap []uint8 "json:\"skippedL1MessageBitmap\"" - PrevStateRoot [32]uint8 "json:\"prevStateRoot\"" - PostStateRoot [32]uint8 "json:\"postStateRoot\"" - WithdrawalRoot [32]uint8 "json:\"withdrawalRoot\"" - }) - batch = eth.RPCRollupBatch{ - Version: uint(rollupBatchData.Version), - ParentBatchHeader: rollupBatchData.ParentBatchHeader, - BlockContexts: rollupBatchData.BlockContexts, - //SkippedL1MessageBitmap: rollupBatchData.SkippedL1MessageBitmap, - PrevStateRoot: common.BytesToHash(rollupBatchData.PrevStateRoot[:]), - PostStateRoot: common.BytesToHash(rollupBatchData.PostStateRoot[:]), - WithdrawRoot: common.BytesToHash(rollupBatchData.WithdrawalRoot[:]), - } - parentBatchHeader := nodetypes.BatchHeaderBytes(batch.ParentBatchHeader) - parentVersion, err := parentBatchHeader.Version() - if err != nil { - return fmt.Errorf("decode parent batch version error:%v", err) - } - if batch.Version == 1 && parentVersion == 0 { - parentBatchIndex, err := parentBatchHeader.BatchIndex() - if err != nil { - return fmt.Errorf("decode parent batch index error:%v", err) - } - parentBatch, err := o.l2Client.GetRollupBatchByIndex(o.ctx, parentBatchIndex) - if err != nil { - return fmt.Errorf("get parent batch error:%v", err) - } - batch.Sidecar = parentBatch.Sidecar - } - } else { - continue - } - - rollupCommitBatch, parseErr := o.rollup.ParseCommitBatch(lg) - if parseErr != nil { - log.Error("get l2 BlockNumber", "err", err) - return parseErr - } - if rollupCommitBatch.BatchIndex.Uint64() < batchIndex { - continue - } - if rollupCommitBatch.BatchIndex.Uint64() > batchIndex { - return fmt.Errorf(fmt.Sprintf("batch is incontinuity,expect %v,have %v", batchIndex, rollupCommitBatch.BatchIndex.Uint64())) - } - // set batchIndex to new batch index + 1 - batchIndex = rollupCommitBatch.BatchIndex.Uint64() + 1 - var batchData derivation.BatchInfo - if err = batchData.ParseBatch(batch); err != nil { - return fmt.Errorf("parse batch error:%v", err) - } - log.Info("received new batch", "batch_index", rollupCommitBatch.BatchIndex.Uint64()) - recordBatchSubmission := bindings.IRecordBatchSubmission{ - Index: rollupCommitBatch.BatchIndex, - Submitter: msg.From(), - StartBlock: big.NewInt(int64(batchData.FirstBlockNumber())), - EndBlock: big.NewInt(int64(batchData.LastBlockNumber())), - RollupTime: big.NewInt(int64(header.Time)), - RollupBlock: big.NewInt(int64(lg.BlockNumber)), - } - *recordBatchSubmissions = append(*recordBatchSubmissions, recordBatchSubmission) - if len(*recordBatchSubmissions) == maxBatchSize { - return nil - } - } - return nil -} - -func (o *Oracle) fetchRollupLog(ctx context.Context, start, end uint64) ([]types.Log, error) { - opts := &bind.FilterOpts{ - Context: ctx, - Start: start, - End: &end, - } - iter, err := o.rollup.FilterCommitBatch(opts, nil, nil) - if err != nil { - return nil, err - } - defer func() { - if err := iter.Close(); err != nil { - log.Info("RollupCommitBatchIterator close failed", "error", err) - } - }() - var logs []types.Log - for iter.Next() { - logs = append(logs, iter.Event.Raw) - } - return logs, nil -} - -func (o *Oracle) GetNextBatchSubmissionIndex() (*big.Int, error) { - return o.record.NextBatchSubmissionIndex(nil) -} - -func (o *Oracle) LastBatchIndex(opts *bind.CallOpts) (*big.Int, error) { - if o.isFinalized { - return o.rollup.LastFinalizedBatchIndex(opts) - - } - return o.rollup.LastCommittedBatchIndex(opts) -} - -func (o *Oracle) submitRecord() error { - nextBatchSubmissionIndex, err := o.GetNextBatchSubmissionIndex() - if err != nil { - return fmt.Errorf("get next batch submission index failed:%v", err) - } - o.metrics.SetBatchEpoch(nextBatchSubmissionIndex.Uint64() - 1) - lastBatchIndex, err := o.LastBatchIndex(nil) - if err != nil { - return fmt.Errorf("get last finalized batch index error:%v", err) - } - if nextBatchSubmissionIndex.Cmp(lastBatchIndex) > 0 { - log.Info("already newest batch submission...", "lastBatchIndex", lastBatchIndex, "nextBatchSubmissionIndex", nextBatchSubmissionIndex) - time.Sleep(defaultSleepTime) - return nil - } - start, err := o.GetStartBlock(nextBatchSubmissionIndex) - if err != nil { - log.Error("get pre batch rollup block number failed", "error", err) - return fmt.Errorf("get pre batch rollup block number error:%v", err) - } - batchSubmissions, err := o.GetBatchSubmission(context.Background(), start, nextBatchSubmissionIndex.Uint64()) - if err != nil { - return fmt.Errorf("get batch submission error:%v", err) - } - callData, err := o.recordAbi.Pack("recordFinalizedBatchSubmissions", batchSubmissions) - if err != nil { - return err - } - tx, err := o.newRecordTxAndSign(callData) - if err != nil { - return fmt.Errorf("record finalized batch error:%v,batchLength:%v", err, len(batchSubmissions)) - } - err = o.l2Client.SendTransaction(o.ctx, tx) - if err != nil { - return fmt.Errorf("send transaction error:%v", err) - } - log.Info("record finalized batch success", "txHash", tx.Hash(), "batchLength", len(batchSubmissions), "nonce", tx.Nonce()) - var receipt *types.Receipt - err = backoff.Do(3, backoff.Exponential(), func() error { - var err error - receipt, err = o.waitReceiptWithCtx(o.ctx, tx.Hash()) - return err - }) - if err != nil { - return fmt.Errorf("wait tx receipt error:%v,txHash:%v", err, tx.Hash()) - } - if receipt.Status != types.ReceiptStatusSuccessful { - return fmt.Errorf("record batch receipt failed,txHash:%v", tx.Hash()) - } - return nil -} diff --git a/oracle/oracle/oracle.go b/oracle/oracle/oracle.go deleted file mode 100644 index 8f688313c..000000000 --- a/oracle/oracle/oracle.go +++ /dev/null @@ -1,273 +0,0 @@ -package oracle - -import ( - "context" - "crypto/ecdsa" - "crypto/rsa" - "errors" - "fmt" - - "io" - "math/big" - "os" - "strings" - "time" - - "morph-l2/bindings/bindings" - "morph-l2/bindings/predeploys" - "morph-l2/oracle/config" - "morph-l2/oracle/metrics" - - "github.com/morph-l2/externalsign" - "github.com/morph-l2/go-ethereum" - "github.com/morph-l2/go-ethereum/accounts/abi" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/go-ethereum/crypto" - "github.com/morph-l2/go-ethereum/ethclient" - "github.com/morph-l2/go-ethereum/log" - jsonrpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" - "github.com/urfave/cli" - "gopkg.in/natefinch/lumberjack.v2" -) - -const ( - defaultRewardEpoch = time.Hour / time.Second * 24 - defaultPrecision = 1e8 - defaultSleepTime = 30 * time.Second -) - -func Main() func(ctx *cli.Context) error { - return func(ctx *cli.Context) error { - cfg, err := config.NewConfig(ctx) - if err != nil { - return err - } - log.Info("Initializing staking-oracle") - m := metrics.NewMetrics("morphoracle") - o, err := NewOracle(&cfg, m) - if err != nil { - log.Error("Unable to create staking-oracle", "error", err) - return err - } - log.Info("Starting staking-oracle") - o.Start() - log.Info("Staking oracle started") - if cfg.MetricsServerEnable { - go func() { - _, err := m.Serve(cfg.MetricsHostname, cfg.MetricsPort) - if err != nil { - log.Error("metrics server failed to start", "err", err) - } - }() - log.Info("metrics server enabled", "host", cfg.MetricsHostname, "port", cfg.MetricsPort) - } - <-(chan struct{})(nil) - log.Info("staking oracle stopped") - return nil - } -} - -type Oracle struct { - ctx context.Context - l1Client *ethclient.Client - l2Client *ethclient.Client - l2Staking *bindings.L2Staking - sequencer *bindings.Sequencer - gov *bindings.Gov - rollup *bindings.Rollup - record *bindings.Record - recordAddr common.Address - recordAbi *abi.ABI - TmClient *jsonrpcclient.Client - rewardEpoch time.Duration - cfg *config.Config - privKey *ecdsa.PrivateKey - externalRsaPriv *rsa.PrivateKey - signer types.Signer - chainId *big.Int - isFinalized bool - enable bool - rollupEpochMaxBlock uint64 - metrics *metrics.Metrics -} - -func NewOracle(cfg *config.Config, m *metrics.Metrics) (*Oracle, error) { - var logHandler log.Handler - output := io.Writer(os.Stderr) - if cfg.LogFilename != "" { - f, err := os.OpenFile(cfg.LogFilename, os.O_CREATE|os.O_RDWR, os.FileMode(0600)) - if err != nil { - return nil, fmt.Errorf("wrong log.filename set: %d", err) - } - _ = f.Close() - - if cfg.LogFileMaxSize < 1 { - return nil, fmt.Errorf("wrong log.maxsize set: %d", cfg.LogFileMaxSize) - } - - if cfg.LogFileMaxAge < 1 { - return nil, fmt.Errorf("wrong log.maxage set: %d", cfg.LogFileMaxAge) - } - logFile := &lumberjack.Logger{ - Filename: cfg.LogFilename, - MaxSize: cfg.LogFileMaxSize, // megabytes - MaxAge: cfg.LogFileMaxAge, // days - Compress: cfg.LogCompress, - } - output = io.MultiWriter(output, logFile) - } - - if cfg.LogTerminal { - logHandler = log.StreamHandler(os.Stdout, log.TerminalFormat(true)) - } else { - logHandler = log.StreamHandler(output, log.JSONFormat()) - } - - logLevel, err := log.LvlFromString(cfg.LogLevel) - if err != nil { - return nil, err - } - - log.Root().SetHandler(log.LvlFilterHandler(logLevel, logHandler)) - l1Client, err := ethclient.Dial(cfg.L1EthRpc) - if err != nil { - return nil, err - } - l2Client, err := ethclient.Dial(cfg.L2EthRpc) - if err != nil { - return nil, err - } - chainId, err := l2Client.ChainID(context.Background()) - if err != nil { - return nil, err - } - httpClient, err := jsonrpcclient.DefaultHTTPClient(cfg.TendermintRpc) - if err != nil { - return nil, err - } - tmClient, err := jsonrpcclient.NewWithHTTPClient(cfg.TendermintRpc, httpClient) - if err != nil { - return nil, err - } - - rollup, err := bindings.NewRollup(cfg.RollupAddr, l1Client) - if err != nil { - return nil, err - } - l2Staking, err := bindings.NewL2Staking(predeploys.L2StakingAddr, l2Client) - if err != nil { - return nil, err - } - record, err := bindings.NewRecord(predeploys.RecordAddr, l2Client) - if err != nil { - return nil, err - } - abi, err := bindings.RecordMetaData.GetAbi() - if err != nil { - return nil, err - } - sequencer, err := bindings.NewSequencer(predeploys.SequencerAddr, l2Client) - if err != nil { - return nil, err - } - gov, err := bindings.NewGov(predeploys.GovAddr, l2Client) - if err != nil { - return nil, err - } - var rsaPriv *rsa.PrivateKey - var privKey *ecdsa.PrivateKey - // external sign - if cfg.ExternalSign { - // parse rsa private key - rsaPriv, err = externalsign.ParseRsaPrivateKey(cfg.ExternalSignRsaPriv) - if err != nil { - return nil, fmt.Errorf("failed to parse rsa private key: %w", err) - } - } else { - // parse priv key - hex := strings.TrimPrefix(cfg.PrivKey, "0x") - privKey, err = crypto.HexToECDSA(hex) - if err != nil { - return nil, fmt.Errorf("parse privkey err:%w", err) - } - - } - - return &Oracle{ - l1Client: l1Client, - l2Client: l2Client, - rollup: rollup, - l2Staking: l2Staking, - record: record, - recordAddr: predeploys.RecordAddr, - recordAbi: abi, - sequencer: sequencer, - gov: gov, - TmClient: tmClient, - cfg: cfg, - rewardEpoch: defaultRewardEpoch, - privKey: privKey, - externalRsaPriv: rsaPriv, - signer: types.LatestSignerForChainID(chainId), - chainId: chainId, - ctx: context.TODO(), - rollupEpochMaxBlock: cfg.MaxSize, - metrics: m, - }, nil -} - -func (o *Oracle) Start() { - go func() { - o.setStartBlock() - for { - if err := o.syncRewardEpoch(); err != nil { - log.Error("syncReward Epoch failed", "error", err) - time.Sleep(30 * time.Second) - } - } - }() - - go func() { - for { - if err := o.submitRecord(); err != nil { - log.Error("reward submission batch failed", "error", err) - time.Sleep(30 * time.Second) - } - } - }() - - if o.enable { - go func() { - for { - if err := o.recordRollupEpoch(); err != nil { - log.Error("record rollup epoch failed", "error", err) - time.Sleep(30 * time.Second) - } - } - }() - } - -} - -func (o *Oracle) waitReceiptWithCtx(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { - t := time.NewTicker(time.Second) - for { - select { - case <-ctx.Done(): - return nil, errors.New("timeout") - case <-t.C: - receipt, err := o.l2Client.TransactionReceipt(o.ctx, txHash) - if errors.Is(err, ethereum.NotFound) { - continue - } - if err != nil { - return nil, err - } - if receipt != nil { - t.Stop() - return receipt, nil - } - } - } -} diff --git a/oracle/oracle/reward.go b/oracle/oracle/reward.go deleted file mode 100644 index fd765b37b..000000000 --- a/oracle/oracle/reward.go +++ /dev/null @@ -1,384 +0,0 @@ -package oracle - -import ( - "bytes" - "context" - "errors" - "fmt" - "math/big" - "sort" - "time" - - "morph-l2/bindings/bindings" - "morph-l2/node/derivation" - "morph-l2/oracle/backoff" - - "github.com/morph-l2/go-ethereum/accounts/abi/bind" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/go-ethereum/log" - "github.com/tendermint/tendermint/crypto/ed25519" - ctypes "github.com/tendermint/tendermint/rpc/core/types" - tmtypes "github.com/tendermint/tendermint/types" -) - -func (o *Oracle) getBlockTimeAndNumber(isFinalized bool) (uint64, *big.Int, error) { - var lastBlockNumber *big.Int - if isFinalized { - latestFinalized, err := o.rollup.LastFinalizedBatchIndex(nil) - if err != nil { - return 0, nil, err - } - batch, err := o.l2Client.GetRollupBatchByIndex(context.Background(), latestFinalized.Uint64()) - if err != nil { - return 0, nil, err - } - if batch == nil { - return 0, nil, fmt.Errorf("batch not found") - } - var batchData derivation.BatchInfo - if err = batchData.ParseBatch(*batch); err != nil { - return 0, nil, fmt.Errorf("parse batch error:%v", err) - } - lastBlockNumber = big.NewInt(int64(batchData.LastBlockNumber())) - } - - header, err := o.l2Client.HeaderByNumber(o.ctx, lastBlockNumber) - if err != nil { - return 0, nil, err - } - return header.Time, header.Number, nil -} - -func (o *Oracle) syncRewardEpoch() error { - _, finalizedBlock, err := o.getBlockTimeAndNumber(o.isFinalized) - if err != nil { - return fmt.Errorf("get block time and number error:%v", err) - } - startRewardEpochIndex, err := o.record.NextRewardEpochIndex(nil) - if err != nil { - return err - } - o.metrics.SetRewardEpoch(startRewardEpochIndex.Uint64() - 1) - startHeight, err := o.getNextHeight() - if err != nil { - return err - } - if startHeight.Cmp(finalizedBlock) > 0 { - time.Sleep(defaultSleepTime) - return nil - } - recordRewardEpochInfo, err := o.getRewardEpochs(startRewardEpochIndex, startHeight) - if err != nil { - return err - } - callData, err := o.recordAbi.Pack("recordRewardEpochs", []bindings.IRecordRewardEpochInfo{*recordRewardEpochInfo}) - if err != nil { - return err - } - tx, err := o.newRecordTxAndSign(callData) - if err != nil { - return fmt.Errorf("record reward epochs error:%v", err) - } - err = o.l2Client.SendTransaction(o.ctx, tx) - if err != nil { - return fmt.Errorf("send transaction error:%v", err) - } - log.Info("send record reward tx success", "txHash", tx.Hash().Hex(), "nonce", tx.Nonce()) - var receipt *types.Receipt - err = backoff.Do(30, backoff.Exponential(), func() error { - var err error - receipt, err = o.waitReceiptWithCtx(o.ctx, tx.Hash()) - return err - }) - if err != nil { - return fmt.Errorf("receipt record reward epochs error:%v", err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - return fmt.Errorf("record reward epochs not success") - } - return nil -} - -func (o *Oracle) getRewardEpochs(startRewardEpochIndex, startHeight *big.Int) (*bindings.IRecordRewardEpochInfo, error) { - endTime, err := o.getEndTime(startHeight, startRewardEpochIndex) - if err != nil { - return nil, err - } - log.Info("new epoch fetching...", "startHeight", startHeight, "startRewardEpochIndex", startRewardEpochIndex, "endTime", endTime) - height := startHeight - sequencersBlockCount := make(map[common.Address]int64) - for { - _, finalizedBlock, err := o.getBlockTimeAndNumber(o.isFinalized) - if err != nil { - continue - } - if height.Cmp(finalizedBlock) > 0 { - log.Info("finalized block small than syncing block,wait...", "finalizedBlock", finalizedBlock, "syncingBlock", height) - time.Sleep(defaultSleepTime) - continue - } - tmHeader, err := o.L2HeaderByNumberWithRetry(height.Int64()) - if err != nil { - return nil, fmt.Errorf("get l2 header error:%v", err) - } - if tmHeader.Time.Unix() > endTime.Int64() { - break - } - log.Info("get new header", "headerNumber", tmHeader.Height, "headerTime", tmHeader.Time) - sequencer, err := o.getSequencer(tmHeader.ProposerAddress, height) - if err != nil { - return nil, fmt.Errorf("get sequencer error:%v", err) - } - sequencersBlockCount[sequencer] += 1 - - height = new(big.Int).Add(height, big.NewInt(1)) - } - - var sequencers []common.Address - var seqBlockCounts, sequencerRatios, sequencerCommissions []*big.Int - for seq, count := range sequencersBlockCount { - sequencers = append(sequencers, seq) - seqBlockCounts = append(seqBlockCounts, big.NewInt(count)) - } - blockCount := new(big.Int).Sub(height, startHeight) - precision := big.NewInt(defaultPrecision) - residue := big.NewInt(defaultPrecision) - maxRatio := big.NewInt(0) - var maxRatioIndex int - for i := 0; i < len(sequencers); i++ { - ratio := new(big.Int).Div(new(big.Int).Mul(seqBlockCounts[i], precision), blockCount) - sequencerRatios = append(sequencerRatios, ratio) - residue = new(big.Int).Sub(residue, ratio) - if ratio.Cmp(maxRatio) > 0 { - maxRatioIndex = i - } - commission, err := o.getSequencerCommission(new(big.Int).Sub(startHeight, big.NewInt(1)), sequencers[i]) - if err != nil { - return nil, fmt.Errorf("get sequencer commission error:%v", err) - } - sequencerCommissions = append(sequencerCommissions, commission) - } - sequencerRatios[maxRatioIndex] = new(big.Int).Add(sequencerRatios[maxRatioIndex], residue) - rewardEpochInfo := bindings.IRecordRewardEpochInfo{ - Index: startRewardEpochIndex, - BlockCount: blockCount, - Sequencers: sequencers, - SequencerBlocks: seqBlockCounts, - SequencerRatios: sequencerRatios, - SequencerCommissions: sequencerCommissions, - } - return &rewardEpochInfo, nil -} - -func (o *Oracle) getSequencerCommission(blockNumber *big.Int, address common.Address) (*big.Int, error) { - if blockNumber.Uint64() < o.cfg.StartBlock { - return big.NewInt(0), nil - } - return o.l2Staking.Commissions(&bind.CallOpts{ - BlockNumber: blockNumber, - }, address) -} - -// L2HeaderByNumberWithRetry retries getting headers. -func (o *Oracle) L2HeaderByNumberWithRetry(height int64) (*tmtypes.Header, error) { - var res *tmtypes.Header - err := backoff.DoCtx(o.ctx, 3, backoff.Exponential(), func() error { - var err error - headerResp, err := o.getHeader(height) - if err != nil { - return err - } - res = headerResp - return nil - }) - return res, err -} - -func (o *Oracle) getHeader(height int64) (*tmtypes.Header, error) { - result := new(ctypes.ResultHeader) - params := make(map[string]interface{}) - if height != 0 { - params["height"] = &height - } - _, err := o.TmClient.Call(o.ctx, "header", params, result) - if err != nil { - return nil, err - } - return result.Header, nil -} - -func (o *Oracle) getSequencer(proposerAddress tmtypes.Address, blockNumber *big.Int) (common.Address, error) { - stakers, err := o.l2Staking.GetStakers(&bind.CallOpts{ - BlockNumber: new(big.Int).Sub(blockNumber, big.NewInt(1)), - }) - if err != nil { - return common.Address{}, err - } - for _, staker := range stakers { - if bytes.Equal(proposerAddress, ed25519.PubKey(staker.TmKey[:]).Address().Bytes()) { - return staker.Addr, nil - } - } - return common.Address{}, fmt.Errorf("sequencer not found") -} - -func (o *Oracle) getNextHeight() (*big.Int, error) { - latest, err := o.record.LatestRewardEpochBlock(nil) - if err != nil { - return latest, err - } - return new(big.Int).Add(latest, big.NewInt(1)), nil -} - -func (o *Oracle) getEndTime(blockNumber *big.Int, nextRewardEpochIndex *big.Int) (*big.Int, error) { - startTime, err := o.l2Staking.RewardStartTime(&bind.CallOpts{ - BlockNumber: blockNumber, - }) - if err != nil { - return nil, err - } - internal := new(big.Int).Mul(nextRewardEpochIndex, big.NewInt(int64(o.rewardEpoch))) - epochStart := new(big.Int).Add(startTime, internal) - epochEnd := new(big.Int).Add(epochStart, big.NewInt(int64(o.rewardEpoch))) - return epochEnd, nil -} - -func (o *Oracle) findStartBlock(start, end uint64, timeStamp int64) (int64, error) { - headerStart, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(start))) - if err != nil { - return 0, err - } - headerEnd, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(end))) - if err != nil { - return 0, err - } - if end < start { - return 0, fmt.Errorf("invalid start or end,start:%v,end:%v", start, end) - } - if int64(headerStart.Time) > timeStamp || int64(headerEnd.Time) < timeStamp { - return 0, fmt.Errorf("this timestamp is not within the given block range") - } - - s := sort.Search(int(end)+1-int(start), func(i int) bool { - header, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(i)+int64(start))) - if err != nil { - log.Error("get header by number failed", "error", err) - return false - } - return int64(header.Time) >= timeStamp - }) - if s == int(end)+1-int(start) { - log.Error("start block not found") - } - target, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(start)+int64(s))) - if err != nil { - return 0, err - } - preHeader, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(start)+int64(s)-1)) - if err != nil { - return 0, err - } - if !(int64(preHeader.Time) < timeStamp && int64(target.Time) >= timeStamp) { - return 0, fmt.Errorf("invalid start block") - } - log.Info("find start block success", "preHeader_time", preHeader.Time, "timestamp", timeStamp, "target_time", target.Time) - return int64(start) + int64(s), nil -} - -func (o *Oracle) setStartBlock() { - start := o.cfg.StartBlock - for { - err := func() error { - header, err := o.l2Client.HeaderByNumber(o.ctx, nil) - if err != nil { - return fmt.Errorf("get latest header error:%v", err) - } - rewardStarted, err := o.l2Staking.RewardStarted(&bind.CallOpts{ - BlockNumber: header.Number, - }) - if err != nil { - return fmt.Errorf("get RewardStarted error:%v", err) - } - if rewardStarted { - return nil - } - return ErrRewardNotStart - - }() - if err != nil { - if errors.Is(err, ErrRewardNotStart) { - log.Info(err.Error()) - } else { - log.Error("query reward start failed", "error", err) - } - time.Sleep(defaultSleepTime) - continue - } - log.Info("reward start") - break - } - - for { - err := func() error { - header, err := o.l2Client.HeaderByNumber(o.ctx, nil) - if err != nil { - return fmt.Errorf("query header by number error:%v", err) - } - startTime, err := o.l2Staking.RewardStartTime(&bind.CallOpts{ - BlockNumber: header.Number, - }) - if err != nil { - return fmt.Errorf("query reward start time error:%v", err) - } - latestRewardEpochBlock, err := o.record.LatestRewardEpochBlock(nil) - if err != nil { - return fmt.Errorf("query latest reward epoch block error:%v", err) - } - if latestRewardEpochBlock.Uint64() != 0 { - return nil - } - if header.Time < startTime.Uint64() { - start = header.Number.Uint64() - return ErrRewardNotStart - } - log.Info("start find start block", "start_block", start, "end_block", header.Number.Uint64()) - startBlock, err := o.findStartBlock(start, header.Number.Uint64(), startTime.Int64()) - if err != nil { - return fmt.Errorf("find start block error:%v", err) - } - callData, err := o.recordAbi.Pack("setLatestRewardEpochBlock", big.NewInt(startBlock)) - if err != nil { - return err - } - tx, err := o.newRecordTxAndSign(callData) - if err != nil { - return err - } - err = o.l2Client.SendTransaction(o.ctx, tx) - if err != nil { - return fmt.Errorf("send transaction error:%v", err) - } - var receipt *types.Receipt - err = backoff.Do(30, backoff.Exponential(), func() error { - var err error - receipt, err = o.waitReceiptWithCtx(o.ctx, tx.Hash()) - return err - }) - if err != nil { - return fmt.Errorf("TransactionReceipt error:%v", err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - return fmt.Errorf("set stark block failed") - } - log.Info("set start block success") - return nil - }() - if err != nil { - log.Error("start block failed", "error", err) - time.Sleep(defaultSleepTime) - continue - } - break - } -} diff --git a/oracle/oracle/rollup.go b/oracle/oracle/rollup.go deleted file mode 100644 index c6052fafa..000000000 --- a/oracle/oracle/rollup.go +++ /dev/null @@ -1,340 +0,0 @@ -package oracle - -import ( - "container/list" - "context" - "fmt" - "math" - "math/big" - "sort" - "time" - - "morph-l2/bindings/bindings" - "morph-l2/oracle/backoff" - - "github.com/morph-l2/go-ethereum/accounts/abi/bind" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/go-ethereum/log" -) - -var ( - MaxEpochCount = 50 -) - -type SequencerSetUpdateEpoch struct { - Submitters []common.Address - StartTime *big.Int - EndTime *big.Int - EndBlock *big.Int -} - -func (o *Oracle) generateRollupEpoch(index, startTime, rollupEpoch, updateTime, endBlock, endBlockTime, nextUpdateTime int64, sequencerSets []common.Address) ([]bindings.IRecordRollupEpochInfo, error) { - var rollupEpochInfos []bindings.IRecordRollupEpochInfo - if startTime == 0 { - startTime = updateTime - } - epochsStart := startTime - for { - endTime := startTime + rollupEpoch - if endTime > nextUpdateTime { - endTime = nextUpdateTime - } - rollupEpochInfo := bindings.IRecordRollupEpochInfo{ - Index: big.NewInt(index), - Submitter: sequencerSets[(endTime-updateTime)/rollupEpoch%int64(len(sequencerSets))], - StartTime: big.NewInt(startTime), - EndTime: big.NewInt(endTime), - EndBlock: big.NewInt(endBlock), - } - if endTime > endBlockTime { - break - } - // TODO - if o.rollupEpochMaxBlock == 1 && len(rollupEpochInfos) >= MaxEpochCount { - rollupEpochInfo.EndBlock = big.NewInt(endBlock - 1) - rollupEpochInfos = append(rollupEpochInfos, rollupEpochInfo) - break - } - rollupEpochInfos = append(rollupEpochInfos, rollupEpochInfo) - if endTime == endBlockTime { - break - } - startTime = endTime - index++ - } - log.Info("generate rollup epoch", "startTime", epochsStart, "endBlockTime", endBlockTime, "epochLength", len(rollupEpochInfos)) - return rollupEpochInfos, nil -} - -func (o *Oracle) recordRollupEpoch() error { - epochIndex, err := o.record.NextRollupEpochIndex(nil) - if err != nil { - return err - } - o.metrics.SetRollupEpoch(epochIndex.Uint64() - 1) - rollupEpoch, err := o.record.RollupEpochs(nil, new(big.Int).Sub(epochIndex, big.NewInt(1))) - if err != nil { - return err - } - startBlock := rollupEpoch.EndBlock.Uint64() - blockNumber, err := o.l2Client.BlockNumber(o.ctx) - if err != nil { - return err - } - if startBlock+o.cfg.MinSize >= blockNumber { - log.Info("too few blocks are newer than startBlock", "startBlock", startBlock, "latestBlock", blockNumber, "minSize", o.cfg.MinSize) - time.Sleep(defaultSleepTime) - return nil - } - endBlock := startBlock + o.rollupEpochMaxBlock - if endBlock > blockNumber { - endBlock = blockNumber - } - log.Info("record rollup epoch info start", "startBlock", startBlock, "endBlock", endBlock, "nextEpochIndex", epochIndex, "lastEpochInfo", rollupEpoch) - setsEpochs, err := o.GetSequencerSetsEpoch(startBlock, endBlock) - if err != nil { - return err - } - var rollupEpochInfos []bindings.IRecordRollupEpochInfo - var epochTime *big.Int - if len(setsEpochs) != 0 { - for _, setsEpoch := range setsEpochs { - log.Info("received new sets change", "startTime", setsEpoch.StartTime, "endTime", setsEpoch.EndTime, "endBlock", setsEpoch.EndBlock) - updateTime, err := o.GetUpdateTime(setsEpoch.EndBlock.Int64() - 1) - if err != nil { - return err - } - epochTime, err = o.gov.RollupEpoch(&bind.CallOpts{ - BlockNumber: big.NewInt(setsEpoch.EndBlock.Int64() - 1), - }) - if err != nil { - return err - } - epochs, err := o.generateRollupEpoch(epochIndex.Int64()+int64(len(rollupEpochInfos)), rollupEpoch.EndTime.Int64(), epochTime.Int64(), updateTime, setsEpoch.EndBlock.Int64(), setsEpoch.EndTime.Int64(), setsEpoch.EndTime.Int64(), setsEpoch.Submitters) - if err != nil { - return err - } - rollupEpochInfos = append(rollupEpochInfos, epochs...) - } - } else { - updateTime, err := o.GetUpdateTime(int64(endBlock)) - if err != nil { - return fmt.Errorf("get update time error:%v", err) - } - epochTime, err = o.gov.RollupEpoch(&bind.CallOpts{ - BlockNumber: big.NewInt(int64(endBlock)), - }) - if err != nil { - return fmt.Errorf("get rollup epoch time error:%v", err) - } - header, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(endBlock))) - if err != nil { - return fmt.Errorf("get header by number error:%v", err) - } - sets, err := o.sequencer.GetSequencerSet2(&bind.CallOpts{ - BlockNumber: big.NewInt(int64(endBlock)), - }) - if err != nil { - return fmt.Errorf("get sequencer set error:%v", err) - } - epochs, err := o.generateRollupEpoch(epochIndex.Int64(), rollupEpoch.EndTime.Int64(), epochTime.Int64(), updateTime, int64(endBlock), int64(header.Time), math.MaxInt64, sets) - if err != nil { - return fmt.Errorf("generate rollup epoch info error:%v", err) - } - rollupEpochInfos = append(rollupEpochInfos, epochs...) - } - if len(rollupEpochInfos) == 0 { - log.Info("rollup epoch infos length is zero", "startBlock", startBlock, "endBlock", endBlock, "rollupEpochMaxBlock", o.rollupEpochMaxBlock, "epochTime", epochTime) - time.Sleep(defaultSleepTime) - return nil - } - log.Info("submit rollup epoch infos", "startBlock", startBlock, "endBlock", endBlock, "infoLength", len(rollupEpochInfos)) - err = o.submitRollupEpoch(rollupEpochInfos) - if err != nil { - if len(rollupEpochInfos) > 50 { - if o.cfg.MinSize*2 <= o.rollupEpochMaxBlock { - o.rollupEpochMaxBlock -= o.cfg.MinSize - } else { - o.rollupEpochMaxBlock = o.rollupEpochMaxBlock / 2 - } - } - return fmt.Errorf("submit rollup epoch info error:%v,rollupEpochMaxBlock:%v", err, o.rollupEpochMaxBlock) - } - if o.rollupEpochMaxBlock+o.cfg.MinSize <= o.cfg.MaxSize { - o.rollupEpochMaxBlock += o.cfg.MinSize - } - - log.Info("submit rollup epoch info success", "rollupEpochMaxBlock", o.rollupEpochMaxBlock) - return nil -} - -func (o *Oracle) submitRollupEpoch(epochs []bindings.IRecordRollupEpochInfo) error { - callData, err := o.recordAbi.Pack("recordRollupEpochs", epochs) - if err != nil { - return err - } - tx, err := o.newRecordTxAndSign(callData) - if err != nil { - return err - } - log.Info("send record rollup epoch tx success", "txHash", tx.Hash().Hex(), "nonce", tx.Nonce()) - var receipt *types.Receipt - err = backoff.Do(30, backoff.Exponential(), func() error { - var err error - receipt, err = o.waitReceiptWithCtx(o.ctx, tx.Hash()) - return err - }) - if err != nil { - return fmt.Errorf("receipt record rollup epochs error:%v", err) - } - if receipt.Status != types.ReceiptStatusSuccessful { - return fmt.Errorf("record rollup epochs not success") - } - log.Info("wait receipt success", "txHash", tx.Hash()) - return nil -} - -func (o *Oracle) GetUpdateTime(blockNumber int64) (int64, error) { - updateTime, err := o.sequencer.UpdateTime(&bind.CallOpts{ - BlockNumber: big.NewInt(blockNumber), - }) - if err != nil { - return 0, err - } - epochUpdateTime, err := o.gov.RollupEpochUpdateTime(&bind.CallOpts{ - BlockNumber: big.NewInt(blockNumber), - }) - if err != nil { - return 0, err - } - header, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(1)) - if err != nil { - return 0, err - } - if updateTime.Cmp(epochUpdateTime) <= 0 { - updateTime = epochUpdateTime - } - if updateTime.Uint64() <= header.Time { - updateTime = big.NewInt(int64(header.Time)) - } - return updateTime.Int64(), nil -} - -func (o *Oracle) GetSequencerSetsEpoch(start, end uint64) ([]SequencerSetUpdateEpoch, error) { - var epochBlock []int - rollupEpochUpdated, err := o.fetchRollupEpochUpdated(o.ctx, start, end) - if err != nil { - return nil, err - } - epochBlock = append(epochBlock, rollupEpochUpdated...) - sequencerSetUpdated, err := o.fetchSequencerSetUpdated(o.ctx, start, end) - if err != nil { - return nil, err - } - epochBlock = append(epochBlock, sequencerSetUpdated...) - sortedBlocks := removeDuplicatesAndSort(epochBlock) - sort.Ints(sortedBlocks) - var setsEpochInfos []SequencerSetUpdateEpoch - for _, eb := range sortedBlocks { - header, err := o.l2Client.HeaderByNumber(o.ctx, big.NewInt(int64(eb))) - if err != nil { - return nil, err - } - sequencerSets, err := o.sequencer.GetSequencerSet2(&bind.CallOpts{ - BlockNumber: big.NewInt(int64(eb - 1)), - }) - if err != nil { - return nil, err - } - lastTime, err := o.GetUpdateTime(header.Number.Int64() - 1) - if err != nil { - return nil, err - } - epochInfo := SequencerSetUpdateEpoch{ - Submitters: sequencerSets, - StartTime: big.NewInt(lastTime), - EndTime: big.NewInt(int64(header.Time)), - EndBlock: header.Number, - } - setsEpochInfos = append(setsEpochInfos, epochInfo) - } - return setsEpochInfos, nil -} - -func (o *Oracle) fetchRollupEpochUpdated(ctx context.Context, start, end uint64) ([]int, error) { - opts := &bind.FilterOpts{ - Context: ctx, - Start: start, - End: &end, - } - iter, err := o.gov.FilterRollupEpochUpdated(opts) - if err != nil { - return nil, err - } - defer func() { - if err := iter.Close(); err != nil { - log.Info("GovRollupEpochUpdatedIterator close failed", "error", err) - } - }() - var blocks []int - for iter.Next() { - blocks = append(blocks, int(iter.Event.Raw.BlockNumber)) - } - return blocks, nil -} - -func (o *Oracle) fetchSequencerSetUpdated(ctx context.Context, start, end uint64) ([]int, error) { - opts := &bind.FilterOpts{ - Context: ctx, - Start: start, - End: &end, - } - iter, err := o.sequencer.FilterSequencerSetUpdated(opts) - if err != nil { - return nil, err - } - defer func() { - if err := iter.Close(); err != nil { - log.Info("SequencerSequencerSetUpdatedIterator close failed", "error", err) - } - }() - var blocks []int - for iter.Next() { - blocks = append(blocks, int(iter.Event.Raw.BlockNumber)) - } - return blocks, nil -} - -type set struct { - list *list.List -} - -func newSet() *set { - return &set{list.New()} -} - -func (s *set) add(value int) { - for e := s.list.Front(); e != nil; e = e.Next() { - if e.Value == value { - return - } - } - s.list.PushBack(value) -} - -func (s *set) values() []int { - values := make([]int, 0, s.list.Len()) - for e := s.list.Front(); e != nil; e = e.Next() { - values = append(values, e.Value.(int)) - } - return values -} - -func removeDuplicatesAndSort(arr []int) []int { - s := newSet() - for _, v := range arr { - s.add(v) - } - return s.values() -} diff --git a/oracle/oracle/sign.go b/oracle/oracle/sign.go deleted file mode 100644 index 05e32d476..000000000 --- a/oracle/oracle/sign.go +++ /dev/null @@ -1,83 +0,0 @@ -package oracle - -import ( - "fmt" - "math/big" - - "morph-l2/bindings/predeploys" - - "github.com/morph-l2/externalsign" - "github.com/morph-l2/go-ethereum" - "github.com/morph-l2/go-ethereum/common" - "github.com/morph-l2/go-ethereum/core/types" - "github.com/morph-l2/go-ethereum/crypto" -) - -var externalSigner *externalsign.ExternalSign - -func (o *Oracle) sign(tx *types.Transaction) (*types.Transaction, error) { - if o.cfg.ExternalSign { - if externalSigner == nil { - externalSigner = externalsign.NewExternalSign(o.cfg.ExternalSignAppid, o.externalRsaPriv, o.cfg.ExternalSignAddress, o.cfg.ExternalSignChain, o.signer) - } - signedTx, err := externalSigner.RequestSign(o.cfg.ExternalSignUrl, tx) - if err != nil { - return nil, fmt.Errorf("externalsign sign tx error:%v", err) - } - return signedTx, nil - } else { - signedTx, err := types.SignTx(tx, o.signer, o.privKey) - if err != nil { - return nil, fmt.Errorf("sign tx error:%v", err) - } - return signedTx, nil - - } -} - -func (o *Oracle) newRecordTxAndSign(callData []byte) (*types.Transaction, error) { - from := common.HexToAddress(o.cfg.ExternalSignAddress) - if !o.cfg.ExternalSign { - from = crypto.PubkeyToAddress(o.privKey.PublicKey) - } - nonce, err := o.l2Client.NonceAt(o.ctx, from, nil) - if err != nil { - return nil, err - } - // tip and cap - tip, err := o.l2Client.SuggestGasTipCap(o.ctx) - if err != nil { - return nil, err - } - head, err := o.l2Client.HeaderByNumber(o.ctx, nil) - if err != nil { - return nil, err - } - var gasFeeCap *big.Int - if head.BaseFee != nil { - gasFeeCap = new(big.Int).Add( - tip, - new(big.Int).Mul(head.BaseFee, big.NewInt(2)), - ) - } else { - gasFeeCap = new(big.Int).Set(tip) - } - gas, err := o.l2Client.EstimateGas(o.ctx, ethereum.CallMsg{ - From: from, - To: &predeploys.RecordAddr, - GasFeeCap: gasFeeCap, - GasTipCap: tip, - Data: callData, - }) - if err != nil { - return nil, err - } - return o.sign(types.NewTx(&types.DynamicFeeTx{ - ChainID: o.chainId, - Nonce: nonce, - GasTipCap: tip, - GasFeeCap: gasFeeCap, - Gas: gas, - To: &o.recordAddr, - Data: callData})) -} diff --git a/oracle/oracle/types.go b/oracle/oracle/types.go deleted file mode 100644 index 2c5fde6d2..000000000 --- a/oracle/oracle/types.go +++ /dev/null @@ -1,10 +0,0 @@ -package oracle - -import "errors" - -// empirical value -const maxBatchSize = 72 - -var ( - ErrRewardNotStart = errors.New("reward has not start") -) diff --git a/tx-submitter/entry.go b/tx-submitter/entry.go index bc5675fcd..5da6aaa05 100644 --- a/tx-submitter/entry.go +++ b/tx-submitter/entry.go @@ -50,7 +50,6 @@ func Main() func(ctx *cli.Context) error { "l2_rpcs", cfg.L2EthRpcs, "rollup_addr", cfg.RollupAddress, "l2_sequencer_addr", cfg.L2SequencerAddress, - "l2_gov_addr", cfg.L2GovAddress, "l1_staking_addr", cfg.L1StakingAddress, "fee_limit", cfg.TxFeeLimit, "finalize_enable", cfg.Finalize, @@ -199,7 +198,7 @@ func Main() func(ctx *cli.Context) error { } eventIndexer := event.NewEventIndexer(l1Client, new(big.Int).SetUint64(cfg.L1StakingDeployedBlockNumber), filter, cfg.EventIndexStep, eventInfoStorage) // new rotator - rotator := services.NewRotator(common.HexToAddress(cfg.L2SequencerAddress), common.HexToAddress(cfg.L2GovAddress), eventIndexer) + rotator := services.NewRotator(common.HexToAddress(cfg.L2SequencerAddress), eventIndexer, cfg.RollupEpoch) // start rorator event indexer rotator.StartEventIndexer() diff --git a/tx-submitter/flags/flags.go b/tx-submitter/flags/flags.go index e7de38ff6..9bc7668dd 100644 --- a/tx-submitter/flags/flags.go +++ b/tx-submitter/flags/flags.go @@ -90,13 +90,6 @@ var ( EnvVar: prefixEnvVar("L2_SEQUENCER_ADDRESS"), Value: predeploys.Sequencer, } - L2GovAddressFlag = cli.StringFlag{ - Name: "l2_gov_address", - Usage: "Address of the gov contract", - Required: false, - EnvVar: prefixEnvVar("L2_GOV_ADDRESS"), - Value: predeploys.Gov, - } /* Optional Flags */ LogLevelFlag = cli.StringFlag{ @@ -324,6 +317,13 @@ var ( Value: 5, EnvVar: prefixEnvVar("BLOCK_NOT_INCREASED_THRESHOLD"), } + + RollupEpochFlag = cli.Uint64Flag{ + Name: "rollup_epoch", + Usage: "The rollup epoch", + Value: 3600, // seconds + EnvVar: prefixEnvVar("ROLLUP_EPOCH"), + } ) var requiredFlags = []cli.Flag{ @@ -362,7 +362,6 @@ var optionalFlags = []cli.Flag{ PrivateKeyFlag, L2SequencerAddressFlag, - L2GovAddressFlag, TipFeeBumpFlag, MaxTipFlag, MinTipFlag, @@ -382,6 +381,7 @@ var optionalFlags = []cli.Flag{ EventIndexStepFlag, LeveldbPathNameFlag, BlockNotIncreasedThreshold, + RollupEpochFlag, } // Flags contains the list of configuration options available to the binary. diff --git a/tx-submitter/go.mod b/tx-submitter/go.mod index b4b15955b..31cd0be01 100644 --- a/tx-submitter/go.mod +++ b/tx-submitter/go.mod @@ -7,9 +7,10 @@ replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3. require ( github.com/holiman/uint256 v1.2.4 github.com/morph-l2/externalsign v0.3.1 - github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de + github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 github.com/prometheus/client_golang v1.17.0 github.com/stretchr/testify v1.9.0 + github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a github.com/tendermint/tendermint v0.35.9 github.com/urfave/cli v1.22.14 gopkg.in/natefinch/lumberjack.v2 v2.2.1 @@ -71,8 +72,8 @@ require ( github.com/scroll-tech/zktrie v0.8.4 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/status-im/keycard-go v0.3.2 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/supranational/blst v0.3.11 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect diff --git a/tx-submitter/go.sum b/tx-submitter/go.sum index b5990fb1a..69e2f3160 100644 --- a/tx-submitter/go.sum +++ b/tx-submitter/go.sum @@ -164,8 +164,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morph-l2/externalsign v0.3.1 h1:UYFDZFB0L85A4rDvuwLNBiGEi0kSmg9AZ2v8Q5O4dQo= github.com/morph-l2/externalsign v0.3.1/go.mod h1:b6NJ4GUiiG/gcSJsp3p8ExsIs4ZdphlrVALASnVoGJE= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de h1:NOzYvFCuqWZ0bg2GAcC2S9cwd1rThSCTwyJCT8Iwfgc= -github.com/morph-l2/go-ethereum v1.10.14-0.20250218031646-de5160c106de/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3 h1:NESrcxRv8CNPoSw6vJ9LuZCBJbAjt/ddO/Tmk/Ox9zE= +github.com/morph-l2/go-ethereum v1.10.14-0.20250507031230-2fbc3c0550c3/go.mod h1:sMJCfHOBzVRDkM2yF/Hy+oUk2rgC0CQZHTLs0cyzhhk= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533 h1:qhBMCyTQ/ezOpeqHGKjr4qSN/B/bGFByuYjQqDt5wiw= github.com/morph-l2/tendermint v0.3.2-0.20250115141431-c84dfe5c8533/go.mod h1:TtCzp9l6Z6yDUiwv3TbqKqw8Q8RKp3fSz5+adO1/Y8w= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -239,6 +239,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= diff --git a/tx-submitter/iface/rollup.go b/tx-submitter/iface/rollup.go index 1b2ea85a0..81cd94c11 100644 --- a/tx-submitter/iface/rollup.go +++ b/tx-submitter/iface/rollup.go @@ -25,9 +25,6 @@ type IL2Sequencer interface { GetSequencerSet2() ([]common.Address, error) } -type IL2Gov interface { - RollupEpoch(opts *bind.CallOpts) (*big.Int, error) -} type IL1Staking interface { IsStaker(opts *bind.CallOpts, addr common.Address) (bool, error) GetStakersBitmap(opts *bind.CallOpts, _stakers []common.Address) (*big.Int, error) diff --git a/tx-submitter/services/rollup.go b/tx-submitter/services/rollup.go index 56cbd43ce..e71bc0336 100644 --- a/tx-submitter/services/rollup.go +++ b/tx-submitter/services/rollup.go @@ -1380,29 +1380,6 @@ func QuerySequencerSet(addr common.Address, clients []iface.L2Client) ([]common. return nil, fmt.Errorf("no sequencer set found after querying all clients") } -// query epoch from gov contract on l2 -func GetEpoch(addr common.Address, clients []iface.L2Client) (*big.Int, error) { - if len(clients) < 1 { - return nil, fmt.Errorf("no client to query epoch") - } - for _, client := range clients { - // l2 gov - l2Gov, err := bindings.NewGov(addr, client) - if err != nil { - log.Warn("failed to connect to gov", "error", err) - continue - } - // get epoch - epoch, err := l2Gov.RollupEpoch(nil) - if err != nil { - log.Warn("failed to get epoch", "error", err) - continue - } - return epoch, nil - } - return nil, fmt.Errorf("no epoch found after querying all clients") -} - // query sequencer set update time from sequencer contract on l2 func GetSequencerSetUpdateTime(addr common.Address, clients []iface.L2Client) (*big.Int, error) { @@ -1427,31 +1404,6 @@ func GetSequencerSetUpdateTime(addr common.Address, clients []iface.L2Client) (* return nil, fmt.Errorf("no sequencer set update time found after querying all clients") } -// query epoch update time from gov contract on l2 -func GetEpochUpdateTime(addr common.Address, clients []iface.L2Client) (*big.Int, error) { - if len(clients) < 1 { - return nil, fmt.Errorf("no client to query epoch update time") - } - for _, client := range clients { - // l2 gov - l2Gov, err := bindings.NewGov(addr, client) - if err != nil { - log.Warn("failed to connect to gov", "error", err) - continue - } - // get epoch update time - updateTime, err := l2Gov.RollupEpochUpdateTime(nil) - if err != nil { - log.Warn("failed to get epoch update time", "error", err) - continue - } - return updateTime, nil - - } - return nil, fmt.Errorf("no epoch update time found after querying all clients") - -} - func UpdateGasLimit(tx *ethtypes.Transaction) (*ethtypes.Transaction, error) { // add buffer to gas limit (*1.2) newGasLimit := tx.Gas() * 12 / 10 diff --git a/tx-submitter/services/rollup_handle_test.go b/tx-submitter/services/rollup_handle_test.go index 64f03b197..d45790377 100644 --- a/tx-submitter/services/rollup_handle_test.go +++ b/tx-submitter/services/rollup_handle_test.go @@ -63,7 +63,7 @@ func setupTestRollup(t *testing.T) (*Rollup, *mock.L1ClientWrapper, *mock.L2Clie ) // Create mock rotator - rotator := NewRotator(common.Address{}, common.Address{}, indexer) + rotator := NewRotator(common.Address{}, indexer, 3600) // Create mock L1Staking l1Staking := mock.NewMockL1Staking() diff --git a/tx-submitter/services/rotator.go b/tx-submitter/services/rotator.go index bb5bb81af..6ebd00df8 100644 --- a/tx-submitter/services/rotator.go +++ b/tx-submitter/services/rotator.go @@ -24,15 +24,14 @@ type Rotator struct { epoch *big.Int // epoch for rotation mu sync.Mutex // lock l2SequencerAddr common.Address - l2GovAddr common.Address indexer *event.EventIndexer } -func NewRotator(l2SeqencerAddr, l2GovAddr common.Address, indexer *event.EventIndexer) *Rotator { +func NewRotator(l2SeqencerAddr common.Address, indexer *event.EventIndexer, rollupEpoch uint64) *Rotator { return &Rotator{ l2SequencerAddr: l2SeqencerAddr, - l2GovAddr: l2GovAddr, indexer: indexer, + epoch: big.NewInt(int64(rollupEpoch)), } } @@ -43,12 +42,7 @@ func (r *Rotator) StartEventIndexer() { // UpdateState updates the state of the rotator // updated by event listener in the future func (r *Rotator) UpdateState(clients []iface.L2Client, l1Staking iface.IL1Staking) error { - - epochUpdateTime, err := GetEpochUpdateTime(r.l2GovAddr, clients) - if err != nil { - log.Error("failed to get epoch update time", "err", err) - return fmt.Errorf("GetCurrentSubmitter: failed to get epoch update time: %w", err) - } + epochUpdateTime := new(big.Int) // sequencer set update time sequcerUpdateTime, err := GetSequencerSetUpdateTime(r.l2SequencerAddr, clients) if err != nil { @@ -76,13 +70,6 @@ func (r *Rotator) UpdateState(clients []iface.L2Client, l1Staking iface.IL1Staki return fmt.Errorf("UpdateState: failed to get sequencer set: %w", err) } r.SetSequencerSet(seqSet) - // get current epoch - epoch, err := GetEpoch(r.l2GovAddr, clients) - if err != nil { - log.Error("failed to get epoch", "err", err) - return err - } - r.epoch = epoch // get l1staking active staker set stakers, err := l1Staking.GetActiveStakers(nil) diff --git a/tx-submitter/utils/config.go b/tx-submitter/utils/config.go index 31bd9c9ea..82ade1c56 100644 --- a/tx-submitter/utils/config.go +++ b/tx-submitter/utils/config.go @@ -48,7 +48,6 @@ type Config struct { Finalize bool // L2 contract L2SequencerAddress string - L2GovAddress string // metrics MetricsServerEnable bool @@ -110,6 +109,8 @@ type Config struct { // leveldb path name LeveldbPathName string BlockNotIncreasedThreshold int64 + + RollupEpoch uint64 } // NewConfig parses the DriverConfig from the provided flags or environment variables. @@ -130,7 +131,6 @@ func NewConfig(ctx *cli.Context) (Config, error) { RollupAddress: ctx.GlobalString(flags.RollupAddressFlag.Name), // L2 contract L2SequencerAddress: ctx.GlobalString(flags.L2SequencerAddressFlag.Name), - L2GovAddress: ctx.GlobalString(flags.L2GovAddressFlag.Name), // metrics MetricsServerEnable: ctx.GlobalBool(flags.MetricsServerEnable.Name), MetricsHostname: ctx.GlobalString(flags.MetricsHostname.Name), @@ -183,6 +183,8 @@ func NewConfig(ctx *cli.Context) (Config, error) { LeveldbPathName: ctx.GlobalString(flags.LeveldbPathNameFlag.Name), // BlockNotIncreasedThreshold BlockNotIncreasedThreshold: ctx.GlobalInt64(flags.BlockNotIncreasedThreshold.Name), + + RollupEpoch: ctx.GlobalUint64(flags.RollupEpochFlag.Name), } return cfg, nil