From 9ace673588f5e12bf95c397323884dfbfde24bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Negovanovi=C4=87?= <93934272+Stefan-Ethernal@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:30:07 +0100 Subject: [PATCH] Unable to fund relayer when using rootchain originated native token (#2002) * Integrate SC changes (with SC logs) Co-authored-by: Goran Rojovic * Fix lint and e2e tests * Approve CustomSupernetManager for premine tx and remove SC logs * Add AccountPremined event * Add e2e tests * Update README.md * e2e fix * fix e2e test * Do not allow native ERC20 token to be used as reward token if it is non-mintable * e2e fix * e2e fix 2 * Code cleanup * Integrate the most recent SC changes * Update account address field when retrieving genesis set * Test_validateRewardWallet expanded * Fix address encoding when reading genesis balance * Lint fix * Update SCs * Remove stake-manager flag from supernet command * Add stake-manager back to supernet cmd and deprecation note --------- Co-authored-by: Goran Rojovic Co-authored-by: Goran Rojovic --- .github/workflows/deploy.nightly.devnet.yml | 1 - command/bridge/bridge.go | 3 + command/bridge/mint/mint_erc20.go | 150 ++++++++++ command/bridge/mint/params.go | 78 ++++++ command/genesis/params.go | 110 ++------ command/genesis/params_test.go | 84 +++--- command/genesis/polybft_params.go | 20 +- command/genesis/utils.go | 31 -- command/helper/helper.go | 37 +++ command/polybftsecrets/utils.go | 2 +- command/rootchain/deploy/deploy.go | 23 +- command/rootchain/fund/fund.go | 4 +- command/rootchain/fund/params.go | 8 +- command/rootchain/helper/utils.go | 8 + command/rootchain/premine/params.go | 94 +++++++ command/rootchain/premine/premine.go | 158 +++++++++++ command/rootchain/rootchain.go | 3 + command/rootchain/supernet/params.go | 2 +- command/rootchain/supernet/supernet.go | 121 ++++++-- consensus/polybft/README.md | 24 +- consensus/polybft/checkpoint_manager.go | 2 +- .../polybft/contractsapi/bindings-gen/main.go | 1 + .../polybft/contractsapi/contractsapi.go | 33 ++- consensus/polybft/contractsapi/gen_sc_data.go | 4 +- consensus/polybft/polybft_config.go | 80 +++++- consensus/polybft/sc_integration_test.go | 2 +- core-contracts | 2 +- docker/local/polygon-edge.sh | 1 - e2e-polybft/e2e/bridge_test.go | 265 +++++++++++++++++- e2e-polybft/e2e/burn_contract_test.go | 1 + e2e-polybft/e2e/consensus_test.go | 32 +-- e2e-polybft/e2e/migration_test.go | 1 + e2e-polybft/e2e/network_test.go | 1 + e2e-polybft/framework/test-bridge.go | 154 +++++++++- e2e-polybft/framework/test-cluster.go | 21 +- scripts/cluster | 1 - 36 files changed, 1303 insertions(+), 259 deletions(-) create mode 100644 command/bridge/mint/mint_erc20.go create mode 100644 command/bridge/mint/params.go create mode 100644 command/rootchain/premine/params.go create mode 100644 command/rootchain/premine/premine.go diff --git a/.github/workflows/deploy.nightly.devnet.yml b/.github/workflows/deploy.nightly.devnet.yml index 5d72513946..d85a45f326 100644 --- a/.github/workflows/deploy.nightly.devnet.yml +++ b/.github/workflows/deploy.nightly.devnet.yml @@ -197,7 +197,6 @@ jobs: polygon-edge polybft supernet \ --private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \ --supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') \ - --stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \ --finalize-genesis-set \ --enable-staking \ --jsonrpc {{ rootchain_json_rpc }} diff --git a/command/bridge/bridge.go b/command/bridge/bridge.go index 2fd8ef2c30..de826ac67e 100644 --- a/command/bridge/bridge.go +++ b/command/bridge/bridge.go @@ -7,6 +7,7 @@ import ( depositERC20 "github.com/0xPolygon/polygon-edge/command/bridge/deposit/erc20" depositERC721 "github.com/0xPolygon/polygon-edge/command/bridge/deposit/erc721" "github.com/0xPolygon/polygon-edge/command/bridge/exit" + "github.com/0xPolygon/polygon-edge/command/bridge/mint" withdrawERC1155 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc1155" withdrawERC20 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc20" withdrawERC721 "github.com/0xPolygon/polygon-edge/command/bridge/withdraw/erc721" @@ -40,5 +41,7 @@ func registerSubcommands(baseCmd *cobra.Command) { withdrawERC1155.GetCommand(), // bridge exit exit.GetCommand(), + // bridge mint erc-20 + mint.GetCommand(), ) } diff --git a/command/bridge/mint/mint_erc20.go b/command/bridge/mint/mint_erc20.go new file mode 100644 index 0000000000..61fb6e73ca --- /dev/null +++ b/command/bridge/mint/mint_erc20.go @@ -0,0 +1,150 @@ +package mint + +import ( + "fmt" + + "github.com/0xPolygon/polygon-edge/command" + "github.com/0xPolygon/polygon-edge/command/helper" + "github.com/0xPolygon/polygon-edge/command/polybftsecrets" + rootHelper "github.com/0xPolygon/polygon-edge/command/rootchain/helper" + "github.com/0xPolygon/polygon-edge/txrelayer" + "github.com/0xPolygon/polygon-edge/types" + "github.com/spf13/cobra" + "golang.org/x/sync/errgroup" +) + +var ( + params mintParams +) + +// GetCommand returns the rootchain fund command +func GetCommand() *cobra.Command { + mintCmd := &cobra.Command{ + Use: "mint-erc20", + Short: "Mints ERC20 tokens to specified addresses", + PreRunE: preRunCommand, + Run: runCommand, + } + + helper.RegisterJSONRPCFlag(mintCmd) + + setFlags(mintCmd) + + return mintCmd +} + +func preRunCommand(cmd *cobra.Command, _ []string) error { + params.jsonRPCAddress = helper.GetJSONRPCAddress(cmd) + + return params.validateFlags() +} + +func setFlags(cmd *cobra.Command) { + cmd.Flags().StringSliceVar( + ¶ms.addresses, + rootHelper.AddressesFlag, + nil, + "addresses to which tokens should be minted", + ) + + cmd.Flags().StringSliceVar( + ¶ms.amounts, + rootHelper.AmountsFlag, + nil, + "token amounts which should be minted to given addresses", + ) + + cmd.Flags().StringVar( + ¶ms.tokenAddr, + rootHelper.Erc20TokenFlag, + "", + "address of the erc20 token to be minted", + ) + + cmd.Flags().StringVar( + ¶ms.deployerPrivateKey, + polybftsecrets.PrivateKeyFlag, + "", + "private key of the token deployer (minter)", + ) +} + +func runCommand(cmd *cobra.Command, _ []string) { + outputter := command.InitializeOutputter(cmd) + defer outputter.WriteOutput() + + txRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithIPAddress(params.jsonRPCAddress)) + if err != nil { + outputter.SetError(fmt.Errorf("failed to initialize tx relayer: %w", err)) + + return + } + + deployerKey, err := rootHelper.DecodePrivateKey(params.deployerPrivateKey) + if err != nil { + outputter.SetError(fmt.Errorf("failed to initialize deployer private key: %w", err)) + + return + } + + g, ctx := errgroup.WithContext(cmd.Context()) + + results := make([]command.CommandResult, len(params.addresses)) + tokenAddr := types.StringToAddress(params.tokenAddr) + + for i := 0; i < len(params.addresses); i++ { + i := i + + g.Go(func() error { + select { + case <-ctx.Done(): + return ctx.Err() + + default: + // mint tokens to address + addr := types.StringToAddress(params.addresses[i]) + amount := params.amountValues[i] + + mintTxn, err := rootHelper.CreateMintTxn(addr, tokenAddr, amount, true) + if err != nil { + return fmt.Errorf("failed to create mint native tokens transaction for validator '%s'. err: %w", + addr, err) + } + + receipt, err := txRelayer.SendTransaction(mintTxn, deployerKey) + if err != nil { + return fmt.Errorf("failed to send mint native tokens transaction to validator '%s'. err: %w", addr, err) + } + + if receipt.Status == uint64(types.ReceiptFailed) { + return fmt.Errorf("failed to mint native tokens to validator '%s'", addr) + } + + results[i] = &mintResult{ + Address: addr, + Amount: amount, + TxHash: types.Hash(receipt.TransactionHash), + } + + return nil + } + }) + } + + if err := g.Wait(); err != nil { + outputter.SetError(err) + _, _ = outputter.Write([]byte("[MINT-ERC20] Successfully minted tokens to following accounts\n")) + + for _, result := range results { + if result != nil { + // In case an error happened, some of the indices may not be populated. + // Filter those out. + outputter.SetCommandResult(result) + } + } + + return + } + + outputter.SetCommandResult(command.Results(results)) +} diff --git a/command/bridge/mint/params.go b/command/bridge/mint/params.go new file mode 100644 index 0000000000..c461d51b01 --- /dev/null +++ b/command/bridge/mint/params.go @@ -0,0 +1,78 @@ +package mint + +import ( + "bytes" + "fmt" + "math/big" + + "github.com/0xPolygon/polygon-edge/command/helper" + rootHelper "github.com/0xPolygon/polygon-edge/command/rootchain/helper" + "github.com/0xPolygon/polygon-edge/types" +) + +type mintParams struct { + addresses []string + amounts []string + tokenAddr string + deployerPrivateKey string + jsonRPCAddress string + + amountValues []*big.Int +} + +func (m *mintParams) validateFlags() error { + if len(m.addresses) == 0 { + return rootHelper.ErrNoAddressesProvided + } + + if len(m.amounts) != len(m.addresses) { + return rootHelper.ErrInconsistentLength + } + + for _, addr := range m.addresses { + if err := types.IsValidAddress(addr); err != nil { + return err + } + } + + m.amountValues = make([]*big.Int, len(m.amounts)) + for i, amountRaw := range m.amounts { + amountValue, err := helper.ParseAmount(amountRaw) + if err != nil { + return err + } + + m.amountValues[i] = amountValue + } + + if m.tokenAddr == "" { + return rootHelper.ErrMandatoryERC20Token + } + + if err := types.IsValidAddress(m.tokenAddr); err != nil { + return fmt.Errorf("invalid erc20 token address is provided: %w", err) + } + + return nil +} + +type mintResult struct { + Address types.Address `json:"address"` + Amount *big.Int `json:"amount"` + TxHash types.Hash `json:"tx_hash"` +} + +func (m *mintResult) GetOutput() string { + var buffer bytes.Buffer + + vals := make([]string, 0, 3) + vals = append(vals, fmt.Sprintf("Address|%s", m.Address)) + vals = append(vals, fmt.Sprintf("Amount|%s", m.Amount)) + vals = append(vals, fmt.Sprintf("Transaction (hash)|%s", m.TxHash)) + + buffer.WriteString("\n[MINT-ERC20]\n") + buffer.WriteString(helper.FormatKV(vals)) + buffer.WriteString("\n") + + return buffer.String() +} diff --git a/command/genesis/params.go b/command/genesis/params.go index 4c55f5de8e..a0827a34c7 100644 --- a/command/genesis/params.go +++ b/command/genesis/params.go @@ -3,10 +3,8 @@ package genesis import ( "errors" "fmt" - "math" "math/big" "os" - "strconv" "strings" "time" @@ -41,11 +39,6 @@ const ( rewardWalletFlag = "reward-wallet" blockTrackerPollIntervalFlag = "block-tracker-poll-interval" proxyContractsAdminFlag = "proxy-contracts-admin" - - defaultNativeTokenName = "Polygon" - defaultNativeTokenSymbol = "MATIC" - defaultNativeTokenDecimals = uint8(18) - minNativeTokenParamsNumber = 4 ) // Legacy flags that need to be preserved for running clients @@ -58,17 +51,19 @@ var ( ) var ( - errValidatorsNotSpecified = errors.New("validator information not specified") - errUnsupportedConsensus = errors.New("specified consensusRaw not supported") - errInvalidEpochSize = errors.New("epoch size must be greater than 1") - errInvalidTokenParams = errors.New("native token params were not submitted in proper format " + - "()") + errValidatorsNotSpecified = errors.New("validator information not specified") + errUnsupportedConsensus = errors.New("specified consensusRaw not supported") + errInvalidEpochSize = errors.New("epoch size must be greater than 1") errRewardWalletAmountZero = errors.New("reward wallet amount can not be zero or negative") errReserveAccMustBePremined = errors.New("it is mandatory to premine reserve account (0x0 address)") errBlockTrackerPollInterval = errors.New("block tracker poll interval must be greater than 0") errBaseFeeChangeDenomZero = errors.New("base fee change denominator must be greater than 0") errBaseFeeEMZero = errors.New("base fee elasticity multiplier must be greater than 0") errBaseFeeZero = errors.New("base fee must be greater than 0") + errRewardWalletNotDefined = errors.New("reward wallet address must be defined") + errRewardTokenOnNonMintable = errors.New("a custom reward token must be defined when " + + "native ERC20 token is non-mintable") + errRewardWalletZero = errors.New("reward wallet address must not be zero address") ) type genesisParams struct { @@ -132,7 +127,7 @@ type genesisParams struct { nativeTokenConfigRaw string nativeTokenConfig *polybft.TokenConfig - premineInfos []*premineInfo + premineInfos []*helper.PremineInfo // rewards rewardTokenCode string @@ -173,7 +168,7 @@ func (p *genesisParams) validateFlags() error { return err } - if err := p.validateRewardWallet(); err != nil { + if err := p.validateRewardWalletAndToken(); err != nil { return err } @@ -451,8 +446,8 @@ func (p *genesisParams) initGenesisConfig() error { } for _, premineInfo := range p.premineInfos { - chainConfig.Genesis.Alloc[premineInfo.address] = &chain.GenesisAccount{ - Balance: premineInfo.amount, + chainConfig.Genesis.Alloc[premineInfo.Address] = &chain.GenesisAccount{ + Balance: premineInfo.Amount, } } @@ -481,23 +476,27 @@ func (p *genesisParams) predeployStakingSC() (*chain.GenesisAccount, error) { return stakingAccount, nil } -// validateRewardWallet validates reward wallet flag -func (p *genesisParams) validateRewardWallet() error { +// validateRewardWalletAndToken validates reward wallet flag +func (p *genesisParams) validateRewardWalletAndToken() error { if p.rewardWallet == "" { - return errors.New("reward wallet address must be defined") + return errRewardWalletNotDefined + } + + if !p.nativeTokenConfig.IsMintable && p.rewardTokenCode == "" { + return errRewardTokenOnNonMintable } - premineInfo, err := parsePremineInfo(p.rewardWallet) + premineInfo, err := helper.ParsePremineInfo(p.rewardWallet) if err != nil { return err } - if premineInfo.address == types.ZeroAddress { - return errors.New("reward wallet address must not be zero address") + if premineInfo.Address == types.ZeroAddress { + return errRewardWalletZero } // If epoch rewards are enabled, reward wallet must have some amount of premine - if p.epochReward > 0 && premineInfo.amount.Cmp(big.NewInt(0)) < 1 { + if p.epochReward > 0 && premineInfo.Amount.Cmp(big.NewInt(0)) < 1 { return errRewardWalletAmountZero } @@ -506,10 +505,10 @@ func (p *genesisParams) validateRewardWallet() error { // parsePremineInfo parses premine flag func (p *genesisParams) parsePremineInfo() error { - p.premineInfos = make([]*premineInfo, 0, len(p.premine)) + p.premineInfos = make([]*helper.PremineInfo, 0, len(p.premine)) for _, premine := range p.premine { - premineInfo, err := parsePremineInfo(premine) + premineInfo, err := helper.ParsePremineInfo(premine) if err != nil { return fmt.Errorf("invalid premine balance amount provided: %w", err) } @@ -523,7 +522,7 @@ func (p *genesisParams) parsePremineInfo() error { // validatePremineInfo validates whether reserve account (0x0 address) is premined func (p *genesisParams) validatePremineInfo() error { for _, premineInfo := range p.premineInfos { - if premineInfo.address == types.ZeroAddress { + if premineInfo.Address == types.ZeroAddress { // we have premine of zero address, just return return nil } @@ -617,65 +616,12 @@ func (p *genesisParams) isBurnContractEnabled() bool { // extractNativeTokenMetadata parses provided native token metadata (such as name, symbol and decimals count) func (p *genesisParams) extractNativeTokenMetadata() error { - if p.nativeTokenConfigRaw == "" { - p.nativeTokenConfig = &polybft.TokenConfig{ - Name: defaultNativeTokenName, - Symbol: defaultNativeTokenSymbol, - Decimals: defaultNativeTokenDecimals, - IsMintable: false, - Owner: types.ZeroAddress, - } - - return nil - } - - params := strings.Split(p.nativeTokenConfigRaw, ":") - if len(params) < minNativeTokenParamsNumber { - return errInvalidTokenParams - } - - // name - name := strings.TrimSpace(params[0]) - if name == "" { - return errInvalidTokenParams - } - - // symbol - symbol := strings.TrimSpace(params[1]) - if symbol == "" { - return errInvalidTokenParams - } - - // decimals - decimals, err := strconv.ParseUint(strings.TrimSpace(params[2]), 10, 8) - if err != nil || decimals > math.MaxUint8 { - return errInvalidTokenParams - } - - // is mintable native token used - isMintable, err := strconv.ParseBool(strings.TrimSpace(params[3])) + tokenConfig, err := polybft.ParseRawTokenConfig(p.nativeTokenConfigRaw) if err != nil { - return errInvalidTokenParams - } - - // in case it is mintable native token, it is expected to have 5 parameters provided - if isMintable && len(params) != minNativeTokenParamsNumber+1 { - return errInvalidTokenParams - } - - // owner address - owner := types.ZeroAddress - if isMintable { - owner = types.StringToAddress(strings.TrimSpace(params[4])) + return err } - p.nativeTokenConfig = &polybft.TokenConfig{ - Name: name, - Symbol: symbol, - Decimals: uint8(decimals), - IsMintable: isMintable, - Owner: owner, - } + p.nativeTokenConfig = tokenConfig return nil } diff --git a/command/genesis/params_test.go b/command/genesis/params_test.go index a39523caec..cce50d0d03 100644 --- a/command/genesis/params_test.go +++ b/command/genesis/params_test.go @@ -8,6 +8,7 @@ import ( "github.com/umbracle/ethgo" "github.com/0xPolygon/polygon-edge/command" + "github.com/0xPolygon/polygon-edge/command/helper" "github.com/0xPolygon/polygon-edge/consensus/polybft" "github.com/0xPolygon/polygon-edge/types" ) @@ -22,16 +23,10 @@ func Test_extractNativeTokenMetadata(t *testing.T) { expectErr bool }{ { - name: "default token config", - rawConfig: "", - expectedCfg: &polybft.TokenConfig{ - Name: defaultNativeTokenName, - Symbol: defaultNativeTokenSymbol, - Decimals: defaultNativeTokenDecimals, - IsMintable: false, - Owner: types.ZeroAddress, - }, - expectErr: false, + name: "default token config", + rawConfig: "", + expectedCfg: polybft.DefaultTokenConfig, + expectErr: false, }, { name: "not enough params provided", @@ -126,21 +121,21 @@ func Test_validatePremineInfo(t *testing.T) { cases := []struct { name string premineRaw []string - expectedPremines []*premineInfo + expectedPremines []*helper.PremineInfo expectValidateErrMsg string expectedParseErrMsg string }{ { name: "invalid premine balance", premineRaw: []string{"0x12345:loremIpsum"}, - expectedPremines: []*premineInfo{}, + expectedPremines: []*helper.PremineInfo{}, expectedParseErrMsg: "invalid premine balance amount provided", }, { name: "missing zero address premine", premineRaw: []string{types.StringToAddress("12").String()}, - expectedPremines: []*premineInfo{ - {address: types.StringToAddress("12"), amount: command.DefaultPremineBalance}, + expectedPremines: []*helper.PremineInfo{ + {Address: types.StringToAddress("12"), Amount: command.DefaultPremineBalance}, }, expectValidateErrMsg: errReserveAccMustBePremined.Error(), }, @@ -150,9 +145,9 @@ func Test_validatePremineInfo(t *testing.T) { fmt.Sprintf("%s:%d", types.StringToAddress("1"), ethgo.Ether(10)), fmt.Sprintf("%s:%d", types.ZeroAddress, ethgo.Ether(10000)), }, - expectedPremines: []*premineInfo{ - {address: types.StringToAddress("1"), amount: ethgo.Ether(10)}, - {address: types.ZeroAddress, amount: ethgo.Ether(10000)}, + expectedPremines: []*helper.PremineInfo{ + {Address: types.StringToAddress("1"), Amount: ethgo.Ether(10)}, + {Address: types.ZeroAddress, Amount: ethgo.Ether(10000)}, }, expectValidateErrMsg: "", }, @@ -190,22 +185,46 @@ func Test_validateRewardWallet(t *testing.T) { t.Parallel() cases := []struct { - name string - rewardWallet string - epochReward uint64 - expectValidateErr error + name string + rewardWallet string + epochReward uint64 + isNativeERC20Mintable bool + expectValidateErr error }{ { - name: "invalid reward wallet: no premine + reward", - rewardWallet: types.StringToAddress("1").String() + ":0", - epochReward: 10, - expectValidateErr: errRewardWalletAmountZero, + name: "invalid reward wallet: no premine + reward", + rewardWallet: types.StringToAddress("1").String() + ":0", + epochReward: 10, + isNativeERC20Mintable: true, + expectValidateErr: errRewardWalletAmountZero, + }, + { + name: "invalid reward wallet: reward wallet not defined", + rewardWallet: "", + epochReward: 10, + isNativeERC20Mintable: true, + expectValidateErr: errRewardWalletNotDefined, + }, + { + name: "invalid reward wallet: reward wallet is zero", + rewardWallet: types.ZeroAddress.String() + ":0", + epochReward: 10, + isNativeERC20Mintable: true, + expectValidateErr: errRewardWalletZero, + }, + { + name: "valid reward wallet: no premine + no reward", + rewardWallet: types.StringToAddress("1").String() + ":0", + epochReward: 0, + isNativeERC20Mintable: true, + expectValidateErr: nil, }, { - name: "valid reward wallet: no premine + no reward", - rewardWallet: types.StringToAddress("1").String() + ":0", - epochReward: 0, - expectValidateErr: nil, + name: "valid reward wallet: native ERC20 mintable", + rewardWallet: types.StringToAddress("1").String() + ":0", + epochReward: 0, + isNativeERC20Mintable: false, + expectValidateErr: errRewardTokenOnNonMintable, }, } for _, c := range cases { @@ -214,10 +233,11 @@ func Test_validateRewardWallet(t *testing.T) { t.Parallel() p := &genesisParams{ - rewardWallet: c.rewardWallet, - epochReward: c.epochReward, + rewardWallet: c.rewardWallet, + epochReward: c.epochReward, + nativeTokenConfig: &polybft.TokenConfig{IsMintable: c.isNativeERC20Mintable}, } - err := p.validateRewardWallet() + err := p.validateRewardWalletAndToken() require.ErrorIs(t, err, c.expectValidateErr) }) } diff --git a/command/genesis/polybft_params.go b/command/genesis/polybft_params.go index a71388405e..fc4590862e 100644 --- a/command/genesis/polybft_params.go +++ b/command/genesis/polybft_params.go @@ -72,13 +72,13 @@ type contractInfo struct { // generatePolyBftChainConfig creates and persists polybft chain configuration to the provided file path func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) error { // populate premine balance map - premineBalances := make(map[types.Address]*premineInfo, len(p.premine)) + premineBalances := make(map[types.Address]*helper.PremineInfo, len(p.premine)) for _, premine := range p.premineInfos { - premineBalances[premine.address] = premine + premineBalances[premine.Address] = premine } - walletPremineInfo, err := parsePremineInfo(p.rewardWallet) + walletPremineInfo, err := helper.ParsePremineInfo(p.rewardWallet) if err != nil { return fmt.Errorf("invalid reward wallet configuration provided '%s' : %w", p.rewardWallet, err) } @@ -87,7 +87,7 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er // validate premine map, no premine is allowed if token is not mintable, // except for the reward wallet (if native token is used as reward token) and zero address for a := range premineBalances { - if a != types.ZeroAddress && (p.rewardTokenCode != "" || a != walletPremineInfo.address) { + if a != types.ZeroAddress && (p.rewardTokenCode != "" || a != walletPremineInfo.Address) { return errNoPremineAllowed } } @@ -102,7 +102,7 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er // native token is used as a reward token, and reward wallet is not a zero address if p.epochReward > 0 { // epoch reward is non zero so premine reward wallet - premineBalances[walletPremineInfo.address] = walletPremineInfo + premineBalances[walletPremineInfo.Address] = walletPremineInfo } } else { bytes, err := hex.DecodeString(p.rewardTokenCode) @@ -147,8 +147,8 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er MaxValidatorSetSize: p.maxNumValidators, RewardConfig: &polybft.RewardsConfig{ TokenAddress: rewardTokenAddr, - WalletAddress: walletPremineInfo.address, - WalletAmount: walletPremineInfo.amount, + WalletAddress: walletPremineInfo.Address, + WalletAmount: walletPremineInfo.Amount, }, BlockTimeDrift: p.blockTimeDrift, BlockTrackerPollInterval: common.Duration{Duration: p.blockTrackerPollInterval}, @@ -203,12 +203,12 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er // premine other accounts for _, premine := range premineBalances { // validators have already been premined, so no need to premine them again - if _, ok := allocs[premine.address]; ok { + if _, ok := allocs[premine.Address]; ok { continue } - allocs[premine.address] = &chain.GenesisAccount{ - Balance: premine.amount, + allocs[premine.Address] = &chain.GenesisAccount{ + Balance: premine.Amount, } } diff --git a/command/genesis/utils.go b/command/genesis/utils.go index 47f3bf81cf..76b9f0cbeb 100644 --- a/command/genesis/utils.go +++ b/command/genesis/utils.go @@ -65,37 +65,6 @@ func verifyGenesisExistence(genesisPath string) *GenesisGenError { return nil } -type premineInfo struct { - address types.Address - amount *big.Int -} - -// parsePremineInfo parses provided premine information and returns premine address and amount -func parsePremineInfo(premineInfoRaw string) (*premineInfo, error) { - var ( - address types.Address - amount = command.DefaultPremineBalance - err error - ) - - if delimiterIdx := strings.Index(premineInfoRaw, ":"); delimiterIdx != -1 { - // : - valueRaw := premineInfoRaw[delimiterIdx+1:] - - amount, err = common.ParseUint256orHex(&valueRaw) - if err != nil { - return nil, fmt.Errorf("failed to parse amount %s: %w", valueRaw, err) - } - - address = types.StringToAddress(premineInfoRaw[:delimiterIdx]) - } else { - // - address = types.StringToAddress(premineInfoRaw) - } - - return &premineInfo{address: address, amount: amount}, nil -} - // parseTrackerStartBlocks parses provided event tracker start blocks configuration. // It is set in a following format: :. // In case smart contract address isn't provided in the string, it is assumed its starting block is 0 implicitly. diff --git a/command/helper/helper.go b/command/helper/helper.go index b934dbd2d4..6c83432403 100644 --- a/command/helper/helper.go +++ b/command/helper/helper.go @@ -7,6 +7,7 @@ import ( "math/big" "net" "net/url" + "strings" "time" "github.com/0xPolygon/polygon-edge/chain" @@ -276,3 +277,39 @@ func ValidateProxyContractsAdmin(proxyContractsAdmin string) error { return nil } + +type PremineInfo struct { + Address types.Address + Amount *big.Int + Key string // only used for tests +} + +// parsePremineInfo parses provided premine information and returns premine address and amount +func ParsePremineInfo(premineInfoRaw string) (*PremineInfo, error) { + var ( + address types.Address + amount = command.DefaultPremineBalance + key string + err error + ) + + parts := strings.Split(premineInfoRaw, ":") + + if len(parts) > 1 { // : + amount, err = common.ParseUint256orHex(&parts[1]) + if err != nil { + return nil, fmt.Errorf("failed to parse amount %s: %w", parts[1], err) + } + + address = types.StringToAddress(parts[0]) + + if len(parts) == 3 { // :: + key = parts[2] + } + } else { + // + address = types.StringToAddress(premineInfoRaw) + } + + return &PremineInfo{Address: address, Amount: amount, Key: key}, nil +} diff --git a/command/polybftsecrets/utils.go b/command/polybftsecrets/utils.go index 655f9b9e87..e9e254dec1 100644 --- a/command/polybftsecrets/utils.go +++ b/command/polybftsecrets/utils.go @@ -17,7 +17,7 @@ const ( AccountDirFlagDesc = "the directory for the Polygon Edge data if the local FS is used" AccountConfigFlagDesc = "the path to the SecretsManager config file, if omitted, the local FS secrets manager is used" - PrivateKeyFlagDesc = "hex-encoded private key of the account which executes rootchain commands" + PrivateKeyFlagDesc = "hex-encoded private key of the account which executes command" ChainIDFlagDesc = "ID of child chain" ) diff --git a/command/rootchain/deploy/deploy.go b/command/rootchain/deploy/deploy.go index 3d5b16e9e0..4aef877289 100644 --- a/command/rootchain/deploy/deploy.go +++ b/command/rootchain/deploy/deploy.go @@ -119,13 +119,14 @@ var ( config *polybft.RootchainConfig, key ethgo.Key) error { initParams := &contractsapi.InitializeCustomSupernetManagerFn{ - NewStakeManager: config.StakeManagerAddress, - NewBls: config.BLSAddress, - NewStateSender: config.StateSenderAddress, - NewMatic: types.StringToAddress(params.stakeTokenAddr), - NewChildValidatorSet: contracts.ValidatorSetContract, - NewExitHelper: config.ExitHelperAddress, - NewDomain: signer.DomainValidatorSetString, + NewStakeManager: config.StakeManagerAddress, + NewBls: config.BLSAddress, + NewStateSender: config.StateSenderAddress, + NewMatic: types.StringToAddress(params.stakeTokenAddr), + NewChildValidatorSet: contracts.ValidatorSetContract, + NewExitHelper: config.ExitHelperAddress, + NewDomain: signer.DomainValidatorSetString, + NewRootERC20Predicate: config.RootERC20PredicateAddress, } return initContract(fmt, relayer, initParams, @@ -145,18 +146,14 @@ var ( relayer txrelayer.TxRelayer, config *polybft.RootchainConfig, key ethgo.Key) error { - // map root native token on rootchain only if it is non-mintable on a childchain - nativeTokenRootAddr := types.ZeroAddress - if !consensusCfg.NativeTokenConfig.IsMintable { - nativeTokenRootAddr = config.RootNativeERC20Address - } inputParams := &contractsapi.InitializeRootERC20PredicateFn{ NewStateSender: config.StateSenderAddress, NewExitHelper: config.ExitHelperAddress, NewChildERC20Predicate: contracts.ChildERC20PredicateContract, NewChildTokenTemplate: contracts.ChildERC20Contract, - NativeTokenRootAddress: nativeTokenRootAddr, + // map root native token address should be non-zero only if native token is non-mintable on a childchain + NewNativeTokenRoot: config.RootNativeERC20Address, } return initContract(fmt, relayer, inputParams, diff --git a/command/rootchain/fund/fund.go b/command/rootchain/fund/fund.go index 03238494d3..1aa16c84fe 100644 --- a/command/rootchain/fund/fund.go +++ b/command/rootchain/fund/fund.go @@ -35,14 +35,14 @@ func GetCommand() *cobra.Command { func setFlags(cmd *cobra.Command) { cmd.Flags().StringSliceVar( ¶ms.addresses, - addressesFlag, + helper.AddressesFlag, nil, "validator addresses", ) cmd.Flags().StringSliceVar( ¶ms.amounts, - amountsFlag, + helper.AmountsFlag, nil, "token amounts which is funded to validator on a root chain", ) diff --git a/command/rootchain/fund/params.go b/command/rootchain/fund/params.go index 8493b059e6..55885910c3 100644 --- a/command/rootchain/fund/params.go +++ b/command/rootchain/fund/params.go @@ -11,15 +11,13 @@ import ( ) const ( - addressesFlag = "addresses" - amountsFlag = "amounts" jsonRPCFlag = "json-rpc" mintStakeTokenFlag = "mint" ) var ( errNoAddressesProvided = errors.New("no addresses provided") - errInconsistentLength = errors.New("validator addresses and amounts must be equal length") + errInconsistentLength = errors.New("addresses and amounts must be equal length") ) type fundParams struct { @@ -35,11 +33,11 @@ type fundParams struct { func (fp *fundParams) validateFlags() error { if len(fp.addresses) == 0 { - return errNoAddressesProvided + return rootHelper.ErrNoAddressesProvided } if len(fp.amounts) != len(fp.addresses) { - return errInconsistentLength + return rootHelper.ErrInconsistentLength } for _, addr := range fp.addresses { diff --git a/command/rootchain/helper/utils.go b/command/rootchain/helper/utils.go index 3c9ab40057..6654624a88 100644 --- a/command/rootchain/helper/utils.go +++ b/command/rootchain/helper/utils.go @@ -39,6 +39,9 @@ const ( StakeTokenFlagDesc = "address of ERC20 token used for staking on rootchain" ProxyContractsAdminFlag = "proxy-contracts-admin" ProxyContractsAdminDesc = "admin for proxy contracts" + AddressesFlag = "addresses" + AmountsFlag = "amounts" + Erc20TokenFlag = "erc20-token" //nolint:gosec ) var ( @@ -47,6 +50,11 @@ var ( ErrMandatoryStakeToken = errors.New("stake token address is mandatory") errTestModeSecrets = errors.New("rootchain test mode does not imply specifying secrets parameters") + ErrNoAddressesProvided = errors.New("no addresses provided") + ErrInconsistentLength = errors.New("addresses and amounts must be equal length") + + ErrMandatoryERC20Token = errors.New("erc20 token address is mandatory") + rootchainAccountKey *wallet.Key ) diff --git a/command/rootchain/premine/params.go b/command/rootchain/premine/params.go new file mode 100644 index 0000000000..30bca7d95c --- /dev/null +++ b/command/rootchain/premine/params.go @@ -0,0 +1,94 @@ +package premine + +import ( + "bytes" + "errors" + "fmt" + "math/big" + + "github.com/0xPolygon/polygon-edge/command/helper" + rootHelper "github.com/0xPolygon/polygon-edge/command/rootchain/helper" + sidechainHelper "github.com/0xPolygon/polygon-edge/command/sidechain" + "github.com/0xPolygon/polygon-edge/types" +) + +var ( + errMandatorySupernetManagerAddr = errors.New("custom supernet manager address not defined") + errMandatoryRootPredicateAddr = errors.New("root erc20 predicate address not defined") +) + +const rootERC20PredicateFlag = "root-erc20-predicate" + +type premineParams struct { + accountDir string + accountConfig string + privateKey string + customSupernetManager string + rootERC20Predicate string + nativeTokenRoot string + jsonRPC string + amount string + + amountValue *big.Int +} + +func (p *premineParams) validateFlags() (err error) { + if p.nativeTokenRoot == "" { + return rootHelper.ErrMandatoryERC20Token + } + + if err := types.IsValidAddress(p.nativeTokenRoot); err != nil { + return fmt.Errorf("invalid erc20 token address is provided: %w", err) + } + + if p.customSupernetManager == "" { + return errMandatorySupernetManagerAddr + } + + if err := types.IsValidAddress(p.customSupernetManager); err != nil { + return fmt.Errorf("invalid supernet manager address is provided: %w", err) + } + + if p.rootERC20Predicate == "" { + return errMandatoryRootPredicateAddr + } + + if err := types.IsValidAddress(p.rootERC20Predicate); err != nil { + return fmt.Errorf("invalid root erc20 predicate address is provided: %w", err) + } + + if p.amountValue, err = helper.ParseAmount(p.amount); err != nil { + return err + } + + // validate jsonrpc address + if _, err := helper.ParseJSONRPCAddress(p.jsonRPC); err != nil { + return fmt.Errorf("failed to parse json rpc address. Error: %w", err) + } + + if p.privateKey == "" { + return sidechainHelper.ValidateSecretFlags(p.accountDir, p.accountConfig) + } + + return nil +} + +type premineResult struct { + Address string `json:"address"` + Amount *big.Int `json:"amount"` +} + +func (p premineResult) GetOutput() string { + var buffer bytes.Buffer + + buffer.WriteString("\n[NATIVE ROOT TOKEN PREMINE]\n") + + vals := make([]string, 0, 2) + vals = append(vals, fmt.Sprintf("Address|%s", p.Address)) + vals = append(vals, fmt.Sprintf("Amount Premined|%d", p.Amount)) + + buffer.WriteString(helper.FormatKV(vals)) + buffer.WriteString("\n") + + return buffer.String() +} diff --git a/command/rootchain/premine/premine.go b/command/rootchain/premine/premine.go new file mode 100644 index 0000000000..02cd564f51 --- /dev/null +++ b/command/rootchain/premine/premine.go @@ -0,0 +1,158 @@ +package premine + +import ( + "fmt" + "time" + + "github.com/0xPolygon/polygon-edge/command" + "github.com/0xPolygon/polygon-edge/command/helper" + "github.com/0xPolygon/polygon-edge/command/polybftsecrets" + rootHelper "github.com/0xPolygon/polygon-edge/command/rootchain/helper" + sidechainHelper "github.com/0xPolygon/polygon-edge/command/sidechain" + "github.com/0xPolygon/polygon-edge/consensus/polybft/contractsapi" + "github.com/0xPolygon/polygon-edge/txrelayer" + "github.com/0xPolygon/polygon-edge/types" + "github.com/spf13/cobra" + "github.com/umbracle/ethgo" +) + +var ( + params premineParams +) + +func GetCommand() *cobra.Command { + premineCmd := &cobra.Command{ + Use: "premine", + Short: "Premine native root token to the caller, which determines genesis balances. " + + "This command is used in case Supernets native token is rootchain originated.", + PreRunE: runPreRun, + RunE: runCommand, + } + + helper.RegisterJSONRPCFlag(premineCmd) + setFlags(premineCmd) + + return premineCmd +} + +func setFlags(cmd *cobra.Command) { + cmd.Flags().StringVar( + ¶ms.accountDir, + polybftsecrets.AccountDirFlag, + "", + polybftsecrets.AccountDirFlagDesc, + ) + + cmd.Flags().StringVar( + ¶ms.accountConfig, + polybftsecrets.AccountConfigFlag, + "", + polybftsecrets.AccountConfigFlagDesc, + ) + + cmd.Flags().StringVar( + ¶ms.privateKey, + polybftsecrets.PrivateKeyFlag, + "", + polybftsecrets.PrivateKeyFlagDesc, + ) + + cmd.Flags().StringVar( + ¶ms.customSupernetManager, + rootHelper.SupernetManagerFlag, + "", + rootHelper.SupernetManagerFlagDesc, + ) + + cmd.Flags().StringVar( + ¶ms.nativeTokenRoot, + rootHelper.Erc20TokenFlag, + "", + "address of root erc20 native token", + ) + + cmd.Flags().StringVar( + ¶ms.rootERC20Predicate, + rootERC20PredicateFlag, + "", + "address of root erc20 predicate", + ) + + cmd.Flags().StringVar( + ¶ms.amount, + sidechainHelper.AmountFlag, + "", + "amount to premine", + ) + + cmd.MarkFlagsMutuallyExclusive(polybftsecrets.AccountDirFlag, polybftsecrets.AccountConfigFlag) + cmd.MarkFlagsMutuallyExclusive(polybftsecrets.PrivateKeyFlag, polybftsecrets.AccountConfigFlag) + cmd.MarkFlagsMutuallyExclusive(polybftsecrets.PrivateKeyFlag, polybftsecrets.AccountDirFlag) +} + +func runPreRun(cmd *cobra.Command, _ []string) error { + params.jsonRPC = helper.GetJSONRPCAddress(cmd) + + return params.validateFlags() +} + +func runCommand(cmd *cobra.Command, _ []string) error { + outputter := command.InitializeOutputter(cmd) + defer outputter.WriteOutput() + + ownerKey, err := rootHelper.GetECDSAKey(params.privateKey, params.accountDir, params.accountConfig) + if err != nil { + return err + } + + txRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithIPAddress(params.jsonRPC), + txrelayer.WithReceiptTimeout(150*time.Millisecond)) + if err != nil { + return err + } + + approveTxn, err := rootHelper.CreateApproveERC20Txn( + params.amountValue, + types.StringToAddress(params.customSupernetManager), + types.StringToAddress(params.nativeTokenRoot), true) + if err != nil { + return err + } + + receipt, err := txRelayer.SendTransaction(approveTxn, ownerKey) + if err != nil { + return err + } + + if receipt == nil || receipt.Status == uint64(types.ReceiptFailed) { + return fmt.Errorf("approve transaction failed on block %d", receipt.BlockNumber) + } + + premineFn := &contractsapi.AddGenesisBalanceCustomSupernetManagerFn{ + Amount: params.amountValue, + } + + premineInput, err := premineFn.EncodeAbi() + if err != nil { + return err + } + + supernetManagerAddr := ethgo.Address(types.StringToAddress(params.customSupernetManager)) + txn := rootHelper.CreateTransaction(ownerKey.Address(), &supernetManagerAddr, premineInput, nil, true) + + receipt, err = txRelayer.SendTransaction(txn, ownerKey) + if err != nil { + return err + } + + if receipt == nil || receipt.Status == uint64(types.ReceiptFailed) { + return fmt.Errorf("premine transaction failed on block %d", receipt.BlockNumber) + } + + outputter.WriteCommandResult(&premineResult{ + Address: ownerKey.Address().String(), + Amount: params.amountValue, + }) + + return nil +} diff --git a/command/rootchain/rootchain.go b/command/rootchain/rootchain.go index c49a8fcd73..8832ea0149 100644 --- a/command/rootchain/rootchain.go +++ b/command/rootchain/rootchain.go @@ -5,6 +5,7 @@ import ( "github.com/0xPolygon/polygon-edge/command/rootchain/deploy" "github.com/0xPolygon/polygon-edge/command/rootchain/fund" + "github.com/0xPolygon/polygon-edge/command/rootchain/premine" "github.com/0xPolygon/polygon-edge/command/rootchain/server" ) @@ -22,6 +23,8 @@ func GetCommand() *cobra.Command { deploy.GetCommand(), // rootchain fund fund.GetCommand(), + // rootchain premine + premine.GetCommand(), ) return rootchainCmd diff --git a/command/rootchain/supernet/params.go b/command/rootchain/supernet/params.go index 98c622e82d..a43ba94d22 100644 --- a/command/rootchain/supernet/params.go +++ b/command/rootchain/supernet/params.go @@ -20,8 +20,8 @@ type supernetParams struct { privateKey string jsonRPC string supernetManagerAddress string - stakeManagerAddress string genesisPath string + stakeManagerAddress string finalizeGenesisSet bool enableStaking bool } diff --git a/command/rootchain/supernet/supernet.go b/command/rootchain/supernet/supernet.go index 62fd77f3aa..41b2c5e09f 100644 --- a/command/rootchain/supernet/supernet.go +++ b/command/rootchain/supernet/supernet.go @@ -1,10 +1,14 @@ package supernet import ( + "errors" "fmt" "math/big" "strings" + "github.com/spf13/cobra" + "github.com/umbracle/ethgo" + "github.com/0xPolygon/polygon-edge/chain" "github.com/0xPolygon/polygon-edge/command" "github.com/0xPolygon/polygon-edge/command/genesis" @@ -15,13 +19,16 @@ import ( "github.com/0xPolygon/polygon-edge/consensus/polybft/contractsapi" "github.com/0xPolygon/polygon-edge/consensus/polybft/validator" "github.com/0xPolygon/polygon-edge/helper/common" + "github.com/0xPolygon/polygon-edge/helper/hex" "github.com/0xPolygon/polygon-edge/txrelayer" "github.com/0xPolygon/polygon-edge/types" - "github.com/spf13/cobra" - "github.com/umbracle/ethgo" ) -var params supernetParams +var ( + params supernetParams + genesisSetABIFn = contractsapi.CustomSupernetManager.Abi.Methods["genesisSet"] + genesisBalancesABIFn = contractsapi.CustomSupernetManager.Abi.Methods["genesisBalances"] +) func GetCommand() *cobra.Command { registerCmd := &cobra.Command{ @@ -82,7 +89,7 @@ func setFlags(cmd *cobra.Command) { ¶ms.stakeManagerAddress, rootHelper.StakeManagerFlag, "", - rootHelper.StakeManagerFlagDesc, + fmt.Sprintf("[DEPRECATED] %s", rootHelper.StakeManagerFlagDesc), ) cmd.Flags().BoolVar( @@ -153,21 +160,60 @@ func runCommand(cmd *cobra.Command, _ []string) error { return fmt.Errorf("failed to retrieve consensus configuration: %w", err) } - stakeManager := types.StringToAddress(params.stakeManagerAddress) - callerAddr := types.Address(ownerKey.Address()) - validatorMetadata := make([]*validator.ValidatorMetadata, len(consensusConfig.InitialValidatorSet)) + genesisSetInput, err := genesisSetABIFn.Encode([]interface{}{}) + if err != nil { + return fmt.Errorf("failed to encode genesis set input: %w", err) + } + + genesisSetHexOut, err := txRelayer.Call(ethgo.ZeroAddress, supernetAddr, genesisSetInput) + if err != nil { + return fmt.Errorf("failed to retrieve genesis set: %w", err) + } + + genesisAccounts, err := decodeGenesisAccounts(genesisSetHexOut) + if err != nil { + return err + } + + genesisAccsMap := make(map[types.Address]*validator.GenesisValidator, len(genesisAccounts)) + + for _, genesisAcc := range genesisAccounts { + genesisBalanceInput, err := genesisBalancesABIFn.Encode([]interface{}{genesisAcc.Address}) + if err != nil { + return err + } + + genesisBalanceRaw, err := txRelayer.Call(ethgo.ZeroAddress, supernetAddr, genesisBalanceInput) + if err != nil { + return err + } + + genesisBalance, err := common.ParseUint256orHex(&genesisBalanceRaw) + if err != nil { + return fmt.Errorf("failed to convert genesis balance '%s' to number: %w", + genesisBalanceRaw, err) + } + + genesisAccsMap[genesisAcc.Address] = genesisAcc + + if genesisBalance.Sign() > 0 { + // premine genesis accounts + chainConfig.Genesis.Alloc[genesisAcc.Address] = + &chain.GenesisAccount{Balance: genesisBalance} + } + } + // update Stake field of validators in genesis file // based on their finalized stake on rootchain for i, v := range consensusConfig.InitialValidatorSet { - finalizedStake, err := getFinalizedStake(callerAddr, v.Address, stakeManager, - consensusConfig.SupernetID, txRelayer) - if err != nil { - return fmt.Errorf("could not get finalized stake for validator: %v. Error: %w", v.Address, err) + genesisAcc, exists := genesisAccsMap[v.Address] + if !exists { + return fmt.Errorf("validator with address %s not found among genesis accounts", v.Address) } - v.Stake = finalizedStake + v.Stake = genesisAcc.Stake metadata, err := v.ToValidatorMetadata() if err != nil { @@ -227,25 +273,54 @@ func runCommand(cmd *cobra.Command, _ []string) error { return nil } -// geFinalizedStake returns finalized stake of given validator for given supernet on StakeManager -func getFinalizedStake(owner, validator, stakeManager types.Address, chainID int64, - txRelayer txrelayer.TxRelayer) (*big.Int, error) { - stakeOfFn := &contractsapi.StakeOfStakeManagerFn{ - Validator: validator, - ID: new(big.Int).SetInt64(chainID), +// decodeGenesisAccounts decodes genesis set retrieved from CustomSupernetManager contract +func decodeGenesisAccounts(genesisSetRaw string) ([]*validator.GenesisValidator, error) { + decodeAccount := func(rawAccount map[string]interface{}) (*validator.GenesisValidator, error) { + addr, ok := rawAccount["addr"].(ethgo.Address) + if !ok { + return nil, errors.New("failed to retrieve genesis account address") + } + + stake, ok := rawAccount["initialStake"].(*big.Int) + if !ok { + return nil, errors.New("failed to retrieve genesis account stake") + } + + return &validator.GenesisValidator{ + Address: types.Address(addr), + Stake: stake, + }, nil } - encode, err := stakeOfFn.EncodeAbi() + genesisSetRawOut, err := hex.DecodeHex(genesisSetRaw) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to decode genesis set from hex format: %w", err) } - response, err := txRelayer.Call(ethgo.Address(owner), ethgo.Address(stakeManager), encode) + decodedGenesisSet, err := genesisSetABIFn.Outputs.Decode(genesisSetRawOut) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to decode genesis set from raw format: %w", err) + } + + decodedGenesisSetMap, ok := decodedGenesisSet.(map[string]interface{}) + if !ok { + return nil, errors.New("failed to convert genesis set to map") + } + + decodedGenesisSetSliceMap, ok := decodedGenesisSetMap["0"].([]map[string]interface{}) + if !ok { + return nil, errors.New("failed to convert genesis set to slice") + } + + genesisAccounts := make([]*validator.GenesisValidator, len(decodedGenesisSetSliceMap)) + for i, rawGenesisAccount := range decodedGenesisSetSliceMap { + genesisAccounts[i], err = decodeAccount(rawGenesisAccount) + if err != nil { + return nil, err + } } - return common.ParseUint256orHex(&response) + return genesisAccounts, nil } // validatorSetToABISlice converts given validators to generic map diff --git a/consensus/polybft/README.md b/consensus/polybft/README.md index 5068031055..96f89d2013 100644 --- a/consensus/polybft/README.md +++ b/consensus/polybft/README.md @@ -105,17 +105,35 @@ It has a native support for running bridge, which enables running cross-chain tr --stake-manager --stake-token ``` -11. Finalize genesis validator set on rootchain (SupernetManager) contract. This is done after all validators from genesis do initial staking on rootchain, and it's a final step that is required before starting the child chain. This needs to be done by the deployer of SupernetManager contract (the user that run the deploy command). He can use either its hex encoded private key, or data-dir flag if he has secerets initialized. If enable-staking flag is provided, validators will be able to continue staking on rootchain. If not, genesis validators will not be able update its stake or unstake, nor will newly registered validators after genesis will be able to stake tokens on the rootchain. Enabling of staking can be done through this command, or later after the child chain starts. +11. Do mint and premine for relayer node. **These commands should only be executed if non-mintable erc20 token is used** + + ```bash + $ polygon-edge bridge mint-erc20 \ + --erc20-token \ + --private-key \ + --addresses \ + --amounts + ``` + + ```bash + $ polygon-edge rootchain premine \ + --erc20-token \ + --root-erc20-predicate \ + --supernet-manager \ + --private-key \ + --amount + ``` + +12. Finalize genesis validator set on rootchain (SupernetManager) contract. This is done after all validators from genesis do initial staking on rootchain, and it's a final step that is required before starting the child chain. This needs to be done by the deployer of SupernetManager contract (the user that run the deploy command). He can use either its hex encoded private key, or data-dir flag if he has secerets initialized. If enable-staking flag is provided, validators will be able to continue staking on rootchain. If not, genesis validators will not be able update its stake or unstake, nor will newly registered validators after genesis will be able to stake tokens on the rootchain. Enabling of staking can be done through this command, or later after the child chain starts. ```bash $ polygon-edge polybft supernet --private-key \ --genesis \ --supernet-manager \ - --stake-manager \ --finalize-genesis --enable-staking ``` -12. Run (child chain) cluster, consisting of 4 Edge clients in this particular example +13. Run (child chain) cluster, consisting of 4 Edge clients in this particular example ```bash $ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :9545 \ diff --git a/consensus/polybft/checkpoint_manager.go b/consensus/polybft/checkpoint_manager.go index d8098f1f6d..ec106fd78f 100644 --- a/consensus/polybft/checkpoint_manager.go +++ b/consensus/polybft/checkpoint_manager.go @@ -22,7 +22,7 @@ import ( var ( // currentCheckpointBlockNumMethod is an ABI method object representation for // currentCheckpointBlockNumber getter function on CheckpointManager contract - currentCheckpointBlockNumMethod, _ = contractsapi.CheckpointManager.Abi.Methods["currentCheckpointBlockNumber"] + currentCheckpointBlockNumMethod = contractsapi.CheckpointManager.Abi.Methods["currentCheckpointBlockNumber"] // frequency at which checkpoints are sent to the rootchain (in blocks count) defaultCheckpointsOffset = uint64(900) ) diff --git a/consensus/polybft/contractsapi/bindings-gen/main.go b/consensus/polybft/contractsapi/bindings-gen/main.go index aa8785c3b9..48200897b6 100644 --- a/consensus/polybft/contractsapi/bindings-gen/main.go +++ b/consensus/polybft/contractsapi/bindings-gen/main.go @@ -352,6 +352,7 @@ func main() { "whitelistValidators", "register", "getValidator", + "addGenesisBalance", }, []string{ "ValidatorRegistered", diff --git a/consensus/polybft/contractsapi/contractsapi.go b/consensus/polybft/contractsapi/contractsapi.go index b84045e6c2..87288a5f99 100644 --- a/consensus/polybft/contractsapi/contractsapi.go +++ b/consensus/polybft/contractsapi/contractsapi.go @@ -539,7 +539,7 @@ type InitializeRootERC20PredicateFn struct { NewExitHelper types.Address `abi:"newExitHelper"` NewChildERC20Predicate types.Address `abi:"newChildERC20Predicate"` NewChildTokenTemplate types.Address `abi:"newChildTokenTemplate"` - NativeTokenRootAddress types.Address `abi:"nativeTokenRootAddress"` + NewNativeTokenRoot types.Address `abi:"newNativeTokenRoot"` } func (i *InitializeRootERC20PredicateFn) Sig() []byte { @@ -1222,13 +1222,14 @@ func (o *OwnerOfChildERC721Fn) DecodeAbi(buf []byte) error { } type InitializeCustomSupernetManagerFn struct { - NewStakeManager types.Address `abi:"newStakeManager"` - NewBls types.Address `abi:"newBls"` - NewStateSender types.Address `abi:"newStateSender"` - NewMatic types.Address `abi:"newMatic"` - NewChildValidatorSet types.Address `abi:"newChildValidatorSet"` - NewExitHelper types.Address `abi:"newExitHelper"` - NewDomain string `abi:"newDomain"` + NewStakeManager types.Address `abi:"newStakeManager"` + NewBls types.Address `abi:"newBls"` + NewStateSender types.Address `abi:"newStateSender"` + NewMatic types.Address `abi:"newMatic"` + NewChildValidatorSet types.Address `abi:"newChildValidatorSet"` + NewExitHelper types.Address `abi:"newExitHelper"` + NewRootERC20Predicate types.Address `abi:"newRootERC20Predicate"` + NewDomain string `abi:"newDomain"` } func (i *InitializeCustomSupernetManagerFn) Sig() []byte { @@ -1292,6 +1293,22 @@ func (g *GetValidatorCustomSupernetManagerFn) DecodeAbi(buf []byte) error { return decodeMethod(CustomSupernetManager.Abi.Methods["getValidator"], buf, g) } +type AddGenesisBalanceCustomSupernetManagerFn struct { + Amount *big.Int `abi:"amount"` +} + +func (a *AddGenesisBalanceCustomSupernetManagerFn) Sig() []byte { + return CustomSupernetManager.Abi.Methods["addGenesisBalance"].ID() +} + +func (a *AddGenesisBalanceCustomSupernetManagerFn) EncodeAbi() ([]byte, error) { + return CustomSupernetManager.Abi.Methods["addGenesisBalance"].Encode(a) +} + +func (a *AddGenesisBalanceCustomSupernetManagerFn) DecodeAbi(buf []byte) error { + return decodeMethod(CustomSupernetManager.Abi.Methods["addGenesisBalance"], buf, a) +} + type ValidatorRegisteredEvent struct { Validator types.Address `abi:"validator"` BlsKey [4]*big.Int `abi:"blsKey"` diff --git a/consensus/polybft/contractsapi/gen_sc_data.go b/consensus/polybft/contractsapi/gen_sc_data.go index a3da7259b0..0f26c30503 100644 --- a/consensus/polybft/contractsapi/gen_sc_data.go +++ b/consensus/polybft/contractsapi/gen_sc_data.go @@ -28,7 +28,7 @@ var CheckpointManagerArtifact string = `{"_format":"hh-sol-artifact-1","contract var ExitHelperArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"ExitHelper","sourceName":"contracts/root/ExitHelper.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"ExitProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[{"components":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint256","name":"leafIndex","type":"uint256"},{"internalType":"bytes","name":"unhashedLeaf","type":"bytes"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"internalType":"struct IExitHelper.BatchExitInput[]","name":"inputs","type":"tuple[]"}],"name":"batchExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkpointManager","outputs":[{"internalType":"contract ICheckpointManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint256","name":"leafIndex","type":"uint256"},{"internalType":"bytes","name":"unhashedLeaf","type":"bytes"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICheckpointManager","name":"newCheckpointManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"processedExits","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610b62806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806350607b351461005c578063aa209cc314610071578063bd88ea7914610084578063c0857ba0146100bc578063c4d66de8146100e7575b600080fd5b61006f61006a3660046106c9565b6100fa565b005b61006f61007f36600461070b565b610200565b6100a76100923660046107bc565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6002546100cf906001600160a01b031681565b6040516001600160a01b0390911681526020016100b3565b61006f6100f53660046107ed565b610240565b6002546001600160a01b031661012b5760405162461bcd60e51b815260040161012290610811565b60405180910390fd5b8060005b818110156101fa576101f284848381811061014c5761014c610848565b905060200281019061015e919061085e565b3585858481811061017157610171610848565b9050602002810190610183919061085e565b6020013586868581811061019957610199610848565b90506020028101906101ab919061085e565b6101b990604081019061087e565b8888878181106101cb576101cb610848565b90506020028101906101dd919061085e565b6101eb9060608101906108c5565b60016103d2565b60010161012f565b50505050565b6002546001600160a01b03166102285760405162461bcd60e51b815260040161012290610811565b61023886868686868660006103d2565b505050505050565b600054610100900460ff16158080156102605750600054600160ff909116105b8061027a5750303b15801561027a575060005460ff166001145b6102dd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610122565b6000805460ff191660011790558015610300576000805461ff0019166101001790555b6001600160a01b0382161580159061032157506001600160a01b0382163b15155b61036d5760405162461bcd60e51b815260206004820152601b60248201527f4578697448656c7065723a20494e56414c49445f4144445245535300000000006044820152606401610122565b600280546001600160a01b0319166001600160a01b03841617905580156103ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60008080806103e3888a018a610925565b935093509350935084156104165760008481526001602052604090205460ff16156104115750505050610674565b610480565b60008481526001602052604090205460ff16156104805760405162461bcd60e51b815260206004820152602260248201527f4578697448656c7065723a20455849545f414c52454144595f50524f43455353604482015261115160f21b6064820152608401610122565b6002546040516001600160a01b03909116906361a02208908d906104a7908d908d90610a05565b6040519081900381206001600160e01b031960e085901b1682526104d492918f908d908d90600401610a15565b602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610a62565b61055d5760405162461bcd60e51b815260206004820152601960248201527822bc34ba2432b63832b91d1024a72b20a624a22fa82927a7a360391b6044820152606401610122565b6000848152600160208190526040808320805460ff19169092179091555181906001600160a01b0385169061059a90889088908790602401610ad4565b60408051601f198184030181529181526020820180516001600160e01b031663f43cda8b60e01b179052516105cf9190610b07565b6000604051808303816000865af19150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b509150915081610632576000868152600160205260409020805460ff191690555b811515867f8bbfa0c9bee3785c03700d2a909592286efb83fc7e7002be5764424b9842f7ec836040516106659190610b19565b60405180910390a35050505050505b50505050505050565b60008083601f84011261068f57600080fd5b50813567ffffffffffffffff8111156106a757600080fd5b6020830191508360208260051b85010111156106c257600080fd5b9250929050565b600080602083850312156106dc57600080fd5b823567ffffffffffffffff8111156106f357600080fd5b6106ff8582860161067d565b90969095509350505050565b6000806000806000806080878903121561072457600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561074a57600080fd5b818901915089601f83011261075e57600080fd5b81358181111561076d57600080fd5b8a602082850101111561077f57600080fd5b60208301965080955050606089013591508082111561079d57600080fd5b506107aa89828a0161067d565b979a9699509497509295939492505050565b6000602082840312156107ce57600080fd5b5035919050565b6001600160a01b03811681146107ea57600080fd5b50565b6000602082840312156107ff57600080fd5b813561080a816107d5565b9392505050565b6020808252601b908201527f4578697448656c7065723a204e4f545f494e495449414c495a45440000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60008235607e1983360301811261087457600080fd5b9190910192915050565b6000808335601e1984360301811261089557600080fd5b83018035915067ffffffffffffffff8211156108b057600080fd5b6020019150368190038213156106c257600080fd5b6000808335601e198436030181126108dc57600080fd5b83018035915067ffffffffffffffff8211156108f757600080fd5b6020019150600581901b36038213156106c257600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561093b57600080fd5b84359350602085013561094d816107d5565b9250604085013561095d816107d5565b9150606085013567ffffffffffffffff8082111561097a57600080fd5b818701915087601f83011261098e57600080fd5b8135818111156109a0576109a061090f565b604051601f8201601f19908116603f011681019083821181831017156109c8576109c861090f565b816040528281528a60208487010111156109e157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b8183823760009101908152919050565b85815284602082015283604082015260806060820152816080820152600060018060fb1b03831115610a4657600080fd5b8260051b808560a08501379190910160a0019695505050505050565b600060208284031215610a7457600080fd5b8151801515811461080a57600080fd5b60005b83811015610a9f578181015183820152602001610a87565b50506000910152565b60008151808452610ac0816020860160208601610a84565b601f01601f19169290920160200192915050565b8381526001600160a01b0383166020820152606060408201819052600090610afe90830184610aa8565b95945050505050565b60008251610874818460208701610a84565b60208152600061080a6020830184610aa856fea264697066735822122062ac4b08903d6279500a6ee30957a69454dadfc7f8af07bc8702efa271a1f6f364736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100575760003560e01c806350607b351461005c578063aa209cc314610071578063bd88ea7914610084578063c0857ba0146100bc578063c4d66de8146100e7575b600080fd5b61006f61006a3660046106c9565b6100fa565b005b61006f61007f36600461070b565b610200565b6100a76100923660046107bc565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6002546100cf906001600160a01b031681565b6040516001600160a01b0390911681526020016100b3565b61006f6100f53660046107ed565b610240565b6002546001600160a01b031661012b5760405162461bcd60e51b815260040161012290610811565b60405180910390fd5b8060005b818110156101fa576101f284848381811061014c5761014c610848565b905060200281019061015e919061085e565b3585858481811061017157610171610848565b9050602002810190610183919061085e565b6020013586868581811061019957610199610848565b90506020028101906101ab919061085e565b6101b990604081019061087e565b8888878181106101cb576101cb610848565b90506020028101906101dd919061085e565b6101eb9060608101906108c5565b60016103d2565b60010161012f565b50505050565b6002546001600160a01b03166102285760405162461bcd60e51b815260040161012290610811565b61023886868686868660006103d2565b505050505050565b600054610100900460ff16158080156102605750600054600160ff909116105b8061027a5750303b15801561027a575060005460ff166001145b6102dd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610122565b6000805460ff191660011790558015610300576000805461ff0019166101001790555b6001600160a01b0382161580159061032157506001600160a01b0382163b15155b61036d5760405162461bcd60e51b815260206004820152601b60248201527f4578697448656c7065723a20494e56414c49445f4144445245535300000000006044820152606401610122565b600280546001600160a01b0319166001600160a01b03841617905580156103ce576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b60008080806103e3888a018a610925565b935093509350935084156104165760008481526001602052604090205460ff16156104115750505050610674565b610480565b60008481526001602052604090205460ff16156104805760405162461bcd60e51b815260206004820152602260248201527f4578697448656c7065723a20455849545f414c52454144595f50524f43455353604482015261115160f21b6064820152608401610122565b6002546040516001600160a01b03909116906361a02208908d906104a7908d908d90610a05565b6040519081900381206001600160e01b031960e085901b1682526104d492918f908d908d90600401610a15565b602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610a62565b61055d5760405162461bcd60e51b815260206004820152601960248201527822bc34ba2432b63832b91d1024a72b20a624a22fa82927a7a360391b6044820152606401610122565b6000848152600160208190526040808320805460ff19169092179091555181906001600160a01b0385169061059a90889088908790602401610ad4565b60408051601f198184030181529181526020820180516001600160e01b031663f43cda8b60e01b179052516105cf9190610b07565b6000604051808303816000865af19150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b509150915081610632576000868152600160205260409020805460ff191690555b811515867f8bbfa0c9bee3785c03700d2a909592286efb83fc7e7002be5764424b9842f7ec836040516106659190610b19565b60405180910390a35050505050505b50505050505050565b60008083601f84011261068f57600080fd5b50813567ffffffffffffffff8111156106a757600080fd5b6020830191508360208260051b85010111156106c257600080fd5b9250929050565b600080602083850312156106dc57600080fd5b823567ffffffffffffffff8111156106f357600080fd5b6106ff8582860161067d565b90969095509350505050565b6000806000806000806080878903121561072457600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561074a57600080fd5b818901915089601f83011261075e57600080fd5b81358181111561076d57600080fd5b8a602082850101111561077f57600080fd5b60208301965080955050606089013591508082111561079d57600080fd5b506107aa89828a0161067d565b979a9699509497509295939492505050565b6000602082840312156107ce57600080fd5b5035919050565b6001600160a01b03811681146107ea57600080fd5b50565b6000602082840312156107ff57600080fd5b813561080a816107d5565b9392505050565b6020808252601b908201527f4578697448656c7065723a204e4f545f494e495449414c495a45440000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60008235607e1983360301811261087457600080fd5b9190910192915050565b6000808335601e1984360301811261089557600080fd5b83018035915067ffffffffffffffff8211156108b057600080fd5b6020019150368190038213156106c257600080fd5b6000808335601e198436030181126108dc57600080fd5b83018035915067ffffffffffffffff8211156108f757600080fd5b6020019150600581901b36038213156106c257600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561093b57600080fd5b84359350602085013561094d816107d5565b9250604085013561095d816107d5565b9150606085013567ffffffffffffffff8082111561097a57600080fd5b818701915087601f83011261098e57600080fd5b8135818111156109a0576109a061090f565b604051601f8201601f19908116603f011681019083821181831017156109c8576109c861090f565b816040528281528a60208487010111156109e157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b8183823760009101908152919050565b85815284602082015283604082015260806060820152816080820152600060018060fb1b03831115610a4657600080fd5b8260051b808560a08501379190910160a0019695505050505050565b600060208284031215610a7457600080fd5b8151801515811461080a57600080fd5b60005b83811015610a9f578181015183820152602001610a87565b50506000910152565b60008151808452610ac0816020860160208601610a84565b601f01601f19169290920160200192915050565b8381526001600160a01b0383166020820152606060408201819052600090610afe90830184610aa8565b95945050505050565b60008251610874818460208701610a84565b60208152600061080a6020830184610aa856fea264697066735822122062ac4b08903d6279500a6ee30957a69454dadfc7f8af07bc8702efa271a1f6f364736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var StateSenderArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"StateSender","sourceName":"contracts/root/StateSender.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"StateSynced","type":"event"},{"inputs":[],"name":"MAX_LENGTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"counter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"syncState","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610297806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806316f198311461004657806361bc221a1461005b578063a6f9885c14610076575b600080fd5b61005961005436600461017a565b61007f565b005b61006460005481565b60405190815260200160405180910390f35b61006461080081565b6001600160a01b0383166100cd5760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa922a1a2a4ab22a960811b60448201526064015b60405180910390fd5b6108008111156101145760405162461bcd60e51b815260206004820152601260248201527108ab0868a8a88a6be9a82b0be988a9c8ea8960731b60448201526064016100c4565b826001600160a01b0316336001600160a01b031660008081546101369061020b565b9190508190557fd1d7f6609674cc5871fdb4b0bcd4f0a214118411de9e38983866514f22659165858560405161016d929190610232565b60405180910390a4505050565b60008060006040848603121561018f57600080fd5b83356001600160a01b03811681146101a657600080fd5b9250602084013567ffffffffffffffff808211156101c357600080fd5b818601915086601f8301126101d757600080fd5b8135818111156101e657600080fd5b8760208285010111156101f857600080fd5b6020830194508093505050509250925092565b60006001820161022b57634e487b7160e01b600052601160045260246000fd5b5060010190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea264697066735822122031b7ec2bc87f0234fe89e0f741bc18f51baa2be5cc844033ea10f35e4b86094c64736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100415760003560e01c806316f198311461004657806361bc221a1461005b578063a6f9885c14610076575b600080fd5b61005961005436600461017a565b61007f565b005b61006460005481565b60405190815260200160405180910390f35b61006461080081565b6001600160a01b0383166100cd5760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa922a1a2a4ab22a960811b60448201526064015b60405180910390fd5b6108008111156101145760405162461bcd60e51b815260206004820152601260248201527108ab0868a8a88a6be9a82b0be988a9c8ea8960731b60448201526064016100c4565b826001600160a01b0316336001600160a01b031660008081546101369061020b565b9190508190557fd1d7f6609674cc5871fdb4b0bcd4f0a214118411de9e38983866514f22659165858560405161016d929190610232565b60405180910390a4505050565b60008060006040848603121561018f57600080fd5b83356001600160a01b03811681146101a657600080fd5b9250602084013567ffffffffffffffff808211156101c357600080fd5b818601915086601f8301126101d757600080fd5b8135818111156101e657600080fd5b8760208285010111156101f857600080fd5b6020830194508093505050509250925092565b60006001820161022b57634e487b7160e01b600052601160045260246000fd5b5060010190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea264697066735822122031b7ec2bc87f0234fe89e0f741bc18f51baa2be5cc844033ea10f35e4b86094c64736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var MockERC20Artifact string = `{"_format":"hh-sol-artifact-1","contractName":"MockERC20","sourceName":"contracts/mocks/MockERC20.sol","abi":[{"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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x60806040523480156200001157600080fd5b50604080518082018252600480825263151154d560e21b60208084018290528451808601909552918452908301529081816005620000508382620002ca565b5060066200005f8282620002ca565b50506007805460ff191690555062000079600033620000d9565b620000a57f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620000d9565b620000d17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620000d9565b505062000396565b620000e58282620000e9565b5050565b620000f5828262000114565b60008281526001602052604090206200010f9082620001b4565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000e5576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001703390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001cb836001600160a01b038416620001d4565b90505b92915050565b60008181526001830160205260408120546200021d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001ce565b506000620001ce565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200025157607f821691505b6020821081036200027257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200010f57600081815260208120601f850160051c81016020861015620002a15750805b601f850160051c820191505b81811015620002c257828155600101620002ad565b505050505050565b81516001600160401b03811115620002e657620002e662000226565b620002fe81620002f784546200023c565b8462000278565b602080601f8311600181146200033657600084156200031d5750858301515b600019600386901b1c1916600185901b178555620002c2565b600085815260208120601f198616915b82811015620003675788860151825594840194600190910190840162000346565b5085821015620003865787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6117fa80620003a66000396000f3fe608060405234801561001057600080fd5b50600436106101845760003560e01c806370a08231116100d9578063a457c2d711610087578063a457c2d714610336578063a9059cbb14610349578063ca15c8731461035c578063d53913931461036f578063d547741f14610396578063dd62ed3e146103a9578063e63ab1e9146103bc57600080fd5b806370a08231146102a457806379cc6790146102cd5780638456cb59146102e05780639010d07c146102e857806391d148541461031357806395d89b4114610326578063a217fddf1461032e57600080fd5b8063313ce56711610136578063313ce5671461023657806336568abe1461024557806339509351146102585780633f4ba83a1461026b57806340c10f191461027357806342966c68146102865780635c975abb1461029957600080fd5b806301ffc9a71461018957806306fdde03146101b1578063095ea7b3146101c657806318160ddd146101d957806323b872dd146101eb578063248a9ca3146101fe5780632f2ff15d14610221575b600080fd5b61019c610197366004611460565b6103d1565b60405190151581526020015b60405180910390f35b6101b96103fc565b6040516101a891906114ae565b61019c6101d43660046114fd565b61048e565b6004545b6040519081526020016101a8565b61019c6101f9366004611527565b6104a6565b6101dd61020c366004611563565b60009081526020819052604090206001015490565b61023461022f36600461157c565b6104ca565b005b604051601281526020016101a8565b61023461025336600461157c565b6104f4565b61019c6102663660046114fd565b610577565b610234610599565b6102346102813660046114fd565b610617565b610234610294366004611563565b6106a4565b60075460ff1661019c565b6101dd6102b23660046115a8565b6001600160a01b031660009081526002602052604090205490565b6102346102db3660046114fd565b6106b1565b6102346106c6565b6102fb6102f63660046115c3565b610740565b6040516001600160a01b0390911681526020016101a8565b61019c61032136600461157c565b61075f565b6101b9610788565b6101dd600081565b61019c6103443660046114fd565b610797565b61019c6103573660046114fd565b610812565b6101dd61036a366004611563565b610820565b6101dd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102346103a436600461157c565b610837565b6101dd6103b73660046115e5565b61085c565b6101dd60008051602061178583398151915281565b60006001600160e01b03198216635a05180f60e01b14806103f657506103f682610887565b92915050565b60606005805461040b9061160f565b80601f01602080910402602001604051908101604052809291908181526020018280546104379061160f565b80156104845780601f1061045957610100808354040283529160200191610484565b820191906000526020600020905b81548152906001019060200180831161046757829003601f168201915b5050505050905090565b60003361049c8185856108bc565b5060019392505050565b6000336104b48582856109e0565b6104bf858585610a5a565b506001949350505050565b6000828152602081905260409020600101546104e581610bfe565b6104ef8383610c08565b505050565b6001600160a01b03811633146105695760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105738282610c2a565b5050565b60003361049c81858561058a838361085c565b610594919061165f565b6108bc565b6105b16000805160206117858339815191523361075f565b61060d5760405162461bcd60e51b8152602060048201526039602482015260008051602061176583398151915260448201527876652070617573657220726f6c6520746f20756e706175736560381b6064820152608401610560565b610615610c4c565b565b6106417f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63361075f565b61069a5760405162461bcd60e51b815260206004820152603660248201526000805160206117658339815191526044820152751d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60521b6064820152608401610560565b6105738282610c9e565b6106ae3382610d59565b50565b6106bc8233836109e0565b6105738282610d59565b6106de6000805160206117858339815191523361075f565b6107385760405162461bcd60e51b8152602060048201526037602482015260008051602061176583398151915260448201527676652070617573657220726f6c6520746f20706175736560481b6064820152608401610560565b610615610e87565b60008281526001602052604081206107589083610ec4565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606006805461040b9061160f565b600033816107a5828661085c565b9050838110156108055760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610560565b6104bf82868684036108bc565b60003361049c818585610a5a565b60008181526001602052604081206103f690610ed0565b60008281526020819052604090206001015461085281610bfe565b6104ef8383610c2a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006001600160e01b03198216637965db0b60e01b14806103f657506301ffc9a760e01b6001600160e01b03198316146103f6565b6001600160a01b03831661091e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610560565b6001600160a01b03821661097f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610560565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006109ec848461085c565b90506000198114610a545781811015610a475760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610560565b610a5484848484036108bc565b50505050565b6001600160a01b038316610abe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610560565b6001600160a01b038216610b205760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610560565b610b2b838383610eda565b6001600160a01b03831660009081526002602052604090205481811015610ba35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610560565b6001600160a01b0380851660008181526002602052604080822086860390559286168082529083902080548601905591516000805160206117a583398151915290610bf19086815260200190565b60405180910390a3610a54565b6106ae8133610ee5565b610c128282610f3e565b60008281526001602052604090206104ef9082610fc2565b610c348282610fd7565b60008281526001602052604090206104ef908261103c565b610c54611051565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216610cf45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610560565b610d0060008383610eda565b8060046000828254610d12919061165f565b90915550506001600160a01b0382166000818152600260209081526040808320805486019055518481526000805160206117a5833981519152910160405180910390a35050565b6001600160a01b038216610db95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610560565b610dc582600083610eda565b6001600160a01b03821660009081526002602052604090205481811015610e395760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610560565b6001600160a01b03831660008181526002602090815260408083208686039055600480548790039055518581529192916000805160206117a5833981519152910160405180910390a3505050565b610e8f61109a565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c813390565b600061075883836110e0565b60006103f6825490565b6104ef83838361110a565b610eef828261075f565b61057357610efc81611170565b610f07836020611182565b604051602001610f18929190611672565b60408051601f198184030181529082905262461bcd60e51b8252610560916004016114ae565b610f48828261075f565b610573576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610f7e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610758836001600160a01b03841661131e565b610fe1828261075f565b15610573576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610758836001600160a01b03841661136d565b60075460ff166106155760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610560565b60075460ff16156106155760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610560565b60008260000182815481106110f7576110f76116e1565b9060005260206000200154905092915050565b60075460ff16156104ef5760405162461bcd60e51b815260206004820152602a60248201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686044820152691a5b19481c185d5cd95960b21b6064820152608401610560565b60606103f66001600160a01b03831660145b606060006111918360026116f7565b61119c90600261165f565b67ffffffffffffffff8111156111b4576111b461170e565b6040519080825280601f01601f1916602001820160405280156111de576020820181803683370190505b509050600360fc1b816000815181106111f9576111f96116e1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611228576112286116e1565b60200101906001600160f81b031916908160001a905350600061124c8460026116f7565b61125790600161165f565b90505b60018111156112cf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061128b5761128b6116e1565b1a60f81b8282815181106112a1576112a16116e1565b60200101906001600160f81b031916908160001a90535060049490941c936112c881611724565b905061125a565b5083156107585760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610560565b6000818152600183016020526040812054611365575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103f6565b5060006103f6565b6000818152600183016020526040812054801561145657600061139160018361173b565b85549091506000906113a59060019061173b565b905081811461140a5760008660000182815481106113c5576113c56116e1565b90600052602060002001549050808760000184815481106113e8576113e86116e1565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061141b5761141b61174e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103f6565b60009150506103f6565b60006020828403121561147257600080fd5b81356001600160e01b03198116811461075857600080fd5b60005b838110156114a557818101518382015260200161148d565b50506000910152565b60208152600082518060208401526114cd81604085016020870161148a565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146114f857600080fd5b919050565b6000806040838503121561151057600080fd5b611519836114e1565b946020939093013593505050565b60008060006060848603121561153c57600080fd5b611545846114e1565b9250611553602085016114e1565b9150604084013590509250925092565b60006020828403121561157557600080fd5b5035919050565b6000806040838503121561158f57600080fd5b8235915061159f602084016114e1565b90509250929050565b6000602082840312156115ba57600080fd5b610758826114e1565b600080604083850312156115d657600080fd5b50508035926020909101359150565b600080604083850312156115f857600080fd5b611601836114e1565b915061159f602084016114e1565b600181811c9082168061162357607f821691505b60208210810361164357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103f6576103f6611649565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516116a481601785016020880161148a565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116d581602884016020880161148a565b01602801949350505050565b634e487b7160e01b600052603260045260246000fd5b80820281158282048414176103f6576103f6611649565b634e487b7160e01b600052604160045260246000fd5b60008161173357611733611649565b506000190190565b818103818111156103f6576103f6611649565b634e487b7160e01b600052603160045260246000fdfe45524332305072657365744d696e7465725061757365723a206d75737420686165d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220d5a22b9391b8f37e5b49e43cc1eabfcea8be6d7b5aa0a84dc5daa1b7a05730f364736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101845760003560e01c806370a08231116100d9578063a457c2d711610087578063a457c2d714610336578063a9059cbb14610349578063ca15c8731461035c578063d53913931461036f578063d547741f14610396578063dd62ed3e146103a9578063e63ab1e9146103bc57600080fd5b806370a08231146102a457806379cc6790146102cd5780638456cb59146102e05780639010d07c146102e857806391d148541461031357806395d89b4114610326578063a217fddf1461032e57600080fd5b8063313ce56711610136578063313ce5671461023657806336568abe1461024557806339509351146102585780633f4ba83a1461026b57806340c10f191461027357806342966c68146102865780635c975abb1461029957600080fd5b806301ffc9a71461018957806306fdde03146101b1578063095ea7b3146101c657806318160ddd146101d957806323b872dd146101eb578063248a9ca3146101fe5780632f2ff15d14610221575b600080fd5b61019c610197366004611460565b6103d1565b60405190151581526020015b60405180910390f35b6101b96103fc565b6040516101a891906114ae565b61019c6101d43660046114fd565b61048e565b6004545b6040519081526020016101a8565b61019c6101f9366004611527565b6104a6565b6101dd61020c366004611563565b60009081526020819052604090206001015490565b61023461022f36600461157c565b6104ca565b005b604051601281526020016101a8565b61023461025336600461157c565b6104f4565b61019c6102663660046114fd565b610577565b610234610599565b6102346102813660046114fd565b610617565b610234610294366004611563565b6106a4565b60075460ff1661019c565b6101dd6102b23660046115a8565b6001600160a01b031660009081526002602052604090205490565b6102346102db3660046114fd565b6106b1565b6102346106c6565b6102fb6102f63660046115c3565b610740565b6040516001600160a01b0390911681526020016101a8565b61019c61032136600461157c565b61075f565b6101b9610788565b6101dd600081565b61019c6103443660046114fd565b610797565b61019c6103573660046114fd565b610812565b6101dd61036a366004611563565b610820565b6101dd7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102346103a436600461157c565b610837565b6101dd6103b73660046115e5565b61085c565b6101dd60008051602061178583398151915281565b60006001600160e01b03198216635a05180f60e01b14806103f657506103f682610887565b92915050565b60606005805461040b9061160f565b80601f01602080910402602001604051908101604052809291908181526020018280546104379061160f565b80156104845780601f1061045957610100808354040283529160200191610484565b820191906000526020600020905b81548152906001019060200180831161046757829003601f168201915b5050505050905090565b60003361049c8185856108bc565b5060019392505050565b6000336104b48582856109e0565b6104bf858585610a5a565b506001949350505050565b6000828152602081905260409020600101546104e581610bfe565b6104ef8383610c08565b505050565b6001600160a01b03811633146105695760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105738282610c2a565b5050565b60003361049c81858561058a838361085c565b610594919061165f565b6108bc565b6105b16000805160206117858339815191523361075f565b61060d5760405162461bcd60e51b8152602060048201526039602482015260008051602061176583398151915260448201527876652070617573657220726f6c6520746f20756e706175736560381b6064820152608401610560565b610615610c4c565b565b6106417f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63361075f565b61069a5760405162461bcd60e51b815260206004820152603660248201526000805160206117658339815191526044820152751d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60521b6064820152608401610560565b6105738282610c9e565b6106ae3382610d59565b50565b6106bc8233836109e0565b6105738282610d59565b6106de6000805160206117858339815191523361075f565b6107385760405162461bcd60e51b8152602060048201526037602482015260008051602061176583398151915260448201527676652070617573657220726f6c6520746f20706175736560481b6064820152608401610560565b610615610e87565b60008281526001602052604081206107589083610ec4565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606006805461040b9061160f565b600033816107a5828661085c565b9050838110156108055760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610560565b6104bf82868684036108bc565b60003361049c818585610a5a565b60008181526001602052604081206103f690610ed0565b60008281526020819052604090206001015461085281610bfe565b6104ef8383610c2a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b60006001600160e01b03198216637965db0b60e01b14806103f657506301ffc9a760e01b6001600160e01b03198316146103f6565b6001600160a01b03831661091e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610560565b6001600160a01b03821661097f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610560565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006109ec848461085c565b90506000198114610a545781811015610a475760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610560565b610a5484848484036108bc565b50505050565b6001600160a01b038316610abe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610560565b6001600160a01b038216610b205760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610560565b610b2b838383610eda565b6001600160a01b03831660009081526002602052604090205481811015610ba35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610560565b6001600160a01b0380851660008181526002602052604080822086860390559286168082529083902080548601905591516000805160206117a583398151915290610bf19086815260200190565b60405180910390a3610a54565b6106ae8133610ee5565b610c128282610f3e565b60008281526001602052604090206104ef9082610fc2565b610c348282610fd7565b60008281526001602052604090206104ef908261103c565b610c54611051565b6007805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038216610cf45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610560565b610d0060008383610eda565b8060046000828254610d12919061165f565b90915550506001600160a01b0382166000818152600260209081526040808320805486019055518481526000805160206117a5833981519152910160405180910390a35050565b6001600160a01b038216610db95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610560565b610dc582600083610eda565b6001600160a01b03821660009081526002602052604090205481811015610e395760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610560565b6001600160a01b03831660008181526002602090815260408083208686039055600480548790039055518581529192916000805160206117a5833981519152910160405180910390a3505050565b610e8f61109a565b6007805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c813390565b600061075883836110e0565b60006103f6825490565b6104ef83838361110a565b610eef828261075f565b61057357610efc81611170565b610f07836020611182565b604051602001610f18929190611672565b60408051601f198184030181529082905262461bcd60e51b8252610560916004016114ae565b610f48828261075f565b610573576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610f7e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610758836001600160a01b03841661131e565b610fe1828261075f565b15610573576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610758836001600160a01b03841661136d565b60075460ff166106155760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610560565b60075460ff16156106155760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610560565b60008260000182815481106110f7576110f76116e1565b9060005260206000200154905092915050565b60075460ff16156104ef5760405162461bcd60e51b815260206004820152602a60248201527f45524332305061757361626c653a20746f6b656e207472616e736665722077686044820152691a5b19481c185d5cd95960b21b6064820152608401610560565b60606103f66001600160a01b03831660145b606060006111918360026116f7565b61119c90600261165f565b67ffffffffffffffff8111156111b4576111b461170e565b6040519080825280601f01601f1916602001820160405280156111de576020820181803683370190505b509050600360fc1b816000815181106111f9576111f96116e1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611228576112286116e1565b60200101906001600160f81b031916908160001a905350600061124c8460026116f7565b61125790600161165f565b90505b60018111156112cf576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061128b5761128b6116e1565b1a60f81b8282815181106112a1576112a16116e1565b60200101906001600160f81b031916908160001a90535060049490941c936112c881611724565b905061125a565b5083156107585760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610560565b6000818152600183016020526040812054611365575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556103f6565b5060006103f6565b6000818152600183016020526040812054801561145657600061139160018361173b565b85549091506000906113a59060019061173b565b905081811461140a5760008660000182815481106113c5576113c56116e1565b90600052602060002001549050808760000184815481106113e8576113e86116e1565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061141b5761141b61174e565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506103f6565b60009150506103f6565b60006020828403121561147257600080fd5b81356001600160e01b03198116811461075857600080fd5b60005b838110156114a557818101518382015260200161148d565b50506000910152565b60208152600082518060208401526114cd81604085016020870161148a565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146114f857600080fd5b919050565b6000806040838503121561151057600080fd5b611519836114e1565b946020939093013593505050565b60008060006060848603121561153c57600080fd5b611545846114e1565b9250611553602085016114e1565b9150604084013590509250925092565b60006020828403121561157557600080fd5b5035919050565b6000806040838503121561158f57600080fd5b8235915061159f602084016114e1565b90509250929050565b6000602082840312156115ba57600080fd5b610758826114e1565b600080604083850312156115d657600080fd5b50508035926020909101359150565b600080604083850312156115f857600080fd5b611601836114e1565b915061159f602084016114e1565b600181811c9082168061162357607f821691505b60208210810361164357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156103f6576103f6611649565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516116a481601785016020880161148a565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516116d581602884016020880161148a565b01602801949350505050565b634e487b7160e01b600052603260045260246000fd5b80820281158282048414176103f6576103f6611649565b634e487b7160e01b600052604160045260246000fd5b60008161173357611733611649565b506000190190565b818103818111156103f6576103f6611649565b634e487b7160e01b600052603160045260246000fdfe45524332305072657365744d696e7465725061757365723a206d75737420686165d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220d5a22b9391b8f37e5b49e43cc1eabfcea8be6d7b5aa0a84dc5daa1b7a05730f364736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` -var RootERC20PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"RootERC20Predicate","sourceName":"contracts/root/RootERC20Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdraw","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":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"TokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childERC20Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newChildERC20Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"},{"internalType":"address","name":"nativeTokenRootAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"}],"name":"mapToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b506113c7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100bf5760003560e01c8063cb10f94c1161007c578063cb10f94c1461018d578063d41f1771146101a6578063d57184e4146101cd578063f213159c146101e0578063f43cda8b146101f3578063f4a120f714610206578063f64512551461021957600080fd5b80631459457a146100c457806347e7ef24146100d95780637efab4f5146100ec57806395c7041c14610132578063b176806514610145578063b68ad1e41461017a575b600080fd5b6100d76100d2366004610f4b565b610240565b005b6100d76100e7366004610fbc565b6104ae565b6101156100fa366004610fe8565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600154610115906001600160a01b031681565b61016c7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610129565b600354610115906001600160a01b031681565b600054610115906201000090046001600160a01b031681565b61016c7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b600254610115906001600160a01b031681565b6100d76101ee36600461100c565b6104bd565b6100d761020136600461104d565b6104cd565b610115610214366004610fe8565b610654565b61016c7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b600054610100900460ff16158080156102605750600054600160ff909116105b8061027a5750303b15801561027a575060005460ff166001145b6102e25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610305576000805461ff0019166101001790555b6001600160a01b0386161580159061032557506001600160a01b03851615155b801561033957506001600160a01b03841615155b801561034d57506001600160a01b03831615155b6103a85760405162461bcd60e51b815260206004820152602660248201527f526f6f7445524332305072656469636174653a204241445f494e495449414c496044820152652d20aa24a7a760d11b60648201526084016102d9565b6000805462010000600160b01b031916620100006001600160a01b038981169190910291909117909155600180546001600160a01b03199081168884161790915560028054821687841617905560038054909116858316179055821615610460576001600160a01b03821660008181526004602052604080822080546001600160a01b03191661101090811790915590519092917f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61791a35b80156104a6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6104b9823383610a15565b5050565b6104c8838383610a15565b505050565b6001546001600160a01b031633146105335760405162461bcd60e51b8152602060048201526024808201527f526f6f7445524332305072656469636174653a204f4e4c595f455849545f4845604482015263262822a960e11b60648201526084016102d9565b6002546001600160a01b038481169116146105a15760405162461bcd60e51b815260206004820152602860248201527f526f6f7445524332305072656469636174653a204f4e4c595f4348494c445f50604482015267524544494341544560c01b60648201526084016102d9565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828696105d06020600084866110d6565b6105d991611100565b036105f8576105f36105ee82602081866110d6565b610b8c565b61064e565b60405162461bcd60e51b815260206004820152602560248201527f526f6f7445524332305072656469636174653a20494e56414c49445f5349474e604482015264415455524560d81b60648201526084016102d9565b50505050565b60006001600160a01b0382166106b65760405162461bcd60e51b815260206004820152602160248201527f526f6f7445524332305072656469636174653a20494e56414c49445f544f4b456044820152602760f91b60648201526084016102d9565b6001600160a01b0382811660009081526004602052604090205416156107295760405162461bcd60e51b815260206004820152602260248201527f526f6f7445524332305072656469636174653a20414c52454144595f4d415050604482015261115160f21b60648201526084016102d9565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b03928316926000926107d792911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa158015610874573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261089c9190810190611159565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109029190810190611159565b8a6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096491906111fb565b60405160200161097895949392919061124a565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016109a492919061129c565b600060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b6001600160a01b038084166000908152600460205260409020541680610a4157610a3e84610654565b90505b6001600160a01b038116610a5757610a576112c0565b610a6c6001600160a01b038516333085610c44565b600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b0388811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f1983193610afd9391169160c40161129c565b600060405180830381600087803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b50505050826001600160a01b0316816001600160a01b0316856001600160a01b03167f8be9001bb612c7123a1861dc0d9d94e683261f6cbbd7c7438b708975bc4908a33386604051610b7e9291906112d6565b60405180910390a450505050565b6000808080610b9d858701876112ef565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610bd057610bd06112c0565b610be46001600160a01b0386168484610caf565b826001600160a01b0316816001600160a01b0316866001600160a01b03167f9c4f744b2e971d7058a9d8f43977e0e17bf7d57a48659f0e18541b7ee3d022e48786604051610c339291906112d6565b60405180910390a450505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261064e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610cce565b6104c88363a9059cbb60e01b8484604051602401610c789291906112d6565b6000610d23826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610da39092919063ffffffff16565b9050805160001480610d44575080806020019051810190610d449190611340565b6104c85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102d9565b6060610db28484600085610dba565b949350505050565b606082471015610e1b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102d9565b600080866001600160a01b03168587604051610e379190611362565b60006040518083038185875af1925050503d8060008114610e74576040519150601f19603f3d011682016040523d82523d6000602084013e610e79565b606091505b5091509150610e8a87838387610e95565b979650505050505050565b60608315610f04578251600003610efd576001600160a01b0385163b610efd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102d9565b5081610db2565b610db28383815115610f195781518083602001fd5b8060405162461bcd60e51b81526004016102d9919061137e565b6001600160a01b0381168114610f4857600080fd5b50565b600080600080600060a08688031215610f6357600080fd5b8535610f6e81610f33565b94506020860135610f7e81610f33565b93506040860135610f8e81610f33565b92506060860135610f9e81610f33565b91506080860135610fae81610f33565b809150509295509295909350565b60008060408385031215610fcf57600080fd5b8235610fda81610f33565b946020939093013593505050565b600060208284031215610ffa57600080fd5b813561100581610f33565b9392505050565b60008060006060848603121561102157600080fd5b833561102c81610f33565b9250602084013561103c81610f33565b929592945050506040919091013590565b6000806000806060858703121561106357600080fd5b84359350602085013561107581610f33565b9250604085013567ffffffffffffffff8082111561109257600080fd5b818701915087601f8301126110a657600080fd5b8135818111156110b557600080fd5b8860208285010111156110c757600080fd5b95989497505060200194505050565b600080858511156110e657600080fd5b838611156110f357600080fd5b5050820193919092039150565b8035602083101561111957600019602084900360031b1b165b92915050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015611150578181015183820152602001611138565b50506000910152565b60006020828403121561116b57600080fd5b815167ffffffffffffffff8082111561118357600080fd5b818401915084601f83011261119757600080fd5b8151818111156111a9576111a961111f565b604051601f8201601f19908116603f011681019083821181831017156111d1576111d161111f565b816040528281528760208487010111156111ea57600080fd5b610e8a836020830160208801611135565b60006020828403121561120d57600080fd5b815160ff8116811461100557600080fd5b60008151808452611236816020860160208601611135565b601f01601f19169290920160200192915050565b8581526001600160a01b038516602082015260a0604082018190526000906112749083018661121e565b8281036060840152611286818661121e565b91505060ff831660808301529695505050505050565b6001600160a01b0383168152604060208201819052600090610db29083018461121e565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b6000806000806080858703121561130557600080fd5b843561131081610f33565b9350602085013561132081610f33565b9250604085013561133081610f33565b9396929550929360600135925050565b60006020828403121561135257600080fd5b8151801515811461100557600080fd5b60008251611374818460208701611135565b9190910192915050565b602081526000611005602083018461121e56fea26469706673582212208b05e97748f5815f5f2643e1eafdda34899d6e704d3c0c792ad454f128c4283464736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100bf5760003560e01c8063cb10f94c1161007c578063cb10f94c1461018d578063d41f1771146101a6578063d57184e4146101cd578063f213159c146101e0578063f43cda8b146101f3578063f4a120f714610206578063f64512551461021957600080fd5b80631459457a146100c457806347e7ef24146100d95780637efab4f5146100ec57806395c7041c14610132578063b176806514610145578063b68ad1e41461017a575b600080fd5b6100d76100d2366004610f4b565b610240565b005b6100d76100e7366004610fbc565b6104ae565b6101156100fa366004610fe8565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600154610115906001600160a01b031681565b61016c7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610129565b600354610115906001600160a01b031681565b600054610115906201000090046001600160a01b031681565b61016c7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b600254610115906001600160a01b031681565b6100d76101ee36600461100c565b6104bd565b6100d761020136600461104d565b6104cd565b610115610214366004610fe8565b610654565b61016c7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b600054610100900460ff16158080156102605750600054600160ff909116105b8061027a5750303b15801561027a575060005460ff166001145b6102e25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610305576000805461ff0019166101001790555b6001600160a01b0386161580159061032557506001600160a01b03851615155b801561033957506001600160a01b03841615155b801561034d57506001600160a01b03831615155b6103a85760405162461bcd60e51b815260206004820152602660248201527f526f6f7445524332305072656469636174653a204241445f494e495449414c496044820152652d20aa24a7a760d11b60648201526084016102d9565b6000805462010000600160b01b031916620100006001600160a01b038981169190910291909117909155600180546001600160a01b03199081168884161790915560028054821687841617905560038054909116858316179055821615610460576001600160a01b03821660008181526004602052604080822080546001600160a01b03191661101090811790915590519092917f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61791a35b80156104a6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6104b9823383610a15565b5050565b6104c8838383610a15565b505050565b6001546001600160a01b031633146105335760405162461bcd60e51b8152602060048201526024808201527f526f6f7445524332305072656469636174653a204f4e4c595f455849545f4845604482015263262822a960e11b60648201526084016102d9565b6002546001600160a01b038481169116146105a15760405162461bcd60e51b815260206004820152602860248201527f526f6f7445524332305072656469636174653a204f4e4c595f4348494c445f50604482015267524544494341544560c01b60648201526084016102d9565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828696105d06020600084866110d6565b6105d991611100565b036105f8576105f36105ee82602081866110d6565b610b8c565b61064e565b60405162461bcd60e51b815260206004820152602560248201527f526f6f7445524332305072656469636174653a20494e56414c49445f5349474e604482015264415455524560d81b60648201526084016102d9565b50505050565b60006001600160a01b0382166106b65760405162461bcd60e51b815260206004820152602160248201527f526f6f7445524332305072656469636174653a20494e56414c49445f544f4b456044820152602760f91b60648201526084016102d9565b6001600160a01b0382811660009081526004602052604090205416156107295760405162461bcd60e51b815260206004820152602260248201527f526f6f7445524332305072656469636174653a20414c52454144595f4d415050604482015261115160f21b60648201526084016102d9565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b03928316926000926107d792911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa158015610874573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261089c9190810190611159565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109029190810190611159565b8a6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610940573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096491906111fb565b60405160200161097895949392919061124a565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016109a492919061129c565b600060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b6001600160a01b038084166000908152600460205260409020541680610a4157610a3e84610654565b90505b6001600160a01b038116610a5757610a576112c0565b610a6c6001600160a01b038516333085610c44565b600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b0388811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f1983193610afd9391169160c40161129c565b600060405180830381600087803b158015610b1757600080fd5b505af1158015610b2b573d6000803e3d6000fd5b50505050826001600160a01b0316816001600160a01b0316856001600160a01b03167f8be9001bb612c7123a1861dc0d9d94e683261f6cbbd7c7438b708975bc4908a33386604051610b7e9291906112d6565b60405180910390a450505050565b6000808080610b9d858701876112ef565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610bd057610bd06112c0565b610be46001600160a01b0386168484610caf565b826001600160a01b0316816001600160a01b0316866001600160a01b03167f9c4f744b2e971d7058a9d8f43977e0e17bf7d57a48659f0e18541b7ee3d022e48786604051610c339291906112d6565b60405180910390a450505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261064e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610cce565b6104c88363a9059cbb60e01b8484604051602401610c789291906112d6565b6000610d23826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610da39092919063ffffffff16565b9050805160001480610d44575080806020019051810190610d449190611340565b6104c85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102d9565b6060610db28484600085610dba565b949350505050565b606082471015610e1b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102d9565b600080866001600160a01b03168587604051610e379190611362565b60006040518083038185875af1925050503d8060008114610e74576040519150601f19603f3d011682016040523d82523d6000602084013e610e79565b606091505b5091509150610e8a87838387610e95565b979650505050505050565b60608315610f04578251600003610efd576001600160a01b0385163b610efd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102d9565b5081610db2565b610db28383815115610f195781518083602001fd5b8060405162461bcd60e51b81526004016102d9919061137e565b6001600160a01b0381168114610f4857600080fd5b50565b600080600080600060a08688031215610f6357600080fd5b8535610f6e81610f33565b94506020860135610f7e81610f33565b93506040860135610f8e81610f33565b92506060860135610f9e81610f33565b91506080860135610fae81610f33565b809150509295509295909350565b60008060408385031215610fcf57600080fd5b8235610fda81610f33565b946020939093013593505050565b600060208284031215610ffa57600080fd5b813561100581610f33565b9392505050565b60008060006060848603121561102157600080fd5b833561102c81610f33565b9250602084013561103c81610f33565b929592945050506040919091013590565b6000806000806060858703121561106357600080fd5b84359350602085013561107581610f33565b9250604085013567ffffffffffffffff8082111561109257600080fd5b818701915087601f8301126110a657600080fd5b8135818111156110b557600080fd5b8860208285010111156110c757600080fd5b95989497505060200194505050565b600080858511156110e657600080fd5b838611156110f357600080fd5b5050820193919092039150565b8035602083101561111957600019602084900360031b1b165b92915050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015611150578181015183820152602001611138565b50506000910152565b60006020828403121561116b57600080fd5b815167ffffffffffffffff8082111561118357600080fd5b818401915084601f83011261119757600080fd5b8151818111156111a9576111a961111f565b604051601f8201601f19908116603f011681019083821181831017156111d1576111d161111f565b816040528281528760208487010111156111ea57600080fd5b610e8a836020830160208801611135565b60006020828403121561120d57600080fd5b815160ff8116811461100557600080fd5b60008151808452611236816020860160208601611135565b601f01601f19169290920160200192915050565b8581526001600160a01b038516602082015260a0604082018190526000906112749083018661121e565b8281036060840152611286818661121e565b91505060ff831660808301529695505050505050565b6001600160a01b0383168152604060208201819052600090610db29083018461121e565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b6000806000806080858703121561130557600080fd5b843561131081610f33565b9350602085013561132081610f33565b9250604085013561133081610f33565b9396929550929360600135925050565b60006020828403121561135257600080fd5b8151801515811461100557600080fd5b60008251611374818460208701611135565b9190910192915050565b602081526000611005602083018461121e56fea26469706673582212208b05e97748f5815f5f2643e1eafdda34899d6e704d3c0c792ad454f128c4283464736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` +var RootERC20PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"RootERC20Predicate","sourceName":"contracts/root/RootERC20Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Withdraw","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":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"TokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childERC20Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newChildERC20Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"},{"internalType":"address","name":"newNativeTokenRoot","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"rootToken","type":"address"}],"name":"mapToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nativeTokenRoot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b506113f5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ca5760003560e01c8063cb10f94c1161007c578063cb10f94c146101ab578063d41f1771146101c4578063d57184e4146101eb578063f213159c146101fe578063f43cda8b14610211578063f4a120f714610224578063f64512551461023757600080fd5b80631459457a146100cf57806347e7ef24146100e45780636a00c1d7146100f75780637efab4f51461012757806395c7041c14610150578063b176806514610163578063b68ad1e414610198575b600080fd5b6100e26100dd366004610f79565b61025e565b005b6100e26100f2366004610fea565b6104dc565b60055461010a906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010a610135366004611016565b6004602052600090815260409020546001600160a01b031681565b60015461010a906001600160a01b031681565b61018a7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60405190815260200161011e565b60035461010a906001600160a01b031681565b60005461010a906201000090046001600160a01b031681565b61018a7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b60025461010a906001600160a01b031681565b6100e261020c36600461103a565b6104eb565b6100e261021f36600461107b565b6104fb565b61010a610232366004611016565b610682565b61018a7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b600054610100900460ff161580801561027e5750600054600160ff909116105b806102985750303b158015610298575060005460ff166001145b6103005760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610323576000805461ff0019166101001790555b6001600160a01b0386161580159061034357506001600160a01b03851615155b801561035757506001600160a01b03841615155b801561036b57506001600160a01b03831615155b6103c65760405162461bcd60e51b815260206004820152602660248201527f526f6f7445524332305072656469636174653a204241445f494e495449414c496044820152652d20aa24a7a760d11b60648201526084016102f7565b6000805462010000600160b01b031916620100006001600160a01b038981169190910291909117909155600180546001600160a01b0319908116888416179091556002805482168784161790556003805490911685831617905582161561048e57600580546001600160a01b03199081166001600160a01b038581169182178455600091825260046020526040808320805461101095168517905593549351929316917f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e6179190a35b80156104d4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6104e7823383610a43565b5050565b6104f6838383610a43565b505050565b6001546001600160a01b031633146105615760405162461bcd60e51b8152602060048201526024808201527f526f6f7445524332305072656469636174653a204f4e4c595f455849545f4845604482015263262822a960e11b60648201526084016102f7565b6002546001600160a01b038481169116146105cf5760405162461bcd60e51b815260206004820152602860248201527f526f6f7445524332305072656469636174653a204f4e4c595f4348494c445f50604482015267524544494341544560c01b60648201526084016102f7565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828696105fe602060008486611104565b6106079161112e565b036106265761062161061c8260208186611104565b610bba565b61067c565b60405162461bcd60e51b815260206004820152602560248201527f526f6f7445524332305072656469636174653a20494e56414c49445f5349474e604482015264415455524560d81b60648201526084016102f7565b50505050565b60006001600160a01b0382166106e45760405162461bcd60e51b815260206004820152602160248201527f526f6f7445524332305072656469636174653a20494e56414c49445f544f4b456044820152602760f91b60648201526084016102f7565b6001600160a01b0382811660009081526004602052604090205416156107575760405162461bcd60e51b815260206004820152602260248201527f526f6f7445524332305072656469636174653a20414c52454144595f4d415050604482015261115160f21b60648201526084016102f7565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b039283169260009261080592911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa1580156108a2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ca9190810190611187565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610908573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109309190810190611187565b8a6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611229565b6040516020016109a6959493929190611278565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016109d29291906112ca565b600060405180830381600087803b1580156109ec57600080fd5b505af1158015610a00573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b6001600160a01b038084166000908152600460205260409020541680610a6f57610a6c84610682565b90505b6001600160a01b038116610a8557610a856112ee565b610a9a6001600160a01b038516333085610c72565b600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b0388811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f1983193610b2b9391169160c4016112ca565b600060405180830381600087803b158015610b4557600080fd5b505af1158015610b59573d6000803e3d6000fd5b50505050826001600160a01b0316816001600160a01b0316856001600160a01b03167f8be9001bb612c7123a1861dc0d9d94e683261f6cbbd7c7438b708975bc4908a33386604051610bac929190611304565b60405180910390a450505050565b6000808080610bcb8587018761131d565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610bfe57610bfe6112ee565b610c126001600160a01b0386168484610cdd565b826001600160a01b0316816001600160a01b0316866001600160a01b03167f9c4f744b2e971d7058a9d8f43977e0e17bf7d57a48659f0e18541b7ee3d022e48786604051610c61929190611304565b60405180910390a450505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261067c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610cfc565b6104f68363a9059cbb60e01b8484604051602401610ca6929190611304565b6000610d51826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610dd19092919063ffffffff16565b9050805160001480610d72575080806020019051810190610d72919061136e565b6104f65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102f7565b6060610de08484600085610de8565b949350505050565b606082471015610e495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102f7565b600080866001600160a01b03168587604051610e659190611390565b60006040518083038185875af1925050503d8060008114610ea2576040519150601f19603f3d011682016040523d82523d6000602084013e610ea7565b606091505b5091509150610eb887838387610ec3565b979650505050505050565b60608315610f32578251600003610f2b576001600160a01b0385163b610f2b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f7565b5081610de0565b610de08383815115610f475781518083602001fd5b8060405162461bcd60e51b81526004016102f791906113ac565b6001600160a01b0381168114610f7657600080fd5b50565b600080600080600060a08688031215610f9157600080fd5b8535610f9c81610f61565b94506020860135610fac81610f61565b93506040860135610fbc81610f61565b92506060860135610fcc81610f61565b91506080860135610fdc81610f61565b809150509295509295909350565b60008060408385031215610ffd57600080fd5b823561100881610f61565b946020939093013593505050565b60006020828403121561102857600080fd5b813561103381610f61565b9392505050565b60008060006060848603121561104f57600080fd5b833561105a81610f61565b9250602084013561106a81610f61565b929592945050506040919091013590565b6000806000806060858703121561109157600080fd5b8435935060208501356110a381610f61565b9250604085013567ffffffffffffffff808211156110c057600080fd5b818701915087601f8301126110d457600080fd5b8135818111156110e357600080fd5b8860208285010111156110f557600080fd5b95989497505060200194505050565b6000808585111561111457600080fd5b8386111561112157600080fd5b5050820193919092039150565b8035602083101561114757600019602084900360031b1b165b92915050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561117e578181015183820152602001611166565b50506000910152565b60006020828403121561119957600080fd5b815167ffffffffffffffff808211156111b157600080fd5b818401915084601f8301126111c557600080fd5b8151818111156111d7576111d761114d565b604051601f8201601f19908116603f011681019083821181831017156111ff576111ff61114d565b8160405282815287602084870101111561121857600080fd5b610eb8836020830160208801611163565b60006020828403121561123b57600080fd5b815160ff8116811461103357600080fd5b60008151808452611264816020860160208601611163565b601f01601f19169290920160200192915050565b8581526001600160a01b038516602082015260a0604082018190526000906112a29083018661124c565b82810360608401526112b4818661124c565b91505060ff831660808301529695505050505050565b6001600160a01b0383168152604060208201819052600090610de09083018461124c565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b6000806000806080858703121561133357600080fd5b843561133e81610f61565b9350602085013561134e81610f61565b9250604085013561135e81610f61565b9396929550929360600135925050565b60006020828403121561138057600080fd5b8151801515811461103357600080fd5b600082516113a2818460208701611163565b9190910192915050565b602081526000611033602083018461124c56fea2646970667358221220b638ab862c775779ca46f64f41fce11a25a259733849faf11ead45e4637ff9b964736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100ca5760003560e01c8063cb10f94c1161007c578063cb10f94c146101ab578063d41f1771146101c4578063d57184e4146101eb578063f213159c146101fe578063f43cda8b14610211578063f4a120f714610224578063f64512551461023757600080fd5b80631459457a146100cf57806347e7ef24146100e45780636a00c1d7146100f75780637efab4f51461012757806395c7041c14610150578063b176806514610163578063b68ad1e414610198575b600080fd5b6100e26100dd366004610f79565b61025e565b005b6100e26100f2366004610fea565b6104dc565b60055461010a906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61010a610135366004611016565b6004602052600090815260409020546001600160a01b031681565b60015461010a906001600160a01b031681565b61018a7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60405190815260200161011e565b60035461010a906001600160a01b031681565b60005461010a906201000090046001600160a01b031681565b61018a7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b60025461010a906001600160a01b031681565b6100e261020c36600461103a565b6104eb565b6100e261021f36600461107b565b6104fb565b61010a610232366004611016565b610682565b61018a7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b600054610100900460ff161580801561027e5750600054600160ff909116105b806102985750303b158015610298575060005460ff166001145b6103005760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610323576000805461ff0019166101001790555b6001600160a01b0386161580159061034357506001600160a01b03851615155b801561035757506001600160a01b03841615155b801561036b57506001600160a01b03831615155b6103c65760405162461bcd60e51b815260206004820152602660248201527f526f6f7445524332305072656469636174653a204241445f494e495449414c496044820152652d20aa24a7a760d11b60648201526084016102f7565b6000805462010000600160b01b031916620100006001600160a01b038981169190910291909117909155600180546001600160a01b0319908116888416179091556002805482168784161790556003805490911685831617905582161561048e57600580546001600160a01b03199081166001600160a01b038581169182178455600091825260046020526040808320805461101095168517905593549351929316917f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e6179190a35b80156104d4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6104e7823383610a43565b5050565b6104f6838383610a43565b505050565b6001546001600160a01b031633146105615760405162461bcd60e51b8152602060048201526024808201527f526f6f7445524332305072656469636174653a204f4e4c595f455849545f4845604482015263262822a960e11b60648201526084016102f7565b6002546001600160a01b038481169116146105cf5760405162461bcd60e51b815260206004820152602860248201527f526f6f7445524332305072656469636174653a204f4e4c595f4348494c445f50604482015267524544494341544560c01b60648201526084016102f7565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828696105fe602060008486611104565b6106079161112e565b036106265761062161061c8260208186611104565b610bba565b61067c565b60405162461bcd60e51b815260206004820152602560248201527f526f6f7445524332305072656469636174653a20494e56414c49445f5349474e604482015264415455524560d81b60648201526084016102f7565b50505050565b60006001600160a01b0382166106e45760405162461bcd60e51b815260206004820152602160248201527f526f6f7445524332305072656469636174653a20494e56414c49445f544f4b456044820152602760f91b60648201526084016102f7565b6001600160a01b0382811660009081526004602052604090205416156107575760405162461bcd60e51b815260206004820152602260248201527f526f6f7445524332305072656469636174653a20414c52454144595f4d415050604482015261115160f21b60648201526084016102f7565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b039283169260009261080592911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa1580156108a2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ca9190810190611187565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610908573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109309190810190611187565b8a6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611229565b6040516020016109a6959493929190611278565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016109d29291906112ca565b600060405180830381600087803b1580156109ec57600080fd5b505af1158015610a00573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b6001600160a01b038084166000908152600460205260409020541680610a6f57610a6c84610682565b90505b6001600160a01b038116610a8557610a856112ee565b610a9a6001600160a01b038516333085610c72565b600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b0388811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f1983193610b2b9391169160c4016112ca565b600060405180830381600087803b158015610b4557600080fd5b505af1158015610b59573d6000803e3d6000fd5b50505050826001600160a01b0316816001600160a01b0316856001600160a01b03167f8be9001bb612c7123a1861dc0d9d94e683261f6cbbd7c7438b708975bc4908a33386604051610bac929190611304565b60405180910390a450505050565b6000808080610bcb8587018761131d565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610bfe57610bfe6112ee565b610c126001600160a01b0386168484610cdd565b826001600160a01b0316816001600160a01b0316866001600160a01b03167f9c4f744b2e971d7058a9d8f43977e0e17bf7d57a48659f0e18541b7ee3d022e48786604051610c61929190611304565b60405180910390a450505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261067c9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610cfc565b6104f68363a9059cbb60e01b8484604051602401610ca6929190611304565b6000610d51826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610dd19092919063ffffffff16565b9050805160001480610d72575080806020019051810190610d72919061136e565b6104f65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102f7565b6060610de08484600085610de8565b949350505050565b606082471015610e495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102f7565b600080866001600160a01b03168587604051610e659190611390565b60006040518083038185875af1925050503d8060008114610ea2576040519150601f19603f3d011682016040523d82523d6000602084013e610ea7565b606091505b5091509150610eb887838387610ec3565b979650505050505050565b60608315610f32578251600003610f2b576001600160a01b0385163b610f2b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f7565b5081610de0565b610de08383815115610f475781518083602001fd5b8060405162461bcd60e51b81526004016102f791906113ac565b6001600160a01b0381168114610f7657600080fd5b50565b600080600080600060a08688031215610f9157600080fd5b8535610f9c81610f61565b94506020860135610fac81610f61565b93506040860135610fbc81610f61565b92506060860135610fcc81610f61565b91506080860135610fdc81610f61565b809150509295509295909350565b60008060408385031215610ffd57600080fd5b823561100881610f61565b946020939093013593505050565b60006020828403121561102857600080fd5b813561103381610f61565b9392505050565b60008060006060848603121561104f57600080fd5b833561105a81610f61565b9250602084013561106a81610f61565b929592945050506040919091013590565b6000806000806060858703121561109157600080fd5b8435935060208501356110a381610f61565b9250604085013567ffffffffffffffff808211156110c057600080fd5b818701915087601f8301126110d457600080fd5b8135818111156110e357600080fd5b8860208285010111156110f557600080fd5b95989497505060200194505050565b6000808585111561111457600080fd5b8386111561112157600080fd5b5050820193919092039150565b8035602083101561114757600019602084900360031b1b165b92915050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561117e578181015183820152602001611166565b50506000910152565b60006020828403121561119957600080fd5b815167ffffffffffffffff808211156111b157600080fd5b818401915084601f8301126111c557600080fd5b8151818111156111d7576111d761114d565b604051601f8201601f19908116603f011681019083821181831017156111ff576111ff61114d565b8160405282815287602084870101111561121857600080fd5b610eb8836020830160208801611163565b60006020828403121561123b57600080fd5b815160ff8116811461103357600080fd5b60008151808452611264816020860160208601611163565b601f01601f19169290920160200192915050565b8581526001600160a01b038516602082015260a0604082018190526000906112a29083018661124c565b82810360608401526112b4818661124c565b91505060ff831660808301529695505050505050565b6001600160a01b0383168152604060208201819052600090610de09083018461124c565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b6000806000806080858703121561133357600080fd5b843561133e81610f61565b9350602085013561134e81610f61565b9250604085013561135e81610f61565b9396929550929360600135925050565b60006020828403121561138057600080fd5b8151801515811461103357600080fd5b600082516113a2818460208701611163565b9190910192915050565b602081526000611033602083018461124c56fea2646970667358221220b638ab862c775779ca46f64f41fce11a25a259733849faf11ead45e4637ff9b964736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var ChildMintableERC20PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"ChildMintableERC20Predicate","sourceName":"contracts/root/ChildMintableERC20Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintableERC20Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintableERC20Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"MintableTokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newRootERC20Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rootERC20Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IChildERC20","name":"childToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IChildERC20","name":"childToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b506113c8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cb10f94c11610071578063cb10f94c14610182578063d41f17711461019b578063f3fef3a3146101c2578063f43cda8b146101d5578063f6451255146101e8578063f8c8765e1461020f57600080fd5b806371cf93b7146100b95780637efab4f5146100e957806395c7041c14610112578063b176806514610125578063b68ad1e41461015a578063c3b35a7e1461016d575b600080fd5b6002546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cc6100f7366004610ecf565b6004602052600090815260409020546001600160a01b031681565b6001546100cc906001600160a01b031681565b61014c7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b6040519081526020016100e0565b6003546100cc906001600160a01b031681565b61018061017b366004610ef3565b610222565b005b6000546100cc906201000090046001600160a01b031681565b61014c7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101806101d0366004610f34565b610232565b6101806101e3366004610f60565b610241565b61014c7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61018061021d366004610fe9565b610432565b61022d83838361054b565b505050565b61023d82338361054b565b5050565b6001546001600160a01b031633146102b95760405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c6545524332305072656469636174653a204f4e4c60448201526f2cafa9aa20aa22afa922a1a2a4ab22a960811b60648201526084015b60405180910390fd5b6002546001600160a01b0384811691161461032f5760405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c6545524332305072656469636174653a204f4e4c60448201526f595f524f4f545f50524544494341544560801b60648201526084016102b0565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161035e602060008486611045565b6103679161106f565b036103865761038161037c8260208186611045565b6108e0565b61042c565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad6103b5602060008486611045565b6103be9161106f565b036103cd576103818282610b9c565b60405162461bcd60e51b815260206004820152602e60248201527f4368696c644d696e7461626c6545524332305072656469636174653a20494e5660448201526d414c49445f5349474e415455524560901b60648201526084016102b0565b50505050565b600054610100900460ff16158080156104525750600054600160ff909116105b8061046c5750303b15801561046c575060005460ff166001145b6104cf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b0565b6000805460ff1916600117905580156104f2576000805461ff0019166101001790555b6104fe85858585610d13565b8015610544576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b826001600160a01b03163b6000036105b75760405162461bcd60e51b815260206004820152602960248201527f4368696c644d696e7461626c6545524332305072656469636174653a204e4f5460448201526817d0d3d395149050d560ba1b60648201526084016102b0565b6000836001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b919061108d565b6001600160a01b0381811660009081526004602052604090205491925085811691161461065a5760405162461bcd60e51b81526004016102b0906110aa565b6001600160a01b038116610670576106706110f5565b306001600160a01b0316846001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc919061108d565b6001600160a01b0316146106f2576106f26110f5565b604051632770a7eb60e21b81526001600160a01b03851690639dc29fac90610720903390869060040161110b565b6020604051808303816000875af115801561073f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190611124565b6107c05760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c6545524332305072656469636174653a204255526044820152671397d1905253115160c21b60648201526084016102b0565b600054600254604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f19831936108519391169160c40161118c565b600060405180830381600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b0316826001600160a01b03167f1da92ba31d15f9af529a2efe7acebc6c0a4ac8e9cd86a84f199a474e505d77a633866040516108d292919061110b565b60405180910390a450505050565b60008080806108f1858701876111b8565b6001600160a01b03808516600090815260046020526040902054949850929650909450925016806109345760405162461bcd60e51b81526004016102b0906110aa565b806001600160a01b03163b60000361094e5761094e6110f5565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b2919061108d565b9050856001600160a01b0316816001600160a01b0316146109d5576109d56110f5565b6001600160a01b0381166109eb576109eb6110f5565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a57919061108d565b6001600160a01b031614610a6d57610a6d6110f5565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610a9b908790879060040161110b565b6020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ade9190611124565b610b3b5760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c6545524332305072656469636174653a204d494e6044820152671517d1905253115160c21b60648201526084016102b0565b836001600160a01b0316826001600160a01b0316876001600160a01b03167fcf47ccd68b2113d6309d8d504a67c10963dc0bfbf2416e4726a316511cca27b58887604051610b8a92919061110b565b60405180910390a45050505050505050565b6000808080610bad858701876112ac565b92975090955093509150506001600160a01b038416610bce57610bce6110f5565b6001600160a01b038481166000908152600460205260409020541615610bf657610bf66110f5565b6003546040516bffffffffffffffffffffffff19606087901b166020820152600091610c46916001600160a01b039091169060340160405160208183030381529060405280519060200120610e1a565b6001600160a01b0386811660009081526004602081905260409182902080546001600160a01b03191693851693841790559051637b69774360e11b8152929350909163f6d2ee8691610ca091899189918991899101611347565b600060405180830381600087803b158015610cba57600080fd5b505af1158015610cce573d6000803e3d6000fd5b50506040516001600160a01b038085169350881691507f0a1eaf9aa124c3f84c9dd77f7016af0f16f67639abb913af1697387db01f5ca590600090a350505050505050565b6001600160a01b03841615801590610d3357506001600160a01b03831615155b8015610d4757506001600160a01b03821615155b8015610d5b57506001600160a01b03811615155b610dbf5760405162461bcd60e51b815260206004820152602f60248201527f4368696c644d696e7461626c6545524332305072656469636174653a2042414460448201526e2fa4a724aa24a0a624ad20aa24a7a760891b60648201526084016102b0565b600080546001600160a01b03958616620100000262010000600160b01b0319909116179055600180549385166001600160a01b0319948516179055600280549285169284169290921790915560038054919093169116179055565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b038116610eb15760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016102b0565b92915050565b6001600160a01b0381168114610ecc57600080fd5b50565b600060208284031215610ee157600080fd5b8135610eec81610eb7565b9392505050565b600080600060608486031215610f0857600080fd5b8335610f1381610eb7565b92506020840135610f2381610eb7565b929592945050506040919091013590565b60008060408385031215610f4757600080fd5b8235610f5281610eb7565b946020939093013593505050565b60008060008060608587031215610f7657600080fd5b843593506020850135610f8881610eb7565b9250604085013567ffffffffffffffff80821115610fa557600080fd5b818701915087601f830112610fb957600080fd5b813581811115610fc857600080fd5b886020828501011115610fda57600080fd5b95989497505060200194505050565b60008060008060808587031215610fff57600080fd5b843561100a81610eb7565b9350602085013561101a81610eb7565b9250604085013561102a81610eb7565b9150606085013561103a81610eb7565b939692955090935050565b6000808585111561105557600080fd5b8386111561106257600080fd5b5050820193919092039150565b80356020831015610eb157600019602084900360031b1b1692915050565b60006020828403121561109f57600080fd5b8151610eec81610eb7565b6020808252602b908201527f4368696c644d696e7461626c6545524332305072656469636174653a20554e4d60408201526a20a82822a22faa27a5a2a760a91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b60006020828403121561113657600080fd5b81518015158114610eec57600080fd5b6000815180845260005b8181101561116c57602081850181015186830182015201611150565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190526000906111b090830184611146565b949350505050565b600080600080608085870312156111ce57600080fd5b84356111d981610eb7565b935060208501356111e981610eb7565b925060408501356111f981610eb7565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261123057600080fd5b813567ffffffffffffffff8082111561124b5761124b611209565b604051601f8301601f19908116603f0116810190828211818310171561127357611273611209565b8160405283815286602085880101111561128c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156112c457600080fd5b8535945060208601356112d681610eb7565b9350604086013567ffffffffffffffff808211156112f357600080fd5b6112ff89838a0161121f565b9450606088013591508082111561131557600080fd5b506113228882890161121f565b925050608086013560ff8116811461133957600080fd5b809150509295509295909350565b6001600160a01b038516815260806020820181905260009061136b90830186611146565b828103604084015261137d8186611146565b91505060ff831660608301529594505050505056fea264697066735822122087775fa0c83774cca5f812d4bf60fa4ef351e7b816104e4edbe586babc84517664736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cb10f94c11610071578063cb10f94c14610182578063d41f17711461019b578063f3fef3a3146101c2578063f43cda8b146101d5578063f6451255146101e8578063f8c8765e1461020f57600080fd5b806371cf93b7146100b95780637efab4f5146100e957806395c7041c14610112578063b176806514610125578063b68ad1e41461015a578063c3b35a7e1461016d575b600080fd5b6002546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cc6100f7366004610ecf565b6004602052600090815260409020546001600160a01b031681565b6001546100cc906001600160a01b031681565b61014c7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b6040519081526020016100e0565b6003546100cc906001600160a01b031681565b61018061017b366004610ef3565b610222565b005b6000546100cc906201000090046001600160a01b031681565b61014c7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101806101d0366004610f34565b610232565b6101806101e3366004610f60565b610241565b61014c7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61018061021d366004610fe9565b610432565b61022d83838361054b565b505050565b61023d82338361054b565b5050565b6001546001600160a01b031633146102b95760405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c6545524332305072656469636174653a204f4e4c60448201526f2cafa9aa20aa22afa922a1a2a4ab22a960811b60648201526084015b60405180910390fd5b6002546001600160a01b0384811691161461032f5760405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c6545524332305072656469636174653a204f4e4c60448201526f595f524f4f545f50524544494341544560801b60648201526084016102b0565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161035e602060008486611045565b6103679161106f565b036103865761038161037c8260208186611045565b6108e0565b61042c565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad6103b5602060008486611045565b6103be9161106f565b036103cd576103818282610b9c565b60405162461bcd60e51b815260206004820152602e60248201527f4368696c644d696e7461626c6545524332305072656469636174653a20494e5660448201526d414c49445f5349474e415455524560901b60648201526084016102b0565b50505050565b600054610100900460ff16158080156104525750600054600160ff909116105b8061046c5750303b15801561046c575060005460ff166001145b6104cf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b0565b6000805460ff1916600117905580156104f2576000805461ff0019166101001790555b6104fe85858585610d13565b8015610544576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b826001600160a01b03163b6000036105b75760405162461bcd60e51b815260206004820152602960248201527f4368696c644d696e7461626c6545524332305072656469636174653a204e4f5460448201526817d0d3d395149050d560ba1b60648201526084016102b0565b6000836001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b919061108d565b6001600160a01b0381811660009081526004602052604090205491925085811691161461065a5760405162461bcd60e51b81526004016102b0906110aa565b6001600160a01b038116610670576106706110f5565b306001600160a01b0316846001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc919061108d565b6001600160a01b0316146106f2576106f26110f5565b604051632770a7eb60e21b81526001600160a01b03851690639dc29fac90610720903390869060040161110b565b6020604051808303816000875af115801561073f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190611124565b6107c05760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c6545524332305072656469636174653a204255526044820152671397d1905253115160c21b60648201526084016102b0565b600054600254604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352620100009094048416936316f19831936108519391169160c40161118c565b600060405180830381600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b0316826001600160a01b03167f1da92ba31d15f9af529a2efe7acebc6c0a4ac8e9cd86a84f199a474e505d77a633866040516108d292919061110b565b60405180910390a450505050565b60008080806108f1858701876111b8565b6001600160a01b03808516600090815260046020526040902054949850929650909450925016806109345760405162461bcd60e51b81526004016102b0906110aa565b806001600160a01b03163b60000361094e5761094e6110f5565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b2919061108d565b9050856001600160a01b0316816001600160a01b0316146109d5576109d56110f5565b6001600160a01b0381166109eb576109eb6110f5565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a57919061108d565b6001600160a01b031614610a6d57610a6d6110f5565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610a9b908790879060040161110b565b6020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ade9190611124565b610b3b5760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c6545524332305072656469636174653a204d494e6044820152671517d1905253115160c21b60648201526084016102b0565b836001600160a01b0316826001600160a01b0316876001600160a01b03167fcf47ccd68b2113d6309d8d504a67c10963dc0bfbf2416e4726a316511cca27b58887604051610b8a92919061110b565b60405180910390a45050505050505050565b6000808080610bad858701876112ac565b92975090955093509150506001600160a01b038416610bce57610bce6110f5565b6001600160a01b038481166000908152600460205260409020541615610bf657610bf66110f5565b6003546040516bffffffffffffffffffffffff19606087901b166020820152600091610c46916001600160a01b039091169060340160405160208183030381529060405280519060200120610e1a565b6001600160a01b0386811660009081526004602081905260409182902080546001600160a01b03191693851693841790559051637b69774360e11b8152929350909163f6d2ee8691610ca091899189918991899101611347565b600060405180830381600087803b158015610cba57600080fd5b505af1158015610cce573d6000803e3d6000fd5b50506040516001600160a01b038085169350881691507f0a1eaf9aa124c3f84c9dd77f7016af0f16f67639abb913af1697387db01f5ca590600090a350505050505050565b6001600160a01b03841615801590610d3357506001600160a01b03831615155b8015610d4757506001600160a01b03821615155b8015610d5b57506001600160a01b03811615155b610dbf5760405162461bcd60e51b815260206004820152602f60248201527f4368696c644d696e7461626c6545524332305072656469636174653a2042414460448201526e2fa4a724aa24a0a624ad20aa24a7a760891b60648201526084016102b0565b600080546001600160a01b03958616620100000262010000600160b01b0319909116179055600180549385166001600160a01b0319948516179055600280549285169284169290921790915560038054919093169116179055565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b038116610eb15760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016102b0565b92915050565b6001600160a01b0381168114610ecc57600080fd5b50565b600060208284031215610ee157600080fd5b8135610eec81610eb7565b9392505050565b600080600060608486031215610f0857600080fd5b8335610f1381610eb7565b92506020840135610f2381610eb7565b929592945050506040919091013590565b60008060408385031215610f4757600080fd5b8235610f5281610eb7565b946020939093013593505050565b60008060008060608587031215610f7657600080fd5b843593506020850135610f8881610eb7565b9250604085013567ffffffffffffffff80821115610fa557600080fd5b818701915087601f830112610fb957600080fd5b813581811115610fc857600080fd5b886020828501011115610fda57600080fd5b95989497505060200194505050565b60008060008060808587031215610fff57600080fd5b843561100a81610eb7565b9350602085013561101a81610eb7565b9250604085013561102a81610eb7565b9150606085013561103a81610eb7565b939692955090935050565b6000808585111561105557600080fd5b8386111561106257600080fd5b5050820193919092039150565b80356020831015610eb157600019602084900360031b1b1692915050565b60006020828403121561109f57600080fd5b8151610eec81610eb7565b6020808252602b908201527f4368696c644d696e7461626c6545524332305072656469636174653a20554e4d60408201526a20a82822a22faa27a5a2a760a91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b60006020828403121561113657600080fd5b81518015158114610eec57600080fd5b6000815180845260005b8181101561116c57602081850181015186830182015201611150565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190526000906111b090830184611146565b949350505050565b600080600080608085870312156111ce57600080fd5b84356111d981610eb7565b935060208501356111e981610eb7565b925060408501356111f981610eb7565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261123057600080fd5b813567ffffffffffffffff8082111561124b5761124b611209565b604051601f8301601f19908116603f0116810190828211818310171561127357611273611209565b8160405283815286602085880101111561128c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156112c457600080fd5b8535945060208601356112d681610eb7565b9350604086013567ffffffffffffffff808211156112f357600080fd5b6112ff89838a0161121f565b9450606088013591508082111561131557600080fd5b506113228882890161121f565b925050608086013560ff8116811461133957600080fd5b809150509295509295909350565b6001600160a01b038516815260806020820181905260009061136b90830186611146565b828103604084015261137d8186611146565b91505060ff831660608301529594505050505056fea264697066735822122087775fa0c83774cca5f812d4bf60fa4ef351e7b816104e4edbe586babc84517664736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var MockERC721Artifact string = `{"_format":"hh-sol-artifact-1","contractName":"MockERC721","sourceName":"contracts/mocks/MockERC721.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x60806040523480156200001157600080fd5b5060405180604001604052806004815260200163151154d560e21b81525060405180604001604052806004815260200163151154d560e21b815250604051806040016040528060058152602001646c6f72656d60d81b815250828281600290816200007d919062000307565b5060036200008c828262000307565b5050600c805460ff1916905550600e620000a7828262000307565b50620000b560003362000116565b620000e17f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a63362000116565b6200010d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a3362000116565b505050620003d3565b62000122828262000126565b5050565b62000132828262000151565b60008281526001602052604090206200014c9082620001f1565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000122576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001ad3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000208836001600160a01b03841662000211565b90505b92915050565b60008181526001830160205260408120546200025a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200020b565b5060006200020b565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200028e57607f821691505b602082108103620002af57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200014c57600081815260208120601f850160051c81016020861015620002de5750805b601f850160051c820191505b81811015620002ff57828155600101620002ea565b505050505050565b81516001600160401b0381111562000323576200032362000263565b6200033b8162000334845462000279565b84620002b5565b602080601f8311600181146200037357600084156200035a5750858301515b600019600386901b1c1916600185901b178555620002ff565b600085815260208120601f198616915b82811015620003a45788860151825594840194600190910190840162000383565b5085821015620003c35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61244180620003e36000396000f3fe608060405234801561001057600080fd5b50600436106101a55760003560e01c80636352211e116100ef578063a22cb46511610092578063a22cb4651461036b578063b88d4fde1461037e578063c87b56dd14610391578063ca15c873146103a4578063d5391393146103b7578063d547741f146103de578063e63ab1e9146103f1578063e985e9c51461040657600080fd5b80636352211e146102f45780636a6278421461030757806370a082311461031a5780638456cb591461032d5780639010d07c1461033557806391d148541461034857806395d89b411461035b578063a217fddf1461036357600080fd5b80632f2ff15d116101575780632f2ff15d1461026f5780632f745c591461028257806336568abe146102955780633f4ba83a146102a857806342842e0e146102b057806342966c68146102c35780634f6ccce7146102d65780635c975abb146102e957600080fd5b806301ffc9a7146101aa57806306fdde03146101d2578063081812fc146101e7578063095ea7b31461021257806318160ddd1461022757806323b872dd14610239578063248a9ca31461024c575b600080fd5b6101bd6101b8366004611dba565b610419565b60405190151581526020015b60405180910390f35b6101da61042a565b6040516101c99190611e27565b6101fa6101f5366004611e3a565b6104bc565b6040516001600160a01b0390911681526020016101c9565b610225610220366004611e6f565b6104e3565b005b600a545b6040519081526020016101c9565b610225610247366004611e99565b6105fd565b61022b61025a366004611e3a565b60009081526020819052604090206001015490565b61022561027d366004611ed5565b61062f565b61022b610290366004611e6f565b610654565b6102256102a3366004611ed5565b6106ea565b610225610768565b6102256102be366004611e99565b6107ec565b6102256102d1366004611e3a565b610807565b61022b6102e4366004611e3a565b610838565b600c5460ff166101bd565b6101fa610302366004611e3a565b6108cb565b610225610315366004611f01565b610900565b61022b610328366004611f01565b6109aa565b610225610a30565b6101fa610343366004611f1c565b610ab0565b6101bd610356366004611ed5565b610acf565b6101da610af8565b61022b600081565b610225610379366004611f3e565b610b07565b61022561038c366004611f90565b610b12565b6101da61039f366004611e3a565b610b4a565b61022b6103b2366004611e3a565b610bb0565b61022b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102256103ec366004611ed5565b610bc7565b61022b6000805160206123ac83398151915281565b6101bd61041436600461206c565b610bec565b600061042482610c1a565b92915050565b60606002805461043990612096565b80601f016020809104026020016040519081016040528092919081815260200182805461046590612096565b80156104b25780601f10610487576101008083540402835291602001916104b2565b820191906000526020600020905b81548152906001019060200180831161049557829003601f168201915b5050505050905090565b60006104c782610c3f565b506000908152600660205260409020546001600160a01b031690565b60006104ee826108cb565b9050806001600160a01b0316836001600160a01b0316036105605760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061057c575061057c8133610bec565b6105ee5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610557565b6105f88383610c64565b505050565b610608335b82610cd2565b6106245760405162461bcd60e51b8152600401610557906120d0565b6105f8838383610d31565b60008281526020819052604090206001015461064a81610e90565b6105f88383610e9a565b600061065f836109aa565b82106106c15760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610557565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b6001600160a01b038116331461075a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610557565b6107648282610ebc565b5050565b6107806000805160206123ac83398151915233610acf565b6107e2576040805162461bcd60e51b81526020600482015260248101919091526000805160206123ec83398151915260448201527f6d75737420686176652070617573657220726f6c6520746f20756e70617573656064820152608401610557565b6107ea610ede565b565b6105f883838360405180602001604052806000815250610b12565b61081033610602565b61082c5760405162461bcd60e51b8152600401610557906120d0565b61083581610f30565b50565b6000610843600a5490565b82106108a65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610557565b600a82815481106108b9576108b961211d565b90600052602060002001549050919050565b6000818152600460205260408120546001600160a01b0316806104245760405162461bcd60e51b815260040161055790612133565b61092a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610acf565b61098a5760405162461bcd60e51b815260206004820152603d60248201526000805160206123ec83398151915260448201527f6d7573742068617665206d696e74657220726f6c6520746f206d696e740000006064820152608401610557565b61099c81610997600d5490565b610fc1565b610835600d80546001019055565b60006001600160a01b038216610a145760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610557565b506001600160a01b031660009081526005602052604090205490565b610a486000805160206123ac83398151915233610acf565b610aa85760405162461bcd60e51b815260206004820152603e60248201526000805160206123ec83398151915260448201527f6d75737420686176652070617573657220726f6c6520746f20706175736500006064820152608401610557565b6107ea6110ca565b6000828152600160205260408120610ac89083611107565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606003805461043990612096565b610764338383611113565b610b1c3383610cd2565b610b385760405162461bcd60e51b8152600401610557906120d0565b610b44848484846111dd565b50505050565b6060610b5582610c3f565b6000610b5f611210565b90506000815111610b7f5760405180602001604052806000815250610ac8565b80610b898461121f565b604051602001610b9a929190612165565b6040516020818303038152906040529392505050565b6000818152600160205260408120610424906112b2565b600082815260208190526040902060010154610be281610e90565b6105f88383610ebc565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60006001600160e01b0319821663780e9d6360e01b14806104245750610424826112bc565b610c48816112fc565b6108355760405162461bcd60e51b815260040161055790612133565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610c99826108cb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610cde836108cb565b9050806001600160a01b0316846001600160a01b03161480610d055750610d058185610bec565b80610d295750836001600160a01b0316610d1e846104bc565b6001600160a01b0316145b949350505050565b826001600160a01b0316610d44826108cb565b6001600160a01b031614610d6a5760405162461bcd60e51b815260040161055790612194565b6001600160a01b038216610dcc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610557565b610dd98383836001611319565b826001600160a01b0316610dec826108cb565b6001600160a01b031614610e125760405162461bcd60e51b815260040161055790612194565b600081815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260058552838620805460001901905590871680865283862080546001019055868652600490945282852080549092168417909155905184936000805160206123cc83398151915291a4505050565b6108358133611325565b610ea4828261137e565b60008281526001602052604090206105f89082611402565b610ec68282611417565b60008281526001602052604090206105f8908261147c565b610ee6611491565b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000610f3b826108cb565b9050610f4b816000846001611319565b610f54826108cb565b600083815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526005845282852080546000190190558785526004909352818420805490911690555192935084926000805160206123cc833981519152908390a45050565b6001600160a01b0382166110175760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610557565b611020816112fc565b1561103d5760405162461bcd60e51b8152600401610557906121d9565b61104b600083836001611319565b611054816112fc565b156110715760405162461bcd60e51b8152600401610557906121d9565b6001600160a01b038216600081815260056020908152604080832080546001019055848352600490915280822080546001600160a01b0319168417905551839291906000805160206123cc833981519152908290a45050565b6110d26114da565b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f133390565b6000610ac88383611520565b816001600160a01b0316836001600160a01b0316036111705760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610557565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6111e8848484610d31565b6111f48484848461154a565b610b445760405162461bcd60e51b815260040161055790612210565b6060600e805461043990612096565b6060600061122c8361164b565b600101905060008167ffffffffffffffff81111561124c5761124c611f7a565b6040519080825280601f01601f191660200182016040528015611276576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461128057509392505050565b6000610424825490565b60006001600160e01b031982166380ac58cd60e01b14806112ed57506001600160e01b03198216635b5e139f60e01b145b80610424575061042482611723565b6000908152600460205260409020546001600160a01b0316151590565b610b4484848484611748565b61132f8282610acf565b6107645761133c816117bb565b6113478360206117cd565b604051602001611358929190612262565b60408051601f198184030181529082905262461bcd60e51b825261055791600401611e27565b6113888282610acf565b610764576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556113be3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ac8836001600160a01b038416611969565b6114218282610acf565b15610764576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610ac8836001600160a01b0384166119b8565b600c5460ff166107ea5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610557565b600c5460ff16156107ea5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610557565b60008260000182815481106115375761153761211d565b9060005260206000200154905092915050565b60006001600160a01b0384163b1561164057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061158e9033908990889088906004016122d1565b6020604051808303816000875af19250505080156115c9575060408051601f3d908101601f191682019092526115c69181019061230e565b60015b611626573d8080156115f7576040519150601f19603f3d011682016040523d82523d6000602084013e6115fc565b606091505b50805160000361161e5760405162461bcd60e51b815260040161055790612210565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d29565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061168a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106116b6576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106116d457662386f26fc10000830492506010015b6305f5e10083106116ec576305f5e100830492506008015b612710831061170057612710830492506004015b60648310611712576064830492506002015b600a83106104245760010192915050565b60006001600160e01b03198216635a05180f60e01b1480610424575061042482611aab565b61175484848484611ae0565b600c5460ff1615610b445760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610557565b60606104246001600160a01b03831660145b606060006117dc836002612341565b6117e7906002612358565b67ffffffffffffffff8111156117ff576117ff611f7a565b6040519080825280601f01601f191660200182016040528015611829576020820181803683370190505b509050600360fc1b816000815181106118445761184461211d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118735761187361211d565b60200101906001600160f81b031916908160001a9053506000611897846002612341565b6118a2906001612358565b90505b600181111561191a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118d6576118d661211d565b1a60f81b8282815181106118ec576118ec61211d565b60200101906001600160f81b031916908160001a90535060049490941c936119138161236b565b90506118a5565b508315610ac85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610557565b60008181526001830160205260408120546119b057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610424565b506000610424565b60008181526001830160205260408120548015611aa15760006119dc600183612382565b85549091506000906119f090600190612382565b9050818114611a55576000866000018281548110611a1057611a1061211d565b9060005260206000200154905080876000018481548110611a3357611a3361211d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a6657611a66612395565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610424565b6000915050610424565b60006001600160e01b03198216637965db0b60e01b148061042457506301ffc9a760e01b6001600160e01b0319831614610424565b6001811115611b4f5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610557565b816001600160a01b038516611bab57611ba681600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b611bce565b836001600160a01b0316856001600160a01b031614611bce57611bce8582611c14565b6001600160a01b038416611bea57611be581611cb1565b611c0d565b846001600160a01b0316846001600160a01b031614611c0d57611c0d8482611d60565b5050505050565b60006001611c21846109aa565b611c2b9190612382565b600083815260096020526040902054909150808214611c7e576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090611cc390600190612382565b6000838152600b6020526040812054600a8054939450909284908110611ceb57611ceb61211d565b9060005260206000200154905080600a8381548110611d0c57611d0c61211d565b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a805480611d4457611d44612395565b6001900381819060005260206000200160009055905550505050565b6000611d6b836109aa565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b6001600160e01b03198116811461083557600080fd5b600060208284031215611dcc57600080fd5b8135610ac881611da4565b60005b83811015611df2578181015183820152602001611dda565b50506000910152565b60008151808452611e13816020860160208601611dd7565b601f01601f19169290920160200192915050565b602081526000610ac86020830184611dfb565b600060208284031215611e4c57600080fd5b5035919050565b80356001600160a01b0381168114611e6a57600080fd5b919050565b60008060408385031215611e8257600080fd5b611e8b83611e53565b946020939093013593505050565b600080600060608486031215611eae57600080fd5b611eb784611e53565b9250611ec560208501611e53565b9150604084013590509250925092565b60008060408385031215611ee857600080fd5b82359150611ef860208401611e53565b90509250929050565b600060208284031215611f1357600080fd5b610ac882611e53565b60008060408385031215611f2f57600080fd5b50508035926020909101359150565b60008060408385031215611f5157600080fd5b611f5a83611e53565b915060208301358015158114611f6f57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611fa657600080fd5b611faf85611e53565b9350611fbd60208601611e53565b925060408501359150606085013567ffffffffffffffff80821115611fe157600080fd5b818701915087601f830112611ff557600080fd5b81358181111561200757612007611f7a565b604051601f8201601f19908116603f0116810190838211818310171561202f5761202f611f7a565b816040528281528a602084870101111561204857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561207f57600080fd5b61208883611e53565b9150611ef860208401611e53565b600181811c908216806120aa57607f821691505b6020821081036120ca57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351612177818460208801611dd7565b83519083019061218b818360208801611dd7565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351612294816017850160208801611dd7565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516122c5816028840160208801611dd7565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061230490830184611dfb565b9695505050505050565b60006020828403121561232057600080fd5b8151610ac881611da4565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104245761042461232b565b808201808211156104245761042461232b565b60008161237a5761237a61232b565b506000190190565b818103818111156104245761042461232b565b634e487b7160e01b600052603160045260246000fdfe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552433732315072657365744d696e7465725061757365724175746f49643a20a2646970667358221220f586c29d0cbd3e2cee9bd99a648a34864226f46f9a05471902f3728b4f230c2864736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101a55760003560e01c80636352211e116100ef578063a22cb46511610092578063a22cb4651461036b578063b88d4fde1461037e578063c87b56dd14610391578063ca15c873146103a4578063d5391393146103b7578063d547741f146103de578063e63ab1e9146103f1578063e985e9c51461040657600080fd5b80636352211e146102f45780636a6278421461030757806370a082311461031a5780638456cb591461032d5780639010d07c1461033557806391d148541461034857806395d89b411461035b578063a217fddf1461036357600080fd5b80632f2ff15d116101575780632f2ff15d1461026f5780632f745c591461028257806336568abe146102955780633f4ba83a146102a857806342842e0e146102b057806342966c68146102c35780634f6ccce7146102d65780635c975abb146102e957600080fd5b806301ffc9a7146101aa57806306fdde03146101d2578063081812fc146101e7578063095ea7b31461021257806318160ddd1461022757806323b872dd14610239578063248a9ca31461024c575b600080fd5b6101bd6101b8366004611dba565b610419565b60405190151581526020015b60405180910390f35b6101da61042a565b6040516101c99190611e27565b6101fa6101f5366004611e3a565b6104bc565b6040516001600160a01b0390911681526020016101c9565b610225610220366004611e6f565b6104e3565b005b600a545b6040519081526020016101c9565b610225610247366004611e99565b6105fd565b61022b61025a366004611e3a565b60009081526020819052604090206001015490565b61022561027d366004611ed5565b61062f565b61022b610290366004611e6f565b610654565b6102256102a3366004611ed5565b6106ea565b610225610768565b6102256102be366004611e99565b6107ec565b6102256102d1366004611e3a565b610807565b61022b6102e4366004611e3a565b610838565b600c5460ff166101bd565b6101fa610302366004611e3a565b6108cb565b610225610315366004611f01565b610900565b61022b610328366004611f01565b6109aa565b610225610a30565b6101fa610343366004611f1c565b610ab0565b6101bd610356366004611ed5565b610acf565b6101da610af8565b61022b600081565b610225610379366004611f3e565b610b07565b61022561038c366004611f90565b610b12565b6101da61039f366004611e3a565b610b4a565b61022b6103b2366004611e3a565b610bb0565b61022b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102256103ec366004611ed5565b610bc7565b61022b6000805160206123ac83398151915281565b6101bd61041436600461206c565b610bec565b600061042482610c1a565b92915050565b60606002805461043990612096565b80601f016020809104026020016040519081016040528092919081815260200182805461046590612096565b80156104b25780601f10610487576101008083540402835291602001916104b2565b820191906000526020600020905b81548152906001019060200180831161049557829003601f168201915b5050505050905090565b60006104c782610c3f565b506000908152600660205260409020546001600160a01b031690565b60006104ee826108cb565b9050806001600160a01b0316836001600160a01b0316036105605760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061057c575061057c8133610bec565b6105ee5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610557565b6105f88383610c64565b505050565b610608335b82610cd2565b6106245760405162461bcd60e51b8152600401610557906120d0565b6105f8838383610d31565b60008281526020819052604090206001015461064a81610e90565b6105f88383610e9a565b600061065f836109aa565b82106106c15760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610557565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b6001600160a01b038116331461075a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610557565b6107648282610ebc565b5050565b6107806000805160206123ac83398151915233610acf565b6107e2576040805162461bcd60e51b81526020600482015260248101919091526000805160206123ec83398151915260448201527f6d75737420686176652070617573657220726f6c6520746f20756e70617573656064820152608401610557565b6107ea610ede565b565b6105f883838360405180602001604052806000815250610b12565b61081033610602565b61082c5760405162461bcd60e51b8152600401610557906120d0565b61083581610f30565b50565b6000610843600a5490565b82106108a65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610557565b600a82815481106108b9576108b961211d565b90600052602060002001549050919050565b6000818152600460205260408120546001600160a01b0316806104245760405162461bcd60e51b815260040161055790612133565b61092a7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610acf565b61098a5760405162461bcd60e51b815260206004820152603d60248201526000805160206123ec83398151915260448201527f6d7573742068617665206d696e74657220726f6c6520746f206d696e740000006064820152608401610557565b61099c81610997600d5490565b610fc1565b610835600d80546001019055565b60006001600160a01b038216610a145760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610557565b506001600160a01b031660009081526005602052604090205490565b610a486000805160206123ac83398151915233610acf565b610aa85760405162461bcd60e51b815260206004820152603e60248201526000805160206123ec83398151915260448201527f6d75737420686176652070617573657220726f6c6520746f20706175736500006064820152608401610557565b6107ea6110ca565b6000828152600160205260408120610ac89083611107565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60606003805461043990612096565b610764338383611113565b610b1c3383610cd2565b610b385760405162461bcd60e51b8152600401610557906120d0565b610b44848484846111dd565b50505050565b6060610b5582610c3f565b6000610b5f611210565b90506000815111610b7f5760405180602001604052806000815250610ac8565b80610b898461121f565b604051602001610b9a929190612165565b6040516020818303038152906040529392505050565b6000818152600160205260408120610424906112b2565b600082815260208190526040902060010154610be281610e90565b6105f88383610ebc565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60006001600160e01b0319821663780e9d6360e01b14806104245750610424826112bc565b610c48816112fc565b6108355760405162461bcd60e51b815260040161055790612133565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610c99826108cb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610cde836108cb565b9050806001600160a01b0316846001600160a01b03161480610d055750610d058185610bec565b80610d295750836001600160a01b0316610d1e846104bc565b6001600160a01b0316145b949350505050565b826001600160a01b0316610d44826108cb565b6001600160a01b031614610d6a5760405162461bcd60e51b815260040161055790612194565b6001600160a01b038216610dcc5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610557565b610dd98383836001611319565b826001600160a01b0316610dec826108cb565b6001600160a01b031614610e125760405162461bcd60e51b815260040161055790612194565b600081815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260058552838620805460001901905590871680865283862080546001019055868652600490945282852080549092168417909155905184936000805160206123cc83398151915291a4505050565b6108358133611325565b610ea4828261137e565b60008281526001602052604090206105f89082611402565b610ec68282611417565b60008281526001602052604090206105f8908261147c565b610ee6611491565b600c805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000610f3b826108cb565b9050610f4b816000846001611319565b610f54826108cb565b600083815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526005845282852080546000190190558785526004909352818420805490911690555192935084926000805160206123cc833981519152908390a45050565b6001600160a01b0382166110175760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610557565b611020816112fc565b1561103d5760405162461bcd60e51b8152600401610557906121d9565b61104b600083836001611319565b611054816112fc565b156110715760405162461bcd60e51b8152600401610557906121d9565b6001600160a01b038216600081815260056020908152604080832080546001019055848352600490915280822080546001600160a01b0319168417905551839291906000805160206123cc833981519152908290a45050565b6110d26114da565b600c805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f133390565b6000610ac88383611520565b816001600160a01b0316836001600160a01b0316036111705760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610557565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6111e8848484610d31565b6111f48484848461154a565b610b445760405162461bcd60e51b815260040161055790612210565b6060600e805461043990612096565b6060600061122c8361164b565b600101905060008167ffffffffffffffff81111561124c5761124c611f7a565b6040519080825280601f01601f191660200182016040528015611276576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461128057509392505050565b6000610424825490565b60006001600160e01b031982166380ac58cd60e01b14806112ed57506001600160e01b03198216635b5e139f60e01b145b80610424575061042482611723565b6000908152600460205260409020546001600160a01b0316151590565b610b4484848484611748565b61132f8282610acf565b6107645761133c816117bb565b6113478360206117cd565b604051602001611358929190612262565b60408051601f198184030181529082905262461bcd60e51b825261055791600401611e27565b6113888282610acf565b610764576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556113be3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ac8836001600160a01b038416611969565b6114218282610acf565b15610764576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610ac8836001600160a01b0384166119b8565b600c5460ff166107ea5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610557565b600c5460ff16156107ea5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610557565b60008260000182815481106115375761153761211d565b9060005260206000200154905092915050565b60006001600160a01b0384163b1561164057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061158e9033908990889088906004016122d1565b6020604051808303816000875af19250505080156115c9575060408051601f3d908101601f191682019092526115c69181019061230e565b60015b611626573d8080156115f7576040519150601f19603f3d011682016040523d82523d6000602084013e6115fc565b606091505b50805160000361161e5760405162461bcd60e51b815260040161055790612210565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610d29565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061168a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106116b6576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106116d457662386f26fc10000830492506010015b6305f5e10083106116ec576305f5e100830492506008015b612710831061170057612710830492506004015b60648310611712576064830492506002015b600a83106104245760010192915050565b60006001600160e01b03198216635a05180f60e01b1480610424575061042482611aab565b61175484848484611ae0565b600c5460ff1615610b445760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b6064820152608401610557565b60606104246001600160a01b03831660145b606060006117dc836002612341565b6117e7906002612358565b67ffffffffffffffff8111156117ff576117ff611f7a565b6040519080825280601f01601f191660200182016040528015611829576020820181803683370190505b509050600360fc1b816000815181106118445761184461211d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106118735761187361211d565b60200101906001600160f81b031916908160001a9053506000611897846002612341565b6118a2906001612358565b90505b600181111561191a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118d6576118d661211d565b1a60f81b8282815181106118ec576118ec61211d565b60200101906001600160f81b031916908160001a90535060049490941c936119138161236b565b90506118a5565b508315610ac85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610557565b60008181526001830160205260408120546119b057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610424565b506000610424565b60008181526001830160205260408120548015611aa15760006119dc600183612382565b85549091506000906119f090600190612382565b9050818114611a55576000866000018281548110611a1057611a1061211d565b9060005260206000200154905080876000018481548110611a3357611a3361211d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a6657611a66612395565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610424565b6000915050610424565b60006001600160e01b03198216637965db0b60e01b148061042457506301ffc9a760e01b6001600160e01b0319831614610424565b6001811115611b4f5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610557565b816001600160a01b038516611bab57611ba681600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b611bce565b836001600160a01b0316856001600160a01b031614611bce57611bce8582611c14565b6001600160a01b038416611bea57611be581611cb1565b611c0d565b846001600160a01b0316846001600160a01b031614611c0d57611c0d8482611d60565b5050505050565b60006001611c21846109aa565b611c2b9190612382565b600083815260096020526040902054909150808214611c7e576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090611cc390600190612382565b6000838152600b6020526040812054600a8054939450909284908110611ceb57611ceb61211d565b9060005260206000200154905080600a8381548110611d0c57611d0c61211d565b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a805480611d4457611d44612395565b6001900381819060005260206000200160009055905550505050565b6000611d6b836109aa565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b6001600160e01b03198116811461083557600080fd5b600060208284031215611dcc57600080fd5b8135610ac881611da4565b60005b83811015611df2578181015183820152602001611dda565b50506000910152565b60008151808452611e13816020860160208601611dd7565b601f01601f19169290920160200192915050565b602081526000610ac86020830184611dfb565b600060208284031215611e4c57600080fd5b5035919050565b80356001600160a01b0381168114611e6a57600080fd5b919050565b60008060408385031215611e8257600080fd5b611e8b83611e53565b946020939093013593505050565b600080600060608486031215611eae57600080fd5b611eb784611e53565b9250611ec560208501611e53565b9150604084013590509250925092565b60008060408385031215611ee857600080fd5b82359150611ef860208401611e53565b90509250929050565b600060208284031215611f1357600080fd5b610ac882611e53565b60008060408385031215611f2f57600080fd5b50508035926020909101359150565b60008060408385031215611f5157600080fd5b611f5a83611e53565b915060208301358015158114611f6f57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611fa657600080fd5b611faf85611e53565b9350611fbd60208601611e53565b925060408501359150606085013567ffffffffffffffff80821115611fe157600080fd5b818701915087601f830112611ff557600080fd5b81358181111561200757612007611f7a565b604051601f8201601f19908116603f0116810190838211818310171561202f5761202f611f7a565b816040528281528a602084870101111561204857600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561207f57600080fd5b61208883611e53565b9150611ef860208401611e53565b600181811c908216806120aa57607f821691505b6020821081036120ca57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351612177818460208801611dd7565b83519083019061218b818360208801611dd7565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b815260008351612294816017850160208801611dd7565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516122c5816028840160208801611dd7565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061230490830184611dfb565b9695505050505050565b60006020828403121561232057600080fd5b8151610ac881611da4565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104245761042461232b565b808201808211156104245761042461232b565b60008161237a5761237a61232b565b506000190190565b818103818111156104245761042461232b565b634e487b7160e01b600052603160045260246000fdfe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862addf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4552433732315072657365744d696e7465725061757365724175746f49643a20a2646970667358221220f586c29d0cbd3e2cee9bd99a648a34864226f46f9a05471902f3728b4f230c2864736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var RootERC721PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"RootERC721Predicate","sourceName":"contracts/root/RootERC721Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"ERC721DepositBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"ERC721WithdrawBatch","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":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"TokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childERC721Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC721Metadata","name":"rootToken","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721Metadata","name":"rootToken","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"depositBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721Metadata","name":"rootToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newChildERC721Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721Metadata","name":"rootToken","type":"address"}],"name":"mapToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b5061196b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100fb5760003560e01c8063cb10f94c116100a2578063f43cda8b11610071578063f43cda8b146102a1578063f4a120f7146102b4578063f6451255146102c7578063f8c8765e146102ee578063ff6f870c1461030157600080fd5b8063cb10f94c14610227578063d41f177114610240578063d7c9e3ec14610267578063f213159c1461028e57600080fd5b8063150b7a021461010057806347e7ef241461013c5780634fdca69d146101515780637efab4f51461017c57806395c7041c146101a5578063b1768065146101b8578063b68ad1e4146101ed578063c5ac2b1c14610200575b600080fd5b61011e61010e36600461112d565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020015b60405180910390f35b61014f61014a3660046111db565b610314565b005b600254610164906001600160a01b031681565b6040516001600160a01b039091168152602001610133565b61016461018a366004611207565b6004602052600090815260409020546001600160a01b031681565b600154610164906001600160a01b031681565b6101df7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610133565b600354610164906001600160a01b031681565b6101df7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b600054610164906201000090046001600160a01b031681565b6101df7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101df7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61029c36600461122b565b610323565b61014f6102af36600461126c565b610333565b6101646102c2366004611207565b61050a565b6101df7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61014f6102fc3660046112f4565b61086a565b61014f61030f36600461139b565b610a78565b61031f823383610ae0565b5050565b61032e838383610ae0565b505050565b6001546001600160a01b031633146103a05760405162461bcd60e51b815260206004820152602560248201527f526f6f744552433732315072656469636174653a204f4e4c595f455849545f4860448201526422a62822a960d91b60648201526084015b60405180910390fd5b6002546001600160a01b0384811691161461040f5760405162461bcd60e51b815260206004820152602960248201527f526f6f744552433732315072656469636174653a204f4e4c595f4348494c445f60448201526850524544494341544560b81b6064820152608401610397565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286961043e60206000848661141d565b61044791611447565b036104665761046161045c826020818661141d565b610c66565b610504565b7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed261049560206000848661141d565b61049e91611447565b036104ad576104618282610d64565b60405162461bcd60e51b815260206004820152602660248201527f526f6f744552433732315072656469636174653a20494e56414c49445f5349476044820152654e415455524560d01b6064820152608401610397565b50505050565b60006001600160a01b03821661056d5760405162461bcd60e51b815260206004820152602260248201527f526f6f744552433732315072656469636174653a20494e56414c49445f544f4b60448201526122a760f11b6064820152608401610397565b6001600160a01b0382811660009081526004602052604090205416156105e15760405162461bcd60e51b815260206004820152602360248201527f526f6f744552433732315072656469636174653a20414c52454144595f4d415060448201526214115160ea1b6064820152608401610397565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b039283169260009261068f92911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa15801561072c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610754919081019061148a565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610792573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ba919081019061148a565b6040516020016107cd949392919061152c565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107f9929190611573565b600060405180830381600087803b15801561081357600080fd5b505af1158015610827573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b600054610100900460ff161580801561088a5750600054600160ff909116105b806108a45750303b1580156108a4575060005460ff166001145b6109075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610397565b6000805460ff19166001179055801561092a576000805461ff0019166101001790555b6001600160a01b0385161580159061094a57506001600160a01b03841615155b801561095e57506001600160a01b03831615155b801561097257506001600160a01b03821615155b6109ce5760405162461bcd60e51b815260206004820152602760248201527f526f6f744552433732315072656469636174653a204241445f494e495449414c60448201526624ad20aa24a7a760c91b6064820152608401610397565b6000805462010000600160b01b031916620100006001600160a01b038881169190910291909117909155600180546001600160a01b031990811687841617909155600280548216868416179055600380549091169184169190911790558015610a71576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b828114610ad35760405162461bcd60e51b815260206004820152602360248201527f526f6f744552433732315072656469636174653a20494e56414c49445f4c454e60448201526208ea8960eb1b6064820152608401610397565b610a718585858585610ea5565b6000610aeb84611061565b604051632142170760e11b81529091506001600160a01b038516906342842e0e90610b1e9033903090879060040161159f565b600060405180830381600087803b158015610b3857600080fd5b505af1158015610b4c573d6000803e3d6000fd5b5050600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b038a811682840152336060830152898116608083015260a08083018a90528351808403909101815260c08301938490526316f1983160e01b90935262010000909404841695506316f198319450610be2939092169160c401611573565b600060405180830381600087803b158015610bfc57600080fd5b505af1158015610c10573d6000803e3d6000fd5b505060408051338152602081018690526001600160a01b03808816945085811693508816917f40e242710be14b7d61d3b93e9d56b40df89cc4dbad8bb88da38c8e0c23809ba7910160405180910390a450505050565b6000808080610c77858701876115c3565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610caa57610caa611614565b604051632142170760e11b81526001600160a01b038616906342842e0e90610cda9030908790879060040161159f565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b5050604080516001600160a01b03888116825260208201879052808816945085811693508916917f8194f168e6e9e449d05a46936e071a710c0f22634eaadeb5b85a86540123931991015b60405180910390a450505050505050565b6000808080610d75858701876116b3565b6001600160a01b03808516600090815260046020526040902054949950929750909550935016905080610daa57610daa611614565b60005b8251811015610e5557856001600160a01b03166342842e0e30868481518110610dd857610dd86117a5565b6020026020010151868581518110610df257610df26117a5565b60200260200101516040518463ffffffff1660e01b8152600401610e189392919061159f565b600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b50505050806001019050610dad565b50836001600160a01b0316816001600160a01b0316866001600160a01b03167f1b7b9713fdef5dfadf92f6d6e998eb1fc4763cee62a194a095d76349f7dce20c8686604051610d539291906117bb565b6000610eb086611061565b905060005b82811015610f4257866001600160a01b03166342842e0e3330878786818110610ee057610ee06117a5565b905060200201356040518463ffffffff1660e01b8152600401610f059392919061159f565b600060405180830381600087803b158015610f1f57600080fd5b505af1158015610f33573d6000803e3d6000fd5b50505050806001019050610eb5565b506000546002546040516001600160a01b03620100009093048316926316f19831921690610fa0907faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d18908b9033908c908c908c908c906020016118ba565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610fcc929190611573565b600060405180830381600087803b158015610fe657600080fd5b505af1158015610ffa573d6000803e3d6000fd5b50505050336001600160a01b0316816001600160a01b0316876001600160a01b03167f02c575a943105cda454293b7ac636c87c94ff1bfcfac968aa5423e6b9b312ee988888888604051611051949392919061190e565b60405180910390a4505050505050565b6001600160a01b03808216600090815260046020526040902054168061108d5761108a8261050a565b90505b6001600160a01b0381166110a3576110a3611614565b919050565b6001600160a01b03811681146110bd57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156110fe576110fe6110c0565b604052919050565b60006001600160401b0382111561111f5761111f6110c0565b50601f01601f191660200190565b6000806000806080858703121561114357600080fd5b843561114e816110a8565b9350602085013561115e816110a8565b92506040850135915060608501356001600160401b0381111561118057600080fd5b8501601f8101871361119157600080fd5b80356111a461119f82611106565b6110d6565b8181528860208385010111156111b957600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156111ee57600080fd5b82356111f9816110a8565b946020939093013593505050565b60006020828403121561121957600080fd5b8135611224816110a8565b9392505050565b60008060006060848603121561124057600080fd5b833561124b816110a8565b9250602084013561125b816110a8565b929592945050506040919091013590565b6000806000806060858703121561128257600080fd5b843593506020850135611294816110a8565b925060408501356001600160401b03808211156112b057600080fd5b818701915087601f8301126112c457600080fd5b8135818111156112d357600080fd5b8860208285010111156112e557600080fd5b95989497505060200194505050565b6000806000806080858703121561130a57600080fd5b8435611315816110a8565b93506020850135611325816110a8565b92506040850135611335816110a8565b91506060850135611345816110a8565b939692955090935050565b60008083601f84011261136257600080fd5b5081356001600160401b0381111561137957600080fd5b6020830191508360208260051b850101111561139457600080fd5b9250929050565b6000806000806000606086880312156113b357600080fd5b85356113be816110a8565b945060208601356001600160401b03808211156113da57600080fd5b6113e689838a01611350565b909650945060408801359150808211156113ff57600080fd5b5061140c88828901611350565b969995985093965092949392505050565b6000808585111561142d57600080fd5b8386111561143a57600080fd5b5050820193919092039150565b8035602083101561146057600019602084900360031b1b165b92915050565b60005b83811015611481578181015183820152602001611469565b50506000910152565b60006020828403121561149c57600080fd5b81516001600160401b038111156114b257600080fd5b8201601f810184136114c357600080fd5b80516114d161119f82611106565b8181528560208385010111156114e657600080fd5b6114f7826020830160208601611466565b95945050505050565b60008151808452611518816020860160208601611466565b601f01601f19169290920160200192915050565b8481526001600160a01b038416602082015260806040820181905260009061155690830185611500565b82810360608401526115688185611500565b979650505050505050565b6001600160a01b038316815260406020820181905260009061159790830184611500565b949350505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600080600080608085870312156115d957600080fd5b84356115e4816110a8565b935060208501356115f4816110a8565b92506040850135611604816110a8565b9396929550929360600135925050565b634e487b7160e01b600052600160045260246000fd5b60006001600160401b03821115611643576116436110c0565b5060051b60200190565b600082601f83011261165e57600080fd5b8135602061166e61119f8361162a565b82815260059290921b8401810191818101908684111561168d57600080fd5b8286015b848110156116a85780358352918301918301611691565b509695505050505050565b600080600080600060a086880312156116cb57600080fd5b853594506020808701356116de816110a8565b945060408701356116ee816110a8565b935060608701356001600160401b038082111561170a57600080fd5b818901915089601f83011261171e57600080fd5b813561172c61119f8261162a565b81815260059190911b8301840190848101908c83111561174b57600080fd5b938501935b82851015611772578435611763816110a8565b82529385019390850190611750565b96505050608089013592508083111561178a57600080fd5b50506117988882890161164d565b9150509295509295909350565b634e487b7160e01b600052603260045260246000fd5b604080825283519082018190526000906020906060840190828701845b828110156117fd5781516001600160a01b0316845292840192908401906001016117d8565b5050508381038285015284518082528583019183019060005b8181101561183257835183529284019291840191600101611816565b5090979650505050505050565b8183526000602080850194508260005b8581101561187d578135611862816110a8565b6001600160a01b03168752958201959082019060010161184f565b509495945050505050565b81835260006001600160fb1b038311156118a157600080fd5b8260051b80836020870137939093016020019392505050565b8781526001600160a01b0387811660208301528616604082015260a0606082018190526000906118ed908301868861183f565b8281036080840152611900818587611888565b9a9950505050505050505050565b60408152600061192260408301868861183f565b828103602084015261156881858761188856fea26469706673582212203621718a3c2b1847a958c6d88f320b8bf9fde1113c6a705bddbeec4f2127ab7364736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100fb5760003560e01c8063cb10f94c116100a2578063f43cda8b11610071578063f43cda8b146102a1578063f4a120f7146102b4578063f6451255146102c7578063f8c8765e146102ee578063ff6f870c1461030157600080fd5b8063cb10f94c14610227578063d41f177114610240578063d7c9e3ec14610267578063f213159c1461028e57600080fd5b8063150b7a021461010057806347e7ef241461013c5780634fdca69d146101515780637efab4f51461017c57806395c7041c146101a5578063b1768065146101b8578063b68ad1e4146101ed578063c5ac2b1c14610200575b600080fd5b61011e61010e36600461112d565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020015b60405180910390f35b61014f61014a3660046111db565b610314565b005b600254610164906001600160a01b031681565b6040516001600160a01b039091168152602001610133565b61016461018a366004611207565b6004602052600090815260409020546001600160a01b031681565b600154610164906001600160a01b031681565b6101df7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610133565b600354610164906001600160a01b031681565b6101df7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b600054610164906201000090046001600160a01b031681565b6101df7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101df7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61029c36600461122b565b610323565b61014f6102af36600461126c565b610333565b6101646102c2366004611207565b61050a565b6101df7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61014f6102fc3660046112f4565b61086a565b61014f61030f36600461139b565b610a78565b61031f823383610ae0565b5050565b61032e838383610ae0565b505050565b6001546001600160a01b031633146103a05760405162461bcd60e51b815260206004820152602560248201527f526f6f744552433732315072656469636174653a204f4e4c595f455849545f4860448201526422a62822a960d91b60648201526084015b60405180910390fd5b6002546001600160a01b0384811691161461040f5760405162461bcd60e51b815260206004820152602960248201527f526f6f744552433732315072656469636174653a204f4e4c595f4348494c445f60448201526850524544494341544560b81b6064820152608401610397565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286961043e60206000848661141d565b61044791611447565b036104665761046161045c826020818661141d565b610c66565b610504565b7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed261049560206000848661141d565b61049e91611447565b036104ad576104618282610d64565b60405162461bcd60e51b815260206004820152602660248201527f526f6f744552433732315072656469636174653a20494e56414c49445f5349476044820152654e415455524560d01b6064820152608401610397565b50505050565b60006001600160a01b03821661056d5760405162461bcd60e51b815260206004820152602260248201527f526f6f744552433732315072656469636174653a20494e56414c49445f544f4b60448201526122a760f11b6064820152608401610397565b6001600160a01b0382811660009081526004602052604090205416156105e15760405162461bcd60e51b815260206004820152602360248201527f526f6f744552433732315072656469636174653a20414c52454144595f4d415060448201526214115160ea1b6064820152608401610397565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b039283169260009261068f92911690603401604051602081830303815290604052805190602001208460405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03858116600081815260046020819052604080832080546001600160a01b031916878716179055825481516306fdde0360e01b81529151969750620100009004909416946316f198319488947f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad948c9491936306fdde039380840193908290030181865afa15801561072c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610754919081019061148a565b896001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015610792573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ba919081019061148a565b6040516020016107cd949392919061152c565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016107f9929190611573565b600060405180830381600087803b15801561081357600080fd5b505af1158015610827573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a39392505050565b600054610100900460ff161580801561088a5750600054600160ff909116105b806108a45750303b1580156108a4575060005460ff166001145b6109075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610397565b6000805460ff19166001179055801561092a576000805461ff0019166101001790555b6001600160a01b0385161580159061094a57506001600160a01b03841615155b801561095e57506001600160a01b03831615155b801561097257506001600160a01b03821615155b6109ce5760405162461bcd60e51b815260206004820152602760248201527f526f6f744552433732315072656469636174653a204241445f494e495449414c60448201526624ad20aa24a7a760c91b6064820152608401610397565b6000805462010000600160b01b031916620100006001600160a01b038881169190910291909117909155600180546001600160a01b031990811687841617909155600280548216868416179055600380549091169184169190911790558015610a71576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b828114610ad35760405162461bcd60e51b815260206004820152602360248201527f526f6f744552433732315072656469636174653a20494e56414c49445f4c454e60448201526208ea8960eb1b6064820152608401610397565b610a718585858585610ea5565b6000610aeb84611061565b604051632142170760e11b81529091506001600160a01b038516906342842e0e90610b1e9033903090879060040161159f565b600060405180830381600087803b158015610b3857600080fd5b505af1158015610b4c573d6000803e3d6000fd5b5050600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b038a811682840152336060830152898116608083015260a08083018a90528351808403909101815260c08301938490526316f1983160e01b90935262010000909404841695506316f198319450610be2939092169160c401611573565b600060405180830381600087803b158015610bfc57600080fd5b505af1158015610c10573d6000803e3d6000fd5b505060408051338152602081018690526001600160a01b03808816945085811693508816917f40e242710be14b7d61d3b93e9d56b40df89cc4dbad8bb88da38c8e0c23809ba7910160405180910390a450505050565b6000808080610c77858701876115c3565b6001600160a01b0380851660009081526004602052604090205494985092965090945092501680610caa57610caa611614565b604051632142170760e11b81526001600160a01b038616906342842e0e90610cda9030908790879060040161159f565b600060405180830381600087803b158015610cf457600080fd5b505af1158015610d08573d6000803e3d6000fd5b5050604080516001600160a01b03888116825260208201879052808816945085811693508916917f8194f168e6e9e449d05a46936e071a710c0f22634eaadeb5b85a86540123931991015b60405180910390a450505050505050565b6000808080610d75858701876116b3565b6001600160a01b03808516600090815260046020526040902054949950929750909550935016905080610daa57610daa611614565b60005b8251811015610e5557856001600160a01b03166342842e0e30868481518110610dd857610dd86117a5565b6020026020010151868581518110610df257610df26117a5565b60200260200101516040518463ffffffff1660e01b8152600401610e189392919061159f565b600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b50505050806001019050610dad565b50836001600160a01b0316816001600160a01b0316866001600160a01b03167f1b7b9713fdef5dfadf92f6d6e998eb1fc4763cee62a194a095d76349f7dce20c8686604051610d539291906117bb565b6000610eb086611061565b905060005b82811015610f4257866001600160a01b03166342842e0e3330878786818110610ee057610ee06117a5565b905060200201356040518463ffffffff1660e01b8152600401610f059392919061159f565b600060405180830381600087803b158015610f1f57600080fd5b505af1158015610f33573d6000803e3d6000fd5b50505050806001019050610eb5565b506000546002546040516001600160a01b03620100009093048316926316f19831921690610fa0907faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d18908b9033908c908c908c908c906020016118ba565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610fcc929190611573565b600060405180830381600087803b158015610fe657600080fd5b505af1158015610ffa573d6000803e3d6000fd5b50505050336001600160a01b0316816001600160a01b0316876001600160a01b03167f02c575a943105cda454293b7ac636c87c94ff1bfcfac968aa5423e6b9b312ee988888888604051611051949392919061190e565b60405180910390a4505050505050565b6001600160a01b03808216600090815260046020526040902054168061108d5761108a8261050a565b90505b6001600160a01b0381166110a3576110a3611614565b919050565b6001600160a01b03811681146110bd57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156110fe576110fe6110c0565b604052919050565b60006001600160401b0382111561111f5761111f6110c0565b50601f01601f191660200190565b6000806000806080858703121561114357600080fd5b843561114e816110a8565b9350602085013561115e816110a8565b92506040850135915060608501356001600160401b0381111561118057600080fd5b8501601f8101871361119157600080fd5b80356111a461119f82611106565b6110d6565b8181528860208385010111156111b957600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156111ee57600080fd5b82356111f9816110a8565b946020939093013593505050565b60006020828403121561121957600080fd5b8135611224816110a8565b9392505050565b60008060006060848603121561124057600080fd5b833561124b816110a8565b9250602084013561125b816110a8565b929592945050506040919091013590565b6000806000806060858703121561128257600080fd5b843593506020850135611294816110a8565b925060408501356001600160401b03808211156112b057600080fd5b818701915087601f8301126112c457600080fd5b8135818111156112d357600080fd5b8860208285010111156112e557600080fd5b95989497505060200194505050565b6000806000806080858703121561130a57600080fd5b8435611315816110a8565b93506020850135611325816110a8565b92506040850135611335816110a8565b91506060850135611345816110a8565b939692955090935050565b60008083601f84011261136257600080fd5b5081356001600160401b0381111561137957600080fd5b6020830191508360208260051b850101111561139457600080fd5b9250929050565b6000806000806000606086880312156113b357600080fd5b85356113be816110a8565b945060208601356001600160401b03808211156113da57600080fd5b6113e689838a01611350565b909650945060408801359150808211156113ff57600080fd5b5061140c88828901611350565b969995985093965092949392505050565b6000808585111561142d57600080fd5b8386111561143a57600080fd5b5050820193919092039150565b8035602083101561146057600019602084900360031b1b165b92915050565b60005b83811015611481578181015183820152602001611469565b50506000910152565b60006020828403121561149c57600080fd5b81516001600160401b038111156114b257600080fd5b8201601f810184136114c357600080fd5b80516114d161119f82611106565b8181528560208385010111156114e657600080fd5b6114f7826020830160208601611466565b95945050505050565b60008151808452611518816020860160208601611466565b601f01601f19169290920160200192915050565b8481526001600160a01b038416602082015260806040820181905260009061155690830185611500565b82810360608401526115688185611500565b979650505050505050565b6001600160a01b038316815260406020820181905260009061159790830184611500565b949350505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600080600080608085870312156115d957600080fd5b84356115e4816110a8565b935060208501356115f4816110a8565b92506040850135611604816110a8565b9396929550929360600135925050565b634e487b7160e01b600052600160045260246000fd5b60006001600160401b03821115611643576116436110c0565b5060051b60200190565b600082601f83011261165e57600080fd5b8135602061166e61119f8361162a565b82815260059290921b8401810191818101908684111561168d57600080fd5b8286015b848110156116a85780358352918301918301611691565b509695505050505050565b600080600080600060a086880312156116cb57600080fd5b853594506020808701356116de816110a8565b945060408701356116ee816110a8565b935060608701356001600160401b038082111561170a57600080fd5b818901915089601f83011261171e57600080fd5b813561172c61119f8261162a565b81815260059190911b8301840190848101908c83111561174b57600080fd5b938501935b82851015611772578435611763816110a8565b82529385019390850190611750565b96505050608089013592508083111561178a57600080fd5b50506117988882890161164d565b9150509295509295909350565b634e487b7160e01b600052603260045260246000fd5b604080825283519082018190526000906020906060840190828701845b828110156117fd5781516001600160a01b0316845292840192908401906001016117d8565b5050508381038285015284518082528583019183019060005b8181101561183257835183529284019291840191600101611816565b5090979650505050505050565b8183526000602080850194508260005b8581101561187d578135611862816110a8565b6001600160a01b03168752958201959082019060010161184f565b509495945050505050565b81835260006001600160fb1b038311156118a157600080fd5b8260051b80836020870137939093016020019392505050565b8781526001600160a01b0387811660208301528616604082015260a0606082018190526000906118ed908301868861183f565b8281036080840152611900818587611888565b9a9950505050505050505050565b60408152600061192260408301868861183f565b828103602084015261156881858761188856fea26469706673582212203621718a3c2b1847a958c6d88f320b8bf9fde1113c6a705bddbeec4f2127ab7364736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` @@ -36,7 +36,7 @@ var ChildMintableERC721PredicateArtifact string = `{"_format":"hh-sol-artifact-1 var MockERC1155Artifact string = `{"_format":"hh-sol-artifact-1","contractName":"MockERC1155","sourceName":"contracts/mocks/MockERC1155.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}],"bytecode":"0x60806040523480156200001157600080fd5b506040805180820190915260058152646c6f72656d60d81b6020820152806200003a81620000b1565b506005805460ff1916905562000052600033620000c3565b6200007e7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620000c3565b620000aa7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620000c3565b5062000376565b6004620000bf8282620002aa565b5050565b620000bf8282620000d58282620000f4565b6000828152600160205260409020620000ef908262000194565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000bf576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001503390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001ab836001600160a01b038416620001b4565b90505b92915050565b6000818152600183016020526040812054620001fd57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001ae565b506000620001ae565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200023157607f821691505b6020821081036200025257634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620000ef57600081815260208120601f850160051c81016020861015620002815750805b601f850160051c820191505b81811015620002a2578281556001016200028d565b505050505050565b81516001600160401b03811115620002c657620002c662000206565b620002de81620002d784546200021c565b8462000258565b602080601f831160018114620003165760008415620002fd5750858301515b600019600386901b1c1916600185901b178555620002a2565b600085815260208120601f198616915b82811015620003475788860151825594840194600190910190840162000326565b5085821015620003665787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6128a080620003866000396000f3fe608060405234801561001057600080fd5b50600436106101625760003560e01c8063731133e9116100ce578063ca15c87311610087578063ca15c873146102fb578063d53913931461030e578063d547741f14610323578063e63ab1e914610336578063e985e9c51461034b578063f242432a14610387578063f5298aca1461039a57600080fd5b8063731133e9146102875780638456cb591461029a5780639010d07c146102a257806391d14854146102cd578063a217fddf146102e0578063a22cb465146102e857600080fd5b80632f2ff15d116101205780632f2ff15d1461021b57806336568abe1461022e5780633f4ba83a146102415780634e1273f4146102495780635c975abb146102695780636b20c4541461027457600080fd5b8062fdd58e1461016757806301ffc9a71461018d5780630e89341c146101b05780631f7fdffa146101d0578063248a9ca3146101e55780632eb2c2d614610208575b600080fd5b61017a610175366004611bd7565b6103ad565b6040519081526020015b60405180910390f35b6101a061019b366004611c17565b610448565b6040519015158152602001610184565b6101c36101be366004611c34565b610453565b6040516101849190611c9d565b6101e36101de366004611df9565b6104e7565b005b61017a6101f3366004611c34565b60009081526020819052604090206001015490565b6101e3610216366004611e91565b61052d565b6101e3610229366004611f3a565b610579565b6101e361023c366004611f3a565b6105a3565b6101e3610621565b61025c610257366004611f66565b6106a3565b604051610184919061206b565b60055460ff166101a0565b6101e361028236600461207e565b6107cc565b6101e36102953660046120f1565b61080f565b6101e361084f565b6102b56102b0366004612145565b6108cb565b6040516001600160a01b039091168152602001610184565b6101a06102db366004611f3a565b6108ea565b61017a600081565b6101e36102f6366004612167565b610913565b61017a610309366004611c34565b61091e565b61017a60008051602061284b83398151915281565b6101e3610331366004611f3a565b610935565b61017a60008051602061282b83398151915281565b6101a06103593660046121a3565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b6101e36103953660046121cd565b61095a565b6101e36103a8366004612231565b61099f565b60006001600160a01b03831661041d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610442826109e2565b60606004805461046290612264565b80601f016020809104026020016040519081016040528092919081815260200182805461048e90612264565b80156104db5780601f106104b0576101008083540402835291602001916104db565b820191906000526020600020905b8154815290600101906020018083116104be57829003601f168201915b50505050509050919050565b6104ff60008051602061284b833981519152336108ea565b61051b5760405162461bcd60e51b81526004016104149061229e565b61052784848484610a22565b50505050565b6001600160a01b03851633148061054957506105498533610359565b6105655760405162461bcd60e51b8152600401610414906122e4565b6105728585858585610b6b565b5050505050565b60008281526020819052604090206001015461059481610d06565b61059e8383610d13565b505050565b6001600160a01b03811633146106135760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610414565b61061d8282610d35565b5050565b61063960008051602061282b833981519152336108ea565b6106995760405162461bcd60e51b815260206004820152603b60248201526000805160206127eb83398151915260448201527f686176652070617573657220726f6c6520746f20756e706175736500000000006064820152608401610414565b6106a1610d57565b565b606081518351146107085760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610414565b600083516001600160401b0381111561072357610723611cb0565b60405190808252806020026020018201604052801561074c578160200160208202803683370190505b50905060005b84518110156107c45761079785828151811061077057610770612332565b602002602001015185838151811061078a5761078a612332565b60200260200101516103ad565b8282815181106107a9576107a9612332565b60209081029190910101526107bd8161235e565b9050610752565b509392505050565b6001600160a01b0383163314806107e857506107e88333610359565b6108045760405162461bcd60e51b8152600401610414906122e4565b61059e838383610da9565b61082760008051602061284b833981519152336108ea565b6108435760405162461bcd60e51b81526004016104149061229e565b61052784848484610f36565b61086760008051602061282b833981519152336108ea565b6108c35760405162461bcd60e51b815260206004820152603960248201526000805160206127eb833981519152604482015278686176652070617573657220726f6c6520746f20706175736560381b6064820152608401610414565b6106a161100f565b60008281526001602052604081206108e3908361104c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61061d338383611058565b600081815260016020526040812061044290611138565b60008281526020819052604090206001015461095081610d06565b61059e8383610d35565b6001600160a01b03851633148061097657506109768533610359565b6109925760405162461bcd60e51b8152600401610414906122e4565b6105728585858585611142565b6001600160a01b0383163314806109bb57506109bb8333610359565b6109d75760405162461bcd60e51b8152600401610414906122e4565b61059e83838361126c565b60006001600160e01b03198216636cdb3d1360e11b1480610a1357506001600160e01b031982166303a24d0760e21b145b80610442575061044282611376565b6001600160a01b038416610a485760405162461bcd60e51b815260040161041490612377565b8151835114610a695760405162461bcd60e51b8152600401610414906123b8565b33610a798160008787878761139b565b60005b8451811015610b1557838181518110610a9757610a97612332565b602002602001015160026000878481518110610ab557610ab5612332565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610afd9190612400565b90915550819050610b0d8161235e565b915050610a7c565b50846001600160a01b031660006001600160a01b0316826001600160a01b03166000805160206127cb8339815191528787604051610b54929190612413565b60405180910390a4610572816000878787876113a9565b8151835114610b8c5760405162461bcd60e51b8152600401610414906123b8565b6001600160a01b038416610bb25760405162461bcd60e51b815260040161041490612441565b33610bc181878787878761139b565b60005b8451811015610caa576000858281518110610be157610be1612332565b602002602001015190506000858381518110610bff57610bff612332565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610c505760405162461bcd60e51b815260040161041490612486565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610c8f908490612400565b9250508190555050505080610ca39061235e565b9050610bc4565b50846001600160a01b0316866001600160a01b0316826001600160a01b03166000805160206127cb8339815191528787604051610ce8929190612413565b60405180910390a4610cfe8187878787876113a9565b505050505050565b610d108133611504565b50565b610d1d828261155d565b600082815260016020526040902061059e90826115e1565b610d3f82826115f6565b600082815260016020526040902061059e908261165b565b610d5f611670565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316610dcf5760405162461bcd60e51b8152600401610414906124d0565b8051825114610df05760405162461bcd60e51b8152600401610414906123b8565b6000339050610e138185600086866040518060200160405280600081525061139b565b60005b8351811015610edb576000848281518110610e3357610e33612332565b602002602001015190506000848381518110610e5157610e51612332565b60209081029190910181015160008481526002835260408082206001600160a01b038c168352909352919091205490915081811015610ea25760405162461bcd60e51b815260040161041490612513565b60009283526002602090815260408085206001600160a01b038b1686529091529092209103905580610ed38161235e565b915050610e16565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03166000805160206127cb8339815191528686604051610f1a929190612413565b60405180910390a4604080516020810190915260009052610527565b6001600160a01b038416610f5c5760405162461bcd60e51b815260040161041490612377565b336000610f68856116b9565b90506000610f75856116b9565b9050610f868360008985858961139b565b60008681526002602090815260408083206001600160a01b038b16845290915281208054879290610fb8908490612400565b909155505060408051878152602081018790526001600160a01b03808a16926000929187169160008051602061280b833981519152910160405180910390a461100683600089898989611704565b50505050505050565b6110176117bf565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610d8c3390565b60006108e38383611805565b816001600160a01b0316836001600160a01b0316036110cb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610414565b6001600160a01b03838116600081815260036020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000610442825490565b6001600160a01b0384166111685760405162461bcd60e51b815260040161041490612441565b336000611174856116b9565b90506000611181856116b9565b905061119183898985858961139b565b60008681526002602090815260408083206001600160a01b038c168452909152902054858110156111d45760405162461bcd60e51b815260040161041490612486565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611213908490612400565b909155505060408051888152602081018890526001600160a01b03808b16928c8216929188169160008051602061280b833981519152910160405180910390a4611261848a8a8a8a8a611704565b505050505050505050565b6001600160a01b0383166112925760405162461bcd60e51b8152600401610414906124d0565b33600061129e846116b9565b905060006112ab846116b9565b90506112cb8387600085856040518060200160405280600081525061139b565b60008581526002602090815260408083206001600160a01b038a1684529091529020548481101561130e5760405162461bcd60e51b815260040161041490612513565b60008681526002602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a905290929088169160008051602061280b833981519152910160405180910390a4604080516020810190915260009052611006565b60006001600160e01b03198216635a05180f60e01b148061044257506104428261182f565b610cfe868686868686611864565b6001600160a01b0384163b15610cfe5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906113ed9089908990889088908890600401612557565b6020604051808303816000875af1925050508015611428575060408051601f3d908101601f19168201909252611425918101906125b5565b60015b6114d4576114346125d2565b806308c379a00361146d57506114486125ee565b80611453575061146f565b8060405162461bcd60e51b81526004016104149190611c9d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610414565b6001600160e01b0319811663bc197c8160e01b146110065760405162461bcd60e51b815260040161041490612677565b61150e82826108ea565b61061d5761151b816118cc565b6115268360206118de565b6040516020016115379291906126bf565b60408051601f198184030181529082905262461bcd60e51b825261041491600401611c9d565b61156782826108ea565b61061d576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561159d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006108e3836001600160a01b038416611a79565b61160082826108ea565b1561061d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006108e3836001600160a01b038416611ac8565b60055460ff166106a15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610414565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106116f3576116f3612332565b602090810291909101015292915050565b6001600160a01b0384163b15610cfe5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611748908990899088908890889060040161272e565b6020604051808303816000875af1925050508015611783575060408051601f3d908101601f19168201909252611780918101906125b5565b60015b61178f576114346125d2565b6001600160e01b0319811663f23a6e6160e01b146110065760405162461bcd60e51b815260040161041490612677565b60055460ff16156106a15760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610414565b600082600001828154811061181c5761181c612332565b9060005260206000200154905092915050565b60006001600160e01b03198216637965db0b60e01b148061044257506301ffc9a760e01b6001600160e01b0319831614610442565b60055460ff1615610cfe5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b6064820152608401610414565b60606104426001600160a01b03831660145b606060006118ed836002612773565b6118f8906002612400565b6001600160401b0381111561190f5761190f611cb0565b6040519080825280601f01601f191660200182016040528015611939576020820181803683370190505b509050600360fc1b8160008151811061195457611954612332565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061198357611983612332565b60200101906001600160f81b031916908160001a90535060006119a7846002612773565b6119b2906001612400565b90505b6001811115611a2a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106119e6576119e6612332565b1a60f81b8282815181106119fc576119fc612332565b60200101906001600160f81b031916908160001a90535060049490941c93611a238161278a565b90506119b5565b5083156108e35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610414565b6000818152600183016020526040812054611ac057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610442565b506000610442565b60008181526001830160205260408120548015611bb1576000611aec6001836127a1565b8554909150600090611b00906001906127a1565b9050818114611b65576000866000018281548110611b2057611b20612332565b9060005260206000200154905080876000018481548110611b4357611b43612332565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611b7657611b766127b4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610442565b6000915050610442565b80356001600160a01b0381168114611bd257600080fd5b919050565b60008060408385031215611bea57600080fd5b611bf383611bbb565b946020939093013593505050565b6001600160e01b031981168114610d1057600080fd5b600060208284031215611c2957600080fd5b81356108e381611c01565b600060208284031215611c4657600080fd5b5035919050565b60005b83811015611c68578181015183820152602001611c50565b50506000910152565b60008151808452611c89816020860160208601611c4d565b601f01601f19169290920160200192915050565b6020815260006108e36020830184611c71565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715611ceb57611ceb611cb0565b6040525050565b60006001600160401b03821115611d0b57611d0b611cb0565b5060051b60200190565b600082601f830112611d2657600080fd5b81356020611d3382611cf2565b604051611d408282611cc6565b83815260059390931b8501820192828101915086841115611d6057600080fd5b8286015b84811015611d7b5780358352918301918301611d64565b509695505050505050565b600082601f830112611d9757600080fd5b81356001600160401b03811115611db057611db0611cb0565b604051611dc7601f8301601f191660200182611cc6565b818152846020838601011115611ddc57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611e0f57600080fd5b611e1885611bbb565b935060208501356001600160401b0380821115611e3457600080fd5b611e4088838901611d15565b94506040870135915080821115611e5657600080fd5b611e6288838901611d15565b93506060870135915080821115611e7857600080fd5b50611e8587828801611d86565b91505092959194509250565b600080600080600060a08688031215611ea957600080fd5b611eb286611bbb565b9450611ec060208701611bbb565b935060408601356001600160401b0380821115611edc57600080fd5b611ee889838a01611d15565b94506060880135915080821115611efe57600080fd5b611f0a89838a01611d15565b93506080880135915080821115611f2057600080fd5b50611f2d88828901611d86565b9150509295509295909350565b60008060408385031215611f4d57600080fd5b82359150611f5d60208401611bbb565b90509250929050565b60008060408385031215611f7957600080fd5b82356001600160401b0380821115611f9057600080fd5b818501915085601f830112611fa457600080fd5b81356020611fb182611cf2565b604051611fbe8282611cc6565b83815260059390931b8501820192828101915089841115611fde57600080fd5b948201945b8386101561200357611ff486611bbb565b82529482019490820190611fe3565b9650508601359250508082111561201957600080fd5b5061202685828601611d15565b9150509250929050565b600081518084526020808501945080840160005b8381101561206057815187529582019590820190600101612044565b509495945050505050565b6020815260006108e36020830184612030565b60008060006060848603121561209357600080fd5b61209c84611bbb565b925060208401356001600160401b03808211156120b857600080fd5b6120c487838801611d15565b935060408601359150808211156120da57600080fd5b506120e786828701611d15565b9150509250925092565b6000806000806080858703121561210757600080fd5b61211085611bbb565b9350602085013592506040850135915060608501356001600160401b0381111561213957600080fd5b611e8587828801611d86565b6000806040838503121561215857600080fd5b50508035926020909101359150565b6000806040838503121561217a57600080fd5b61218383611bbb565b91506020830135801515811461219857600080fd5b809150509250929050565b600080604083850312156121b657600080fd5b6121bf83611bbb565b9150611f5d60208401611bbb565b600080600080600060a086880312156121e557600080fd5b6121ee86611bbb565b94506121fc60208701611bbb565b9350604086013592506060860135915060808601356001600160401b0381111561222557600080fd5b611f2d88828901611d86565b60008060006060848603121561224657600080fd5b61224f84611bbb565b95602085013595506040909401359392505050565b600181811c9082168061227857607f821691505b60208210810361229857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526038908201526000805160206127eb8339815191526040820152771a185d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60421b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161237057612370612348565b5060010190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b8082018082111561044257610442612348565b6040815260006124266040830185612030565b82810360208401526124388185612030565b95945050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061258390830186612030565b82810360608401526125958186612030565b905082810360808401526125a98185611c71565b98975050505050505050565b6000602082840312156125c757600080fd5b81516108e381611c01565b600060033d11156125eb5760046000803e5060005160e01c5b90565b600060443d10156125fc5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561262b57505050505090565b82850191508151818111156126435750505050505090565b843d870101602082850101111561265d5750505050505090565b61266c60208286010187611cc6565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516126f1816017850160208801611c4d565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612722816028840160208801611c4d565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061276890830184611c71565b979650505050505050565b808202811582820484141761044257610442612348565b60008161279957612799612348565b506000190190565b8181038181111561044257610442612348565b634e487b7160e01b600052603160045260246000fdfe4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb455243313135355072657365744d696e7465725061757365723a206d75737420c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6265d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a2646970667358221220294efe154e549198ff0c6b7ab7e9846223d9e8fe7ae7de1938f6eb7d0f5e66a664736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101625760003560e01c8063731133e9116100ce578063ca15c87311610087578063ca15c873146102fb578063d53913931461030e578063d547741f14610323578063e63ab1e914610336578063e985e9c51461034b578063f242432a14610387578063f5298aca1461039a57600080fd5b8063731133e9146102875780638456cb591461029a5780639010d07c146102a257806391d14854146102cd578063a217fddf146102e0578063a22cb465146102e857600080fd5b80632f2ff15d116101205780632f2ff15d1461021b57806336568abe1461022e5780633f4ba83a146102415780634e1273f4146102495780635c975abb146102695780636b20c4541461027457600080fd5b8062fdd58e1461016757806301ffc9a71461018d5780630e89341c146101b05780631f7fdffa146101d0578063248a9ca3146101e55780632eb2c2d614610208575b600080fd5b61017a610175366004611bd7565b6103ad565b6040519081526020015b60405180910390f35b6101a061019b366004611c17565b610448565b6040519015158152602001610184565b6101c36101be366004611c34565b610453565b6040516101849190611c9d565b6101e36101de366004611df9565b6104e7565b005b61017a6101f3366004611c34565b60009081526020819052604090206001015490565b6101e3610216366004611e91565b61052d565b6101e3610229366004611f3a565b610579565b6101e361023c366004611f3a565b6105a3565b6101e3610621565b61025c610257366004611f66565b6106a3565b604051610184919061206b565b60055460ff166101a0565b6101e361028236600461207e565b6107cc565b6101e36102953660046120f1565b61080f565b6101e361084f565b6102b56102b0366004612145565b6108cb565b6040516001600160a01b039091168152602001610184565b6101a06102db366004611f3a565b6108ea565b61017a600081565b6101e36102f6366004612167565b610913565b61017a610309366004611c34565b61091e565b61017a60008051602061284b83398151915281565b6101e3610331366004611f3a565b610935565b61017a60008051602061282b83398151915281565b6101a06103593660046121a3565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b6101e36103953660046121cd565b61095a565b6101e36103a8366004612231565b61099f565b60006001600160a01b03831661041d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610442826109e2565b60606004805461046290612264565b80601f016020809104026020016040519081016040528092919081815260200182805461048e90612264565b80156104db5780601f106104b0576101008083540402835291602001916104db565b820191906000526020600020905b8154815290600101906020018083116104be57829003601f168201915b50505050509050919050565b6104ff60008051602061284b833981519152336108ea565b61051b5760405162461bcd60e51b81526004016104149061229e565b61052784848484610a22565b50505050565b6001600160a01b03851633148061054957506105498533610359565b6105655760405162461bcd60e51b8152600401610414906122e4565b6105728585858585610b6b565b5050505050565b60008281526020819052604090206001015461059481610d06565b61059e8383610d13565b505050565b6001600160a01b03811633146106135760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610414565b61061d8282610d35565b5050565b61063960008051602061282b833981519152336108ea565b6106995760405162461bcd60e51b815260206004820152603b60248201526000805160206127eb83398151915260448201527f686176652070617573657220726f6c6520746f20756e706175736500000000006064820152608401610414565b6106a1610d57565b565b606081518351146107085760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610414565b600083516001600160401b0381111561072357610723611cb0565b60405190808252806020026020018201604052801561074c578160200160208202803683370190505b50905060005b84518110156107c45761079785828151811061077057610770612332565b602002602001015185838151811061078a5761078a612332565b60200260200101516103ad565b8282815181106107a9576107a9612332565b60209081029190910101526107bd8161235e565b9050610752565b509392505050565b6001600160a01b0383163314806107e857506107e88333610359565b6108045760405162461bcd60e51b8152600401610414906122e4565b61059e838383610da9565b61082760008051602061284b833981519152336108ea565b6108435760405162461bcd60e51b81526004016104149061229e565b61052784848484610f36565b61086760008051602061282b833981519152336108ea565b6108c35760405162461bcd60e51b815260206004820152603960248201526000805160206127eb833981519152604482015278686176652070617573657220726f6c6520746f20706175736560381b6064820152608401610414565b6106a161100f565b60008281526001602052604081206108e3908361104c565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61061d338383611058565b600081815260016020526040812061044290611138565b60008281526020819052604090206001015461095081610d06565b61059e8383610d35565b6001600160a01b03851633148061097657506109768533610359565b6109925760405162461bcd60e51b8152600401610414906122e4565b6105728585858585611142565b6001600160a01b0383163314806109bb57506109bb8333610359565b6109d75760405162461bcd60e51b8152600401610414906122e4565b61059e83838361126c565b60006001600160e01b03198216636cdb3d1360e11b1480610a1357506001600160e01b031982166303a24d0760e21b145b80610442575061044282611376565b6001600160a01b038416610a485760405162461bcd60e51b815260040161041490612377565b8151835114610a695760405162461bcd60e51b8152600401610414906123b8565b33610a798160008787878761139b565b60005b8451811015610b1557838181518110610a9757610a97612332565b602002602001015160026000878481518110610ab557610ab5612332565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610afd9190612400565b90915550819050610b0d8161235e565b915050610a7c565b50846001600160a01b031660006001600160a01b0316826001600160a01b03166000805160206127cb8339815191528787604051610b54929190612413565b60405180910390a4610572816000878787876113a9565b8151835114610b8c5760405162461bcd60e51b8152600401610414906123b8565b6001600160a01b038416610bb25760405162461bcd60e51b815260040161041490612441565b33610bc181878787878761139b565b60005b8451811015610caa576000858281518110610be157610be1612332565b602002602001015190506000858381518110610bff57610bff612332565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610c505760405162461bcd60e51b815260040161041490612486565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610c8f908490612400565b9250508190555050505080610ca39061235e565b9050610bc4565b50846001600160a01b0316866001600160a01b0316826001600160a01b03166000805160206127cb8339815191528787604051610ce8929190612413565b60405180910390a4610cfe8187878787876113a9565b505050505050565b610d108133611504565b50565b610d1d828261155d565b600082815260016020526040902061059e90826115e1565b610d3f82826115f6565b600082815260016020526040902061059e908261165b565b610d5f611670565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316610dcf5760405162461bcd60e51b8152600401610414906124d0565b8051825114610df05760405162461bcd60e51b8152600401610414906123b8565b6000339050610e138185600086866040518060200160405280600081525061139b565b60005b8351811015610edb576000848281518110610e3357610e33612332565b602002602001015190506000848381518110610e5157610e51612332565b60209081029190910181015160008481526002835260408082206001600160a01b038c168352909352919091205490915081811015610ea25760405162461bcd60e51b815260040161041490612513565b60009283526002602090815260408085206001600160a01b038b1686529091529092209103905580610ed38161235e565b915050610e16565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03166000805160206127cb8339815191528686604051610f1a929190612413565b60405180910390a4604080516020810190915260009052610527565b6001600160a01b038416610f5c5760405162461bcd60e51b815260040161041490612377565b336000610f68856116b9565b90506000610f75856116b9565b9050610f868360008985858961139b565b60008681526002602090815260408083206001600160a01b038b16845290915281208054879290610fb8908490612400565b909155505060408051878152602081018790526001600160a01b03808a16926000929187169160008051602061280b833981519152910160405180910390a461100683600089898989611704565b50505050505050565b6110176117bf565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610d8c3390565b60006108e38383611805565b816001600160a01b0316836001600160a01b0316036110cb5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610414565b6001600160a01b03838116600081815260036020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000610442825490565b6001600160a01b0384166111685760405162461bcd60e51b815260040161041490612441565b336000611174856116b9565b90506000611181856116b9565b905061119183898985858961139b565b60008681526002602090815260408083206001600160a01b038c168452909152902054858110156111d45760405162461bcd60e51b815260040161041490612486565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611213908490612400565b909155505060408051888152602081018890526001600160a01b03808b16928c8216929188169160008051602061280b833981519152910160405180910390a4611261848a8a8a8a8a611704565b505050505050505050565b6001600160a01b0383166112925760405162461bcd60e51b8152600401610414906124d0565b33600061129e846116b9565b905060006112ab846116b9565b90506112cb8387600085856040518060200160405280600081525061139b565b60008581526002602090815260408083206001600160a01b038a1684529091529020548481101561130e5760405162461bcd60e51b815260040161041490612513565b60008681526002602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a905290929088169160008051602061280b833981519152910160405180910390a4604080516020810190915260009052611006565b60006001600160e01b03198216635a05180f60e01b148061044257506104428261182f565b610cfe868686868686611864565b6001600160a01b0384163b15610cfe5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906113ed9089908990889088908890600401612557565b6020604051808303816000875af1925050508015611428575060408051601f3d908101601f19168201909252611425918101906125b5565b60015b6114d4576114346125d2565b806308c379a00361146d57506114486125ee565b80611453575061146f565b8060405162461bcd60e51b81526004016104149190611c9d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610414565b6001600160e01b0319811663bc197c8160e01b146110065760405162461bcd60e51b815260040161041490612677565b61150e82826108ea565b61061d5761151b816118cc565b6115268360206118de565b6040516020016115379291906126bf565b60408051601f198184030181529082905262461bcd60e51b825261041491600401611c9d565b61156782826108ea565b61061d576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561159d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006108e3836001600160a01b038416611a79565b61160082826108ea565b1561061d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006108e3836001600160a01b038416611ac8565b60055460ff166106a15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610414565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106116f3576116f3612332565b602090810291909101015292915050565b6001600160a01b0384163b15610cfe5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611748908990899088908890889060040161272e565b6020604051808303816000875af1925050508015611783575060408051601f3d908101601f19168201909252611780918101906125b5565b60015b61178f576114346125d2565b6001600160e01b0319811663f23a6e6160e01b146110065760405162461bcd60e51b815260040161041490612677565b60055460ff16156106a15760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610414565b600082600001828154811061181c5761181c612332565b9060005260206000200154905092915050565b60006001600160e01b03198216637965db0b60e01b148061044257506301ffc9a760e01b6001600160e01b0319831614610442565b60055460ff1615610cfe5760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b6064820152608401610414565b60606104426001600160a01b03831660145b606060006118ed836002612773565b6118f8906002612400565b6001600160401b0381111561190f5761190f611cb0565b6040519080825280601f01601f191660200182016040528015611939576020820181803683370190505b509050600360fc1b8160008151811061195457611954612332565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061198357611983612332565b60200101906001600160f81b031916908160001a90535060006119a7846002612773565b6119b2906001612400565b90505b6001811115611a2a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106119e6576119e6612332565b1a60f81b8282815181106119fc576119fc612332565b60200101906001600160f81b031916908160001a90535060049490941c93611a238161278a565b90506119b5565b5083156108e35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610414565b6000818152600183016020526040812054611ac057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610442565b506000610442565b60008181526001830160205260408120548015611bb1576000611aec6001836127a1565b8554909150600090611b00906001906127a1565b9050818114611b65576000866000018281548110611b2057611b20612332565b9060005260206000200154905080876000018481548110611b4357611b43612332565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611b7657611b766127b4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610442565b6000915050610442565b80356001600160a01b0381168114611bd257600080fd5b919050565b60008060408385031215611bea57600080fd5b611bf383611bbb565b946020939093013593505050565b6001600160e01b031981168114610d1057600080fd5b600060208284031215611c2957600080fd5b81356108e381611c01565b600060208284031215611c4657600080fd5b5035919050565b60005b83811015611c68578181015183820152602001611c50565b50506000910152565b60008151808452611c89816020860160208601611c4d565b601f01601f19169290920160200192915050565b6020815260006108e36020830184611c71565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715611ceb57611ceb611cb0565b6040525050565b60006001600160401b03821115611d0b57611d0b611cb0565b5060051b60200190565b600082601f830112611d2657600080fd5b81356020611d3382611cf2565b604051611d408282611cc6565b83815260059390931b8501820192828101915086841115611d6057600080fd5b8286015b84811015611d7b5780358352918301918301611d64565b509695505050505050565b600082601f830112611d9757600080fd5b81356001600160401b03811115611db057611db0611cb0565b604051611dc7601f8301601f191660200182611cc6565b818152846020838601011115611ddc57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611e0f57600080fd5b611e1885611bbb565b935060208501356001600160401b0380821115611e3457600080fd5b611e4088838901611d15565b94506040870135915080821115611e5657600080fd5b611e6288838901611d15565b93506060870135915080821115611e7857600080fd5b50611e8587828801611d86565b91505092959194509250565b600080600080600060a08688031215611ea957600080fd5b611eb286611bbb565b9450611ec060208701611bbb565b935060408601356001600160401b0380821115611edc57600080fd5b611ee889838a01611d15565b94506060880135915080821115611efe57600080fd5b611f0a89838a01611d15565b93506080880135915080821115611f2057600080fd5b50611f2d88828901611d86565b9150509295509295909350565b60008060408385031215611f4d57600080fd5b82359150611f5d60208401611bbb565b90509250929050565b60008060408385031215611f7957600080fd5b82356001600160401b0380821115611f9057600080fd5b818501915085601f830112611fa457600080fd5b81356020611fb182611cf2565b604051611fbe8282611cc6565b83815260059390931b8501820192828101915089841115611fde57600080fd5b948201945b8386101561200357611ff486611bbb565b82529482019490820190611fe3565b9650508601359250508082111561201957600080fd5b5061202685828601611d15565b9150509250929050565b600081518084526020808501945080840160005b8381101561206057815187529582019590820190600101612044565b509495945050505050565b6020815260006108e36020830184612030565b60008060006060848603121561209357600080fd5b61209c84611bbb565b925060208401356001600160401b03808211156120b857600080fd5b6120c487838801611d15565b935060408601359150808211156120da57600080fd5b506120e786828701611d15565b9150509250925092565b6000806000806080858703121561210757600080fd5b61211085611bbb565b9350602085013592506040850135915060608501356001600160401b0381111561213957600080fd5b611e8587828801611d86565b6000806040838503121561215857600080fd5b50508035926020909101359150565b6000806040838503121561217a57600080fd5b61218383611bbb565b91506020830135801515811461219857600080fd5b809150509250929050565b600080604083850312156121b657600080fd5b6121bf83611bbb565b9150611f5d60208401611bbb565b600080600080600060a086880312156121e557600080fd5b6121ee86611bbb565b94506121fc60208701611bbb565b9350604086013592506060860135915060808601356001600160401b0381111561222557600080fd5b611f2d88828901611d86565b60008060006060848603121561224657600080fd5b61224f84611bbb565b95602085013595506040909401359392505050565b600181811c9082168061227857607f821691505b60208210810361229857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526038908201526000805160206127eb8339815191526040820152771a185d99481b5a5b9d195c881c9bdb19481d1bc81b5a5b9d60421b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161237057612370612348565b5060010190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b8082018082111561044257610442612348565b6040815260006124266040830185612030565b82810360208401526124388185612030565b95945050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061258390830186612030565b82810360608401526125958186612030565b905082810360808401526125a98185611c71565b98975050505050505050565b6000602082840312156125c757600080fd5b81516108e381611c01565b600060033d11156125eb5760046000803e5060005160e01c5b90565b600060443d10156125fc5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561262b57505050505090565b82850191508151818111156126435750505050505090565b843d870101602082850101111561265d5750505050505090565b61266c60208286010187611cc6565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516126f1816017850160208801611c4d565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612722816028840160208801611c4d565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061276890830184611c71565b979650505050505050565b808202811582820484141761044257610442612348565b60008161279957612799612348565b506000190190565b8181038181111561044257610442612348565b634e487b7160e01b600052603160045260246000fdfe4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb455243313135355072657365744d696e7465725061757365723a206d75737420c3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6265d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a2646970667358221220294efe154e549198ff0c6b7ab7e9846223d9e8fe7ae7de1938f6eb7d0f5e66a664736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var RootERC1155PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"RootERC1155Predicate","sourceName":"contracts/root/RootERC1155Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC1155Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ERC1155DepositBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC1155Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ERC1155WithdrawBatch","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":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"TokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childERC1155Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC1155MetadataURI","name":"rootToken","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC1155MetadataURI","name":"rootToken","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"depositBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC1155MetadataURI","name":"rootToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newChildERC1155Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC1155MetadataURI","name":"rootToken","type":"address"}],"name":"mapToken","outputs":[{"internalType":"address","name":"childToken","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50611bd2806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063bc197c81116100ad578063f23a6e6111610071578063f23a6e61146102fe578063f43cda8b1461031d578063f4a120f714610330578063f645125514610343578063f8c8765e1461036a57600080fd5b8063bc197c8114610238578063c5ac2b1c14610270578063cb10f94c14610297578063d41f1771146102b0578063d7c9e3ec146102d757600080fd5b80637efab4f5116100f45780637efab4f5146101a157806395c7041c146101ca578063a78e111c146101dd578063b1768065146101f0578063b68ad1e41461022557600080fd5b806301ffc9a7146101265780630efe6a8b1461014e5780634c4c45de14610163578063654715e614610176575b600080fd5b610139610134366004611173565b61037d565b60405190151581526020015b60405180910390f35b61016161015c3660046111bc565b6103b4565b005b61016161017136600461123c565b6103c5565b600254610189906001600160a01b031681565b6040516001600160a01b039091168152602001610145565b6101896101af3660046112e8565b6004602052600090815260409020546001600160a01b031681565b600154610189906001600160a01b031681565b6101616101eb366004611305565b610448565b6102177f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610145565b600354610189906001600160a01b031681565b610257610246366004611497565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610145565b6102177faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b600054610189906201000090046001600160a01b031681565b6102177f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6102177f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61025761030c366004611544565b63f23a6e6160e01b95945050505050565b61016161032b3660046115ac565b61045a565b61018961033e3660046112e8565b610629565b6102177f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b610161610378366004611634565b610945565b60006001600160e01b03198216630271189760e51b14806103ae57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6103c083338484610b54565b505050565b84831480156103d357508481145b6104305760405162461bcd60e51b8152602060048201526024808201527f526f6f74455243313135355072656469636174653a20494e56414c49445f4c4560448201526309c8ea8960e31b60648201526084015b60405180910390fd5b61043f87878787878787610cec565b50505050505050565b61045484848484610b54565b50505050565b6001546001600160a01b031633146104c35760405162461bcd60e51b815260206004820152602660248201527f526f6f74455243313135355072656469636174653a204f4e4c595f455849545f6044820152652422a62822a960d11b6064820152608401610427565b6002546001600160a01b038481169116146105335760405162461bcd60e51b815260206004820152602a60248201527f526f6f74455243313135355072656469636174653a204f4e4c595f4348494c446044820152695f50524544494341544560b01b6064820152608401610427565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e982869610562602060008486611690565b61056b916116ba565b0361058a576105856105808260208186611690565b610ecc565b610454565b7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed26105b9602060008486611690565b6105c2916116ba565b036105d1576105858282610fcb565b60405162461bcd60e51b815260206004820152602760248201527f526f6f74455243313135355072656469636174653a20494e56414c49445f5349604482015266474e415455524560c81b6064820152608401610427565b60006001600160a01b03821661068d5760405162461bcd60e51b815260206004820152602360248201527f526f6f74455243313135355072656469636174653a20494e56414c49445f544f60448201526225a2a760e91b6064820152608401610427565b6001600160a01b0382811660009081526004602052604090205416156107015760405162461bcd60e51b8152602060048201526024808201527f526f6f74455243313135355072656469636174653a20414c52454144595f4d416044820152631414115160e21b6064820152608401610427565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b03928316926107ab921690603401604051602081830303815290604052805190602001208360405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03848116600081815260046020818152604080842080546001600160a01b031916968816969096179095558451908101855282815293516303a24d0760e21b8152908101919091529294509091630e89341c90602401600060405180830381865afa92505050801561084657506040513d6000823e601f3d908101601f1916820160405261084391908101906116fc565b60015b1561084e5790505b600060029054906101000a90046001600160a01b03166001600160a01b03166316f19831837f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad87856040516020016108a89392919061179e565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016108d49291906117c8565b600060405180830381600087803b1580156108ee57600080fd5b505af1158015610902573d6000803e3d6000fd5b50506040516001600160a01b038087169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a35050919050565b600054610100900460ff16158080156109655750600054600160ff909116105b8061097f5750303b15801561097f575060005460ff166001145b6109e25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610427565b6000805460ff191660011790558015610a05576000805461ff0019166101001790555b6001600160a01b03851615801590610a2557506001600160a01b03841615155b8015610a3957506001600160a01b03831615155b8015610a4d57506001600160a01b03821615155b610aaa5760405162461bcd60e51b815260206004820152602860248201527f526f6f74455243313135355072656469636174653a204241445f494e495449416044820152672624ad20aa24a7a760c11b6064820152608401610427565b6000805462010000600160b01b031916620100006001600160a01b038881169190910291909117909155600180546001600160a01b031990811687841617909155600280548216868416179055600380549091169184169190911790558015610b4d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000610b5f8561112c565b604051637921219560e11b81529091506001600160a01b0386169063f242432a90610b949033903090889088906004016117f4565b600060405180830381600087803b158015610bae57600080fd5b505af1158015610bc2573d6000803e3d6000fd5b5050600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b038b8116828401523360608301528a8116608083015260a082018a905260c08083018a90528351808403909101815260e08301938490526316f1983160e01b90935262010000909404841695506316f198319450610c5f939092169160e4016117c8565b600060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505060408051338152602081018790529081018590526001600160a01b03808816935084811692508816907fbcbdf0c69f975f2a4085544938b054f02e77e87cbd055146d388c0be7120e04f9060600160405180910390a45050505050565b6000610cf78861112c565b905060005b84811015610da357886001600160a01b031663f242432a3330898986818110610d2757610d2761182c565b90506020020135888887818110610d4057610d4061182c565b905060200201356040518563ffffffff1660e01b8152600401610d6694939291906117f4565b600060405180830381600087803b158015610d8057600080fd5b505af1158015610d94573d6000803e3d6000fd5b50505050806001019050610cfc565b506000546002546040516001600160a01b03620100009093048316926316f19831921690610e05907faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d18908d9033908e908e908e908e908e908e906020016118bd565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e319291906117c8565b600060405180830381600087803b158015610e4b57600080fd5b505af1158015610e5f573d6000803e3d6000fd5b50505050336001600160a01b0316816001600160a01b0316896001600160a01b03167f7e8ab6f25cb177d65db49b7a2197bb2a7df5757434857d411e2523b332a913e68a8a8a8a8a8a604051610eba96959493929190611928565b60405180910390a45050505050505050565b600080808080610ede86880188611971565b6001600160a01b03808616600090815260046020526040902054959a50939850919650945092501680610f1357610f136119cc565b604051637921219560e11b81526001600160a01b0387169063f242432a90610f459030908890889088906004016117f4565b600060405180830381600087803b158015610f5f57600080fd5b505af1158015610f73573d6000803e3d6000fd5b5050604080516001600160a01b0389811682526020820188905291810186905281881693508482169250908916907fc42752949ca07109e6f25adcde4a9407be23e084b1d32ca2bce8aa55bf3dd62590606001610eba565b600080808080610fdd868801886119e2565b6001600160a01b03808616600090815260046020526040902054959b509399509197509550935016905080611014576110146119cc565b60005b83518110156110da57866001600160a01b031663f242432a308784815181106110425761104261182c565b602002602001015187858151811061105c5761105c61182c565b60200260200101518786815181106110765761107661182c565b60200260200101516040518563ffffffff1660e01b815260040161109d94939291906117f4565b600060405180830381600087803b1580156110b757600080fd5b505af11580156110cb573d6000803e3d6000fd5b50505050806001019050611017565b50846001600160a01b0316816001600160a01b0316876001600160a01b03167fce612e98b81c726375e7c2395409e74ee0a29b22f7641ea5a8ce8508616448c0878787604051610eba93929190611b27565b6001600160a01b0380821660009081526004602052604090205416806111585761115582610629565b90505b6001600160a01b03811661116e5761116e6119cc565b919050565b60006020828403121561118557600080fd5b81356001600160e01b03198116811461119d57600080fd5b9392505050565b6001600160a01b03811681146111b957600080fd5b50565b6000806000606084860312156111d157600080fd5b83356111dc816111a4565b95602085013595506040909401359392505050565b60008083601f84011261120357600080fd5b5081356001600160401b0381111561121a57600080fd5b6020830191508360208260051b850101111561123557600080fd5b9250929050565b60008060008060008060006080888a03121561125757600080fd5b8735611262816111a4565b965060208801356001600160401b038082111561127e57600080fd5b61128a8b838c016111f1565b909850965060408a01359150808211156112a357600080fd5b6112af8b838c016111f1565b909650945060608a01359150808211156112c857600080fd5b506112d58a828b016111f1565b989b979a50959850939692959293505050565b6000602082840312156112fa57600080fd5b813561119d816111a4565b6000806000806080858703121561131b57600080fd5b8435611326816111a4565b93506020850135611336816111a4565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156113895761138961134b565b604052919050565b60006001600160401b038211156113aa576113aa61134b565b5060051b60200190565b600082601f8301126113c557600080fd5b813560206113da6113d583611391565b611361565b82815260059290921b840181019181810190868411156113f957600080fd5b8286015b8481101561141457803583529183019183016113fd565b509695505050505050565b60006001600160401b038211156114385761143861134b565b50601f01601f191660200190565b600082601f83011261145757600080fd5b81356114656113d58261141f565b81815284602083860101111561147a57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156114af57600080fd5b85356114ba816111a4565b945060208601356114ca816111a4565b935060408601356001600160401b03808211156114e657600080fd5b6114f289838a016113b4565b9450606088013591508082111561150857600080fd5b61151489838a016113b4565b9350608088013591508082111561152a57600080fd5b5061153788828901611446565b9150509295509295909350565b600080600080600060a0868803121561155c57600080fd5b8535611567816111a4565b94506020860135611577816111a4565b9350604086013592506060860135915060808601356001600160401b038111156115a057600080fd5b61153788828901611446565b600080600080606085870312156115c257600080fd5b8435935060208501356115d4816111a4565b925060408501356001600160401b03808211156115f057600080fd5b818701915087601f83011261160457600080fd5b81358181111561161357600080fd5b88602082850101111561162557600080fd5b95989497505060200194505050565b6000806000806080858703121561164a57600080fd5b8435611655816111a4565b93506020850135611665816111a4565b92506040850135611675816111a4565b91506060850135611685816111a4565b939692955090935050565b600080858511156116a057600080fd5b838611156116ad57600080fd5b5050820193919092039150565b803560208310156103ae57600019602084900360031b1b1692915050565b60005b838110156116f35781810151838201526020016116db565b50506000910152565b60006020828403121561170e57600080fd5b81516001600160401b0381111561172457600080fd5b8201601f8101841361173557600080fd5b80516117436113d58261141f565b81815285602083850101111561175857600080fd5b6117698260208301602086016116d8565b95945050505050565b6000815180845261178a8160208601602086016116d8565b601f01601f19169290920160200192915050565b8381526001600160a01b038316602082015260606040820181905260009061176990830184611772565b6001600160a01b03831681526040602082018190526000906117ec90830184611772565b949350505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b85811015611880578135611865816111a4565b6001600160a01b031687529582019590820190600101611852565b509495945050505050565b81835260006001600160fb1b038311156118a457600080fd5b8260051b80836020870137939093016020019392505050565b8981526001600160a01b0389811660208301528816604082015260c0606082018190526000906118f0908301888a611842565b828103608084015261190381878961188b565b905082810360a084015261191881858761188b565b9c9b505050505050505050505050565b60608152600061193c60608301888a611842565b828103602084015261194f81878961188b565b9050828103604084015261196481858761188b565b9998505050505050505050565b600080600080600060a0868803121561198957600080fd5b8535611994816111a4565b945060208601356119a4816111a4565b935060408601356119b4816111a4565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052600160045260246000fd5b60008060008060008060c087890312156119fb57600080fd5b86359550602080880135611a0e816111a4565b95506040880135611a1e816111a4565b945060608801356001600160401b0380821115611a3a57600080fd5b818a0191508a601f830112611a4e57600080fd5b8135611a5c6113d582611391565b81815260059190911b8301840190848101908d831115611a7b57600080fd5b938501935b82851015611aa2578435611a93816111a4565b82529385019390850190611a80565b9750505060808a0135925080831115611aba57600080fd5b611ac68b848c016113b4565b945060a08a0135925080831115611adc57600080fd5b5050611aea89828a016113b4565b9150509295509295509295565b600081518084526020808501945080840160005b8381101561188057815187529582019590820190600101611b0b565b606080825284519082018190526000906020906080840190828801845b82811015611b695781516001600160a01b031684529284019290840190600101611b44565b50505083810382850152611b7d8187611af7565b9150508281036040840152611b928185611af7565b969550505050505056fea2646970667358221220fca09c260114445d76ac4a1ec1efcbdba6ac7f99d1bccd257e90ed39dcea400d64736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063bc197c81116100ad578063f23a6e6111610071578063f23a6e61146102fe578063f43cda8b1461031d578063f4a120f714610330578063f645125514610343578063f8c8765e1461036a57600080fd5b8063bc197c8114610238578063c5ac2b1c14610270578063cb10f94c14610297578063d41f1771146102b0578063d7c9e3ec146102d757600080fd5b80637efab4f5116100f45780637efab4f5146101a157806395c7041c146101ca578063a78e111c146101dd578063b1768065146101f0578063b68ad1e41461022557600080fd5b806301ffc9a7146101265780630efe6a8b1461014e5780634c4c45de14610163578063654715e614610176575b600080fd5b610139610134366004611173565b61037d565b60405190151581526020015b60405180910390f35b61016161015c3660046111bc565b6103b4565b005b61016161017136600461123c565b6103c5565b600254610189906001600160a01b031681565b6040516001600160a01b039091168152602001610145565b6101896101af3660046112e8565b6004602052600090815260409020546001600160a01b031681565b600154610189906001600160a01b031681565b6101616101eb366004611305565b610448565b6102177f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610145565b600354610189906001600160a01b031681565b610257610246366004611497565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610145565b6102177faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b600054610189906201000090046001600160a01b031681565b6102177f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6102177f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61025761030c366004611544565b63f23a6e6160e01b95945050505050565b61016161032b3660046115ac565b61045a565b61018961033e3660046112e8565b610629565b6102177f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b610161610378366004611634565b610945565b60006001600160e01b03198216630271189760e51b14806103ae57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6103c083338484610b54565b505050565b84831480156103d357508481145b6104305760405162461bcd60e51b8152602060048201526024808201527f526f6f74455243313135355072656469636174653a20494e56414c49445f4c4560448201526309c8ea8960e31b60648201526084015b60405180910390fd5b61043f87878787878787610cec565b50505050505050565b61045484848484610b54565b50505050565b6001546001600160a01b031633146104c35760405162461bcd60e51b815260206004820152602660248201527f526f6f74455243313135355072656469636174653a204f4e4c595f455849545f6044820152652422a62822a960d11b6064820152608401610427565b6002546001600160a01b038481169116146105335760405162461bcd60e51b815260206004820152602a60248201527f526f6f74455243313135355072656469636174653a204f4e4c595f4348494c446044820152695f50524544494341544560b01b6064820152608401610427565b7f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e982869610562602060008486611690565b61056b916116ba565b0361058a576105856105808260208186611690565b610ecc565b610454565b7f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed26105b9602060008486611690565b6105c2916116ba565b036105d1576105858282610fcb565b60405162461bcd60e51b815260206004820152602760248201527f526f6f74455243313135355072656469636174653a20494e56414c49445f5349604482015266474e415455524560c81b6064820152608401610427565b60006001600160a01b03821661068d5760405162461bcd60e51b815260206004820152602360248201527f526f6f74455243313135355072656469636174653a20494e56414c49445f544f60448201526225a2a760e91b6064820152608401610427565b6001600160a01b0382811660009081526004602052604090205416156107015760405162461bcd60e51b8152602060048201526024808201527f526f6f74455243313135355072656469636174653a20414c52454144595f4d416044820152631414115160e21b6064820152608401610427565b6002546003546040516bffffffffffffffffffffffff19606086901b1660208201526001600160a01b03928316926107ab921690603401604051602081830303815290604052805190602001208360405160388101919091526f5af43d82803e903d91602b57fd5bf3ff60248201526014810192909252733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c8201206078820152605560439091012090565b6001600160a01b03848116600081815260046020818152604080842080546001600160a01b031916968816969096179095558451908101855282815293516303a24d0760e21b8152908101919091529294509091630e89341c90602401600060405180830381865afa92505050801561084657506040513d6000823e601f3d908101601f1916820160405261084391908101906116fc565b60015b1561084e5790505b600060029054906101000a90046001600160a01b03166001600160a01b03166316f19831837f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad87856040516020016108a89392919061179e565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016108d49291906117c8565b600060405180830381600087803b1580156108ee57600080fd5b505af1158015610902573d6000803e3d6000fd5b50506040516001600160a01b038087169350871691507f85920d35e6c72f6b2affffa04298b0cecfeba86e4a9f407df661f1cb8ab5e61790600090a35050919050565b600054610100900460ff16158080156109655750600054600160ff909116105b8061097f5750303b15801561097f575060005460ff166001145b6109e25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610427565b6000805460ff191660011790558015610a05576000805461ff0019166101001790555b6001600160a01b03851615801590610a2557506001600160a01b03841615155b8015610a3957506001600160a01b03831615155b8015610a4d57506001600160a01b03821615155b610aaa5760405162461bcd60e51b815260206004820152602860248201527f526f6f74455243313135355072656469636174653a204241445f494e495449416044820152672624ad20aa24a7a760c11b6064820152608401610427565b6000805462010000600160b01b031916620100006001600160a01b038881169190910291909117909155600180546001600160a01b031990811687841617909155600280548216868416179055600380549091169184169190911790558015610b4d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6000610b5f8561112c565b604051637921219560e11b81529091506001600160a01b0386169063f242432a90610b949033903090889088906004016117f4565b600060405180830381600087803b158015610bae57600080fd5b505af1158015610bc2573d6000803e3d6000fd5b5050600054600254604080517f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82160208201526001600160a01b038b8116828401523360608301528a8116608083015260a082018a905260c08083018a90528351808403909101815260e08301938490526316f1983160e01b90935262010000909404841695506316f198319450610c5f939092169160e4016117c8565b600060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505060408051338152602081018790529081018590526001600160a01b03808816935084811692508816907fbcbdf0c69f975f2a4085544938b054f02e77e87cbd055146d388c0be7120e04f9060600160405180910390a45050505050565b6000610cf78861112c565b905060005b84811015610da357886001600160a01b031663f242432a3330898986818110610d2757610d2761182c565b90506020020135888887818110610d4057610d4061182c565b905060200201356040518563ffffffff1660e01b8152600401610d6694939291906117f4565b600060405180830381600087803b158015610d8057600080fd5b505af1158015610d94573d6000803e3d6000fd5b50505050806001019050610cfc565b506000546002546040516001600160a01b03620100009093048316926316f19831921690610e05907faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d18908d9033908e908e908e908e908e908e906020016118bd565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e319291906117c8565b600060405180830381600087803b158015610e4b57600080fd5b505af1158015610e5f573d6000803e3d6000fd5b50505050336001600160a01b0316816001600160a01b0316896001600160a01b03167f7e8ab6f25cb177d65db49b7a2197bb2a7df5757434857d411e2523b332a913e68a8a8a8a8a8a604051610eba96959493929190611928565b60405180910390a45050505050505050565b600080808080610ede86880188611971565b6001600160a01b03808616600090815260046020526040902054959a50939850919650945092501680610f1357610f136119cc565b604051637921219560e11b81526001600160a01b0387169063f242432a90610f459030908890889088906004016117f4565b600060405180830381600087803b158015610f5f57600080fd5b505af1158015610f73573d6000803e3d6000fd5b5050604080516001600160a01b0389811682526020820188905291810186905281881693508482169250908916907fc42752949ca07109e6f25adcde4a9407be23e084b1d32ca2bce8aa55bf3dd62590606001610eba565b600080808080610fdd868801886119e2565b6001600160a01b03808616600090815260046020526040902054959b509399509197509550935016905080611014576110146119cc565b60005b83518110156110da57866001600160a01b031663f242432a308784815181106110425761104261182c565b602002602001015187858151811061105c5761105c61182c565b60200260200101518786815181106110765761107661182c565b60200260200101516040518563ffffffff1660e01b815260040161109d94939291906117f4565b600060405180830381600087803b1580156110b757600080fd5b505af11580156110cb573d6000803e3d6000fd5b50505050806001019050611017565b50846001600160a01b0316816001600160a01b0316876001600160a01b03167fce612e98b81c726375e7c2395409e74ee0a29b22f7641ea5a8ce8508616448c0878787604051610eba93929190611b27565b6001600160a01b0380821660009081526004602052604090205416806111585761115582610629565b90505b6001600160a01b03811661116e5761116e6119cc565b919050565b60006020828403121561118557600080fd5b81356001600160e01b03198116811461119d57600080fd5b9392505050565b6001600160a01b03811681146111b957600080fd5b50565b6000806000606084860312156111d157600080fd5b83356111dc816111a4565b95602085013595506040909401359392505050565b60008083601f84011261120357600080fd5b5081356001600160401b0381111561121a57600080fd5b6020830191508360208260051b850101111561123557600080fd5b9250929050565b60008060008060008060006080888a03121561125757600080fd5b8735611262816111a4565b965060208801356001600160401b038082111561127e57600080fd5b61128a8b838c016111f1565b909850965060408a01359150808211156112a357600080fd5b6112af8b838c016111f1565b909650945060608a01359150808211156112c857600080fd5b506112d58a828b016111f1565b989b979a50959850939692959293505050565b6000602082840312156112fa57600080fd5b813561119d816111a4565b6000806000806080858703121561131b57600080fd5b8435611326816111a4565b93506020850135611336816111a4565b93969395505050506040820135916060013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156113895761138961134b565b604052919050565b60006001600160401b038211156113aa576113aa61134b565b5060051b60200190565b600082601f8301126113c557600080fd5b813560206113da6113d583611391565b611361565b82815260059290921b840181019181810190868411156113f957600080fd5b8286015b8481101561141457803583529183019183016113fd565b509695505050505050565b60006001600160401b038211156114385761143861134b565b50601f01601f191660200190565b600082601f83011261145757600080fd5b81356114656113d58261141f565b81815284602083860101111561147a57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156114af57600080fd5b85356114ba816111a4565b945060208601356114ca816111a4565b935060408601356001600160401b03808211156114e657600080fd5b6114f289838a016113b4565b9450606088013591508082111561150857600080fd5b61151489838a016113b4565b9350608088013591508082111561152a57600080fd5b5061153788828901611446565b9150509295509295909350565b600080600080600060a0868803121561155c57600080fd5b8535611567816111a4565b94506020860135611577816111a4565b9350604086013592506060860135915060808601356001600160401b038111156115a057600080fd5b61153788828901611446565b600080600080606085870312156115c257600080fd5b8435935060208501356115d4816111a4565b925060408501356001600160401b03808211156115f057600080fd5b818701915087601f83011261160457600080fd5b81358181111561161357600080fd5b88602082850101111561162557600080fd5b95989497505060200194505050565b6000806000806080858703121561164a57600080fd5b8435611655816111a4565b93506020850135611665816111a4565b92506040850135611675816111a4565b91506060850135611685816111a4565b939692955090935050565b600080858511156116a057600080fd5b838611156116ad57600080fd5b5050820193919092039150565b803560208310156103ae57600019602084900360031b1b1692915050565b60005b838110156116f35781810151838201526020016116db565b50506000910152565b60006020828403121561170e57600080fd5b81516001600160401b0381111561172457600080fd5b8201601f8101841361173557600080fd5b80516117436113d58261141f565b81815285602083850101111561175857600080fd5b6117698260208301602086016116d8565b95945050505050565b6000815180845261178a8160208601602086016116d8565b601f01601f19169290920160200192915050565b8381526001600160a01b038316602082015260606040820181905260009061176990830184611772565b6001600160a01b03831681526040602082018190526000906117ec90830184611772565b949350505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b85811015611880578135611865816111a4565b6001600160a01b031687529582019590820190600101611852565b509495945050505050565b81835260006001600160fb1b038311156118a457600080fd5b8260051b80836020870137939093016020019392505050565b8981526001600160a01b0389811660208301528816604082015260c0606082018190526000906118f0908301888a611842565b828103608084015261190381878961188b565b905082810360a084015261191881858761188b565b9c9b505050505050505050505050565b60608152600061193c60608301888a611842565b828103602084015261194f81878961188b565b9050828103604084015261196481858761188b565b9998505050505050505050565b600080600080600060a0868803121561198957600080fd5b8535611994816111a4565b945060208601356119a4816111a4565b935060408601356119b4816111a4565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052600160045260246000fd5b60008060008060008060c087890312156119fb57600080fd5b86359550602080880135611a0e816111a4565b95506040880135611a1e816111a4565b945060608801356001600160401b0380821115611a3a57600080fd5b818a0191508a601f830112611a4e57600080fd5b8135611a5c6113d582611391565b81815260059190911b8301840190848101908d831115611a7b57600080fd5b938501935b82851015611aa2578435611a93816111a4565b82529385019390850190611a80565b9750505060808a0135925080831115611aba57600080fd5b611ac68b848c016113b4565b945060a08a0135925080831115611adc57600080fd5b5050611aea89828a016113b4565b9150509295509295509295565b600081518084526020808501945080840160005b8381101561188057815187529582019590820190600101611b0b565b606080825284519082018190526000906020906080840190828801845b82811015611b695781516001600160a01b031684529284019290840190600101611b44565b50505083810382850152611b7d8187611af7565b9150508281036040840152611b928185611af7565b969550505050505056fea2646970667358221220fca09c260114445d76ac4a1ec1efcbdba6ac7f99d1bccd257e90ed39dcea400d64736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var ChildMintableERC1155PredicateArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"ChildMintableERC1155Predicate","sourceName":"contracts/root/ChildMintableERC1155Predicate.sol","abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintableERC1155Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"MintableERC1155DepositBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintableERC1155Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"MintableERC1155WithdrawBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootToken","type":"address"},{"indexed":true,"internalType":"address","name":"childToken","type":"address"}],"name":"MintableTokenMapped","type":"event"},{"inputs":[],"name":"DEPOSIT_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAP_TOKEN_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_BATCH_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_SIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"childTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitHelper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newRootERC1155Predicate","type":"address"},{"internalType":"address","name":"newChildTokenTemplate","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rootERC1155Predicate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rootTokenToChildToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateSender","outputs":[{"internalType":"contract IStateSender","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IChildERC1155","name":"childToken","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IChildERC1155","name":"childToken","type":"address"},{"internalType":"address[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"withdrawBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IChildERC1155","name":"childToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50611f7c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100d55760003560e01c8063b8cd3ec011610087578063b8cd3ec0146101b6578063c5ac2b1c146101c9578063cb10f94c146101f0578063d41f177114610209578063d7c9e3ec14610230578063f43cda8b14610257578063f64512551461026a578063f8c8765e1461029157600080fd5b8063051eb2e2146100da5780637efab4f51461010a57806386937eb41461013357806395c7041c14610148578063b17680651461015b578063b5c5f67214610190578063b68ad1e4146101a3575b600080fd5b6002546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ed610118366004611564565b6004602052600090815260409020546001600160a01b031681565b6101466101413660046115d3565b6102a4565b005b6001546100ed906001600160a01b031681565b6101827f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610101565b61014661019e36600461167f565b6102bc565b6003546100ed906001600160a01b031681565b6101466101c43660046116b4565b6102cd565b6101827faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6000546100ed906201000090046001600160a01b031681565b6101827f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101827f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b6101466102653660046116fa565b6102df565b6101827f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61014661029f366004611782565b610514565b6102b38787878787878761062d565b50505050505050565b6102c8833384846109ba565b505050565b6102d9848484846109ba565b50505050565b6001546001600160a01b031633146103565760405162461bcd60e51b815260206004820152602f60248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204f60448201526e27262cafa2ac24aa2fa422a62822a960891b60648201526084015b60405180910390fd5b6002546001600160a01b038481169116146103ce5760405162461bcd60e51b815260206004820152603260248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204f6044820152714e4c595f524f4f545f50524544494341544560701b606482015260840161034d565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f8216103fd6020600084866117de565b61040691611808565b036104255761042061041b82602081866117de565b610cd5565b6102d9565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104546020600084866117de565b61045d91611808565b0361046c576104208282610f40565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61049b6020600084866117de565b6104a491611808565b036104b35761042082826111ad565b60405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204960448201526f4e56414c49445f5349474e415455524560801b606482015260840161034d565b600054610100900460ff16158080156105345750600054600160ff909116105b8061054e5750303b15801561054e575060005460ff166001145b6105b15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161034d565b6000805460ff1916600117905580156105d4576000805461ff0019166101001790555b6105e085858585611317565b8015610626576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b8661063781611420565b6106535760405162461bcd60e51b815260040161034d90611826565b6000886001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b79190611871565b6001600160a01b038181166000908152600460205260409020549192508a81169116146106f65760405162461bcd60e51b815260040161034d9061188e565b6001600160a01b03811661070c5761070c6118db565b306001600160a01b0316896001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107789190611871565b6001600160a01b03161461078e5761078e6118db565b868514801561079c57508483145b6107fe5760405162461bcd60e51b815260206004820152602d60248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204960448201526c09cac82989288be988a9c8ea89609b1b606482015260840161034d565b604051631ac8311560e21b81526001600160a01b038a1690636b20c454906108329033908a908a908a908a90600401611923565b6020604051808303816000875af1158015610851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108759190611967565b6108915760405162461bcd60e51b815260040161034d90611989565b6000546002546040516001600160a01b03620100009093048316926316f198319216906108f2907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908f908f908f908f908f908f90602001611a1c565b6040516020818303038152906040526040518363ffffffff1660e01b815260040161091e929190611acd565b600060405180830381600087803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b50505050336001600160a01b0316896001600160a01b0316826001600160a01b03167fdd47868997765508c515e1f8ca079846dafbdfd8f98f6e76bca0891810b9f9d18b8b8b8b8b8b6040516109a796959493929190611af9565b60405180910390a4505050505050505050565b836109c481611420565b6109e05760405162461bcd60e51b815260040161034d90611826565b6000856001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a449190611871565b6001600160a01b03818116600090815260046020526040902054919250878116911614610a835760405162461bcd60e51b815260040161034d9061188e565b6001600160a01b038116610a9957610a996118db565b306001600160a01b0316866001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b059190611871565b6001600160a01b031614610b1b57610b1b6118db565b604051637a94c56560e11b81526001600160a01b0387169063f5298aca90610b4b90339088908890600401611b42565b6020604051808303816000875af1158015610b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8e9190611967565b610baa5760405162461bcd60e51b815260040161034d90611989565b600054600254604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152898116608083015260a0820189905260c08083018990528351808403909101815260e08301938490526316f1983160e01b909352620100009094048416936316f1983193610c429391169160e401611acd565b600060405180830381600087803b158015610c5c57600080fd5b505af1158015610c70573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316826001600160a01b03167fda58d73e08ba3c7767de904e68d208be8291494a9faaf70a6d4f736d24ec1f0f338888604051610cc593929190611b42565b60405180910390a4505050505050565b600080808080610ce786880188611b63565b6001600160a01b03808616600090815260046020526040902054959a50939850919650945092501680610d2c5760405162461bcd60e51b815260040161034d9061188e565b610d3581611420565b610d4157610d416118db565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da59190611871565b9050866001600160a01b0316816001600160a01b031614610dc857610dc86118db565b6001600160a01b038116610dde57610dde6118db565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611871565b6001600160a01b031614610e6057610e606118db565b604051630ab714fb60e11b81526001600160a01b0383169063156e29f690610e9090889088908890600401611b42565b6020604051808303816000875af1158015610eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed39190611967565b610eef5760405162461bcd60e51b815260040161034d90611bbe565b846001600160a01b0316826001600160a01b0316886001600160a01b03167f76a4cd47013e7e58abe817eedbb692d1614d71080b527412ebfb3f91a085a6de8988886040516109a793929190611b42565b600080808080610f5286880188611cdc565b6001600160a01b03808616600090815260046020526040902054959b509399509197509550935016905080610f995760405162461bcd60e51b815260040161034d9061188e565b610fa281611420565b610fae57610fae6118db565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190611871565b9050866001600160a01b0316816001600160a01b031614611035576110356118db565b6001600160a01b03811661104b5761104b6118db565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611093573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b79190611871565b6001600160a01b0316146110cd576110cd6118db565b604051635712868360e01b81526001600160a01b038316906357128683906110fd90889088908890600401611e21565b6020604051808303816000875af115801561111c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111409190611967565b61115c5760405162461bcd60e51b815260040161034d90611bbe565b856001600160a01b0316826001600160a01b0316886001600160a01b03167fc244cac13e0edc863dc5a2c3bd2b935f605b2ed225fb052eaef869bc24b76fde8888886040516109a793929190611e21565b6000806111bc83850185611e96565b9093509150506001600160a01b0382166111d8576111d86118db565b6001600160a01b038281166000908152600460205260409020541615611200576112006118db565b6003546040516bffffffffffffffffffffffff19606085901b166020820152600091611250916001600160a01b0390911690603401604051602081830303815290604052805190602001206114b5565b6001600160a01b0384811660009081526004602081905260409182902080546001600160a01b031916938516938417905590516379ccf11760e11b8152929350909163f399e22e916112a6918791879101611acd565b600060405180830381600087803b1580156112c057600080fd5b505af11580156112d4573d6000803e3d6000fd5b50506040516001600160a01b038085169350861691507f0a1eaf9aa124c3f84c9dd77f7016af0f16f67639abb913af1697387db01f5ca590600090a35050505050565b6001600160a01b0384161580159061133757506001600160a01b03831615155b801561134b57506001600160a01b03821615155b801561135f57506001600160a01b03811615155b6113c55760405162461bcd60e51b815260206004820152603160248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204260448201527020a22fa4a724aa24a0a624ad20aa24a7a760791b606482015260840161034d565b600080546001600160a01b03958616620100000262010000600160b01b0319909116179055600180549385166001600160a01b0319948516179055600280549285169284169290921790915560038054919093169116179055565b6000816001600160a01b03163b60000361143c57506000919050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa9250505080156114a3575060408051601f3d908101601f191682019092526114a091810190611967565b60015b6114af57506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166114af5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640161034d565b6001600160a01b038116811461156157600080fd5b50565b60006020828403121561157657600080fd5b81356115818161154c565b9392505050565b60008083601f84011261159a57600080fd5b5081356001600160401b038111156115b157600080fd5b6020830191508360208260051b85010111156115cc57600080fd5b9250929050565b60008060008060008060006080888a0312156115ee57600080fd5b87356115f98161154c565b965060208801356001600160401b038082111561161557600080fd5b6116218b838c01611588565b909850965060408a013591508082111561163a57600080fd5b6116468b838c01611588565b909650945060608a013591508082111561165f57600080fd5b5061166c8a828b01611588565b989b979a50959850939692959293505050565b60008060006060848603121561169457600080fd5b833561169f8161154c565b95602085013595506040909401359392505050565b600080600080608085870312156116ca57600080fd5b84356116d58161154c565b935060208501356116e58161154c565b93969395505050506040820135916060013590565b6000806000806060858703121561171057600080fd5b8435935060208501356117228161154c565b925060408501356001600160401b038082111561173e57600080fd5b818701915087601f83011261175257600080fd5b81358181111561176157600080fd5b88602082850101111561177357600080fd5b95989497505060200194505050565b6000806000806080858703121561179857600080fd5b84356117a38161154c565b935060208501356117b38161154c565b925060408501356117c38161154c565b915060608501356117d38161154c565b939692955090935050565b600080858511156117ee57600080fd5b838611156117fb57600080fd5b5050820193919092039150565b803560208310156114af57600019602084900360031b1b1692915050565b6020808252602b908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204e60408201526a13d517d0d3d395149050d560aa1b606082015260800190565b60006020828403121561188357600080fd5b81516115818161154c565b6020808252602d908201527f4368696c644d696e7461626c65455243313135355072656469636174653a205560408201526c2726a0a82822a22faa27a5a2a760991b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561190a57600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b038616815260606020820181905260009061194890830186886118f1565b828103604084015261195b8185876118f1565b98975050505050505050565b60006020828403121561197957600080fd5b8151801515811461158157600080fd5b6020808252602a908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204260408201526915549397d1905253115160b21b606082015260800190565b8183526000602080850194508260005b85811015611a115781356119f68161154c565b6001600160a01b0316875295820195908201906001016119e3565b509495945050505050565b8981526001600160a01b0389811660208301528816604082015260c060608201819052600090611a4f908301888a6119d3565b8281036080840152611a628187896118f1565b905082810360a0840152611a778185876118f1565b9c9b505050505050505050505050565b6000815180845260005b81811015611aad57602081850181015186830182015201611a91565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611af190830184611a87565b949350505050565b606081526000611b0d60608301888a6119d3565b8281036020840152611b208187896118f1565b90508281036040840152611b358185876118f1565b9998505050505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600080600080600060a08688031215611b7b57600080fd5b8535611b868161154c565b94506020860135611b968161154c565b93506040860135611ba68161154c565b94979396509394606081013594506080013592915050565b6020808252602a908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204d60408201526912539517d1905253115160b21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c4657611c46611c08565b604052919050565b60006001600160401b03821115611c6757611c67611c08565b5060051b60200190565b600082601f830112611c8257600080fd5b81356020611c97611c9283611c4e565b611c1e565b82815260059290921b84018101918181019086841115611cb657600080fd5b8286015b84811015611cd15780358352918301918301611cba565b509695505050505050565b60008060008060008060c08789031215611cf557600080fd5b86359550602080880135611d088161154c565b95506040880135611d188161154c565b945060608801356001600160401b0380821115611d3457600080fd5b818a0191508a601f830112611d4857600080fd5b8135611d56611c9282611c4e565b81815260059190911b8301840190848101908d831115611d7557600080fd5b938501935b82851015611d9c578435611d8d8161154c565b82529385019390850190611d7a565b9750505060808a0135925080831115611db457600080fd5b611dc08b848c01611c71565b945060a08a0135925080831115611dd657600080fd5b5050611de489828a01611c71565b9150509295509295509295565b600081518084526020808501945080840160005b83811015611a1157815187529582019590820190600101611e05565b606080825284519082018190526000906020906080840190828801845b82811015611e635781516001600160a01b031684529284019290840190600101611e3e565b50505083810382850152611e778187611df1565b9150508281036040840152611e8c8185611df1565b9695505050505050565b600080600060608486031215611eab57600080fd5b83359250602080850135611ebe8161154c565b925060408501356001600160401b0380821115611eda57600080fd5b818701915087601f830112611eee57600080fd5b813581811115611f0057611f00611c08565b611f12601f8201601f19168501611c1e565b91508082528884828501011115611f2857600080fd5b8084840185840137600084828401015250809350505050925092509256fea26469706673582212202548c33121341dfe54a3591ddfb48a0522912106419666b488c71144be4fd23264736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100d55760003560e01c8063b8cd3ec011610087578063b8cd3ec0146101b6578063c5ac2b1c146101c9578063cb10f94c146101f0578063d41f177114610209578063d7c9e3ec14610230578063f43cda8b14610257578063f64512551461026a578063f8c8765e1461029157600080fd5b8063051eb2e2146100da5780637efab4f51461010a57806386937eb41461013357806395c7041c14610148578063b17680651461015b578063b5c5f67214610190578063b68ad1e4146101a3575b600080fd5b6002546100ed906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ed610118366004611564565b6004602052600090815260409020546001600160a01b031681565b6101466101413660046115d3565b6102a4565b005b6001546100ed906001600160a01b031681565b6101827f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b604051908152602001610101565b61014661019e36600461167f565b6102bc565b6003546100ed906001600160a01b031681565b6101466101c43660046116b4565b6102cd565b6101827faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6000546100ed906201000090046001600160a01b031681565b6101827f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101827f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b6101466102653660046116fa565b6102df565b6101827f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b61014661029f366004611782565b610514565b6102b38787878787878761062d565b50505050505050565b6102c8833384846109ba565b505050565b6102d9848484846109ba565b50505050565b6001546001600160a01b031633146103565760405162461bcd60e51b815260206004820152602f60248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204f60448201526e27262cafa2ac24aa2fa422a62822a960891b60648201526084015b60405180910390fd5b6002546001600160a01b038481169116146103ce5760405162461bcd60e51b815260206004820152603260248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204f6044820152714e4c595f524f4f545f50524544494341544560701b606482015260840161034d565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f8216103fd6020600084866117de565b61040691611808565b036104255761042061041b82602081866117de565b610cd5565b6102d9565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104546020600084866117de565b61045d91611808565b0361046c576104208282610f40565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61049b6020600084866117de565b6104a491611808565b036104b35761042082826111ad565b60405162461bcd60e51b815260206004820152603060248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204960448201526f4e56414c49445f5349474e415455524560801b606482015260840161034d565b600054610100900460ff16158080156105345750600054600160ff909116105b8061054e5750303b15801561054e575060005460ff166001145b6105b15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161034d565b6000805460ff1916600117905580156105d4576000805461ff0019166101001790555b6105e085858585611317565b8015610626576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b8661063781611420565b6106535760405162461bcd60e51b815260040161034d90611826565b6000886001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610693573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b79190611871565b6001600160a01b038181166000908152600460205260409020549192508a81169116146106f65760405162461bcd60e51b815260040161034d9061188e565b6001600160a01b03811661070c5761070c6118db565b306001600160a01b0316896001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107789190611871565b6001600160a01b03161461078e5761078e6118db565b868514801561079c57508483145b6107fe5760405162461bcd60e51b815260206004820152602d60248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204960448201526c09cac82989288be988a9c8ea89609b1b606482015260840161034d565b604051631ac8311560e21b81526001600160a01b038a1690636b20c454906108329033908a908a908a908a90600401611923565b6020604051808303816000875af1158015610851573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108759190611967565b6108915760405162461bcd60e51b815260040161034d90611989565b6000546002546040516001600160a01b03620100009093048316926316f198319216906108f2907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908f908f908f908f908f908f90602001611a1c565b6040516020818303038152906040526040518363ffffffff1660e01b815260040161091e929190611acd565b600060405180830381600087803b15801561093857600080fd5b505af115801561094c573d6000803e3d6000fd5b50505050336001600160a01b0316896001600160a01b0316826001600160a01b03167fdd47868997765508c515e1f8ca079846dafbdfd8f98f6e76bca0891810b9f9d18b8b8b8b8b8b6040516109a796959493929190611af9565b60405180910390a4505050505050505050565b836109c481611420565b6109e05760405162461bcd60e51b815260040161034d90611826565b6000856001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a449190611871565b6001600160a01b03818116600090815260046020526040902054919250878116911614610a835760405162461bcd60e51b815260040161034d9061188e565b6001600160a01b038116610a9957610a996118db565b306001600160a01b0316866001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b059190611871565b6001600160a01b031614610b1b57610b1b6118db565b604051637a94c56560e11b81526001600160a01b0387169063f5298aca90610b4b90339088908890600401611b42565b6020604051808303816000875af1158015610b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8e9190611967565b610baa5760405162461bcd60e51b815260040161034d90611989565b600054600254604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152898116608083015260a0820189905260c08083018990528351808403909101815260e08301938490526316f1983160e01b909352620100009094048416936316f1983193610c429391169160e401611acd565b600060405180830381600087803b158015610c5c57600080fd5b505af1158015610c70573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316826001600160a01b03167fda58d73e08ba3c7767de904e68d208be8291494a9faaf70a6d4f736d24ec1f0f338888604051610cc593929190611b42565b60405180910390a4505050505050565b600080808080610ce786880188611b63565b6001600160a01b03808616600090815260046020526040902054959a50939850919650945092501680610d2c5760405162461bcd60e51b815260040161034d9061188e565b610d3581611420565b610d4157610d416118db565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da59190611871565b9050866001600160a01b0316816001600160a01b031614610dc857610dc86118db565b6001600160a01b038116610dde57610dde6118db565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611871565b6001600160a01b031614610e6057610e606118db565b604051630ab714fb60e11b81526001600160a01b0383169063156e29f690610e9090889088908890600401611b42565b6020604051808303816000875af1158015610eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed39190611967565b610eef5760405162461bcd60e51b815260040161034d90611bbe565b846001600160a01b0316826001600160a01b0316886001600160a01b03167f76a4cd47013e7e58abe817eedbb692d1614d71080b527412ebfb3f91a085a6de8988886040516109a793929190611b42565b600080808080610f5286880188611cdc565b6001600160a01b03808616600090815260046020526040902054959b509399509197509550935016905080610f995760405162461bcd60e51b815260040161034d9061188e565b610fa281611420565b610fae57610fae6118db565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190611871565b9050866001600160a01b0316816001600160a01b031614611035576110356118db565b6001600160a01b03811661104b5761104b6118db565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611093573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b79190611871565b6001600160a01b0316146110cd576110cd6118db565b604051635712868360e01b81526001600160a01b038316906357128683906110fd90889088908890600401611e21565b6020604051808303816000875af115801561111c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111409190611967565b61115c5760405162461bcd60e51b815260040161034d90611bbe565b856001600160a01b0316826001600160a01b0316886001600160a01b03167fc244cac13e0edc863dc5a2c3bd2b935f605b2ed225fb052eaef869bc24b76fde8888886040516109a793929190611e21565b6000806111bc83850185611e96565b9093509150506001600160a01b0382166111d8576111d86118db565b6001600160a01b038281166000908152600460205260409020541615611200576112006118db565b6003546040516bffffffffffffffffffffffff19606085901b166020820152600091611250916001600160a01b0390911690603401604051602081830303815290604052805190602001206114b5565b6001600160a01b0384811660009081526004602081905260409182902080546001600160a01b031916938516938417905590516379ccf11760e11b8152929350909163f399e22e916112a6918791879101611acd565b600060405180830381600087803b1580156112c057600080fd5b505af11580156112d4573d6000803e3d6000fd5b50506040516001600160a01b038085169350861691507f0a1eaf9aa124c3f84c9dd77f7016af0f16f67639abb913af1697387db01f5ca590600090a35050505050565b6001600160a01b0384161580159061133757506001600160a01b03831615155b801561134b57506001600160a01b03821615155b801561135f57506001600160a01b03811615155b6113c55760405162461bcd60e51b815260206004820152603160248201527f4368696c644d696e7461626c65455243313135355072656469636174653a204260448201527020a22fa4a724aa24a0a624ad20aa24a7a760791b606482015260840161034d565b600080546001600160a01b03958616620100000262010000600160b01b0319909116179055600180549385166001600160a01b0319948516179055600280549285169284169290921790915560038054919093169116179055565b6000816001600160a01b03163b60000361143c57506000919050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa9250505080156114a3575060408051601f3d908101601f191682019092526114a091810190611967565b60015b6114af57506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166114af5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640161034d565b6001600160a01b038116811461156157600080fd5b50565b60006020828403121561157657600080fd5b81356115818161154c565b9392505050565b60008083601f84011261159a57600080fd5b5081356001600160401b038111156115b157600080fd5b6020830191508360208260051b85010111156115cc57600080fd5b9250929050565b60008060008060008060006080888a0312156115ee57600080fd5b87356115f98161154c565b965060208801356001600160401b038082111561161557600080fd5b6116218b838c01611588565b909850965060408a013591508082111561163a57600080fd5b6116468b838c01611588565b909650945060608a013591508082111561165f57600080fd5b5061166c8a828b01611588565b989b979a50959850939692959293505050565b60008060006060848603121561169457600080fd5b833561169f8161154c565b95602085013595506040909401359392505050565b600080600080608085870312156116ca57600080fd5b84356116d58161154c565b935060208501356116e58161154c565b93969395505050506040820135916060013590565b6000806000806060858703121561171057600080fd5b8435935060208501356117228161154c565b925060408501356001600160401b038082111561173e57600080fd5b818701915087601f83011261175257600080fd5b81358181111561176157600080fd5b88602082850101111561177357600080fd5b95989497505060200194505050565b6000806000806080858703121561179857600080fd5b84356117a38161154c565b935060208501356117b38161154c565b925060408501356117c38161154c565b915060608501356117d38161154c565b939692955090935050565b600080858511156117ee57600080fd5b838611156117fb57600080fd5b5050820193919092039150565b803560208310156114af57600019602084900360031b1b1692915050565b6020808252602b908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204e60408201526a13d517d0d3d395149050d560aa1b606082015260800190565b60006020828403121561188357600080fd5b81516115818161154c565b6020808252602d908201527f4368696c644d696e7461626c65455243313135355072656469636174653a205560408201526c2726a0a82822a22faa27a5a2a760991b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561190a57600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b038616815260606020820181905260009061194890830186886118f1565b828103604084015261195b8185876118f1565b98975050505050505050565b60006020828403121561197957600080fd5b8151801515811461158157600080fd5b6020808252602a908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204260408201526915549397d1905253115160b21b606082015260800190565b8183526000602080850194508260005b85811015611a115781356119f68161154c565b6001600160a01b0316875295820195908201906001016119e3565b509495945050505050565b8981526001600160a01b0389811660208301528816604082015260c060608201819052600090611a4f908301888a6119d3565b8281036080840152611a628187896118f1565b905082810360a0840152611a778185876118f1565b9c9b505050505050505050505050565b6000815180845260005b81811015611aad57602081850181015186830182015201611a91565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611af190830184611a87565b949350505050565b606081526000611b0d60608301888a6119d3565b8281036020840152611b208187896118f1565b90508281036040840152611b358185876118f1565b9998505050505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600080600080600060a08688031215611b7b57600080fd5b8535611b868161154c565b94506020860135611b968161154c565b93506040860135611ba68161154c565b94979396509394606081013594506080013592915050565b6020808252602a908201527f4368696c644d696e7461626c65455243313135355072656469636174653a204d60408201526912539517d1905253115160b21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c4657611c46611c08565b604052919050565b60006001600160401b03821115611c6757611c67611c08565b5060051b60200190565b600082601f830112611c8257600080fd5b81356020611c97611c9283611c4e565b611c1e565b82815260059290921b84018101918181019086841115611cb657600080fd5b8286015b84811015611cd15780358352918301918301611cba565b509695505050505050565b60008060008060008060c08789031215611cf557600080fd5b86359550602080880135611d088161154c565b95506040880135611d188161154c565b945060608801356001600160401b0380821115611d3457600080fd5b818a0191508a601f830112611d4857600080fd5b8135611d56611c9282611c4e565b81815260059190911b8301840190848101908d831115611d7557600080fd5b938501935b82851015611d9c578435611d8d8161154c565b82529385019390850190611d7a565b9750505060808a0135925080831115611db457600080fd5b611dc08b848c01611c71565b945060a08a0135925080831115611dd657600080fd5b5050611de489828a01611c71565b9150509295509295509295565b600081518084526020808501945080840160005b83811015611a1157815187529582019590820190600101611e05565b606080825284519082018190526000906020906080840190828801845b82811015611e635781516001600160a01b031684529284019290840190600101611e3e565b50505083810382850152611e778187611df1565b9150508281036040840152611e8c8185611df1565b9695505050505050565b600080600060608486031215611eab57600080fd5b83359250602080850135611ebe8161154c565b925060408501356001600160401b0380821115611eda57600080fd5b818701915087601f830112611eee57600080fd5b813581811115611f0057611f00611c08565b611f12601f8201601f19168501611c1e565b91508082528884828501011115611f2857600080fd5b8084840185840137600084828401015250809350505050925092509256fea26469706673582212202548c33121341dfe54a3591ddfb48a0522912106419666b488c71144be4fd23264736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` -var CustomSupernetManagerArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"CustomSupernetManager","sourceName":"contracts/root/staking/CustomSupernetManager.sol","abi":[{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"string","name":"message","type":"string"}],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"}],"name":"AddedToWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountValidators","type":"uint256"}],"name":"GenesisFinalized","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":"OwnershipTransferStarted","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":"validator","type":"address"}],"name":"RemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[],"name":"StakingEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"}],"name":"ValidatorDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"},{"indexed":false,"internalType":"uint256[4]","name":"blsKey","type":"uint256[4]"}],"name":"ValidatorRegistered","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domain","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeGenesis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"genesisSet","outputs":[{"components":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"initialStake","type":"uint256"}],"internalType":"struct GenesisValidator[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"validator_","type":"address"}],"name":"getValidator","outputs":[{"components":[{"internalType":"uint256[4]","name":"blsKey","type":"uint256[4]"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"}],"internalType":"struct Validator","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStakeManager","type":"address"},{"internalType":"address","name":"newBls","type":"address"},{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newMatic","type":"address"},{"internalType":"address","name":"newChildValidatorSet","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"string","name":"newDomain","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"onInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"onStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[2]","name":"signature","type":"uint256[2]"},{"internalType":"uint256[4]","name":"pubkey","type":"uint256[4]"}],"name":"register","outputs":[],"stateMutability":"nonpayable","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":"address","name":"","type":"address"}],"name":"validators","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"validators_","type":"address[]"}],"name":"whitelistValidators","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50611b94806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80639e19e9c1116100a2578063e30c397811610071578063e30c39781461020c578063f2fde38b1461021d578063f43cda8b14610230578063fa52c7d814610243578063fd051b4a1461029657600080fd5b80639e19e9c1146101cf578063af640d0f146101e4578063c2fb26a6146101fb578063d11aca621461020457600080fd5b8063715018a6116100e9578063715018a61461017f57806379ba50971461018757806385758cc71461018f5780638c087b1c146101975780638da5cb5b146101aa57600080fd5b80631904bb2e1461011b5780631f6590b814610144578063344a5e6414610159578063542c85f21461016c575b600080fd5b61012e610129366004611472565b6102a9565b60405161013b919061148f565b60405180910390f35b6101576101523660046114e3565b610333565b005b610157610167366004611525565b610400565b61015761017a36600461153e565b61047f565b6101576104da565b6101576104ee565b610157610568565b6101576101a53660046115b3565b6105b9565b6033546001600160a01b03165b6040516001600160a01b03909116815260200161013b565b6101d76105f1565b60405161013b91906115df565b6101ed60985481565b60405190815260200161013b565b6101ed60d05481565b610157610602565b6065546001600160a01b03166101b7565b61015761022b366004611472565b61063f565b61015761023e366004611637565b6106b0565b610279610251366004611472565b60d4602052600090815260409020600481015460059091015460ff8082169161010090041683565b60408051938452911515602084015215159082015260600161013b565b6101576102a4366004611707565b610784565b6102b16113a0565b6001600160a01b038216600090815260d46020526040908190208151610100810190925281608081018260048282826020028201915b8154815260200190600101908083116102e75750505091835250506004820154602082015260059091015460ff8082161515604084015261010090910416151560609091015292915050565b33600090815260d460205260409020600581015460ff166103885760405163973d02cb60e01b815260206004820152600960248201526815d2125511531254d560ba1b60448201526064015b60405180910390fd5b6103933384846109df565b61039f818360046113ce565b5060058101805461ff0019166101001790556103ba33610ad7565b336001600160a01b03167f110ae3ae039a4632f836a35dc9b1282df88780883fb28779f22c2f7ccde8dd0a836040516103f3919061180c565b60405180910390a2505050565b6097546001600160a01b0316331461042a5760405162461bcd60e51b815260040161037f9061181b565b6098541561047a5760405162461bcd60e51b815260206004820152601f60248201527f53757065726e65744d616e616765723a2049445f414c52454144595f53455400604482015260640161037f565b609855565b610487610b23565b8060005b818110156104d4576104c28484838181106104a8576104a861185e565b90506020020160208101906104bd9190611472565b610b7d565b806104cc8161188a565b91505061048b565b50505050565b6104e2610b23565b6104ec6000610bcc565b565b60655433906001600160a01b0316811461055c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840161037f565b61056581610bcc565b50565b610570610b23565b61057a60d1610be5565b7f87f41ee3facb6317b1c2811e539539ac1693525b4460699b4245e8aac9f590cb6105a560d1610c5f565b5160405190815260200160405180910390a1565b6097546001600160a01b031633146105e35760405162461bcd60e51b815260040161037f9061181b565b6105ed8282610cd8565b5050565b60606105fd60d1610c5f565b905090565b61060a610b23565b61061460d1610e56565b6040517fda917aeab736a19e4ba54207413dbe4f8c7d558fde2c14d7e66fc8f7186ea8a390600090a1565b610647610b23565b606580546001600160a01b0383166001600160a01b031990911681179091556106786033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60cf546001600160a01b0316331415806106d8575060ce546001600160a01b03848116911614155b156107145760405163973d02cb60e01b815260206004820152600b60248201526a2fb2bc34ba2432b63832b960a91b604482015260640161037f565b7f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936107436020600084866118a3565b61074c916118cd565b036104d45760008061076183602081876118a3565b81019061076e91906115b3565b9150915061077c8282610f2d565b505050505050565b600054610100900460ff16158080156107a45750600054600160ff909116105b806107be5750303b1580156107be575060005460ff166001145b6108215760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161037f565b6000805460ff191660011790558015610844576000805461ff0019166101001790555b6001600160a01b0388161580159061086457506001600160a01b03871615155b801561087857506001600160a01b03861615155b801561088c57506001600160a01b03851615155b80156108a057506001600160a01b03841615155b80156108b457506001600160a01b03831615155b80156108c05750815115155b6108fc5760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b604482015260640161037f565b61090588610f9c565b60cb80546001600160a01b03199081166001600160a01b038a81169190911790925560cc8054821689841617905560cd8054821688841617905560ce8054821687841617905560cf805490911691851691909117905560405161096c90839060200161190f565b60408051601f19818403018152919052805160209091012060d05561098f610fe5565b80156109d5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b81351580156109f057506020820135155b15610a1957604051633615713d60e21b81526001600160a01b038416600482015260240161037f565b60cb5460009081906001600160a01b031663ebbdac918585610a3a89611014565b6040518463ffffffff1660e01b8152600401610a589392919061192b565b6040805180830381865afa158015610a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a989190611984565b91509150801580610aa7575081155b15610ad057604051633615713d60e21b81526001600160a01b038616600482015260240161037f565b5050505050565b6001600160a01b038116600081815260d46020526040808220600501805460ff19169055517fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df7579190a250565b6033546001600160a01b031633146104ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161037f565b6001600160a01b038116600081815260d46020526040808220600501805460ff19166001179055517fa850ae9193f515cbae8d35e8925bd2be26627fc91bce650b8652ed254e9cab039190a250565b606580546001600160a01b0319169055610565816110d6565b6000600182015460ff166002811115610c0057610c006119b7565b14610c4d5760405162461bcd60e51b815260206004820152601d60248201527f47656e657369734c69623a20616c72656164792066696e616c697a6564000000604482015260640161037f565b6001908101805460ff19169091179055565b606081600001805480602002602001604051908101604052809291908181526020016000905b82821015610ccd576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610c85565b505050509050919050565b6001600160a01b038216600090815260d460205260409020600501548290610100900460ff16610d375760405163973d02cb60e01b81526020600482015260096024820152682b20a624a220aa27a960b91b604482015260640161037f565b610d4160d1611128565b15610d5757610d5260d1848461114c565b505050565b610d6160d161125e565b15610e1a5760cc5460ce54604080517f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a6960208201526001600160a01b038781168284015260608083018890528351808403909101815260808301938490526316f1983160e01b909352938416936316f1983193610de3939116916084016119f9565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b50505050505050565b60405163973d02cb60e01b815260206004820152601060248201526f5761697420666f722067656e6573697360801b604482015260640161037f565b600181015460ff166000816002811115610e7257610e726119b7565b03610ebb5760405162461bcd60e51b815260206004820152601960248201527811d95b995cda5cd31a588e881b9bdd08199a5b985b1a5e9959603a1b604482015260640161037f565b6002816002811115610ecf57610ecf6119b7565b03610f1c5760405162461bcd60e51b815260206004820152601b60248201527f47656e657369734c69623a20616c726561647920656e61626c65640000000000604482015260640161037f565b50600101805460ff19166002179055565b609754604051633651bb1d60e01b81526001600160a01b0384811660048301526024820184905290911690633651bb1d90604401600060405180830381600087803b158015610f7b57600080fd5b505af1158015610f8f573d6000803e3d6000fd5b505050506105ed82611267565b600054610100900460ff16610fc35760405162461bcd60e51b815260040161037f90611a25565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff1661100c5760405162461bcd60e51b815260040161037f90611a25565b6104ec611333565b61101c61140c565b60cb5460d0546040516bffffffffffffffffffffffff19606086811b8216602084015230901b1660348201524660488201526001600160a01b039092169163a850a90991906068016040516020818303038152906040526040518363ffffffff1660e01b8152600401611090929190611a70565b6040805180830381865afa1580156110ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d09190611a89565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000805b600183015460ff166002811115611145576111456119b7565b1492915050565b6000600184015460ff166002811115611167576111676119b7565b1461117457611174611b09565b6001600160a01b0382166000908152600284016020526040812054908190036112115783546111a4906001611b1f565b6001600160a01b03848116600081815260028881016020908152604080842087905580518082019091529384528381018881528a5460018082018d558c86529290942094519390920290930180546001600160a01b031916929094169190911783555191015590506104d4565b60008461121e8186611363565b8154811061122e5761122e61185e565b90600052602060002090600202019050828160010160008282546112529190611b1f565b90915550505050505050565b6000600261112c565b609754609854604051633b61c5a760e21b81526001600160a01b038481166004830152602482019290925291169063ed87169c90604401602060405180830381865afa1580156112bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190611b32565b600003610565576001600160a01b038116600081815260d46020526040808220600501805461ff0019169055517f23d934bfe7f1275bc6fd70432159c9cc1c0075d069f89da6a40f43bfe7a94ed39190a250565b600054610100900460ff1661135a5760405162461bcd60e51b815260040161037f90611a25565b6104ec33610bcc565b6001600160a01b03811660009081526002830160205260408120549081900361138e5761138e611b09565b611399600182611b4b565b9392505050565b60405180608001604052806113b361142a565b81526000602082018190526040820181905260609091015290565b82600481019282156113fc579160200282015b828111156113fc5782358255916020019190600101906113e1565b50611408929150611448565b5090565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b5b808211156114085760008155600101611449565b6001600160a01b038116811461056557600080fd5b60006020828403121561148457600080fd5b81356113998161145d565b815160e08201908260005b60048110156114b957825182526020928301929091019060010161149a565b505050602083015160808301526040830151151560a0830152606090920151151560c09091015290565b60008060c083850312156114f657600080fd5b604083018481111561150757600080fd5b8392508460c08501111561151a57600080fd5b809150509250929050565b60006020828403121561153757600080fd5b5035919050565b6000806020838503121561155157600080fd5b823567ffffffffffffffff8082111561156957600080fd5b818501915085601f83011261157d57600080fd5b81358181111561158c57600080fd5b8660208260051b85010111156115a157600080fd5b60209290920196919550909350505050565b600080604083850312156115c657600080fd5b82356115d18161145d565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b8281101561162a57815180516001600160a01b031685528601518685015292840192908501906001016115fc565b5091979650505050505050565b6000806000806060858703121561164d57600080fd5b84359350602085013561165f8161145d565b9250604085013567ffffffffffffffff8082111561167c57600080fd5b818701915087601f83011261169057600080fd5b81358181111561169f57600080fd5b8860208285010111156116b157600080fd5b95989497505060200194505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156116ff576116ff6116c0565b604052919050565b600080600080600080600060e0888a03121561172257600080fd5b873561172d8161145d565b965060208881013561173e8161145d565b9650604089013561174e8161145d565b9550606089013561175e8161145d565b9450608089013561176e8161145d565b935060a089013561177e8161145d565b925060c089013567ffffffffffffffff8082111561179b57600080fd5b818b0191508b601f8301126117af57600080fd5b8135818111156117c1576117c16116c0565b6117d3601f8201601f191685016116d6565b91508082528c848285010111156117e957600080fd5b808484018584013760008482840101525080935050505092959891949750929550565b60808181019083833792915050565b60208082526023908201527f53757065726e65744d616e616765723a204f4e4c595f5354414b455f4d414e4160408201526223a2a960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161189c5761189c611874565b5060010190565b600080858511156118b357600080fd5b838611156118c057600080fd5b5050820193919092039150565b803560208310156110d057600019602084900360031b1b1692915050565b60005b838110156119065781810151838201526020016118ee565b50506000910152565b600082516119218184602087016118eb565b9190910192915050565b61010081016040858337608084604084013760c082018360005b6002811015611964578151835260209283019290910190600101611945565b505050949350505050565b8051801515811461197f57600080fd5b919050565b6000806040838503121561199757600080fd5b6119a08361196f565b91506119ae6020840161196f565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b600081518084526119e58160208601602086016118eb565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090611a1d908301846119cd565b949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b828152604060208201526000611a1d60408301846119cd565b600060408284031215611a9b57600080fd5b82601f830112611aaa57600080fd5b6040516040810181811067ffffffffffffffff82111715611acd57611acd6116c0565b8060405250806040840185811115611ae457600080fd5b845b81811015611afe578051835260209283019201611ae6565b509195945050505050565b634e487b7160e01b600052600160045260246000fd5b808201808211156110d0576110d0611874565b600060208284031215611b4457600080fd5b5051919050565b818103818111156110d0576110d061187456fea26469706673582212208ad6bae8c19dfcd92ec338ac0862580d6f5e28ab031432ecdcb25f6e11adffd264736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101165760003560e01c80639e19e9c1116100a2578063e30c397811610071578063e30c39781461020c578063f2fde38b1461021d578063f43cda8b14610230578063fa52c7d814610243578063fd051b4a1461029657600080fd5b80639e19e9c1146101cf578063af640d0f146101e4578063c2fb26a6146101fb578063d11aca621461020457600080fd5b8063715018a6116100e9578063715018a61461017f57806379ba50971461018757806385758cc71461018f5780638c087b1c146101975780638da5cb5b146101aa57600080fd5b80631904bb2e1461011b5780631f6590b814610144578063344a5e6414610159578063542c85f21461016c575b600080fd5b61012e610129366004611472565b6102a9565b60405161013b919061148f565b60405180910390f35b6101576101523660046114e3565b610333565b005b610157610167366004611525565b610400565b61015761017a36600461153e565b61047f565b6101576104da565b6101576104ee565b610157610568565b6101576101a53660046115b3565b6105b9565b6033546001600160a01b03165b6040516001600160a01b03909116815260200161013b565b6101d76105f1565b60405161013b91906115df565b6101ed60985481565b60405190815260200161013b565b6101ed60d05481565b610157610602565b6065546001600160a01b03166101b7565b61015761022b366004611472565b61063f565b61015761023e366004611637565b6106b0565b610279610251366004611472565b60d4602052600090815260409020600481015460059091015460ff8082169161010090041683565b60408051938452911515602084015215159082015260600161013b565b6101576102a4366004611707565b610784565b6102b16113a0565b6001600160a01b038216600090815260d46020526040908190208151610100810190925281608081018260048282826020028201915b8154815260200190600101908083116102e75750505091835250506004820154602082015260059091015460ff8082161515604084015261010090910416151560609091015292915050565b33600090815260d460205260409020600581015460ff166103885760405163973d02cb60e01b815260206004820152600960248201526815d2125511531254d560ba1b60448201526064015b60405180910390fd5b6103933384846109df565b61039f818360046113ce565b5060058101805461ff0019166101001790556103ba33610ad7565b336001600160a01b03167f110ae3ae039a4632f836a35dc9b1282df88780883fb28779f22c2f7ccde8dd0a836040516103f3919061180c565b60405180910390a2505050565b6097546001600160a01b0316331461042a5760405162461bcd60e51b815260040161037f9061181b565b6098541561047a5760405162461bcd60e51b815260206004820152601f60248201527f53757065726e65744d616e616765723a2049445f414c52454144595f53455400604482015260640161037f565b609855565b610487610b23565b8060005b818110156104d4576104c28484838181106104a8576104a861185e565b90506020020160208101906104bd9190611472565b610b7d565b806104cc8161188a565b91505061048b565b50505050565b6104e2610b23565b6104ec6000610bcc565b565b60655433906001600160a01b0316811461055c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840161037f565b61056581610bcc565b50565b610570610b23565b61057a60d1610be5565b7f87f41ee3facb6317b1c2811e539539ac1693525b4460699b4245e8aac9f590cb6105a560d1610c5f565b5160405190815260200160405180910390a1565b6097546001600160a01b031633146105e35760405162461bcd60e51b815260040161037f9061181b565b6105ed8282610cd8565b5050565b60606105fd60d1610c5f565b905090565b61060a610b23565b61061460d1610e56565b6040517fda917aeab736a19e4ba54207413dbe4f8c7d558fde2c14d7e66fc8f7186ea8a390600090a1565b610647610b23565b606580546001600160a01b0383166001600160a01b031990911681179091556106786033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60cf546001600160a01b0316331415806106d8575060ce546001600160a01b03848116911614155b156107145760405163973d02cb60e01b815260206004820152600b60248201526a2fb2bc34ba2432b63832b960a91b604482015260640161037f565b7f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936107436020600084866118a3565b61074c916118cd565b036104d45760008061076183602081876118a3565b81019061076e91906115b3565b9150915061077c8282610f2d565b505050505050565b600054610100900460ff16158080156107a45750600054600160ff909116105b806107be5750303b1580156107be575060005460ff166001145b6108215760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161037f565b6000805460ff191660011790558015610844576000805461ff0019166101001790555b6001600160a01b0388161580159061086457506001600160a01b03871615155b801561087857506001600160a01b03861615155b801561088c57506001600160a01b03851615155b80156108a057506001600160a01b03841615155b80156108b457506001600160a01b03831615155b80156108c05750815115155b6108fc5760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b604482015260640161037f565b61090588610f9c565b60cb80546001600160a01b03199081166001600160a01b038a81169190911790925560cc8054821689841617905560cd8054821688841617905560ce8054821687841617905560cf805490911691851691909117905560405161096c90839060200161190f565b60408051601f19818403018152919052805160209091012060d05561098f610fe5565b80156109d5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b81351580156109f057506020820135155b15610a1957604051633615713d60e21b81526001600160a01b038416600482015260240161037f565b60cb5460009081906001600160a01b031663ebbdac918585610a3a89611014565b6040518463ffffffff1660e01b8152600401610a589392919061192b565b6040805180830381865afa158015610a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a989190611984565b91509150801580610aa7575081155b15610ad057604051633615713d60e21b81526001600160a01b038616600482015260240161037f565b5050505050565b6001600160a01b038116600081815260d46020526040808220600501805460ff19169055517fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df7579190a250565b6033546001600160a01b031633146104ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161037f565b6001600160a01b038116600081815260d46020526040808220600501805460ff19166001179055517fa850ae9193f515cbae8d35e8925bd2be26627fc91bce650b8652ed254e9cab039190a250565b606580546001600160a01b0319169055610565816110d6565b6000600182015460ff166002811115610c0057610c006119b7565b14610c4d5760405162461bcd60e51b815260206004820152601d60248201527f47656e657369734c69623a20616c72656164792066696e616c697a6564000000604482015260640161037f565b6001908101805460ff19169091179055565b606081600001805480602002602001604051908101604052809291908181526020016000905b82821015610ccd576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610c85565b505050509050919050565b6001600160a01b038216600090815260d460205260409020600501548290610100900460ff16610d375760405163973d02cb60e01b81526020600482015260096024820152682b20a624a220aa27a960b91b604482015260640161037f565b610d4160d1611128565b15610d5757610d5260d1848461114c565b505050565b610d6160d161125e565b15610e1a5760cc5460ce54604080517f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a6960208201526001600160a01b038781168284015260608083018890528351808403909101815260808301938490526316f1983160e01b909352938416936316f1983193610de3939116916084016119f9565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b50505050505050565b60405163973d02cb60e01b815260206004820152601060248201526f5761697420666f722067656e6573697360801b604482015260640161037f565b600181015460ff166000816002811115610e7257610e726119b7565b03610ebb5760405162461bcd60e51b815260206004820152601960248201527811d95b995cda5cd31a588e881b9bdd08199a5b985b1a5e9959603a1b604482015260640161037f565b6002816002811115610ecf57610ecf6119b7565b03610f1c5760405162461bcd60e51b815260206004820152601b60248201527f47656e657369734c69623a20616c726561647920656e61626c65640000000000604482015260640161037f565b50600101805460ff19166002179055565b609754604051633651bb1d60e01b81526001600160a01b0384811660048301526024820184905290911690633651bb1d90604401600060405180830381600087803b158015610f7b57600080fd5b505af1158015610f8f573d6000803e3d6000fd5b505050506105ed82611267565b600054610100900460ff16610fc35760405162461bcd60e51b815260040161037f90611a25565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff1661100c5760405162461bcd60e51b815260040161037f90611a25565b6104ec611333565b61101c61140c565b60cb5460d0546040516bffffffffffffffffffffffff19606086811b8216602084015230901b1660348201524660488201526001600160a01b039092169163a850a90991906068016040516020818303038152906040526040518363ffffffff1660e01b8152600401611090929190611a70565b6040805180830381865afa1580156110ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d09190611a89565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000805b600183015460ff166002811115611145576111456119b7565b1492915050565b6000600184015460ff166002811115611167576111676119b7565b1461117457611174611b09565b6001600160a01b0382166000908152600284016020526040812054908190036112115783546111a4906001611b1f565b6001600160a01b03848116600081815260028881016020908152604080842087905580518082019091529384528381018881528a5460018082018d558c86529290942094519390920290930180546001600160a01b031916929094169190911783555191015590506104d4565b60008461121e8186611363565b8154811061122e5761122e61185e565b90600052602060002090600202019050828160010160008282546112529190611b1f565b90915550505050505050565b6000600261112c565b609754609854604051633b61c5a760e21b81526001600160a01b038481166004830152602482019290925291169063ed87169c90604401602060405180830381865afa1580156112bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190611b32565b600003610565576001600160a01b038116600081815260d46020526040808220600501805461ff0019169055517f23d934bfe7f1275bc6fd70432159c9cc1c0075d069f89da6a40f43bfe7a94ed39190a250565b600054610100900460ff1661135a5760405162461bcd60e51b815260040161037f90611a25565b6104ec33610bcc565b6001600160a01b03811660009081526002830160205260408120549081900361138e5761138e611b09565b611399600182611b4b565b9392505050565b60405180608001604052806113b361142a565b81526000602082018190526040820181905260609091015290565b82600481019282156113fc579160200282015b828111156113fc5782358255916020019190600101906113e1565b50611408929150611448565b5090565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b5b808211156114085760008155600101611449565b6001600160a01b038116811461056557600080fd5b60006020828403121561148457600080fd5b81356113998161145d565b815160e08201908260005b60048110156114b957825182526020928301929091019060010161149a565b505050602083015160808301526040830151151560a0830152606090920151151560c09091015290565b60008060c083850312156114f657600080fd5b604083018481111561150757600080fd5b8392508460c08501111561151a57600080fd5b809150509250929050565b60006020828403121561153757600080fd5b5035919050565b6000806020838503121561155157600080fd5b823567ffffffffffffffff8082111561156957600080fd5b818501915085601f83011261157d57600080fd5b81358181111561158c57600080fd5b8660208260051b85010111156115a157600080fd5b60209290920196919550909350505050565b600080604083850312156115c657600080fd5b82356115d18161145d565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b8281101561162a57815180516001600160a01b031685528601518685015292840192908501906001016115fc565b5091979650505050505050565b6000806000806060858703121561164d57600080fd5b84359350602085013561165f8161145d565b9250604085013567ffffffffffffffff8082111561167c57600080fd5b818701915087601f83011261169057600080fd5b81358181111561169f57600080fd5b8860208285010111156116b157600080fd5b95989497505060200194505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156116ff576116ff6116c0565b604052919050565b600080600080600080600060e0888a03121561172257600080fd5b873561172d8161145d565b965060208881013561173e8161145d565b9650604089013561174e8161145d565b9550606089013561175e8161145d565b9450608089013561176e8161145d565b935060a089013561177e8161145d565b925060c089013567ffffffffffffffff8082111561179b57600080fd5b818b0191508b601f8301126117af57600080fd5b8135818111156117c1576117c16116c0565b6117d3601f8201601f191685016116d6565b91508082528c848285010111156117e957600080fd5b808484018584013760008482840101525080935050505092959891949750929550565b60808181019083833792915050565b60208082526023908201527f53757065726e65744d616e616765723a204f4e4c595f5354414b455f4d414e4160408201526223a2a960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161189c5761189c611874565b5060010190565b600080858511156118b357600080fd5b838611156118c057600080fd5b5050820193919092039150565b803560208310156110d057600019602084900360031b1b1692915050565b60005b838110156119065781810151838201526020016118ee565b50506000910152565b600082516119218184602087016118eb565b9190910192915050565b61010081016040858337608084604084013760c082018360005b6002811015611964578151835260209283019290910190600101611945565b505050949350505050565b8051801515811461197f57600080fd5b919050565b6000806040838503121561199757600080fd5b6119a08361196f565b91506119ae6020840161196f565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b600081518084526119e58160208601602086016118eb565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090611a1d908301846119cd565b949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b828152604060208201526000611a1d60408301846119cd565b600060408284031215611a9b57600080fd5b82601f830112611aaa57600080fd5b6040516040810181811067ffffffffffffffff82111715611acd57611acd6116c0565b8060405250806040840185811115611ae457600080fd5b845b81811015611afe578051835260209283019201611ae6565b509195945050505050565b634e487b7160e01b600052600160045260246000fd5b808201808211156110d0576110d0611874565b600060208284031215611b4457600080fd5b5051919050565b818103818111156110d0576110d061187456fea26469706673582212208ad6bae8c19dfcd92ec338ac0862580d6f5e28ab031432ecdcb25f6e11adffd264736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` +var CustomSupernetManagerArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"CustomSupernetManager","sourceName":"contracts/root/staking/CustomSupernetManager.sol","abi":[{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"string","name":"message","type":"string"}],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"}],"name":"AddedToWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"GenesisBalanceAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountValidators","type":"uint256"}],"name":"GenesisFinalized","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":"OwnershipTransferStarted","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":"validator","type":"address"}],"name":"RemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[],"name":"StakingEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"}],"name":"ValidatorDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"},{"indexed":false,"internalType":"uint256[4]","name":"blsKey","type":"uint256[4]"}],"name":"ValidatorRegistered","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addGenesisBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"domain","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeGenesis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"genesisBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisSet","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"initialStake","type":"uint256"}],"internalType":"struct GenesisValidator[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"validator_","type":"address"}],"name":"getValidator","outputs":[{"components":[{"internalType":"uint256[4]","name":"blsKey","type":"uint256[4]"},{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"}],"internalType":"struct Validator","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"id","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStakeManager","type":"address"},{"internalType":"address","name":"newBls","type":"address"},{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newMatic","type":"address"},{"internalType":"address","name":"newChildValidatorSet","type":"address"},{"internalType":"address","name":"newExitHelper","type":"address"},{"internalType":"address","name":"newRootERC20Predicate","type":"address"},{"internalType":"string","name":"newDomain","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"onInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onL2StateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"onStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[2]","name":"signature","type":"uint256[2]"},{"internalType":"uint256[4]","name":"pubkey","type":"uint256[4]"}],"name":"register","outputs":[],"stateMutability":"nonpayable","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":"address","name":"","type":"address"}],"name":"validators","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"validators_","type":"address[]"}],"name":"whitelistValidators","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b506121a0806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063e30c397811610071578063e30c397814610248578063e53b87a814610259578063f2fde38b14610279578063f43cda8b1461028c578063fa52c7d81461029f57600080fd5b80638da5cb5b146101e65780639e19e9c11461020b578063af640d0f14610220578063c2fb26a614610237578063d11aca621461024057600080fd5b806379ba5097116100f457806379ba50971461019d578063819dc9fb146101a557806385758cc7146101b857806386202194146101c05780638c087b1c146101d357600080fd5b80631904bb2e146101315780631f6590b81461015a578063344a5e641461016f578063542c85f214610182578063715018a614610195575b600080fd5b61014461013f366004611a3d565b6102f2565b6040516101519190611a5a565b60405180910390f35b61016d610168366004611aae565b61037c565b005b61016d61017d366004611af0565b610449565b61016d610190366004611b09565b6104c8565b61016d610523565b61016d610537565b61016d6101b3366004611b94565b6105b1565b61016d610819565b61016d6101ce366004611af0565b61086a565b61016d6101e1366004611cc8565b610b17565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610151565b610213610b4f565b6040516101519190611cf4565b61022960985481565b604051908152602001610151565b61022960d05481565b61016d610b60565b6065546001600160a01b03166101f3565b610229610267366004611a3d565b60d66020526000908152604090205481565b61016d610287366004611a3d565b610b9d565b61016d61029a366004611d4c565b610c0e565b6102d56102ad366004611a3d565b60d4602052600090815260409020600481015460059091015460ff8082169161010090041683565b604080519384529115156020840152151590820152606001610151565b6102fa61196b565b6001600160a01b038216600090815260d46020526040908190208151610100810190925281608081018260048282826020028201915b8154815260200190600101908083116103305750505091835250506004820154602082015260059091015460ff8082161515604084015261010090910416151560609091015292915050565b33600090815260d460205260409020600581015460ff166103d15760405163973d02cb60e01b815260206004820152600960248201526815d2125511531254d560ba1b60448201526064015b60405180910390fd5b6103dc338484610ce2565b6103e881836004611999565b5060058101805461ff00191661010017905561040333610dda565b336001600160a01b03167f110ae3ae039a4632f836a35dc9b1282df88780883fb28779f22c2f7ccde8dd0a8360405161043c9190611dd5565b60405180910390a2505050565b6097546001600160a01b031633146104735760405162461bcd60e51b81526004016103c890611de4565b609854156104c35760405162461bcd60e51b815260206004820152601f60248201527f53757065726e65744d616e616765723a2049445f414c52454144595f5345540060448201526064016103c8565b609855565b6104d0610e26565b8060005b8181101561051d5761050b8484838181106104f1576104f1611e27565b90506020020160208101906105069190611a3d565b610e80565b8061051581611e53565b9150506104d4565b50505050565b61052b610e26565b6105356000610ecf565b565b60655433906001600160a01b031681146105a55760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016103c8565b6105ae81610ecf565b50565b600054610100900460ff16158080156105d15750600054600160ff909116105b806105eb5750303b1580156105eb575060005460ff166001145b61064e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805460ff191660011790558015610671576000805461ff0019166101001790555b6001600160a01b0389161580159061069157506001600160a01b03881615155b80156106a557506001600160a01b03871615155b80156106b957506001600160a01b03861615155b80156106cd57506001600160a01b03851615155b80156106e157506001600160a01b03841615155b80156106ed5750815115155b6107295760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b60448201526064016103c8565b61073289610ee8565b60cb80546001600160a01b03199081166001600160a01b038b81169190911790925560cc805482168a841617905560cd8054821689841617905560ce8054821688841617905560cf8054821687841617905560d580549091169185169190911790556040516107a5908390602001611e90565b60408051601f19818403018152919052805160209091012060d0556107c8610f31565b801561080e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b610821610e26565b61082b60d1610f60565b7f87f41ee3facb6317b1c2811e539539ac1693525b4460699b4245e8aac9f590cb61085660d1610fda565b5160405190815260200160405180910390a1565b600081116108c85760405162461bcd60e51b815260206004820152602560248201527f437573746f6d53757065726e65744d616e616765723a20494e56414c49445f416044820152641353d5539560da1b60648201526084016103c8565b60d5546001600160a01b031661093f5760405163973d02cb60e01b815260206004820152603560248201527f437573746f6d53757065726e65744d616e616765723a20554e444546494e45446044820152745f524f4f545f45524332305f50524544494341544560581b60648201526084016103c8565b60d55460408051636a00c1d760e01b815290516000926001600160a01b031691636a00c1d7916004808301926020929190829003018187875af115801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae9190611eac565b90506001600160a01b038116610a225760405163973d02cb60e01b815260206004820152603260248201527f437573746f6d53757065726e65744d616e616765723a20554e444546494e454460448201527117d3905512559157d513d2d15397d493d3d560721b60648201526084016103c8565b610a2c60d1611053565b15610a995760405162461bcd60e51b815260206004820152603760248201527f437573746f6d53757065726e65744d616e616765723a2047454e455349535f53604482015276115517d254d7d053149150511657d19253905312569151604a1b60648201526084016103c8565b610aa660d1336000611078565b33600090815260d6602052604081208054849290610ac5908490611ec9565b909155505060d554610ae6906001600160a01b038381169133911685611193565b604051829033907f1706c887e0f7786a7e97fed7b6f19bd6b31854c47c2012b072b44fdbd652623990600090a35050565b6097546001600160a01b03163314610b415760405162461bcd60e51b81526004016103c890611de4565b610b4b82826111ed565b5050565b6060610b5b60d1610fda565b905090565b610b68610e26565b610b7260d161136b565b6040517fda917aeab736a19e4ba54207413dbe4f8c7d558fde2c14d7e66fc8f7186ea8a390600090a1565b610ba5610e26565b606580546001600160a01b0383166001600160a01b03199091168117909155610bd66033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60cf546001600160a01b031633141580610c36575060ce546001600160a01b03848116911614155b15610c725760405163973d02cb60e01b815260206004820152600b60248201526a2fb2bc34ba2432b63832b960a91b60448201526064016103c8565b7f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e732293610ca1602060008486611edc565b610caa91611f06565b0361051d57600080610cbf8360208187611edc565b810190610ccc9190611cc8565b91509150610cda8282611442565b505050505050565b8135158015610cf357506020820135155b15610d1c57604051633615713d60e21b81526001600160a01b03841660048201526024016103c8565b60cb5460009081906001600160a01b031663ebbdac918585610d3d896114b1565b6040518463ffffffff1660e01b8152600401610d5b93929190611f24565b6040805180830381865afa158015610d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9b9190611f7d565b91509150801580610daa575081155b15610dd357604051633615713d60e21b81526001600160a01b03861660048201526024016103c8565b5050505050565b6001600160a01b038116600081815260d46020526040808220600501805460ff19169055517fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df7579190a250565b6033546001600160a01b031633146105355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b6001600160a01b038116600081815260d46020526040808220600501805460ff19166001179055517fa850ae9193f515cbae8d35e8925bd2be26627fc91bce650b8652ed254e9cab039190a250565b606580546001600160a01b03191690556105ae81611573565b600054610100900460ff16610f0f5760405162461bcd60e51b81526004016103c890611fb0565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16610f585760405162461bcd60e51b81526004016103c890611fb0565b6105356115c5565b6000600182015460ff166002811115610f7b57610f7b611ffb565b14610fc85760405162461bcd60e51b815260206004820152601d60248201527f47656e657369734c69623a20616c72656164792066696e616c697a656400000060448201526064016103c8565b6001908101805460ff19169091179055565b606081600001805480602002602001604051908101604052809291908181526020016000905b82821015611048576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101611000565b505050509050919050565b600060025b600183015460ff16600281111561107157611071611ffb565b1492915050565b6000600184015460ff16600281111561109357611093611ffb565b146110a0576110a0612011565b6001600160a01b03821660009081526002840160205260408120549081900361113d5783546110d0906001611ec9565b6001600160a01b03848116600081815260028881016020908152604080842087905580518082019091529384528381018881528a5460018082018d558c86529290942094519390920290930180546001600160a01b0319169290941691909117835551910155905061051d565b600061114985856115f5565b9050600085600001828154811061116257611162611e27565b90600052602060002090600202019050838160010160008282546111869190611ec9565b9091555050505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261051d908590611632565b6001600160a01b038216600090815260d460205260409020600501548290610100900460ff1661124c5760405163973d02cb60e01b81526020600482015260096024820152682b20a624a220aa27a960b91b60448201526064016103c8565b61125660d1611707565b1561126c5761126760d18484611078565b505050565b61127660d1611053565b1561132f5760cc5460ce54604080517f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a6960208201526001600160a01b038781168284015260608083018890528351808403909101815260808301938490526316f1983160e01b909352938416936316f19831936112f893911691608401612053565b600060405180830381600087803b15801561131257600080fd5b505af1158015611326573d6000803e3d6000fd5b50505050505050565b60405163973d02cb60e01b815260206004820152601060248201526f5761697420666f722067656e6573697360801b60448201526064016103c8565b600181015460ff16600081600281111561138757611387611ffb565b036113d05760405162461bcd60e51b815260206004820152601960248201527811d95b995cda5cd31a588e881b9bdd08199a5b985b1a5e9959603a1b60448201526064016103c8565b60028160028111156113e4576113e4611ffb565b036114315760405162461bcd60e51b815260206004820152601b60248201527f47656e657369734c69623a20616c726561647920656e61626c6564000000000060448201526064016103c8565b50600101805460ff19166002179055565b609754604051633651bb1d60e01b81526001600160a01b0384811660048301526024820184905290911690633651bb1d90604401600060405180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b50505050610b4b8261170f565b6114b96119d7565b60cb5460d0546040516bffffffffffffffffffffffff19606086811b8216602084015230901b1660348201524660488201526001600160a01b039092169163a850a90991906068016040516020818303038152906040526040518363ffffffff1660e01b815260040161152d929190612077565b6040805180830381865afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156d9190612090565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166115ec5760405162461bcd60e51b81526004016103c890611fb0565b61053533610ecf565b6001600160a01b03811660009081526002830160205260408120549081900361162057611620612011565b61162b600182612110565b9392505050565b6000611687826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117db9092919063ffffffff16565b90508051600014806116a85750808060200190518101906116a89190612123565b6112675760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103c8565b600080611058565b609754609854604051633b61c5a760e21b81526001600160a01b038481166004830152602482019290925291169063ed87169c90604401602060405180830381865afa158015611763573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611787919061213e565b6000036105ae576001600160a01b038116600081815260d46020526040808220600501805461ff0019169055517f23d934bfe7f1275bc6fd70432159c9cc1c0075d069f89da6a40f43bfe7a94ed39190a250565b60606117ea84846000856117f2565b949350505050565b6060824710156118535760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103c8565b600080866001600160a01b0316858760405161186f9190611e90565b60006040518083038185875af1925050503d80600081146118ac576040519150601f19603f3d011682016040523d82523d6000602084013e6118b1565b606091505b50915091506118c2878383876118cd565b979650505050505050565b6060831561193c578251600003611935576001600160a01b0385163b6119355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c8565b50816117ea565b6117ea83838151156119515781518083602001fd5b8060405162461bcd60e51b81526004016103c89190612157565b604051806080016040528061197e6119f5565b81526000602082018190526040820181905260609091015290565b82600481019282156119c7579160200282015b828111156119c75782358255916020019190600101906119ac565b506119d3929150611a13565b5090565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b5b808211156119d35760008155600101611a14565b6001600160a01b03811681146105ae57600080fd5b600060208284031215611a4f57600080fd5b813561162b81611a28565b815160e08201908260005b6004811015611a84578251825260209283019290910190600101611a65565b505050602083015160808301526040830151151560a0830152606090920151151560c09091015290565b60008060c08385031215611ac157600080fd5b6040830184811115611ad257600080fd5b8392508460c085011115611ae557600080fd5b809150509250929050565b600060208284031215611b0257600080fd5b5035919050565b60008060208385031215611b1c57600080fd5b823567ffffffffffffffff80821115611b3457600080fd5b818501915085601f830112611b4857600080fd5b813581811115611b5757600080fd5b8660208260051b8501011115611b6c57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600080610100898b031215611bb157600080fd5b8835611bbc81611a28565b97506020890135611bcc81611a28565b96506040890135611bdc81611a28565b95506060890135611bec81611a28565b94506080890135611bfc81611a28565b935060a0890135611c0c81611a28565b925060c0890135611c1c81611a28565b915060e089013567ffffffffffffffff80821115611c3957600080fd5b818b0191508b601f830112611c4d57600080fd5b813581811115611c5f57611c5f611b7e565b604051601f8201601f19908116603f01168101908382118183101715611c8757611c87611b7e565b816040528281528e6020848701011115611ca057600080fd5b8260208601602083013760006020848301015280955050505050509295985092959890939650565b60008060408385031215611cdb57600080fd5b8235611ce681611a28565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b82811015611d3f57815180516001600160a01b03168552860151868501529284019290850190600101611d11565b5091979650505050505050565b60008060008060608587031215611d6257600080fd5b843593506020850135611d7481611a28565b9250604085013567ffffffffffffffff80821115611d9157600080fd5b818701915087601f830112611da557600080fd5b813581811115611db457600080fd5b886020828501011115611dc657600080fd5b95989497505060200194505050565b60808181019083833792915050565b60208082526023908201527f53757065726e65744d616e616765723a204f4e4c595f5354414b455f4d414e4160408201526223a2a960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e6557611e65611e3d565b5060010190565b60005b83811015611e87578181015183820152602001611e6f565b50506000910152565b60008251611ea2818460208701611e6c565b9190910192915050565b600060208284031215611ebe57600080fd5b815161162b81611a28565b8082018082111561156d5761156d611e3d565b60008085851115611eec57600080fd5b83861115611ef957600080fd5b5050820193919092039150565b8035602083101561156d57600019602084900360031b1b1692915050565b61010081016040858337608084604084013760c082018360005b6002811015611f5d578151835260209283019290910190600101611f3e565b505050949350505050565b80518015158114611f7857600080fd5b919050565b60008060408385031215611f9057600080fd5b611f9983611f68565b9150611fa760208401611f68565b90509250929050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052600160045260246000fd5b6000815180845261203f816020860160208601611e6c565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906117ea90830184612027565b8281526040602082015260006117ea6040830184612027565b6000604082840312156120a257600080fd5b82601f8301126120b157600080fd5b6040516040810181811067ffffffffffffffff821117156120d4576120d4611b7e565b80604052508060408401858111156120eb57600080fd5b845b818110156121055780518352602092830192016120ed565b509195945050505050565b8181038181111561156d5761156d611e3d565b60006020828403121561213557600080fd5b61162b82611f68565b60006020828403121561215057600080fd5b5051919050565b60208152600061162b602083018461202756fea2646970667358221220c854c4bd92b5e40db8e0e9b90d5bc01c31cbec4f50c64ece828835f89a96927664736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063e30c397811610071578063e30c397814610248578063e53b87a814610259578063f2fde38b14610279578063f43cda8b1461028c578063fa52c7d81461029f57600080fd5b80638da5cb5b146101e65780639e19e9c11461020b578063af640d0f14610220578063c2fb26a614610237578063d11aca621461024057600080fd5b806379ba5097116100f457806379ba50971461019d578063819dc9fb146101a557806385758cc7146101b857806386202194146101c05780638c087b1c146101d357600080fd5b80631904bb2e146101315780631f6590b81461015a578063344a5e641461016f578063542c85f214610182578063715018a614610195575b600080fd5b61014461013f366004611a3d565b6102f2565b6040516101519190611a5a565b60405180910390f35b61016d610168366004611aae565b61037c565b005b61016d61017d366004611af0565b610449565b61016d610190366004611b09565b6104c8565b61016d610523565b61016d610537565b61016d6101b3366004611b94565b6105b1565b61016d610819565b61016d6101ce366004611af0565b61086a565b61016d6101e1366004611cc8565b610b17565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610151565b610213610b4f565b6040516101519190611cf4565b61022960985481565b604051908152602001610151565b61022960d05481565b61016d610b60565b6065546001600160a01b03166101f3565b610229610267366004611a3d565b60d66020526000908152604090205481565b61016d610287366004611a3d565b610b9d565b61016d61029a366004611d4c565b610c0e565b6102d56102ad366004611a3d565b60d4602052600090815260409020600481015460059091015460ff8082169161010090041683565b604080519384529115156020840152151590820152606001610151565b6102fa61196b565b6001600160a01b038216600090815260d46020526040908190208151610100810190925281608081018260048282826020028201915b8154815260200190600101908083116103305750505091835250506004820154602082015260059091015460ff8082161515604084015261010090910416151560609091015292915050565b33600090815260d460205260409020600581015460ff166103d15760405163973d02cb60e01b815260206004820152600960248201526815d2125511531254d560ba1b60448201526064015b60405180910390fd5b6103dc338484610ce2565b6103e881836004611999565b5060058101805461ff00191661010017905561040333610dda565b336001600160a01b03167f110ae3ae039a4632f836a35dc9b1282df88780883fb28779f22c2f7ccde8dd0a8360405161043c9190611dd5565b60405180910390a2505050565b6097546001600160a01b031633146104735760405162461bcd60e51b81526004016103c890611de4565b609854156104c35760405162461bcd60e51b815260206004820152601f60248201527f53757065726e65744d616e616765723a2049445f414c52454144595f5345540060448201526064016103c8565b609855565b6104d0610e26565b8060005b8181101561051d5761050b8484838181106104f1576104f1611e27565b90506020020160208101906105069190611a3d565b610e80565b8061051581611e53565b9150506104d4565b50505050565b61052b610e26565b6105356000610ecf565b565b60655433906001600160a01b031681146105a55760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016103c8565b6105ae81610ecf565b50565b600054610100900460ff16158080156105d15750600054600160ff909116105b806105eb5750303b1580156105eb575060005460ff166001145b61064e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805460ff191660011790558015610671576000805461ff0019166101001790555b6001600160a01b0389161580159061069157506001600160a01b03881615155b80156106a557506001600160a01b03871615155b80156106b957506001600160a01b03861615155b80156106cd57506001600160a01b03851615155b80156106e157506001600160a01b03841615155b80156106ed5750815115155b6107295760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b60448201526064016103c8565b61073289610ee8565b60cb80546001600160a01b03199081166001600160a01b038b81169190911790925560cc805482168a841617905560cd8054821689841617905560ce8054821688841617905560cf8054821687841617905560d580549091169185169190911790556040516107a5908390602001611e90565b60408051601f19818403018152919052805160209091012060d0556107c8610f31565b801561080e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b610821610e26565b61082b60d1610f60565b7f87f41ee3facb6317b1c2811e539539ac1693525b4460699b4245e8aac9f590cb61085660d1610fda565b5160405190815260200160405180910390a1565b600081116108c85760405162461bcd60e51b815260206004820152602560248201527f437573746f6d53757065726e65744d616e616765723a20494e56414c49445f416044820152641353d5539560da1b60648201526084016103c8565b60d5546001600160a01b031661093f5760405163973d02cb60e01b815260206004820152603560248201527f437573746f6d53757065726e65744d616e616765723a20554e444546494e45446044820152745f524f4f545f45524332305f50524544494341544560581b60648201526084016103c8565b60d55460408051636a00c1d760e01b815290516000926001600160a01b031691636a00c1d7916004808301926020929190829003018187875af115801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae9190611eac565b90506001600160a01b038116610a225760405163973d02cb60e01b815260206004820152603260248201527f437573746f6d53757065726e65744d616e616765723a20554e444546494e454460448201527117d3905512559157d513d2d15397d493d3d560721b60648201526084016103c8565b610a2c60d1611053565b15610a995760405162461bcd60e51b815260206004820152603760248201527f437573746f6d53757065726e65744d616e616765723a2047454e455349535f53604482015276115517d254d7d053149150511657d19253905312569151604a1b60648201526084016103c8565b610aa660d1336000611078565b33600090815260d6602052604081208054849290610ac5908490611ec9565b909155505060d554610ae6906001600160a01b038381169133911685611193565b604051829033907f1706c887e0f7786a7e97fed7b6f19bd6b31854c47c2012b072b44fdbd652623990600090a35050565b6097546001600160a01b03163314610b415760405162461bcd60e51b81526004016103c890611de4565b610b4b82826111ed565b5050565b6060610b5b60d1610fda565b905090565b610b68610e26565b610b7260d161136b565b6040517fda917aeab736a19e4ba54207413dbe4f8c7d558fde2c14d7e66fc8f7186ea8a390600090a1565b610ba5610e26565b606580546001600160a01b0383166001600160a01b03199091168117909155610bd66033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60cf546001600160a01b031633141580610c36575060ce546001600160a01b03848116911614155b15610c725760405163973d02cb60e01b815260206004820152600b60248201526a2fb2bc34ba2432b63832b960a91b60448201526064016103c8565b7f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e732293610ca1602060008486611edc565b610caa91611f06565b0361051d57600080610cbf8360208187611edc565b810190610ccc9190611cc8565b91509150610cda8282611442565b505050505050565b8135158015610cf357506020820135155b15610d1c57604051633615713d60e21b81526001600160a01b03841660048201526024016103c8565b60cb5460009081906001600160a01b031663ebbdac918585610d3d896114b1565b6040518463ffffffff1660e01b8152600401610d5b93929190611f24565b6040805180830381865afa158015610d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9b9190611f7d565b91509150801580610daa575081155b15610dd357604051633615713d60e21b81526001600160a01b03861660048201526024016103c8565b5050505050565b6001600160a01b038116600081815260d46020526040808220600501805460ff19169055517fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df7579190a250565b6033546001600160a01b031633146105355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b6001600160a01b038116600081815260d46020526040808220600501805460ff19166001179055517fa850ae9193f515cbae8d35e8925bd2be26627fc91bce650b8652ed254e9cab039190a250565b606580546001600160a01b03191690556105ae81611573565b600054610100900460ff16610f0f5760405162461bcd60e51b81526004016103c890611fb0565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16610f585760405162461bcd60e51b81526004016103c890611fb0565b6105356115c5565b6000600182015460ff166002811115610f7b57610f7b611ffb565b14610fc85760405162461bcd60e51b815260206004820152601d60248201527f47656e657369734c69623a20616c72656164792066696e616c697a656400000060448201526064016103c8565b6001908101805460ff19169091179055565b606081600001805480602002602001604051908101604052809291908181526020016000905b82821015611048576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101611000565b505050509050919050565b600060025b600183015460ff16600281111561107157611071611ffb565b1492915050565b6000600184015460ff16600281111561109357611093611ffb565b146110a0576110a0612011565b6001600160a01b03821660009081526002840160205260408120549081900361113d5783546110d0906001611ec9565b6001600160a01b03848116600081815260028881016020908152604080842087905580518082019091529384528381018881528a5460018082018d558c86529290942094519390920290930180546001600160a01b0319169290941691909117835551910155905061051d565b600061114985856115f5565b9050600085600001828154811061116257611162611e27565b90600052602060002090600202019050838160010160008282546111869190611ec9565b9091555050505050505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261051d908590611632565b6001600160a01b038216600090815260d460205260409020600501548290610100900460ff1661124c5760405163973d02cb60e01b81526020600482015260096024820152682b20a624a220aa27a960b91b60448201526064016103c8565b61125660d1611707565b1561126c5761126760d18484611078565b505050565b61127660d1611053565b1561132f5760cc5460ce54604080517f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a6960208201526001600160a01b038781168284015260608083018890528351808403909101815260808301938490526316f1983160e01b909352938416936316f19831936112f893911691608401612053565b600060405180830381600087803b15801561131257600080fd5b505af1158015611326573d6000803e3d6000fd5b50505050505050565b60405163973d02cb60e01b815260206004820152601060248201526f5761697420666f722067656e6573697360801b60448201526064016103c8565b600181015460ff16600081600281111561138757611387611ffb565b036113d05760405162461bcd60e51b815260206004820152601960248201527811d95b995cda5cd31a588e881b9bdd08199a5b985b1a5e9959603a1b60448201526064016103c8565b60028160028111156113e4576113e4611ffb565b036114315760405162461bcd60e51b815260206004820152601b60248201527f47656e657369734c69623a20616c726561647920656e61626c6564000000000060448201526064016103c8565b50600101805460ff19166002179055565b609754604051633651bb1d60e01b81526001600160a01b0384811660048301526024820184905290911690633651bb1d90604401600060405180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b50505050610b4b8261170f565b6114b96119d7565b60cb5460d0546040516bffffffffffffffffffffffff19606086811b8216602084015230901b1660348201524660488201526001600160a01b039092169163a850a90991906068016040516020818303038152906040526040518363ffffffff1660e01b815260040161152d929190612077565b6040805180830381865afa158015611549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156d9190612090565b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166115ec5760405162461bcd60e51b81526004016103c890611fb0565b61053533610ecf565b6001600160a01b03811660009081526002830160205260408120549081900361162057611620612011565b61162b600182612110565b9392505050565b6000611687826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117db9092919063ffffffff16565b90508051600014806116a85750808060200190518101906116a89190612123565b6112675760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103c8565b600080611058565b609754609854604051633b61c5a760e21b81526001600160a01b038481166004830152602482019290925291169063ed87169c90604401602060405180830381865afa158015611763573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611787919061213e565b6000036105ae576001600160a01b038116600081815260d46020526040808220600501805461ff0019169055517f23d934bfe7f1275bc6fd70432159c9cc1c0075d069f89da6a40f43bfe7a94ed39190a250565b60606117ea84846000856117f2565b949350505050565b6060824710156118535760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103c8565b600080866001600160a01b0316858760405161186f9190611e90565b60006040518083038185875af1925050503d80600081146118ac576040519150601f19603f3d011682016040523d82523d6000602084013e6118b1565b606091505b50915091506118c2878383876118cd565b979650505050505050565b6060831561193c578251600003611935576001600160a01b0385163b6119355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c8565b50816117ea565b6117ea83838151156119515781518083602001fd5b8060405162461bcd60e51b81526004016103c89190612157565b604051806080016040528061197e6119f5565b81526000602082018190526040820181905260609091015290565b82600481019282156119c7579160200282015b828111156119c75782358255916020019190600101906119ac565b506119d3929150611a13565b5090565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b5b808211156119d35760008155600101611a14565b6001600160a01b03811681146105ae57600080fd5b600060208284031215611a4f57600080fd5b813561162b81611a28565b815160e08201908260005b6004811015611a84578251825260209283019290910190600101611a65565b505050602083015160808301526040830151151560a0830152606090920151151560c09091015290565b60008060c08385031215611ac157600080fd5b6040830184811115611ad257600080fd5b8392508460c085011115611ae557600080fd5b809150509250929050565b600060208284031215611b0257600080fd5b5035919050565b60008060208385031215611b1c57600080fd5b823567ffffffffffffffff80821115611b3457600080fd5b818501915085601f830112611b4857600080fd5b813581811115611b5757600080fd5b8660208260051b8501011115611b6c57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600080610100898b031215611bb157600080fd5b8835611bbc81611a28565b97506020890135611bcc81611a28565b96506040890135611bdc81611a28565b95506060890135611bec81611a28565b94506080890135611bfc81611a28565b935060a0890135611c0c81611a28565b925060c0890135611c1c81611a28565b915060e089013567ffffffffffffffff80821115611c3957600080fd5b818b0191508b601f830112611c4d57600080fd5b813581811115611c5f57611c5f611b7e565b604051601f8201601f19908116603f01168101908382118183101715611c8757611c87611b7e565b816040528281528e6020848701011115611ca057600080fd5b8260208601602083013760006020848301015280955050505050509295985092959890939650565b60008060408385031215611cdb57600080fd5b8235611ce681611a28565b946020939093013593505050565b602080825282518282018190526000919060409081850190868401855b82811015611d3f57815180516001600160a01b03168552860151868501529284019290850190600101611d11565b5091979650505050505050565b60008060008060608587031215611d6257600080fd5b843593506020850135611d7481611a28565b9250604085013567ffffffffffffffff80821115611d9157600080fd5b818701915087601f830112611da557600080fd5b813581811115611db457600080fd5b886020828501011115611dc657600080fd5b95989497505060200194505050565b60808181019083833792915050565b60208082526023908201527f53757065726e65744d616e616765723a204f4e4c595f5354414b455f4d414e4160408201526223a2a960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e6557611e65611e3d565b5060010190565b60005b83811015611e87578181015183820152602001611e6f565b50506000910152565b60008251611ea2818460208701611e6c565b9190910192915050565b600060208284031215611ebe57600080fd5b815161162b81611a28565b8082018082111561156d5761156d611e3d565b60008085851115611eec57600080fd5b83861115611ef957600080fd5b5050820193919092039150565b8035602083101561156d57600019602084900360031b1b1692915050565b61010081016040858337608084604084013760c082018360005b6002811015611f5d578151835260209283019290910190600101611f3e565b505050949350505050565b80518015158114611f7857600080fd5b919050565b60008060408385031215611f9057600080fd5b611f9983611f68565b9150611fa760208401611f68565b90509250929050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052600160045260246000fd5b6000815180845261203f816020860160208601611e6c565b601f01601f19169290920160200192915050565b6001600160a01b03831681526040602082018190526000906117ea90830184612027565b8281526040602082015260006117ea6040830184612027565b6000604082840312156120a257600080fd5b82601f8301126120b157600080fd5b6040516040810181811067ffffffffffffffff821117156120d4576120d4611b7e565b80604052508060408401858111156120eb57600080fd5b845b818110156121055780518352602092830192016120ed565b509195945050505050565b8181038181111561156d5761156d611e3d565b60006020828403121561213557600080fd5b61162b82611f68565b60006020828403121561215057600080fd5b5051919050565b60208152600061162b602083018461202756fea2646970667358221220c854c4bd92b5e40db8e0e9b90d5bc01c31cbec4f50c64ece828835f89a96927664736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var StakeManagerArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"StakeManager","sourceName":"contracts/root/staking/StakeManager.sol","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"manager","type":"address"}],"name":"ChildManagerRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"validator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"validator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"validator","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeWithdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"idFor","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newStakingToken","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"managerOf","outputs":[{"internalType":"contract ISupernetManager","name":"manager","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"registerChildChain","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"releaseStakeOf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"stakeOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStake","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"totalStakeOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalStakeOfChild","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"withdrawableStake","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610e59806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063c73a7a1f11610071578063c73a7a1f14610135578063d5364bbf14610148578063d7fbee3d1461015b578063e3f56eaa14610186578063ed87169c14610199578063f90423fe146101ac57600080fd5b80633651bb1d146100b957806339ed8c90146100ce5780638b0e9f3f146100f4578063b64ddbf6146100fc578063c4d66de81461010f578063c606627214610122575b600080fd5b6100cc6100c7366004610cd2565b6101bf565b005b6100e16100dc366004610cfc565b610220565b6040519081526020015b60405180910390f35b6036546100e1565b6100e161010a366004610d15565b610236565b6100cc61011d366004610d15565b610342565b6100cc610130366004610cd2565b610467565b6100cc610143366004610d30565b610472565b6100e1610156366004610d15565b61058f565b61016e610169366004610cfc565b6105ad565b6040516001600160a01b0390911681526020016100eb565b6100e1610194366004610d15565b6105b8565b6100e16101a7366004610cd2565b6105d6565b6100e16101ba366004610d15565b610602565b60006101ca33610602565b90506101d783828461060d565b826001600160a01b0316817fcbc2141407acdf7a77731afda2c1369f3c46e04194b90a9d527385c17608eb0d8460405161021391815260200190565b60405180910390a3505050565b6000818152603860205260408120545b92915050565b6001600160a01b038116600090815260036020526040812054156102a15760405162461bcd60e51b815260206004820152601c60248201527f5374616b654d616e616765723a2049445f414c52454144595f5345540000000060448201526064015b60405180910390fd5b6102aa826106e0565b604051630d12979960e21b8152600481018290529091506001600160a01b0383169063344a5e6490602401600060405180830381600087803b1580156102ef57600080fd5b505af1158015610303573d6000803e3d6000fd5b50506040516001600160a01b03851692508391507f64566eaf28160aee8cce7464dbf8eb54939f81ac929a8ebeea66865ff57963c490600090a3919050565b600054610100900460ff16158080156103625750600054600160ff909116105b8061037c5750303b15801561037c575060005460ff166001145b6103df5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610298565b6000805460ff191660011790558015610402576000805461ff0019166101001790555b606d80546001600160a01b0319166001600160a01b0384161790558015610463576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b610463338383610791565b811580159061048357506001548211155b6104ca5760405162461bcd60e51b815260206004820152601860248201527714dd185ad953585b9859d95c8e881253959053125117d25160421b6044820152606401610298565b606d546104e2906001600160a01b03163330846107f7565b6104ed338383610868565b60006104f8836105ad565b6040516323021ec760e21b8152336004820152602481018490529091506001600160a01b03821690638c087b1c90604401600060405180830381600087803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b50506040518481523392508591507fc1d3c31619aec7561f6fa519052617aed252a25edaddc5d7428681180516837a90602001610213565b6001600160a01b0381166000908152603a6020526040812054610230565b600061023082610904565b6001600160a01b038116600090815260396020526040812054610230565b6001600160a01b03821660009081526037602090815260408083208484529091528120545b9392505050565b600061023082610978565b6001600160a01b038316600090815260376020908152604080832085845290915281208054839290610640908490610d68565b909155505060008281526038602052604081208054839290610663908490610d68565b90915550506001600160a01b03831660009081526039602052604081208054839290610690908490610d68565b9250508190555080603660008282546106a99190610d68565b90915550506001600160a01b0383166000908152603a6020526040812080548392906106d6908490610d7b565b9091555050505050565b60006001600160a01b0382166107475760405162461bcd60e51b815260206004820152602660248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f4160448201526544445245535360d01b6064820152608401610298565b5060018054810190819055600081815260026020908152604080832080546001600160a01b039096166001600160a01b031990961686179055938252600390529190912081905590565b61079b83826109f0565b606d546107b2906001600160a01b03168383610a21565b816001600160a01b0316836001600160a01b03167fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda38360405161021391815260200190565b6040516001600160a01b03808516602483015283166044820152606481018290526108629085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610a56565b50505050565b6001600160a01b03831660009081526037602090815260408083208584529091528120805483929061089b908490610d7b565b9091555050600082815260386020526040812080548392906108be908490610d7b565b90915550506001600160a01b038316600090815260396020526040812080548392906108eb908490610d7b565b9250508190555080603660008282546106d69190610d7b565b6000818152600260205260409020546001600160a01b0316806109735760405162461bcd60e51b815260206004820152602160248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f496044820152601160fa1b6064820152608401610298565b919050565b6001600160a01b038116600090815260036020526040812054908190036109735760405162461bcd60e51b815260206004820152602660248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f4d60448201526520a720a3a2a960d11b6064820152608401610298565b6001600160a01b0382166000908152603a602052604081208054839290610a18908490610d68565b90915550505050565b6040516001600160a01b038316602482015260448101829052610a5190849063a9059cbb60e01b9060640161082b565b505050565b6000610aab826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b2b9092919063ffffffff16565b9050805160001480610acc575080806020019051810190610acc9190610d8e565b610a515760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610298565b6060610b3a8484600085610b42565b949350505050565b606082471015610ba35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610298565b600080866001600160a01b03168587604051610bbf9190610dd4565b60006040518083038185875af1925050503d8060008114610bfc576040519150601f19603f3d011682016040523d82523d6000602084013e610c01565b606091505b5091509150610c1287838387610c1d565b979650505050505050565b60608315610c8c578251600003610c85576001600160a01b0385163b610c855760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610298565b5081610b3a565b610b3a8383815115610ca15781518083602001fd5b8060405162461bcd60e51b81526004016102989190610df0565b80356001600160a01b038116811461097357600080fd5b60008060408385031215610ce557600080fd5b610cee83610cbb565b946020939093013593505050565b600060208284031215610d0e57600080fd5b5035919050565b600060208284031215610d2757600080fd5b6105fb82610cbb565b60008060408385031215610d4357600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561023057610230610d52565b8082018082111561023057610230610d52565b600060208284031215610da057600080fd5b815180151581146105fb57600080fd5b60005b83811015610dcb578181015183820152602001610db3565b50506000910152565b60008251610de6818460208701610db0565b9190910192915050565b6020815260008251806020840152610e0f816040850160208701610db0565b601f01601f1916919091016040019291505056fea26469706673582212207f5dfe1cb46bc115076fa23b9ffb2421ed989feee340cc0546c7e357469d57e864736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063c73a7a1f11610071578063c73a7a1f14610135578063d5364bbf14610148578063d7fbee3d1461015b578063e3f56eaa14610186578063ed87169c14610199578063f90423fe146101ac57600080fd5b80633651bb1d146100b957806339ed8c90146100ce5780638b0e9f3f146100f4578063b64ddbf6146100fc578063c4d66de81461010f578063c606627214610122575b600080fd5b6100cc6100c7366004610cd2565b6101bf565b005b6100e16100dc366004610cfc565b610220565b6040519081526020015b60405180910390f35b6036546100e1565b6100e161010a366004610d15565b610236565b6100cc61011d366004610d15565b610342565b6100cc610130366004610cd2565b610467565b6100cc610143366004610d30565b610472565b6100e1610156366004610d15565b61058f565b61016e610169366004610cfc565b6105ad565b6040516001600160a01b0390911681526020016100eb565b6100e1610194366004610d15565b6105b8565b6100e16101a7366004610cd2565b6105d6565b6100e16101ba366004610d15565b610602565b60006101ca33610602565b90506101d783828461060d565b826001600160a01b0316817fcbc2141407acdf7a77731afda2c1369f3c46e04194b90a9d527385c17608eb0d8460405161021391815260200190565b60405180910390a3505050565b6000818152603860205260408120545b92915050565b6001600160a01b038116600090815260036020526040812054156102a15760405162461bcd60e51b815260206004820152601c60248201527f5374616b654d616e616765723a2049445f414c52454144595f5345540000000060448201526064015b60405180910390fd5b6102aa826106e0565b604051630d12979960e21b8152600481018290529091506001600160a01b0383169063344a5e6490602401600060405180830381600087803b1580156102ef57600080fd5b505af1158015610303573d6000803e3d6000fd5b50506040516001600160a01b03851692508391507f64566eaf28160aee8cce7464dbf8eb54939f81ac929a8ebeea66865ff57963c490600090a3919050565b600054610100900460ff16158080156103625750600054600160ff909116105b8061037c5750303b15801561037c575060005460ff166001145b6103df5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610298565b6000805460ff191660011790558015610402576000805461ff0019166101001790555b606d80546001600160a01b0319166001600160a01b0384161790558015610463576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b610463338383610791565b811580159061048357506001548211155b6104ca5760405162461bcd60e51b815260206004820152601860248201527714dd185ad953585b9859d95c8e881253959053125117d25160421b6044820152606401610298565b606d546104e2906001600160a01b03163330846107f7565b6104ed338383610868565b60006104f8836105ad565b6040516323021ec760e21b8152336004820152602481018490529091506001600160a01b03821690638c087b1c90604401600060405180830381600087803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b50506040518481523392508591507fc1d3c31619aec7561f6fa519052617aed252a25edaddc5d7428681180516837a90602001610213565b6001600160a01b0381166000908152603a6020526040812054610230565b600061023082610904565b6001600160a01b038116600090815260396020526040812054610230565b6001600160a01b03821660009081526037602090815260408083208484529091528120545b9392505050565b600061023082610978565b6001600160a01b038316600090815260376020908152604080832085845290915281208054839290610640908490610d68565b909155505060008281526038602052604081208054839290610663908490610d68565b90915550506001600160a01b03831660009081526039602052604081208054839290610690908490610d68565b9250508190555080603660008282546106a99190610d68565b90915550506001600160a01b0383166000908152603a6020526040812080548392906106d6908490610d7b565b9091555050505050565b60006001600160a01b0382166107475760405162461bcd60e51b815260206004820152602660248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f4160448201526544445245535360d01b6064820152608401610298565b5060018054810190819055600081815260026020908152604080832080546001600160a01b039096166001600160a01b031990961686179055938252600390529190912081905590565b61079b83826109f0565b606d546107b2906001600160a01b03168383610a21565b816001600160a01b0316836001600160a01b03167fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda38360405161021391815260200190565b6040516001600160a01b03808516602483015283166044820152606481018290526108629085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610a56565b50505050565b6001600160a01b03831660009081526037602090815260408083208584529091528120805483929061089b908490610d7b565b9091555050600082815260386020526040812080548392906108be908490610d7b565b90915550506001600160a01b038316600090815260396020526040812080548392906108eb908490610d7b565b9250508190555080603660008282546106d69190610d7b565b6000818152600260205260409020546001600160a01b0316806109735760405162461bcd60e51b815260206004820152602160248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f496044820152601160fa1b6064820152608401610298565b919050565b6001600160a01b038116600090815260036020526040812054908190036109735760405162461bcd60e51b815260206004820152602660248201527f5374616b654d616e616765724368696c64446174613a20494e56414c49445f4d60448201526520a720a3a2a960d11b6064820152608401610298565b6001600160a01b0382166000908152603a602052604081208054839290610a18908490610d68565b90915550505050565b6040516001600160a01b038316602482015260448101829052610a5190849063a9059cbb60e01b9060640161082b565b505050565b6000610aab826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b2b9092919063ffffffff16565b9050805160001480610acc575080806020019051810190610acc9190610d8e565b610a515760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610298565b6060610b3a8484600085610b42565b949350505050565b606082471015610ba35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610298565b600080866001600160a01b03168587604051610bbf9190610dd4565b60006040518083038185875af1925050503d8060008114610bfc576040519150601f19603f3d011682016040523d82523d6000602084013e610c01565b606091505b5091509150610c1287838387610c1d565b979650505050505050565b60608315610c8c578251600003610c85576001600160a01b0385163b610c855760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610298565b5081610b3a565b610b3a8383815115610ca15781518083602001fd5b8060405162461bcd60e51b81526004016102989190610df0565b80356001600160a01b038116811461097357600080fd5b60008060408385031215610ce557600080fd5b610cee83610cbb565b946020939093013593505050565b600060208284031215610d0e57600080fd5b5035919050565b600060208284031215610d2757600080fd5b6105fb82610cbb565b60008060408385031215610d4357600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561023057610230610d52565b8082018082111561023057610230610d52565b600060208284031215610da057600080fd5b815180151581146105fb57600080fd5b60005b83811015610dcb578181015183820152602001610db3565b50506000910152565b60008251610de6818460208701610db0565b9190910192915050565b6020815260008251806020840152610e0f816040850160208701610db0565b601f01601f1916919091016040019291505056fea26469706673582212207f5dfe1cb46bc115076fa23b9ffb2421ed989feee340cc0546c7e357469d57e864736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var RewardPoolArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"RewardPool","sourceName":"contracts/child/validator/RewardPool.sol","abi":[{"inputs":[{"internalType":"string","name":"only","type":"string"}],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalReward","type":"uint256"}],"name":"RewardDistributed","type":"event"},{"inputs":[],"name":"ALLOWLIST_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKLIST_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TRANSFER_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TRANSFER_PRECOMPILE_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"READ_ADDRESSLIST_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SYSTEM","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_PKCHECK_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_PKCHECK_PRECOMPILE_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochId","type":"uint256"},{"components":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"uint256","name":"signedBlocks","type":"uint256"}],"internalType":"struct Uptime[]","name":"uptime","type":"tuple[]"}],"name":"distributeRewardFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRewardToken","type":"address"},{"internalType":"address","name":"newRewardWallet","type":"address"},{"internalType":"address","name":"newValidatorSet","type":"address"},{"internalType":"uint256","name":"newBaseReward","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"paidRewardPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"validatorSet","outputs":[{"internalType":"contract IValidatorSet","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b50610ee1806100206000396000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638a9cd82d116100a2578063c885bc5811610071578063c885bc581461020f578063cf756fdf14610217578063e0563ab11461022a578063f7c618c114610233578063fb75b2c71461024c57600080fd5b80638a9cd82d146101d45780639426e226146101e9578063947287cf146101fc57806397e5230d1461020557600080fd5b80633b878c22116100e95780633b878c221461019d57806351351d53146101a657806355b01e4d146101b45780635ea5df79146101c257806376ad03bc146101cb57600080fd5b806307358b991461011b57806307b3e2521461014e578063284017f51461017457806331d7a2621461017d575b600080fd5b61013b610129366004610be0565b60366020526000908152604090205481565b6040519081526020015b60405180910390f35b61015c6004600360981b0181565b6040516001600160a01b039091168152602001610145565b61015c61202081565b61013b61018b366004610c15565b60376020526000908152604090205481565b61015c61101081565b61015c6002600160a01b0381565b61015c6004600160991b0181565b61013b61138881565b61013b60355481565b6101e76101e2366004610c37565b61025f565b005b60345461015c906001600160a01b031681565b61013b61520881565b61013b620249f081565b6101e76106a9565b6101e7610225366004610cb6565b6106df565b61015c61203081565b60325461015c906201000090046001600160a01b031681565b60335461015c906001600160a01b031681565b336002600160a01b03146102a85760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b600083815260366020526040902054156103045760405162461bcd60e51b815260206004820152601a60248201527f5245574152445f414c52454144595f4449535452494255544544000000000000604482015260640161029f565b603454604051633f490b0560e21b8152600481018590526000916001600160a01b03169063fd242c1490602401602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610d01565b9050806000036103ba5760405162461bcd60e51b8152602060048201526013602482015272115413d0d217d393d517d0d3d3535255151151606a1b604482015260640161029f565b60345460408051636265600360e01b815290516000926001600160a01b03169163626560039160048083019260209291908290030181865afa158015610404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104289190610d01565b90506000818360355461043b9190610d30565b6104459190610d4d565b603454604051630981b24d60e41b8152600481018990529192506000916001600160a01b039091169063981b24d090602401602060405180830381865afa158015610494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b89190610d01565b9050846000805b828110156106495760008989838181106104db576104db610d6f565b9050604002018036038101906104f19190610d85565b905087816020015111156105475760405162461bcd60e51b815260206004820152601b60248201527f5349474e45445f424c4f434b535f455843454544535f544f54414c0000000000604482015260640161029f565b603454815160405163277166bf60e11b81526001600160a01b039182166004820152602481018e90526000929190911690634ee2cd7e90604401602060405180830381865afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c29190610d01565b905060006105d08a88610d30565b60208401516105df848b610d30565b6105e99190610d30565b6105f39190610d4d565b83516001600160a01b0316600090815260376020526040812080549293508392909190610621908490610dea565b9091555061063190508186610dea565b9450505050808061064190610dfd565b9150506104bf565b506000898152603660205260409020819055610664816108b1565b887feaf3d57629d9b1ce95715ccd98d6f5bf48023be1d5a06e09f64ab7f6d8be01d58260405161069691815260200190565b60405180910390a2505050505050505050565b336000818152603760205260408120805491905560325490916106dc916201000090046001600160a01b031690836108d5565b50565b603254610100900460ff16158080156106ff5750603254600160ff909116105b806107195750303b158015610719575060325460ff166001145b61077c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161029f565b6032805460ff19166001179055801561079f576032805461ff0019166101001790555b6001600160a01b038516158015906107bf57506001600160a01b03841615155b80156107d357506001600160a01b03831615155b61080e5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015260640161029f565b603280546001600160a01b03808816620100000262010000600160b01b031990921691909117909155603380548683166001600160a01b0319918216179091556034805492861692909116919091179055603582905580156108aa576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6033546032546106dc916001600160a01b036201000090920482169116308461093d565b6040516001600160a01b03831660248201526044810182905261093890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261097b565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526109759085906323b872dd60e01b90608401610901565b50505050565b60006109d0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610a509092919063ffffffff16565b90508051600014806109f15750808060200190518101906109f19190610e16565b6109385760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029f565b6060610a5f8484600085610a67565b949350505050565b606082471015610ac85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029f565b600080866001600160a01b03168587604051610ae49190610e5c565b60006040518083038185875af1925050503d8060008114610b21576040519150601f19603f3d011682016040523d82523d6000602084013e610b26565b606091505b5091509150610b3787838387610b42565b979650505050505050565b60608315610bb1578251600003610baa576001600160a01b0385163b610baa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029f565b5081610a5f565b610a5f8383815115610bc65781518083602001fd5b8060405162461bcd60e51b815260040161029f9190610e78565b600060208284031215610bf257600080fd5b5035919050565b80356001600160a01b0381168114610c1057600080fd5b919050565b600060208284031215610c2757600080fd5b610c3082610bf9565b9392505050565b600080600060408486031215610c4c57600080fd5b83359250602084013567ffffffffffffffff80821115610c6b57600080fd5b818601915086601f830112610c7f57600080fd5b813581811115610c8e57600080fd5b8760208260061b8501011115610ca357600080fd5b6020830194508093505050509250925092565b60008060008060808587031215610ccc57600080fd5b610cd585610bf9565b9350610ce360208601610bf9565b9250610cf160408601610bf9565b9396929550929360600135925050565b600060208284031215610d1357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d4757610d47610d1a565b92915050565b600082610d6a57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060408284031215610d9757600080fd5b6040516040810181811067ffffffffffffffff82111715610dc857634e487b7160e01b600052604160045260246000fd5b604052610dd483610bf9565b8152602083013560208201528091505092915050565b80820180821115610d4757610d47610d1a565b600060018201610e0f57610e0f610d1a565b5060010190565b600060208284031215610e2857600080fd5b81518015158114610c3057600080fd5b60005b83811015610e53578181015183820152602001610e3b565b50506000910152565b60008251610e6e818460208701610e38565b9190910192915050565b6020815260008251806020840152610e97816040850160208701610e38565b601f01601f1916919091016040019291505056fea26469706673582212200c9fa9211b5f5937d8516e90589d94c68470826588820f396136e3f3ed465c6c64736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638a9cd82d116100a2578063c885bc5811610071578063c885bc581461020f578063cf756fdf14610217578063e0563ab11461022a578063f7c618c114610233578063fb75b2c71461024c57600080fd5b80638a9cd82d146101d45780639426e226146101e9578063947287cf146101fc57806397e5230d1461020557600080fd5b80633b878c22116100e95780633b878c221461019d57806351351d53146101a657806355b01e4d146101b45780635ea5df79146101c257806376ad03bc146101cb57600080fd5b806307358b991461011b57806307b3e2521461014e578063284017f51461017457806331d7a2621461017d575b600080fd5b61013b610129366004610be0565b60366020526000908152604090205481565b6040519081526020015b60405180910390f35b61015c6004600360981b0181565b6040516001600160a01b039091168152602001610145565b61015c61202081565b61013b61018b366004610c15565b60376020526000908152604090205481565b61015c61101081565b61015c6002600160a01b0381565b61015c6004600160991b0181565b61013b61138881565b61013b60355481565b6101e76101e2366004610c37565b61025f565b005b60345461015c906001600160a01b031681565b61013b61520881565b61013b620249f081565b6101e76106a9565b6101e7610225366004610cb6565b6106df565b61015c61203081565b60325461015c906201000090046001600160a01b031681565b60335461015c906001600160a01b031681565b336002600160a01b03146102a85760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b600083815260366020526040902054156103045760405162461bcd60e51b815260206004820152601a60248201527f5245574152445f414c52454144595f4449535452494255544544000000000000604482015260640161029f565b603454604051633f490b0560e21b8152600481018590526000916001600160a01b03169063fd242c1490602401602060405180830381865afa15801561034e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103729190610d01565b9050806000036103ba5760405162461bcd60e51b8152602060048201526013602482015272115413d0d217d393d517d0d3d3535255151151606a1b604482015260640161029f565b60345460408051636265600360e01b815290516000926001600160a01b03169163626560039160048083019260209291908290030181865afa158015610404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104289190610d01565b90506000818360355461043b9190610d30565b6104459190610d4d565b603454604051630981b24d60e41b8152600481018990529192506000916001600160a01b039091169063981b24d090602401602060405180830381865afa158015610494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b89190610d01565b9050846000805b828110156106495760008989838181106104db576104db610d6f565b9050604002018036038101906104f19190610d85565b905087816020015111156105475760405162461bcd60e51b815260206004820152601b60248201527f5349474e45445f424c4f434b535f455843454544535f544f54414c0000000000604482015260640161029f565b603454815160405163277166bf60e11b81526001600160a01b039182166004820152602481018e90526000929190911690634ee2cd7e90604401602060405180830381865afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c29190610d01565b905060006105d08a88610d30565b60208401516105df848b610d30565b6105e99190610d30565b6105f39190610d4d565b83516001600160a01b0316600090815260376020526040812080549293508392909190610621908490610dea565b9091555061063190508186610dea565b9450505050808061064190610dfd565b9150506104bf565b506000898152603660205260409020819055610664816108b1565b887feaf3d57629d9b1ce95715ccd98d6f5bf48023be1d5a06e09f64ab7f6d8be01d58260405161069691815260200190565b60405180910390a2505050505050505050565b336000818152603760205260408120805491905560325490916106dc916201000090046001600160a01b031690836108d5565b50565b603254610100900460ff16158080156106ff5750603254600160ff909116105b806107195750303b158015610719575060325460ff166001145b61077c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161029f565b6032805460ff19166001179055801561079f576032805461ff0019166101001790555b6001600160a01b038516158015906107bf57506001600160a01b03841615155b80156107d357506001600160a01b03831615155b61080e5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015260640161029f565b603280546001600160a01b03808816620100000262010000600160b01b031990921691909117909155603380548683166001600160a01b0319918216179091556034805492861692909116919091179055603582905580156108aa576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b6033546032546106dc916001600160a01b036201000090920482169116308461093d565b6040516001600160a01b03831660248201526044810182905261093890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261097b565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526109759085906323b872dd60e01b90608401610901565b50505050565b60006109d0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610a509092919063ffffffff16565b90508051600014806109f15750808060200190518101906109f19190610e16565b6109385760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029f565b6060610a5f8484600085610a67565b949350505050565b606082471015610ac85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029f565b600080866001600160a01b03168587604051610ae49190610e5c565b60006040518083038185875af1925050503d8060008114610b21576040519150601f19603f3d011682016040523d82523d6000602084013e610b26565b606091505b5091509150610b3787838387610b42565b979650505050505050565b60608315610bb1578251600003610baa576001600160a01b0385163b610baa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029f565b5081610a5f565b610a5f8383815115610bc65781518083602001fd5b8060405162461bcd60e51b815260040161029f9190610e78565b600060208284031215610bf257600080fd5b5035919050565b80356001600160a01b0381168114610c1057600080fd5b919050565b600060208284031215610c2757600080fd5b610c3082610bf9565b9392505050565b600080600060408486031215610c4c57600080fd5b83359250602084013567ffffffffffffffff80821115610c6b57600080fd5b818601915086601f830112610c7f57600080fd5b813581811115610c8e57600080fd5b8760208260061b8501011115610ca357600080fd5b6020830194508093505050509250925092565b60008060008060808587031215610ccc57600080fd5b610cd585610bf9565b9350610ce360208601610bf9565b9250610cf160408601610bf9565b9396929550929360600135925050565b600060208284031215610d1357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d4757610d47610d1a565b92915050565b600082610d6a57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060408284031215610d9757600080fd5b6040516040810181811067ffffffffffffffff82111715610dc857634e487b7160e01b600052604160045260246000fd5b604052610dd483610bf9565b8152602083013560208201528091505092915050565b80820180821115610d4757610d47610d1a565b600060018201610e0f57610e0f610d1a565b5060010190565b600060208284031215610e2857600080fd5b81518015158114610c3057600080fd5b60005b83811015610e53578181015183820152602001610e3b565b50506000910152565b60008251610e6e818460208701610e38565b9190910192915050565b6020815260008251806020840152610e97816040850160208701610e38565b601f01601f1916919091016040019291505056fea26469706673582212200c9fa9211b5f5937d8516e90589d94c68470826588820f396136e3f3ed465c6c64736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` var ValidatorSetArtifact string = `{"_format":"hh-sol-artifact-1","contractName":"ValidatorSet","sourceName":"contracts/child/validator/ValidatorSet.sol","abi":[{"inputs":[{"internalType":"string","name":"only","type":"string"}],"name":"Unauthorized","type":"error"},{"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":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"endBlock","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"epochRoot","type":"bytes32"}],"name":"NewEpoch","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Snapshot","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":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawalRegistered","type":"event"},{"inputs":[],"name":"ALLOWLIST_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BLOCKLIST_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EPOCH_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TOKEN_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TRANSFER_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NATIVE_TRANSFER_PRECOMPILE_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"READ_ADDRESSLIST_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SYSTEM","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_PKCHECK_PRECOMPILE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_PKCHECK_PRECOMPILE_GAS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_WAIT_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"account","type":"address"},{"internalType":"uint256","name":"epochNumber","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"bytes32","name":"epochRoot","type":"bytes32"}],"internalType":"struct Epoch","name":"epoch","type":"tuple"}],"name":"commitEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochEndBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochs","outputs":[{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"bytes32","name":"epochRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newStateSender","type":"address"},{"internalType":"address","name":"newStateReceiver","type":"address"},{"internalType":"address","name":"newRootChainManager","type":"address"},{"internalType":"uint256","name":"newEpochSize","type":"uint256"},{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"stake","type":"uint256"}],"internalType":"struct ValidatorInit[]","name":"initialValidators","type":"tuple[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onStateReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"pendingWithdrawals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"totalBlocks","outputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochNumber","type":"uint256"}],"name":"totalSupplyAt","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":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"withdrawable","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"}],"bytecode":"0x608060405234801561001057600080fd5b5061215c806100206000396000f3fe608060405234801561001057600080fd5b50600436106102015760003560e01c806361cc276311610125578063c6b61e4c116100ad578063ea0fee4f1161007c578063ea0fee4f1461043d578063eacdc5ff14610445578063eeb499451461044e578063f3f4370314610461578063fd242c141461047457600080fd5b8063c6b61e4c146103c4578063ce513b6f1461040e578063dd62ed3e14610421578063e0563ab11461043457600080fd5b806395d89b41116100f457806395d89b411461037957806397e5230d14610381578063981b24d01461038b578063a457c2d71461039e578063a9059cbb146103b157600080fd5b806361cc276314610341578063626560031461035457806370a082311461035d578063947287cf1461037057600080fd5b8063313ce567116101a85780633fd50001116101775780633fd50001146102f65780634ee2cd7e1461030957806351351d531461031c57806355b01e4d1461032a5780635ea5df791461033857600080fd5b8063313ce567146102c357806339509351146102d25780633b878c22146102e55780633ccfd60b146102ee57600080fd5b806306fdde031461020657806307b3e25214610224578063095ea7b31461024a5780630f50287c1461026d57806318160ddd1461028257806323b872dd14610294578063284017f5146102a75780632e17de78146102b0575b600080fd5b61020e610487565b60405161021b9190611aeb565b60405180910390f35b6102326004600360981b0181565b6040516001600160a01b03909116815260200161021b565b61025d610258366004611b13565b610519565b604051901515815260200161021b565b61028061027b366004611b3f565b610533565b005b6035545b60405190815260200161021b565b61025d6102a2366004611b77565b6107c5565b61023261202081565b6102806102be366004611bb8565b6107e9565b6040516012815260200161021b565b61025d6102e0366004611b13565b610800565b61023261101081565b610280610822565b610286610304366004611bb8565b610933565b610286610317366004611b13565b610954565b6102326002600160a01b0381565b6102326004600160991b0181565b61028661138881565b61028061034f366004611c41565b610967565b61028660cc5481565b61028661036b366004611d5a565b610c05565b61028661520881565b61020e610c20565b610286620249f081565b610286610399366004611bb8565b610c2f565b61025d6103ac366004611b13565b610c3a565b61025d6103bf366004611b13565b610cb5565b6103f36103d2366004611bb8565b60ce6020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021b565b61028661041c366004611d5a565b610cc3565b61028661042f366004611d77565b610cf1565b61023261203081565b610286600181565b61028660cd5481565b61028061045c366004611db0565b610d1c565b61028661046f366004611d5a565b610dee565b610286610482366004611bb8565b610e15565b60606036805461049690611e39565b80601f01602080910402602001604051908101604052809291908181526020018280546104c290611e39565b801561050f5780601f106104e45761010080835404028352916020019161050f565b820191906000526020600020905b8154815290600101906020018083116104f257829003601f168201915b5050505050905090565b600033610527818585610e5f565b60019150505b92915050565b336002600160a01b031461057c5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b60cd80546000918261058d83611e89565b9190505590508083146105d85760405162461bcd60e51b815260206004820152601360248201527215539156141150d5115117d15413d0d217d251606a1b6044820152606401610573565b81356020830135116106225760405162461bcd60e51b81526020600482015260136024820152721393d7d09313d0d2d4d7d0d3d3535255151151606a1b6044820152606401610573565b60cc5461063483356020850135611ea2565b61063f906001611eb5565b6106499190611ede565b156106a45760405162461bcd60e51b815260206004820152602560248201527f45504f43485f4d5553545f42455f444956495349424c455f42595f45504f43486044820152645f53495a4560d81b6064820152608401610573565b813560ce60006106b5600185611ea2565b81526020019081526020016000206001015460016106d39190611eb5565b146107165760405162461bcd60e51b8152602060048201526013602482015272494e56414c49445f53544152545f424c4f434b60681b6044820152606401610573565b600081815260ce60205260409020829061074782828135815560208201356001820155604082013560028201555050565b505060cf80546001810182556000919091526020838101357facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299092018290556040805190850135815284359186917f0ce8712c4dee4bd5a691f0bc1c39594671591e77395f8ebf6a3fb5f63fbea66a910160405180910390a4505050565b6000336107d3858285610f84565b6107de858585610ff8565b506001949350505050565b6107f3338261119c565b6107fd33826112c7565b50565b6000336105278185856108138383610cf1565b61081d9190611eb5565b610e5f565b33600090815260d06020526040812060cd549091908190610844908490611340565b808555604051828152919350915033907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a260c95460cb54604080517f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936020820152338183015260608082018790528251808303909101815260808201928390526316f1983160e01b9092526001600160a01b03938416936316f19831936108fc93911691608401611ef2565b600060405180830381600087803b15801561091657600080fd5b505af115801561092a573d6000803e3d6000fd5b50505050505050565b60cf818154811061094357600080fd5b600091825260209091200154905081565b600061096083836113b2565b9392505050565b600054610100900460ff16158080156109875750600054600160ff909116105b806109a15750303b1580156109a1575060005460ff166001145b610a045760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610573565b6000805460ff191660011790558015610a27576000805461ff0019166101001790555b6001600160a01b03861615801590610a4757506001600160a01b03851615155b8015610a5b57506001600160a01b03841615155b610a975760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b6044820152606401610573565b610ae16040518060400160405280600c81526020016b15985b1a59185d1bdc94d95d60a21b815250604051806040016040528060048152602001631594d15560e21b8152506113fb565b60c980546001600160a01b038089166001600160a01b03199283161790925560ca805488841690831617905560cb80549287169290911691909117905560cc83905560005b8251811015610b7b57610b73838281518110610b4457610b44611f16565b602002602001015160000151848381518110610b6257610b62611f16565b602002602001015160200151611430565b600101610b26565b5060cf80546001818101835560009283527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299091019190915560cd558015610bfd576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6001600160a01b031660009081526033602052604090205490565b60606037805461049690611e39565b600061052d8261143a565b60003381610c488286610cf1565b905083811015610ca85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610573565b6107de8286868403610e5f565b600033610527818585610ff8565b60cd546001600160a01b038216600090815260d0602052604081209091610cea9190611340565b5092915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b60ca546001600160a01b031633148015610d43575060cb546001600160a01b038481169116145b610d805760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a2a72222a960911b6044820152606401610573565b7f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a69610daf602060008486611f2c565b610db891611f56565b03610de857600080610dcd8360208187611f2c565b810190610dda9190611b13565b91509150610bfd8282611430565b50505050565b60cd546001600160a01b038216600090815260d060205260408120909161052d9190611465565b600081815260ce60205260408120600101548015610e5657600083815260ce6020526040902054610e469082611ea2565b610e51906001611eb5565b610960565b60009392505050565b6001600160a01b038316610ec15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610573565b6001600160a01b038216610f225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610573565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610f908484610cf1565b90506000198114610de85781811015610feb5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610573565b610de88484848403610e5f565b6001600160a01b03831661105c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610573565b6001600160a01b0382166110be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610573565b6110c9838383611503565b6001600160a01b038316600090815260336020526040902054818110156111415760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610573565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591516000805160206121078339815191529061118f9086815260200190565b60405180910390a3610de8565b6001600160a01b0382166111fc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610573565b61120882600083611503565b6001600160a01b0382166000908152603360205260409020548181101561127c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610573565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192916000805160206121078339815191529101610f77565b505050565b6112f981600160cd546112da9190611eb5565b6001600160a01b038516600090815260d060205260409020919061156c565b816001600160a01b03167f655c1cd0236fb6dc4916f34c8ff10e3b18fcaea5b344dfc16c36fbb1bdfc5df28260405161133491815260200190565b60405180910390a25050565b81546000905b83600101548110156113ab5760008181526002850160209081526040918290208251808401909352805483526001015490820181905284101561138957506113ab565b80516113959084611eb5565b92505080806113a390611e89565b915050611346565b9250929050565b6001600160a01b0382166000908152606560205260408120819081906113d99085906116e2565b91509150816113f0576113eb85610c05565b6113f2565b805b95945050505050565b600054610100900460ff166114225760405162461bcd60e51b815260040161057390611f74565b61142c82826117d0565b5050565b61142c8282611810565b600080600061144a8460666116e2565b915091508161145b5760355461145d565b805b949350505050565b600182015460009080820361147e57600091505061052d565b600061148b600183611ea2565b90505b845481106114fb5760008181526002860160209081526040918290208251808401909352805483526001015490820181905285106114cc57506114fb565b80516114d89085611eb5565b9350816000036114e857506114fb565b50806114f381611fbf565b91505061148e565b505092915050565b6001600160a01b038316158061152057506001600160a01b038216155b6115615760405162461bcd60e51b81526020600482015260126024820152712a2920a729a322a92fa327a92124a22222a760711b6044820152606401610573565b6112c28383836118cb565b816000036115c75760405162461bcd60e51b815260206004820152602260248201527f5769746864726177616c51756575654c69623a20494e56414c49445f414d4f55604482015261139560f21b6064820152608401610573565b8254600184015481810361161e576040805180820182528581526020808201868152600085815260028a01909252928120915182559151600191820155860180549161161283611e89565b91905055505050505050565b60006002860181611630600185611ea2565b81526020019081526020016000206001015490508084101561165457611654611fd6565b838110156116a3576040805180820182528681526020808201878152600086815260028b01909252928120915182559151600191820155870180549161169983611e89565b9190505550610bfd565b846002870160006116b5600186611ea2565b815260200190815260200160002060000160008282546116d59190611eb5565b9091555050505050505050565b6000806000841161172e5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610573565b60cd548411156117805760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610573565b600061178c8486611913565b845490915081036117a45760008092509250506113ab565b60018460010182815481106117bb576117bb611f16565b906000526020600020015492509250506113ab565b600054610100900460ff166117f75760405162461bcd60e51b815260040161057390611f74565b60366118038382612032565b5060376112c28282612032565b6001600160a01b0382166118665760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610573565b61187260008383611503565b80603560008282546118849190611eb5565b90915550506001600160a01b038216600081815260336020908152604080832080548601905551848152600080516020612107833981519152910160405180910390a35050565b6001600160a01b0383166118ea576118e2826119c0565b6112c26119ea565b6001600160a01b038216611901576118e2836119c0565b61190a836119c0565b6112c2826119c0565b815460009081036119265750600061052d565b82546000905b8082101561197357600061194083836119fa565b6000878152602090209091508590820154111561195f5780915061196d565b61196a816001611eb5565b92505b5061192c565b60008211801561199f57508361199c8661198e600186611ea2565b600091825260209091200190565b54145b156119b8576119af600183611ea2565b9250505061052d565b50905061052d565b6001600160a01b03811660009081526065602052604090206107fd906119e583610c05565b611a15565b6119f860666119e560355490565b565b6000611a0960028484186120f2565b61096090848416611eb5565b6000611a2060cd5490565b905080611a2c84611a60565b10156112c2578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b80546000908103611a7357506000919050565b81548290611a8390600190611ea2565b81548110611a9357611a93611f16565b90600052602060002001549050919050565b6000815180845260005b81811015611acb57602081850181015186830182015201611aaf565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006109606020830184611aa5565b6001600160a01b03811681146107fd57600080fd5b60008060408385031215611b2657600080fd5b8235611b3181611afe565b946020939093013593505050565b6000808284036080811215611b5357600080fd5b833592506060601f1982011215611b6957600080fd5b506020830190509250929050565b600080600060608486031215611b8c57600080fd5b8335611b9781611afe565b92506020840135611ba781611afe565b929592945050506040919091013590565b600060208284031215611bca57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611c0a57611c0a611bd1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611c3957611c39611bd1565b604052919050565b600080600080600060a08688031215611c5957600080fd5b8535611c6481611afe565b9450602086810135611c7581611afe565b9450604087810135611c8681611afe565b945060608801359350608088013567ffffffffffffffff80821115611caa57600080fd5b818a0191508a601f830112611cbe57600080fd5b813581811115611cd057611cd0611bd1565b611cde858260051b01611c10565b818152858101925060069190911b83018501908c821115611cfe57600080fd5b928501925b81841015611d475784848e031215611d1b5760008081fd5b611d23611be7565b8435611d2e81611afe565b8152848701358782015283529284019291850191611d03565b8096505050505050509295509295909350565b600060208284031215611d6c57600080fd5b813561096081611afe565b60008060408385031215611d8a57600080fd5b8235611d9581611afe565b91506020830135611da581611afe565b809150509250929050565b60008060008060608587031215611dc657600080fd5b843593506020850135611dd881611afe565b9250604085013567ffffffffffffffff80821115611df557600080fd5b818701915087601f830112611e0957600080fd5b813581811115611e1857600080fd5b886020828501011115611e2a57600080fd5b95989497505060200194505050565b600181811c90821680611e4d57607f821691505b602082108103611e6d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611e9b57611e9b611e73565b5060010190565b8181038181111561052d5761052d611e73565b8082018082111561052d5761052d611e73565b634e487b7160e01b600052601260045260246000fd5b600082611eed57611eed611ec8565b500690565b6001600160a01b038316815260406020820181905260009061145d90830184611aa5565b634e487b7160e01b600052603260045260246000fd5b60008085851115611f3c57600080fd5b83861115611f4957600080fd5b5050820193919092039150565b8035602083101561052d57600019602084900360031b1b1692915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081611fce57611fce611e73565b506000190190565b634e487b7160e01b600052600160045260246000fd5b601f8211156112c257600081815260208120601f850160051c810160208610156120135750805b601f850160051c820191505b81811015610bfd5782815560010161201f565b815167ffffffffffffffff81111561204c5761204c611bd1565b6120608161205a8454611e39565b84611fec565b602080601f831160018114612095576000841561207d5750858301515b600019600386901b1c1916600185901b178555610bfd565b600085815260208120601f198616915b828110156120c4578886015182559484019460019091019084016120a5565b50858210156120e25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008261210157612101611ec8565b50049056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220a7f49f3b74e4ac0e9fc814278d95b8601a69f04a86da95d921d3e639218e2b7264736f6c63430008130033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106102015760003560e01c806361cc276311610125578063c6b61e4c116100ad578063ea0fee4f1161007c578063ea0fee4f1461043d578063eacdc5ff14610445578063eeb499451461044e578063f3f4370314610461578063fd242c141461047457600080fd5b8063c6b61e4c146103c4578063ce513b6f1461040e578063dd62ed3e14610421578063e0563ab11461043457600080fd5b806395d89b41116100f457806395d89b411461037957806397e5230d14610381578063981b24d01461038b578063a457c2d71461039e578063a9059cbb146103b157600080fd5b806361cc276314610341578063626560031461035457806370a082311461035d578063947287cf1461037057600080fd5b8063313ce567116101a85780633fd50001116101775780633fd50001146102f65780634ee2cd7e1461030957806351351d531461031c57806355b01e4d1461032a5780635ea5df791461033857600080fd5b8063313ce567146102c357806339509351146102d25780633b878c22146102e55780633ccfd60b146102ee57600080fd5b806306fdde031461020657806307b3e25214610224578063095ea7b31461024a5780630f50287c1461026d57806318160ddd1461028257806323b872dd14610294578063284017f5146102a75780632e17de78146102b0575b600080fd5b61020e610487565b60405161021b9190611aeb565b60405180910390f35b6102326004600360981b0181565b6040516001600160a01b03909116815260200161021b565b61025d610258366004611b13565b610519565b604051901515815260200161021b565b61028061027b366004611b3f565b610533565b005b6035545b60405190815260200161021b565b61025d6102a2366004611b77565b6107c5565b61023261202081565b6102806102be366004611bb8565b6107e9565b6040516012815260200161021b565b61025d6102e0366004611b13565b610800565b61023261101081565b610280610822565b610286610304366004611bb8565b610933565b610286610317366004611b13565b610954565b6102326002600160a01b0381565b6102326004600160991b0181565b61028661138881565b61028061034f366004611c41565b610967565b61028660cc5481565b61028661036b366004611d5a565b610c05565b61028661520881565b61020e610c20565b610286620249f081565b610286610399366004611bb8565b610c2f565b61025d6103ac366004611b13565b610c3a565b61025d6103bf366004611b13565b610cb5565b6103f36103d2366004611bb8565b60ce6020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161021b565b61028661041c366004611d5a565b610cc3565b61028661042f366004611d77565b610cf1565b61023261203081565b610286600181565b61028660cd5481565b61028061045c366004611db0565b610d1c565b61028661046f366004611d5a565b610dee565b610286610482366004611bb8565b610e15565b60606036805461049690611e39565b80601f01602080910402602001604051908101604052809291908181526020018280546104c290611e39565b801561050f5780601f106104e45761010080835404028352916020019161050f565b820191906000526020600020905b8154815290600101906020018083116104f257829003601f168201915b5050505050905090565b600033610527818585610e5f565b60019150505b92915050565b336002600160a01b031461057c5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b60cd80546000918261058d83611e89565b9190505590508083146105d85760405162461bcd60e51b815260206004820152601360248201527215539156141150d5115117d15413d0d217d251606a1b6044820152606401610573565b81356020830135116106225760405162461bcd60e51b81526020600482015260136024820152721393d7d09313d0d2d4d7d0d3d3535255151151606a1b6044820152606401610573565b60cc5461063483356020850135611ea2565b61063f906001611eb5565b6106499190611ede565b156106a45760405162461bcd60e51b815260206004820152602560248201527f45504f43485f4d5553545f42455f444956495349424c455f42595f45504f43486044820152645f53495a4560d81b6064820152608401610573565b813560ce60006106b5600185611ea2565b81526020019081526020016000206001015460016106d39190611eb5565b146107165760405162461bcd60e51b8152602060048201526013602482015272494e56414c49445f53544152545f424c4f434b60681b6044820152606401610573565b600081815260ce60205260409020829061074782828135815560208201356001820155604082013560028201555050565b505060cf80546001810182556000919091526020838101357facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299092018290556040805190850135815284359186917f0ce8712c4dee4bd5a691f0bc1c39594671591e77395f8ebf6a3fb5f63fbea66a910160405180910390a4505050565b6000336107d3858285610f84565b6107de858585610ff8565b506001949350505050565b6107f3338261119c565b6107fd33826112c7565b50565b6000336105278185856108138383610cf1565b61081d9190611eb5565b610e5f565b33600090815260d06020526040812060cd549091908190610844908490611340565b808555604051828152919350915033907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a260c95460cb54604080517f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936020820152338183015260608082018790528251808303909101815260808201928390526316f1983160e01b9092526001600160a01b03938416936316f19831936108fc93911691608401611ef2565b600060405180830381600087803b15801561091657600080fd5b505af115801561092a573d6000803e3d6000fd5b50505050505050565b60cf818154811061094357600080fd5b600091825260209091200154905081565b600061096083836113b2565b9392505050565b600054610100900460ff16158080156109875750600054600160ff909116105b806109a15750303b1580156109a1575060005460ff166001145b610a045760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610573565b6000805460ff191660011790558015610a27576000805461ff0019166101001790555b6001600160a01b03861615801590610a4757506001600160a01b03851615155b8015610a5b57506001600160a01b03841615155b610a975760405162461bcd60e51b815260206004820152600d60248201526c1253959053125117d253941555609a1b6044820152606401610573565b610ae16040518060400160405280600c81526020016b15985b1a59185d1bdc94d95d60a21b815250604051806040016040528060048152602001631594d15560e21b8152506113fb565b60c980546001600160a01b038089166001600160a01b03199283161790925560ca805488841690831617905560cb80549287169290911691909117905560cc83905560005b8251811015610b7b57610b73838281518110610b4457610b44611f16565b602002602001015160000151848381518110610b6257610b62611f16565b602002602001015160200151611430565b600101610b26565b5060cf80546001818101835560009283527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299091019190915560cd558015610bfd576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6001600160a01b031660009081526033602052604090205490565b60606037805461049690611e39565b600061052d8261143a565b60003381610c488286610cf1565b905083811015610ca85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610573565b6107de8286868403610e5f565b600033610527818585610ff8565b60cd546001600160a01b038216600090815260d0602052604081209091610cea9190611340565b5092915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b60ca546001600160a01b031633148015610d43575060cb546001600160a01b038481169116145b610d805760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a2a72222a960911b6044820152606401610573565b7f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a69610daf602060008486611f2c565b610db891611f56565b03610de857600080610dcd8360208187611f2c565b810190610dda9190611b13565b91509150610bfd8282611430565b50505050565b60cd546001600160a01b038216600090815260d060205260408120909161052d9190611465565b600081815260ce60205260408120600101548015610e5657600083815260ce6020526040902054610e469082611ea2565b610e51906001611eb5565b610960565b60009392505050565b6001600160a01b038316610ec15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610573565b6001600160a01b038216610f225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610573565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610f908484610cf1565b90506000198114610de85781811015610feb5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610573565b610de88484848403610e5f565b6001600160a01b03831661105c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610573565b6001600160a01b0382166110be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610573565b6110c9838383611503565b6001600160a01b038316600090815260336020526040902054818110156111415760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610573565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591516000805160206121078339815191529061118f9086815260200190565b60405180910390a3610de8565b6001600160a01b0382166111fc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610573565b61120882600083611503565b6001600160a01b0382166000908152603360205260409020548181101561127c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610573565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192916000805160206121078339815191529101610f77565b505050565b6112f981600160cd546112da9190611eb5565b6001600160a01b038516600090815260d060205260409020919061156c565b816001600160a01b03167f655c1cd0236fb6dc4916f34c8ff10e3b18fcaea5b344dfc16c36fbb1bdfc5df28260405161133491815260200190565b60405180910390a25050565b81546000905b83600101548110156113ab5760008181526002850160209081526040918290208251808401909352805483526001015490820181905284101561138957506113ab565b80516113959084611eb5565b92505080806113a390611e89565b915050611346565b9250929050565b6001600160a01b0382166000908152606560205260408120819081906113d99085906116e2565b91509150816113f0576113eb85610c05565b6113f2565b805b95945050505050565b600054610100900460ff166114225760405162461bcd60e51b815260040161057390611f74565b61142c82826117d0565b5050565b61142c8282611810565b600080600061144a8460666116e2565b915091508161145b5760355461145d565b805b949350505050565b600182015460009080820361147e57600091505061052d565b600061148b600183611ea2565b90505b845481106114fb5760008181526002860160209081526040918290208251808401909352805483526001015490820181905285106114cc57506114fb565b80516114d89085611eb5565b9350816000036114e857506114fb565b50806114f381611fbf565b91505061148e565b505092915050565b6001600160a01b038316158061152057506001600160a01b038216155b6115615760405162461bcd60e51b81526020600482015260126024820152712a2920a729a322a92fa327a92124a22222a760711b6044820152606401610573565b6112c28383836118cb565b816000036115c75760405162461bcd60e51b815260206004820152602260248201527f5769746864726177616c51756575654c69623a20494e56414c49445f414d4f55604482015261139560f21b6064820152608401610573565b8254600184015481810361161e576040805180820182528581526020808201868152600085815260028a01909252928120915182559151600191820155860180549161161283611e89565b91905055505050505050565b60006002860181611630600185611ea2565b81526020019081526020016000206001015490508084101561165457611654611fd6565b838110156116a3576040805180820182528681526020808201878152600086815260028b01909252928120915182559151600191820155870180549161169983611e89565b9190505550610bfd565b846002870160006116b5600186611ea2565b815260200190815260200160002060000160008282546116d59190611eb5565b9091555050505050505050565b6000806000841161172e5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b6044820152606401610573565b60cd548411156117805760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e742069640000006044820152606401610573565b600061178c8486611913565b845490915081036117a45760008092509250506113ab565b60018460010182815481106117bb576117bb611f16565b906000526020600020015492509250506113ab565b600054610100900460ff166117f75760405162461bcd60e51b815260040161057390611f74565b60366118038382612032565b5060376112c28282612032565b6001600160a01b0382166118665760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610573565b61187260008383611503565b80603560008282546118849190611eb5565b90915550506001600160a01b038216600081815260336020908152604080832080548601905551848152600080516020612107833981519152910160405180910390a35050565b6001600160a01b0383166118ea576118e2826119c0565b6112c26119ea565b6001600160a01b038216611901576118e2836119c0565b61190a836119c0565b6112c2826119c0565b815460009081036119265750600061052d565b82546000905b8082101561197357600061194083836119fa565b6000878152602090209091508590820154111561195f5780915061196d565b61196a816001611eb5565b92505b5061192c565b60008211801561199f57508361199c8661198e600186611ea2565b600091825260209091200190565b54145b156119b8576119af600183611ea2565b9250505061052d565b50905061052d565b6001600160a01b03811660009081526065602052604090206107fd906119e583610c05565b611a15565b6119f860666119e560355490565b565b6000611a0960028484186120f2565b61096090848416611eb5565b6000611a2060cd5490565b905080611a2c84611a60565b10156112c2578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b80546000908103611a7357506000919050565b81548290611a8390600190611ea2565b81548110611a9357611a93611f16565b90600052602060002001549050919050565b6000815180845260005b81811015611acb57602081850181015186830182015201611aaf565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006109606020830184611aa5565b6001600160a01b03811681146107fd57600080fd5b60008060408385031215611b2657600080fd5b8235611b3181611afe565b946020939093013593505050565b6000808284036080811215611b5357600080fd5b833592506060601f1982011215611b6957600080fd5b506020830190509250929050565b600080600060608486031215611b8c57600080fd5b8335611b9781611afe565b92506020840135611ba781611afe565b929592945050506040919091013590565b600060208284031215611bca57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611c0a57611c0a611bd1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611c3957611c39611bd1565b604052919050565b600080600080600060a08688031215611c5957600080fd5b8535611c6481611afe565b9450602086810135611c7581611afe565b9450604087810135611c8681611afe565b945060608801359350608088013567ffffffffffffffff80821115611caa57600080fd5b818a0191508a601f830112611cbe57600080fd5b813581811115611cd057611cd0611bd1565b611cde858260051b01611c10565b818152858101925060069190911b83018501908c821115611cfe57600080fd5b928501925b81841015611d475784848e031215611d1b5760008081fd5b611d23611be7565b8435611d2e81611afe565b8152848701358782015283529284019291850191611d03565b8096505050505050509295509295909350565b600060208284031215611d6c57600080fd5b813561096081611afe565b60008060408385031215611d8a57600080fd5b8235611d9581611afe565b91506020830135611da581611afe565b809150509250929050565b60008060008060608587031215611dc657600080fd5b843593506020850135611dd881611afe565b9250604085013567ffffffffffffffff80821115611df557600080fd5b818701915087601f830112611e0957600080fd5b813581811115611e1857600080fd5b886020828501011115611e2a57600080fd5b95989497505060200194505050565b600181811c90821680611e4d57607f821691505b602082108103611e6d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611e9b57611e9b611e73565b5060010190565b8181038181111561052d5761052d611e73565b8082018082111561052d5761052d611e73565b634e487b7160e01b600052601260045260246000fd5b600082611eed57611eed611ec8565b500690565b6001600160a01b038316815260406020820181905260009061145d90830184611aa5565b634e487b7160e01b600052603260045260246000fd5b60008085851115611f3c57600080fd5b83861115611f4957600080fd5b5050820193919092039150565b8035602083101561052d57600019602084900360031b1b1692915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081611fce57611fce611e73565b506000190190565b634e487b7160e01b600052600160045260246000fd5b601f8211156112c257600081815260208120601f850160051c810160208610156120135750805b601f850160051c820191505b81811015610bfd5782815560010161201f565b815167ffffffffffffffff81111561204c5761204c611bd1565b6120608161205a8454611e39565b84611fec565b602080601f831160018114612095576000841561207d5750858301515b600019600386901b1c1916600185901b178555610bfd565b600085815260208120601f198616915b828110156120c4578886015182559484019460019091019084016120a5565b50858210156120e25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008261210157612101611ec8565b50049056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220a7f49f3b74e4ac0e9fc814278d95b8601a69f04a86da95d921d3e639218e2b7264736f6c63430008130033","linkReferences":{},"deployedLinkReferences":{}}` diff --git a/consensus/polybft/polybft_config.go b/consensus/polybft/polybft_config.go index a78d109e2c..f85873e3ab 100644 --- a/consensus/polybft/polybft_config.go +++ b/consensus/polybft/polybft_config.go @@ -2,7 +2,11 @@ package polybft import ( "encoding/json" + "errors" + "math" "math/big" + "strconv" + "strings" "github.com/0xPolygon/polygon-edge/chain" "github.com/0xPolygon/polygon-edge/consensus/polybft/validator" @@ -10,7 +14,27 @@ import ( "github.com/0xPolygon/polygon-edge/types" ) -const ConsensusName = "polybft" +const ( + ConsensusName = "polybft" + minNativeTokenParamsNumber = 4 + + defaultNativeTokenName = "Polygon" + defaultNativeTokenSymbol = "MATIC" + defaultNativeTokenDecimals = uint8(18) +) + +var ( + DefaultTokenConfig = &TokenConfig{ + Name: defaultNativeTokenName, + Symbol: defaultNativeTokenSymbol, + Decimals: defaultNativeTokenDecimals, + IsMintable: false, + Owner: types.ZeroAddress, + } + + errInvalidTokenParams = errors.New("native token params were not submitted in proper format " + + "()") +) // PolyBFTConfig is the configuration file for the Polybft consensus protocol. type PolyBFTConfig struct { @@ -182,6 +206,60 @@ type TokenConfig struct { Owner types.Address `json:"owner"` } +func ParseRawTokenConfig(rawConfig string) (*TokenConfig, error) { + if rawConfig == "" { + return DefaultTokenConfig, nil + } + + params := strings.Split(rawConfig, ":") + if len(params) < minNativeTokenParamsNumber { + return nil, errInvalidTokenParams + } + + // name + name := strings.TrimSpace(params[0]) + if name == "" { + return nil, errInvalidTokenParams + } + + // symbol + symbol := strings.TrimSpace(params[1]) + if symbol == "" { + return nil, errInvalidTokenParams + } + + // decimals + decimals, err := strconv.ParseUint(strings.TrimSpace(params[2]), 10, 8) + if err != nil || decimals > math.MaxUint8 { + return nil, errInvalidTokenParams + } + + // is mintable native token used + isMintable, err := strconv.ParseBool(strings.TrimSpace(params[3])) + if err != nil { + return nil, errInvalidTokenParams + } + + // in case it is mintable native token, it is expected to have 5 parameters provided + if isMintable && len(params) != minNativeTokenParamsNumber+1 { + return nil, errInvalidTokenParams + } + + // owner address + owner := types.ZeroAddress + if isMintable { + owner = types.StringToAddress(strings.TrimSpace(params[4])) + } + + return &TokenConfig{ + Name: name, + Symbol: symbol, + Decimals: uint8(decimals), + IsMintable: isMintable, + Owner: owner, + }, nil +} + type RewardsConfig struct { // TokenAddress is the address of reward token on child chain TokenAddress types.Address diff --git a/consensus/polybft/sc_integration_test.go b/consensus/polybft/sc_integration_test.go index c352853cbe..24ed181235 100644 --- a/consensus/polybft/sc_integration_test.go +++ b/consensus/polybft/sc_integration_test.go @@ -93,7 +93,7 @@ func TestIntegration_PerformExit(t *testing.T) { NewExitHelper: exitHelperContractAddress, NewChildERC20Predicate: contracts.ChildERC20PredicateContract, NewChildTokenTemplate: contracts.ChildERC20Contract, - NativeTokenRootAddress: contracts.NativeERC20TokenContract, + NewNativeTokenRoot: contracts.NativeERC20TokenContract, }).EncodeAbi() } rootERC20PredicateAddr := deployAndInitContract(t, transition, contractsapi.RootERC20Predicate.Bytecode, deployerAddress, rootERC20PredicateInit) diff --git a/core-contracts b/core-contracts index 7393eef151..813c1b811d 160000 --- a/core-contracts +++ b/core-contracts @@ -1 +1 @@ -Subproject commit 7393eef151150177fb3bec8101071a0e87a19f19 +Subproject commit 813c1b811d3cd5e7d52fa85bc7d4ce9f77d8227a diff --git a/docker/local/polygon-edge.sh b/docker/local/polygon-edge.sh index fbd8803489..76b11566a5 100755 --- a/docker/local/polygon-edge.sh +++ b/docker/local/polygon-edge.sh @@ -122,7 +122,6 @@ case "$1" in "$POLYGON_EDGE_BIN" polybft supernet \ --private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \ --supernet-manager ${customSupernetManagerAddr} \ - --stake-manager ${stakeManagerAddr} \ --finalize-genesis-set \ --enable-staking \ --genesis /data/genesis.json \ diff --git a/e2e-polybft/e2e/bridge_test.go b/e2e-polybft/e2e/bridge_test.go index 2ea8d0dc8d..dc6a970572 100644 --- a/e2e-polybft/e2e/bridge_test.go +++ b/e2e-polybft/e2e/bridge_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" "github.com/umbracle/ethgo" - ethgow "github.com/umbracle/ethgo/wallet" + "github.com/umbracle/ethgo/wallet" "github.com/0xPolygon/polygon-edge/command" "github.com/0xPolygon/polygon-edge/command/bridge/common" @@ -50,7 +50,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) { receiverKeys := make([]string, transfersCount) for i := 0; i < transfersCount; i++ { - key, err := ethgow.GenerateKey() + key, err := wallet.GenerateKey() require.NoError(t, err) rawKey, err := key.MarshallPrivateKey() @@ -65,6 +65,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) { } cluster := framework.NewTestCluster(t, 5, + framework.WithTestRewardToken(), framework.WithNumBlockConfirmations(numBlockConfirmations), framework.WithEpochSize(epochSize)) defer cluster.Stop() @@ -112,7 +113,9 @@ func TestE2E_Bridge_Transfers(t *testing.T) { // check validator balance got increased by deposited amount balance, err := childEthEndpoint.GetBalance(ethgo.Address(senderAccount.Address()), ethgo.Latest) require.NoError(t, err) - require.Equal(t, tokensToDeposit, balance) + // because we premined validators + expectedBalance := new(big.Int).Add(tokensToDeposit, command.DefaultPremineBalance) + require.Equal(t, expectedBalance, balance) t.Run("bridge ERC 20 tokens", func(t *testing.T) { // DEPOSIT ERC20 TOKENS @@ -464,7 +467,7 @@ func TestE2E_Bridge_ERC721Transfer(t *testing.T) { stateSyncedLogsCount = 2 ) - minter, err := ethgow.GenerateKey() + minter, err := wallet.GenerateKey() require.NoError(t, err) receiverKeys := make([]string, transfersCount) @@ -473,7 +476,7 @@ func TestE2E_Bridge_ERC721Transfer(t *testing.T) { tokenIDs := make([]string, transfersCount) for i := 0; i < transfersCount; i++ { - key, err := ethgow.GenerateKey() + key, err := wallet.GenerateKey() require.NoError(t, err) rawKey, err := key.MarshallPrivateKey() @@ -626,7 +629,7 @@ func TestE2E_Bridge_ERC1155Transfer(t *testing.T) { stateSyncedLogsCount = 2 ) - minter, err := ethgow.GenerateKey() + minter, err := wallet.GenerateKey() require.NoError(t, err) receiverKeys := make([]string, transfersCount) @@ -636,7 +639,7 @@ func TestE2E_Bridge_ERC1155Transfer(t *testing.T) { tokenIDs := make([]string, transfersCount) for i := 0; i < transfersCount; i++ { - key, err := ethgow.GenerateKey() + key, err := wallet.GenerateKey() require.NoError(t, err) rawKey, err := key.MarshallPrivateKey() @@ -830,13 +833,13 @@ func TestE2E_Bridge_ChildChainMintableTokensTransfer(t *testing.T) { funds := make([]*big.Int, transfersCount) singleToken := ethgo.Ether(1) - admin, err := ethgow.GenerateKey() + admin, err := wallet.GenerateKey() require.NoError(t, err) adminAddr := types.Address(admin.Address()) for i := uint64(0); i < transfersCount; i++ { - key, err := ethgow.GenerateKey() + key, err := wallet.GenerateKey() require.NoError(t, err) rawKey, err := key.MarshallPrivateKey() @@ -1152,7 +1155,7 @@ func TestE2E_Bridge_ChildChainMintableTokensTransfer(t *testing.T) { func TestE2E_CheckpointSubmission(t *testing.T) { // spin up a cluster with epoch size set to 5 blocks - cluster := framework.NewTestCluster(t, 5, framework.WithEpochSize(5)) + cluster := framework.NewTestCluster(t, 5, framework.WithEpochSize(5), framework.WithTestRewardToken()) defer cluster.Stop() // initialize tx relayer used to query CheckpointManager smart contract @@ -1206,9 +1209,15 @@ func TestE2E_Bridge_ChangeVotingPower(t *testing.T) { epochSize = 5 ) + minter, err := wallet.GenerateKey() + require.NoError(t, err) + cluster := framework.NewTestCluster(t, 5, framework.WithEpochSize(epochSize), - framework.WithEpochReward(1000000)) + framework.WithEpochReward(1000000), + framework.WithNativeTokenConfig(fmt.Sprintf(nativeTokenMintableTestCfg, minter.Address())), + framework.WithPremine(types.Address(minter.Address())), + ) defer cluster.Stop() // load polybft config @@ -1329,12 +1338,13 @@ func TestE2E_Bridge_Transfers_AccessLists(t *testing.T) { depositAmounts := make([]string, transfersCount) withdrawAmounts := make([]string, transfersCount) - admin, _ := ethgow.GenerateKey() + admin, _ := wallet.GenerateKey() adminAddr := types.Address(admin.Address()) cluster := framework.NewTestCluster(t, 5, framework.WithNumBlockConfirmations(0), framework.WithEpochSize(epochSize), + framework.WithTestRewardToken(), framework.WithBridgeAllowListAdmin(adminAddr), framework.WithBridgeBlockListAdmin(adminAddr), framework.WithSecretsCallback(func(a []types.Address, tcc *framework.TestClusterConfig) { @@ -1429,10 +1439,13 @@ func TestE2E_Bridge_Transfers_AccessLists(t *testing.T) { checkStateSyncResultLogs(t, logs, totalTransfers) // check receivers balances got increased by deposited amount + // because we premined validators + expectedBalance := new(big.Int).Add(command.DefaultPremineBalance, depositAmount) + for _, receiver := range receivers { balance, err := childEthEndpoint.GetBalance(ethgo.Address(types.StringToAddress(receiver)), ethgo.Latest) require.NoError(t, err) - require.Equal(t, depositAmount, balance) + require.Equal(t, expectedBalance, balance) } t.Log("Deposits were successfully processed") @@ -1546,6 +1559,7 @@ func TestE2E_Bridge_Transfers_WithRootTrackerPollInterval(t *testing.T) { framework.WithEpochSize(epochSize), framework.WithNumBlockConfirmations(numBlockConfirmations), framework.WithRootTrackerPollInterval(rootPollInterval), + framework.WithTestRewardToken(), ) defer cluster.Stop() @@ -1599,5 +1613,228 @@ func TestE2E_Bridge_Transfers_WithRootTrackerPollInterval(t *testing.T) { // check validator balance got increased by deposited amount balance, err := childEthEndpoint.GetBalance(ethgo.Address(senderAccount.Address()), ethgo.Latest) require.NoError(t, err) - require.Equal(t, tokensToDeposit, balance) + + // because we premined the validators + expectedBalance := new(big.Int).Add(command.DefaultPremineBalance, tokensToDeposit) + require.Equal(t, expectedBalance, balance) +} + +func TestE2E_Bridge_NonMintableERC20Token_WithPremine(t *testing.T) { + var ( + numBlockConfirmations = uint64(2) + epochSize = 10 + sprintSize = uint64(5) + numberOfAttempts = uint64(4) + stateSyncedLogsCount = 2 + exitEventsCount = uint64(2) + tokensToTransfer = ethgo.Gwei(10) + bigZero = big.NewInt(0) + ) + + nonValidatorKey, err := wallet.GenerateKey() + require.NoError(t, err) + + nonValidatorKeyRaw, err := nonValidatorKey.MarshallPrivateKey() + require.NoError(t, err) + + // start cluster with default, non-mintable native erc20 root token + // with london fork enabled + cluster := framework.NewTestCluster(t, 5, + framework.WithEpochSize(epochSize), + framework.WithNumBlockConfirmations(numBlockConfirmations), + // this enables London (EIP-1559) fork + framework.WithBurnContract(&polybft.BurnContractInfo{ + BlockNumber: 0, + Address: types.StringToAddress("0xBurnContractAddress")}), + framework.WithTestRewardToken(), + framework.WithSecretsCallback(func(_ []types.Address, tcc *framework.TestClusterConfig) { + nonValidatorKeyString := hex.EncodeToString(nonValidatorKeyRaw) + + // do premine to a non validator address + tcc.Premine = append(tcc.Premine, + fmt.Sprintf("%s:%s:%s", + nonValidatorKey.Address(), + command.DefaultPremineBalance.String(), + nonValidatorKeyString)) + }), + ) + + rootchainTxRelayer, err := txrelayer.NewTxRelayer(txrelayer.WithIPAddress(cluster.Bridge.JSONRPCAddr())) + require.NoError(t, err) + + childEthEndpoint := cluster.Servers[0].JSONRPC().Eth() + + defer cluster.Stop() + + cluster.WaitForReady(t) + + polybftCfg, err := polybft.LoadPolyBFTConfig(path.Join(cluster.Config.TmpDir, chainConfigFileName)) + require.NoError(t, err) + + checkBalancesFn := func(address types.Address, rootExpected, childExpected *big.Int) { + t.Log("Checking balance of native ERC20 token on root and child", "Address", address, + "Root expected", rootExpected, "Child Expected", childExpected) + + balance := erc20BalanceOf(t, address, + polybftCfg.Bridge.RootNativeERC20Addr, rootchainTxRelayer) + t.Log("Balance of native ERC20 token on root", balance, "Address", address) + require.Equal(t, rootExpected, balance) + + balance, err = childEthEndpoint.GetBalance(ethgo.Address(address), ethgo.Latest) + require.NoError(t, err) + t.Log("Balance of native ERC20 token on child", balance, "Address", address) + require.True(t, balance.Cmp(childExpected) >= 0) // because of London fork + } + + t.Run("check the balances at the beginning", func(t *testing.T) { + // check the balances on root and child at the beginning to see if they are as expected + checkBalancesFn(types.Address(nonValidatorKey.Address()), bigZero, command.DefaultPremineBalance) + + for _, server := range cluster.Servers { + validatorAccount, err := sidechain.GetAccountFromDir(server.DataDir()) + require.NoError(t, err) + + checkBalancesFn(validatorAccount.Address(), bigZero, command.DefaultPremineBalance) + } + }) + + // this test case will check first if they can withdraw some of the premined amount of non-mintable token + t.Run("Do a withdraw for premined validator address and premined non-validator address", func(t *testing.T) { + validatorSrv := cluster.Servers[1] + validatorAcc, err := sidechain.GetAccountFromDir(validatorSrv.DataDir()) + require.NoError(t, err) + + validatorRawKey, err := validatorAcc.Ecdsa.MarshallPrivateKey() + require.NoError(t, err) + + err = cluster.Bridge.Withdraw( + common.ERC20, + hex.EncodeToString(validatorRawKey), + validatorAcc.Address().String(), + tokensToTransfer.String(), + "", + validatorSrv.JSONRPCAddr(), + contracts.ChildERC20PredicateContract, + contracts.NativeERC20TokenContract, + false) + require.NoError(t, err) + + validatorBalanceAfterWithdraw, err := childEthEndpoint.GetBalance( + ethgo.Address(validatorAcc.Address()), ethgo.Latest) + require.NoError(t, err) + + err = cluster.Bridge.Withdraw( + common.ERC20, + hex.EncodeToString(nonValidatorKeyRaw), + nonValidatorKey.Address().String(), + tokensToTransfer.String(), + "", + validatorSrv.JSONRPCAddr(), + contracts.ChildERC20PredicateContract, + contracts.NativeERC20TokenContract, + false) + require.NoError(t, err) + + nonValidatorBalanceAfterWithdraw, err := childEthEndpoint.GetBalance( + nonValidatorKey.Address(), ethgo.Latest) + require.NoError(t, err) + + currentBlock, err := childEthEndpoint.GetBlockByNumber(ethgo.Latest, false) + require.NoError(t, err) + + currentExtra, err := polybft.GetIbftExtra(currentBlock.ExtraData) + require.NoError(t, err) + + t.Logf("Latest block number: %d, epoch number: %d\n", currentBlock.Number, currentExtra.Checkpoint.EpochNumber) + + currentEpoch := currentExtra.Checkpoint.EpochNumber + + exitHelper := polybftCfg.Bridge.ExitHelperAddr + childJSONRPC := validatorSrv.JSONRPCAddr() + + successfulExitTransactions := make([]bool, exitEventsCount) + + for i := uint64(0); i < numberOfAttempts; i++ { + t.Log("Number of attempts: ", i+1) + + require.NoError(t, waitForRootchainEpoch(currentEpoch+i, 3*time.Minute, + rootchainTxRelayer, polybftCfg.Bridge.CheckpointManagerAddr)) + + for exitEventID := uint64(1); exitEventID <= exitEventsCount; exitEventID++ { + if successfulExitTransactions[exitEventID-1] { + continue + } + + // send exit transaction to exit helper + if err = cluster.Bridge.SendExitTransaction(exitHelper, exitEventID, childJSONRPC); err == nil { + successfulExitTransactions[exitEventID-1] = true + + continue + } + + if i == numberOfAttempts-1 { + require.NoError(t, err) + } + } + + allExitsSuccessfull := true + for _, isSuccessfull := range successfulExitTransactions { + if !isSuccessfull { + allExitsSuccessfull = false + + break + } + } + + if allExitsSuccessfull { + break + } + } + + // assert that receiver's balances on RootERC20 smart contract are expected + checkBalancesFn(validatorAcc.Address(), tokensToTransfer, validatorBalanceAfterWithdraw) + checkBalancesFn(types.Address(nonValidatorKey.Address()), tokensToTransfer, nonValidatorBalanceAfterWithdraw) + }) + + t.Run("Do a deposit to some validator and non-validator address", func(t *testing.T) { + validatorSrv := cluster.Servers[4] + validatorAcc, err := sidechain.GetAccountFromDir(validatorSrv.DataDir()) + require.NoError(t, err) + + require.NoError(t, cluster.Bridge.Deposit( + common.ERC20, + polybftCfg.Bridge.RootNativeERC20Addr, + polybftCfg.Bridge.RootERC20PredicateAddr, + rootHelper.TestAccountPrivKey, + strings.Join([]string{validatorAcc.Address().String(), nonValidatorKey.Address().String()}, ","), + strings.Join([]string{tokensToTransfer.String(), tokensToTransfer.String()}, ","), + "", + cluster.Bridge.JSONRPCAddr(), + rootHelper.TestAccountPrivKey, + false), + ) + + currentBlock, err := childEthEndpoint.GetBlockByNumber(ethgo.Latest, false) + require.NoError(t, err) + + // wait for a couple of sprints + finalBlockNum := currentBlock.Number + 5*sprintSize + + // the transaction is processed and there should be a success event + var stateSyncedResult contractsapi.StateSyncResultEvent + + for i := uint64(0); i < numberOfAttempts; i++ { + logs, err := getFilteredLogs(stateSyncedResult.Sig(), 0, finalBlockNum+i*sprintSize, childEthEndpoint) + require.NoError(t, err) + + if len(logs) == stateSyncedLogsCount || i == numberOfAttempts-1 { + // assert that all deposits are executed successfully + checkStateSyncResultLogs(t, logs, stateSyncedLogsCount) + + break + } + + require.NoError(t, cluster.WaitForBlock(finalBlockNum+(i+1)*sprintSize, 2*time.Minute)) + } + }) } diff --git a/e2e-polybft/e2e/burn_contract_test.go b/e2e-polybft/e2e/burn_contract_test.go index 9a592397ea..a95e101eaf 100644 --- a/e2e-polybft/e2e/burn_contract_test.go +++ b/e2e-polybft/e2e/burn_contract_test.go @@ -20,6 +20,7 @@ func TestE2E_BurnContract_Deployed(t *testing.T) { destinationAddr := types.Address(destinationKey.Address()) cluster := framework.NewTestCluster(t, 5, + framework.WithTestRewardToken(), framework.WithBurnContract(&polybft.BurnContractInfo{ Address: contractAddr, DestinationAddress: destinationAddr, diff --git a/e2e-polybft/e2e/consensus_test.go b/e2e-polybft/e2e/consensus_test.go index b65d5d0928..67248c113e 100644 --- a/e2e-polybft/e2e/consensus_test.go +++ b/e2e-polybft/e2e/consensus_test.go @@ -29,10 +29,16 @@ import ( var uint256ABIType = abi.MustNewType("tuple(uint256)") func TestE2E_Consensus_Basic_WithNonValidators(t *testing.T) { - const epochSize = 4 + const ( + epochSize = 4 + validatorsNum = 5 + ) - cluster := framework.NewTestCluster(t, 5, - framework.WithEpochSize(epochSize), framework.WithNonValidators(2)) + cluster := framework.NewTestCluster(t, validatorsNum, + framework.WithEpochSize(epochSize), + framework.WithNonValidators(2), + framework.WithTestRewardToken(), + ) defer cluster.Stop() cluster.WaitForReady(t) @@ -41,8 +47,8 @@ func TestE2E_Consensus_Basic_WithNonValidators(t *testing.T) { relayer, err := txrelayer.NewTxRelayer(txrelayer.WithClient(cluster.Servers[0].JSONRPC())) require.NoError(t, err) - // because we are using native token as reward wallet, and it has default premine balance - initialTotalSupply := new(big.Int).Set(command.DefaultPremineBalance) + // because we are pre-mining native tokens to validators + initialTotalSupply := new(big.Int).Mul(big.NewInt(validatorsNum), command.DefaultPremineBalance) // check if initial total supply of native ERC20 token is the same as expected totalSupply := queryNativeERC20Metadata(t, "totalSupply", uint256ABIType, relayer) @@ -100,7 +106,9 @@ func TestE2E_Consensus_BulkDrop(t *testing.T) { cluster := framework.NewTestCluster(t, clusterSize, framework.WithEpochSize(epochSize), - framework.WithBlockTime(time.Second)) + framework.WithBlockTime(time.Second), + framework.WithTestRewardToken(), + ) defer cluster.Stop() // wait for cluster to start @@ -595,18 +603,6 @@ func TestE2E_Consensus_CustomRewardToken(t *testing.T) { cluster.WaitForReady(t) - // initialize tx relayer - relayer, err := txrelayer.NewTxRelayer(txrelayer.WithClient(cluster.Servers[0].JSONRPC())) - require.NoError(t, err) - - // because we are not using native token as reward wallet, and have no premine - // initial token supply should be 0 - initialTotalSupply := big.NewInt(0) - - // check if initial total supply of native ERC20 token is the same as expected - totalSupply := queryNativeERC20Metadata(t, "totalSupply", uint256ABIType, relayer) - require.True(t, initialTotalSupply.Cmp(totalSupply.(*big.Int)) == 0) //nolint:forcetypeassert - // wait for couple of epochs to accumulate some rewards require.NoError(t, cluster.WaitForBlock(epochSize*3, 3*time.Minute)) diff --git a/e2e-polybft/e2e/migration_test.go b/e2e-polybft/e2e/migration_test.go index 04eae9cb40..f3a931e9d4 100644 --- a/e2e-polybft/e2e/migration_test.go +++ b/e2e-polybft/e2e/migration_test.go @@ -149,6 +149,7 @@ func TestE2E_Migration(t *testing.T) { cluster := frameworkpolybft.NewTestCluster(t, 7, frameworkpolybft.WithNonValidators(2), frameworkpolybft.WithValidatorSnapshot(5), + frameworkpolybft.WithTestRewardToken(), frameworkpolybft.WithGenesisState(tmpDir, types.Hash(stateRoot)), ) defer cluster.Stop() diff --git a/e2e-polybft/e2e/network_test.go b/e2e-polybft/e2e/network_test.go index c04a1320c1..7129244d70 100644 --- a/e2e-polybft/e2e/network_test.go +++ b/e2e-polybft/e2e/network_test.go @@ -21,6 +21,7 @@ func TestE2E_NetworkDiscoveryProtocol(t *testing.T) { // create cluster cluster := framework.NewTestCluster(t, validatorCount, + framework.WithTestRewardToken(), framework.WithNonValidators(nonValidatorCount), framework.WithBootnodeCount(1)) defer cluster.Stop() diff --git a/e2e-polybft/framework/test-bridge.go b/e2e-polybft/framework/test-bridge.go index 3d09749557..725ff6ecec 100644 --- a/e2e-polybft/framework/test-bridge.go +++ b/e2e-polybft/framework/test-bridge.go @@ -16,6 +16,7 @@ import ( "github.com/0xPolygon/polygon-edge/command" bridgeCommon "github.com/0xPolygon/polygon-edge/command/bridge/common" "github.com/0xPolygon/polygon-edge/command/genesis" + cmdHelper "github.com/0xPolygon/polygon-edge/command/helper" "github.com/0xPolygon/polygon-edge/command/polybftsecrets" rootHelper "github.com/0xPolygon/polygon-edge/command/rootchain/helper" "github.com/0xPolygon/polygon-edge/command/rootchain/server" @@ -328,13 +329,14 @@ func (t *TestBridge) deployRootchainContracts(genesisPath string) error { return nil } -// fundRootchainValidators sends predefined amount of tokens to rootchain validators -func (t *TestBridge) fundRootchainValidators(polybftConfig polybft.PolyBFTConfig) error { +// fundAddressesOnRoot sends predefined amount of tokens to rootchain addresses +func (t *TestBridge) fundAddressesOnRoot(tokenConfig *polybft.TokenConfig, polybftConfig polybft.PolyBFTConfig) error { validatorSecrets, err := genesis.GetValidatorKeyFiles(t.clusterConfig.TmpDir, t.clusterConfig.ValidatorPrefix) if err != nil { return fmt.Errorf("could not get validator secrets on initial rootchain funding of genesis validators: %w", err) } + // first fund validators balances := make([]*big.Int, len(polybftConfig.InitialValidatorSet)) secrets := make([]string, len(validatorSecrets)) @@ -348,6 +350,33 @@ func (t *TestBridge) fundRootchainValidators(polybftConfig polybft.PolyBFTConfig return fmt.Errorf("failed to fund validators on the rootchain: %w", err) } + // then fund all other addresses if token is non-mintable + // so that they can do premine on SupernetMAnager + if tokenConfig.IsMintable || len(t.clusterConfig.Premine) == 0 { + return nil + } + + // non-validator addresses don't need to mint stake token, + // they only need to be funded with root token + args := []string{ + "rootchain", + "fund", + } + + for _, premineRaw := range t.clusterConfig.Premine { + premineInfo, err := cmdHelper.ParsePremineInfo(premineRaw) + if err != nil { + return err + } + + args = append(args, "--addresses", premineInfo.Address.String()) + args = append(args, "--amounts", command.DefaultPremineBalance.String()) // this is more than enough tokens + } + + if err := t.cmdRun(args...); err != nil { + return fmt.Errorf("failed to fund non-validator addresses on root: %w", err) + } + return nil } @@ -467,7 +496,6 @@ func (t *TestBridge) finalizeGenesis(genesisPath string, polybftConfig polybft.P "--private-key", rootHelper.TestAccountPrivKey, "--genesis", genesisPath, "--supernet-manager", polybftConfig.Bridge.CustomSupernetManagerAddr.String(), - "--stake-manager", polybftConfig.Bridge.StakeManagerAddr.String(), "--finalize-genesis-set", "--enable-staking", } @@ -530,3 +558,123 @@ func (t *TestBridge) deployStakeManager(genesisPath string) error { return nil } + +func (t *TestBridge) mintNativeRootToken(validatorAddresses []types.Address, tokenConfig *polybft.TokenConfig, + polybftConfig polybft.PolyBFTConfig) error { + if tokenConfig.IsMintable { + // if token is mintable, it is premined in genesis command, + // so we just return here + return nil + } + + // if token is non-mintable, then to do premine we first need to mint those tokens + // to validators and other provided addresses + args := []string{ + "bridge", + "mint-erc20", + "--jsonrpc", t.JSONRPCAddr(), + "--erc20-token", polybftConfig.Bridge.RootNativeERC20Addr.String(), + } + + // mint something for every validator + for _, addr := range validatorAddresses { + args = append(args, "--addresses", addr.String()) + args = append(args, "--amounts", command.DefaultPremineBalance.String()) + } + + // mint something to others as well + for _, premineRaw := range t.clusterConfig.Premine { + premineInfo, err := cmdHelper.ParsePremineInfo(premineRaw) + if err != nil { + return err + } + + args = append(args, "--addresses", premineInfo.Address.String()) + args = append(args, "--amounts", premineInfo.Amount.String()) + } + + return t.cmdRun(args...) +} + +func (t *TestBridge) premineNativeRootToken(tokenConfig *polybft.TokenConfig, + polybftConfig polybft.PolyBFTConfig) error { + if tokenConfig.IsMintable { + // if token is mintable, it is premined in genesis command, + // so we just return here + return nil + } + + validatorSecrets, err := genesis.GetValidatorKeyFiles(t.clusterConfig.TmpDir, t.clusterConfig.ValidatorPrefix) + if err != nil { + return fmt.Errorf("could not get validator secrets on premining native root"+ + " token for genesis validators: %w", err) + } + + premineCmdArgs := func(secret, key string, amount *big.Int) error { + args := []string{ + "rootchain", + "premine", + "--jsonrpc", t.JSONRPCAddr(), + "--supernet-manager", polybftConfig.Bridge.CustomSupernetManagerAddr.String(), + "--amount", amount.String(), + "--erc20-token", polybftConfig.Bridge.RootNativeERC20Addr.String(), + "--root-erc20-predicate", polybftConfig.Bridge.RootERC20PredicateAddr.String(), + } + + if secret != "" { + args = append(args, "--"+polybftsecrets.AccountDirFlag, path.Join(t.clusterConfig.TmpDir, secret)) + } else { + args = append(args, "--private-key", key) + } + + return t.cmdRun(args...) + } + + g, ctx := errgroup.WithContext(context.Background()) + + // premine validators + for _, secret := range validatorSecrets { + secret := secret + + g.Go(func() error { + select { + case <-ctx.Done(): + return ctx.Err() + default: + if err := premineCmdArgs(secret, "", command.DefaultPremineBalance); err != nil { + return fmt.Errorf("failed to do premine of native root token for genesis validator: %w", + err) + } + + return nil + } + }) + } + + // now premine for other addresses + for _, premineRaw := range t.clusterConfig.Premine { + premineRaw := premineRaw + + g.Go(func() error { + select { + case <-ctx.Done(): + return ctx.Err() + default: + premineInfo, err := cmdHelper.ParsePremineInfo(premineRaw) + if err != nil { + return fmt.Errorf("failed to do premine of native root token for non-validator"+ + " account: %w. premine raw: %s", err, premineRaw) + } + + if err := premineCmdArgs("", premineInfo.Key, premineInfo.Amount); err != nil { + return fmt.Errorf("failed to do premine of native root token for "+ + "non-validator account: %w. premine raw: %s", err, premineRaw) + } + + return nil + } + }) + } + + return g.Wait() +} diff --git a/e2e-polybft/framework/test-cluster.go b/e2e-polybft/framework/test-cluster.go index 9e4f1309a8..f7882b3925 100644 --- a/e2e-polybft/framework/test-cluster.go +++ b/e2e-polybft/framework/test-cluster.go @@ -90,7 +90,6 @@ type TestClusterConfig struct { Name string Premine []string // address[:amount] - PremineValidators []string // address[:amount] StakeAmounts []*big.Int BootnodeCount int NonValidatorCount int @@ -512,7 +511,11 @@ func NewTestCluster(t *testing.T, validatorsCount int, opts ...ClusterOption) *T args = append(args, "--native-token-config", cluster.Config.NativeTokenConfigRaw) } - if len(cluster.Config.Premine) != 0 { + tokenConfig, err := polybft.ParseRawTokenConfig(cluster.Config.NativeTokenConfigRaw) + require.NoError(t, err) + + if len(cluster.Config.Premine) != 0 && tokenConfig.IsMintable { + // only add premine flags in genesis if token is mintable for _, premine := range cluster.Config.Premine { args = append(args, "--premine", premine) } @@ -626,8 +629,11 @@ func NewTestCluster(t *testing.T, validatorsCount int, opts ...ClusterOption) *T polybftConfig, err := polybft.LoadPolyBFTConfig(genesisPath) require.NoError(t, err) - // fund validators on the rootchain - err = cluster.Bridge.fundRootchainValidators(polybftConfig) + tokenConfig, err := polybft.ParseRawTokenConfig(cluster.Config.NativeTokenConfigRaw) + require.NoError(t, err) + + // fund addresses on the rootchain + err = cluster.Bridge.fundAddressesOnRoot(tokenConfig, polybftConfig) require.NoError(t, err) // whitelist genesis validators on the rootchain @@ -642,6 +648,13 @@ func NewTestCluster(t *testing.T, validatorsCount int, opts ...ClusterOption) *T err = cluster.Bridge.initialStakingOfGenesisValidators(polybftConfig) require.NoError(t, err) + // add premine if token is non-mintable + err = cluster.Bridge.mintNativeRootToken(addresses, tokenConfig, polybftConfig) + require.NoError(t, err) + + err = cluster.Bridge.premineNativeRootToken(tokenConfig, polybftConfig) + require.NoError(t, err) + // finalize genesis validators on the rootchain err = cluster.Bridge.finalizeGenesis(genesisPath, polybftConfig) require.NoError(t, err) diff --git a/scripts/cluster b/scripts/cluster index 700e7ac224..44667cbc94 100755 --- a/scripts/cluster +++ b/scripts/cluster @@ -154,7 +154,6 @@ function initRootchain() { ./polygon-edge polybft supernet \ --private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \ --supernet-manager ${customSupernetManagerAddr} \ - --stake-manager ${stakeManagerAddr} \ --finalize-genesis-set \ --enable-staking \ --jsonrpc http://127.0.0.1:8545